index.vue 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <template>
  2. <div>
  3. <page-header :title="$t('k8s.text_230')" />
  4. <page-body needMarginBottom>
  5. <!-- <a-tabs v-model="activeTab">
  6. <a-tab-pane v-for="item in tabs" :tab="item.label" :key="item.component">
  7. <component :is="activeTab" resource="deployments" :ref="`${activeTab}Ref`" />
  8. </a-tab-pane>
  9. </a-tabs> -->
  10. <form-create ref="FormCreateRef" />
  11. </page-body>
  12. <page-footer>
  13. <div slot="right">
  14. <a-button class="mr-3" type="primary" @click="confirm" :loading="loading">{{$t('k8s.create')}}</a-button>
  15. <a-button @click="cancel">{{$t('k8s.text_213')}}</a-button>
  16. </div>
  17. </page-footer>
  18. </div>
  19. </template>
  20. <script>
  21. import FormCreate from './Form'
  22. export default {
  23. name: 'K8SDeploymentCreate',
  24. components: {
  25. FormCreate,
  26. },
  27. data () {
  28. return {
  29. loading: false,
  30. activeTab: 'FormCreate',
  31. tabs: [
  32. {
  33. label: this.$t('k8s.text_231'),
  34. component: 'FormCreate',
  35. },
  36. {
  37. label: this.$t('k8s.text_232'),
  38. component: 'InputCreate',
  39. },
  40. {
  41. label: this.$t('k8s.text_233'),
  42. component: 'UploadCreate',
  43. },
  44. ],
  45. }
  46. },
  47. methods: {
  48. async confirm () {
  49. await this.$refs.FormCreateRef.doCreate()
  50. this.cancel()
  51. },
  52. cancel () {
  53. this.$router.push('/k8s-daemonset')
  54. },
  55. },
  56. }
  57. </script>