singleActions.js 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. import {
  2. getSetPublicAction,
  3. } from '@/utils/common/tableActions'
  4. export default {
  5. created () {
  6. this.singleActions = [
  7. {
  8. label: this.$t('compute.perform_sync_status'),
  9. permission: 'backupstorages_perform_syncstatus',
  10. action: obj => {
  11. this.onManager('performAction', {
  12. steadyStatus: ['running', 'ready'],
  13. id: obj.id,
  14. managerArgs: {
  15. action: 'syncstatus',
  16. },
  17. })
  18. },
  19. meta: () => ({
  20. validate: true,
  21. }),
  22. },
  23. {
  24. label: this.$t('compute.text_352'),
  25. actions: obj => {
  26. return [
  27. getSetPublicAction(this, {
  28. name: this.$t('dictionary.backup_storage'),
  29. scope: 'domain',
  30. resource: 'backupstorages',
  31. }, {
  32. permission: 'backupstorages_perform_public',
  33. }),
  34. {
  35. label: this.$t('compute.text_295'),
  36. permission: 'backupstorages_update',
  37. action: obj => {
  38. this.createDialog('BackupStorageUpdateDialog', {
  39. vm: this,
  40. data: [obj],
  41. columns: this.columns,
  42. name: this.$t('compute.backup_storage'),
  43. title: this.$t('common_641', [this.$t('compute.backup_storage')]),
  44. onManager: this.onManager,
  45. refresh: this.refresh,
  46. action: this.$t('compute.text_295'),
  47. })
  48. },
  49. },
  50. {
  51. label: this.$t('compute.perform_delete'),
  52. permission: 'backupstorages_delete',
  53. action: obj => {
  54. this.createDialog('DeleteResDialog', {
  55. vm: this,
  56. data: [obj],
  57. columns: this.columns,
  58. title: this.$t('compute.perform_delete'),
  59. onManager: this.onManager,
  60. name: this.$t('compute.backup_storage'),
  61. })
  62. },
  63. meta: obj => {
  64. return this.$getDeleteResult(obj)
  65. },
  66. },
  67. ]
  68. },
  69. },
  70. ]
  71. },
  72. }