singleActions.js 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import i18n from '@/locales'
  2. export default {
  3. created () {
  4. this.singleActions = [
  5. {
  6. label: i18n.t('compute.text_1355'),
  7. permission: 'server_perform_instance_snapshot_reset',
  8. action: obj => {
  9. this.createDialog('RollbackHostDialog', {
  10. vm: this,
  11. title: i18n.t('compute.text_1355'),
  12. name: i18n.t('compute.text_102'),
  13. data: [obj],
  14. columns: this.columns,
  15. onManager: this.onManager,
  16. refresh: this.refresh,
  17. })
  18. },
  19. meta: obj => ({
  20. validate: obj.guest_status === 'ready',
  21. tooltip: obj.guest_status === 'ready' ? '' : i18n.t('compute.text_1357'),
  22. }),
  23. },
  24. {
  25. label: i18n.t('compute.perform_delete'),
  26. permission: 'instance_snapshots_delete',
  27. action: obj => {
  28. this.createDialog('DeleteResDialog', {
  29. vm: this,
  30. data: [obj],
  31. columns: this.columns,
  32. title: i18n.t('compute.perform_delete'),
  33. onManager: this.onManager,
  34. name: i18n.t('compute.text_462'),
  35. })
  36. },
  37. meta: obj => this.$getDeleteResult(obj),
  38. },
  39. ]
  40. },
  41. }