| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128 |
- import { getSetPublicAction, getDomainChangeOwnerAction } from '@/utils/common/tableActions'
- import i18n from '@/locales'
- export default {
- created () {
- this.singleActions = [
- {
- label: this.$t('network.text_719'),
- permission: 'dns_zones_add_vpcs',
- action: (obj) => {
- this.createDialog('AssociateVpcDialog', {
- title: this.$t('network.text_719'),
- data: [obj],
- resData: obj,
- columns: this.columns,
- onManager: this.onManager,
- refresh: this.refresh,
- })
- },
- meta: (obj) => {
- const ret = this.$isOwner(obj)
- if (!ret.validate) return ret
- if (obj.zone_type === 'PublicZone') {
- ret.validate = false
- ret.tooltip = i18n.t('common_662')
- return ret
- }
- if (obj.status !== 'available') {
- ret.validate = false
- ret.tooltip = i18n.t('network.text_730')
- return ret
- }
- if (obj.cloud_env === 'onpremise') {
- ret.validate = false
- ret.tooltip = i18n.t('network.text_652')
- }
- return ret
- },
- },
- {
- label: this.$t('network.text_129'),
- permission: 'dns_zones_syncstatus',
- actions: obj => {
- return [
- {
- label: this.$t('network.text_201'),
- action: () => {
- this.onManager('performAction', {
- steadyStatus: ['available'],
- id: obj.id,
- managerArgs: {
- action: 'syncstatus',
- },
- })
- },
- meta: () => {
- const ret = this.$isOwner(obj)
- if (!ret.validate) return ret
- return ret
- },
- },
- // {
- // label: this.$t('network.text_721'),
- // permission: 'dns_zones_sync_recordsets',
- // action: () => {
- // this.createDialog('DeleteResDialog', {
- // vm: this,
- // title: this.$t('network.text_721'),
- // name: this.$t('dictionary.dns_zone'),
- // data: [obj],
- // columns: this.columns,
- // onManager: this.onManager,
- // alert: this.$t('network.text_761'),
- // ok: () => {
- // this.onManager('performAction', {
- // steadyStatus: ['available'],
- // id: obj.id,
- // managerArgs: {
- // action: 'sync-recordsets',
- // },
- // })
- // },
- // })
- // },
- // meta: () => {
- // const ret = this.$isOwner(obj)
- // if (!ret.validate) return ret
- // return {
- // validate: !['sync_record_sets'].includes(obj.status),
- // }
- // },
- // },
- getDomainChangeOwnerAction(this, {
- name: this.$t('dictionary.dns_zone'),
- resource: 'dns_zones',
- }),
- getSetPublicAction(this, {
- name: this.$t('dictionary.dns_zone'),
- scope: 'domain',
- resource: 'dns_zones',
- ignorel3PermissionEnable: true,
- }),
- {
- label: this.$t('network.text_131'),
- permission: 'dns_zones_delete',
- action: () => {
- this.createDialog('DeleteResDialog', {
- vm: this,
- title: this.$t('network.text_131'),
- name: this.$t('dictionary.dns_zone'),
- data: [obj],
- columns: this.columns,
- onManager: this.onManager,
- alert: this.$t('network.text_762'),
- })
- },
- meta: () => {
- const ret = this.$isOwner(obj)
- if (!ret.validate) return ret
- return this.$getDeleteResult(obj)
- },
- },
- ]
- },
- },
- ]
- },
- }
|