BackupResume.vue 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <template>
  2. <base-dialog @cancel="cancelDialog">
  3. <div slot="header">{{title}}</div>
  4. <div slot="body">
  5. <dialog-selected-tips :name="$t('dictionary.elasticcaches')" :count="params.data.length" :action="title" />
  6. <dialog-table :data="params.data" :columns="params.columns.slice(0, 3)" />
  7. </div>
  8. <div slot="footer">
  9. <a-button type="primary" @click="handleConfirm" :loading="loading">{{ $t('dialog.ok') }}</a-button>
  10. <a-button @click="cancelDialog">{{ $t('dialog.cancel') }}</a-button>
  11. </div>
  12. </base-dialog>
  13. </template>
  14. <script>
  15. import { ACCOUNT_PRIVILEGES } from '../constants'
  16. import DialogMixin from '@/mixins/dialog'
  17. import WindowsMixin from '@/mixins/windows'
  18. // import validateForm from '@/utils/validate'
  19. export default {
  20. name: 'RedisBackupResumeDialog',
  21. mixins: [DialogMixin, WindowsMixin],
  22. data () {
  23. return {
  24. title: this.$t('db.text_45'),
  25. loading: false,
  26. privileges: ACCOUNT_PRIVILEGES,
  27. form: {
  28. fc: this.$form.createForm(this),
  29. },
  30. }
  31. },
  32. methods: {
  33. async handleConfirm () {
  34. this.loading = true
  35. try {
  36. await this.params.list.onManager('performAction', {
  37. steadyStatus: 'running',
  38. id: this.params.data[0].id,
  39. managerArgs: {
  40. action: 'restore-instance',
  41. },
  42. })
  43. this.loading = false
  44. this.cancelDialog()
  45. } catch (error) {
  46. this.loading = false
  47. }
  48. },
  49. },
  50. }
  51. </script>