index.vue 972 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <template>
  2. <div>
  3. <page-header :title="$t('k8s.text_315')" />
  4. <page-body needMarginBottom>
  5. <form-create ref="FormCreateRef" />
  6. </page-body>
  7. <page-footer>
  8. <div slot="right">
  9. <a-button class="mr-3" type="primary" @click="confirm" :loading="loading">{{$t('k8s.text_212')}}</a-button>
  10. <a-button @click="cancel">{{$t('k8s.text_213')}}</a-button>
  11. </div>
  12. </page-footer>
  13. </div>
  14. </template>
  15. <script>
  16. import FormCreate from './Form'
  17. export default {
  18. name: 'StatefulsetCreate',
  19. components: {
  20. FormCreate,
  21. },
  22. data () {
  23. return {
  24. loading: false,
  25. }
  26. },
  27. methods: {
  28. async confirm () {
  29. try {
  30. this.loading = true
  31. await this.$refs.FormCreateRef.doCreate()
  32. this.loading = false
  33. this.cancel()
  34. } catch (error) {
  35. this.loading = false
  36. throw error
  37. }
  38. },
  39. cancel () {
  40. this.$router.push('/k8s-statefulset')
  41. },
  42. },
  43. }
  44. </script>