singleActions.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. import i18n from '@/locales'
  2. export default {
  3. created () {
  4. this.singleActions = [
  5. {
  6. label: i18n.t('compute.text_477'),
  7. permission: 'disks_delete',
  8. action: obj => {
  9. this.createDialog('DeleteResDialog', {
  10. vm: this,
  11. data: [obj],
  12. columns: this.columns,
  13. title: i18n.t('compute.text_477'),
  14. name: this.$t('dictionary.disk'),
  15. requestParams: { override_pending_delete: true },
  16. onManager: this.onManager,
  17. })
  18. },
  19. meta: obj => {
  20. return {
  21. validate: obj.can_delete,
  22. tooltip: obj.can_delete ? '' : this.$t('compute.text_1344'),
  23. }
  24. },
  25. },
  26. {
  27. label: i18n.t('compute.text_478'),
  28. permission: 'disks_perform_cancel_delete',
  29. action: (obj) => {
  30. this.createDialog('DiskRestoreDialog', {
  31. data: [obj],
  32. columns: this.columns,
  33. refresh: this.refresh,
  34. })
  35. },
  36. meta: obj => {
  37. return {
  38. validate: obj.status !== 'deleting',
  39. }
  40. },
  41. },
  42. ]
  43. },
  44. }