|
18 | 18 | import { shallowRef, defineAsyncComponent } from 'vue' |
19 | 19 | import store from '@/store' |
20 | 20 | import tungsten from '@/assets/icons/tungsten.svg?inline' |
21 | | -import { isAdmin } from '@/role' |
| 21 | +import { isAdmin, isAdminOrDomainAdmin } from '@/role' |
22 | 22 | import { isZoneCreated } from '@/utils/zone' |
23 | 23 | import { vueProps } from '@/vue-app' |
24 | 24 |
|
@@ -49,7 +49,10 @@ export default { |
49 | 49 | return fields |
50 | 50 | }, |
51 | 51 | details: () => { |
52 | | - var fields = ['name', 'id', 'description', 'type', 'traffictype', 'vpcid', 'vlan', 'broadcasturi', 'cidr', 'ip6cidr', 'netmask', 'gateway', 'asnumber', 'aclname', 'ispersistent', 'restartrequired', 'reservediprange', 'redundantrouter', 'networkdomain', 'egressdefaultpolicy', 'zonename', 'account', 'domainpath', 'associatednetwork', 'associatednetworkid', 'ip4routing', 'ip6firewall', 'ip6routing', 'ip6routes', 'dns1', 'dns2', 'ip6dns1', 'ip6dns2', 'publicmtu', 'privatemtu'] |
| 52 | + var fields = ['name', 'id', 'description', 'type', 'traffictype', 'vpcid', 'vlan', 'broadcasturi', 'cidr', 'ip6cidr', 'netmask', 'gateway', 'asnumber', |
| 53 | + 'aclname', 'ispersistent', 'restartrequired', 'reservediprange', 'redundantrouter', 'networkdomain', 'egressdefaultpolicy', 'zonename', 'account', |
| 54 | + 'domainpath', 'associatednetwork', 'associatednetworkid', 'ip4routing', 'ip6firewall', 'ip6routing', 'ip6routes', 'dns1', 'dns2', 'ip6dns1', 'ip6dns2', |
| 55 | + 'publicmtu', 'privatemtu', 'dnszone', 'dnssubdomain'] |
53 | 56 | if (!isAdmin()) { |
54 | 57 | fields = fields.filter(function (e) { return e !== 'broadcasturi' }) |
55 | 58 | } |
@@ -202,6 +205,36 @@ export default { |
202 | 205 | } |
203 | 206 | } |
204 | 207 | }, |
| 208 | + { |
| 209 | + api: 'associateDnsZoneToNetwork', |
| 210 | + icon: 'link-outlined', |
| 211 | + label: 'label.action.associate.dns.zone', |
| 212 | + dataView: true, |
| 213 | + show: (record, store) => { |
| 214 | + return (record.type === 'Shared' && record.dnszone === undefined && |
| 215 | + (record.account === store.userInfo.account || isAdminOrDomainAdmin(store.userInfo.roletype))) |
| 216 | + }, |
| 217 | + popup: true, |
| 218 | + component: shallowRef(defineAsyncComponent(() => import('@/views/network/dns/AssociateDnsZone.vue'))) |
| 219 | + }, |
| 220 | + { |
| 221 | + api: 'disassociateDnsZoneFromNetwork', |
| 222 | + icon: 'disconnect-outlined', |
| 223 | + label: 'label.action.disassociate.dns.zone', |
| 224 | + message: 'message.action.disassociate.dns.zone', |
| 225 | + dataView: true, |
| 226 | + popup: true, |
| 227 | + args: ['networkid'], |
| 228 | + show: (record, store) => { |
| 229 | + return record.dnszone !== undefined && record.type === 'Shared' && |
| 230 | + (record.account === store.userInfo.account || isAdminOrDomainAdmin(store.userInfo.roletype)) |
| 231 | + }, |
| 232 | + mapping: { |
| 233 | + networkid: { |
| 234 | + value: (record) => { return record.id } |
| 235 | + } |
| 236 | + } |
| 237 | + }, |
205 | 238 | { |
206 | 239 | api: 'deleteNetwork', |
207 | 240 | icon: 'delete-outlined', |
|
0 commit comments