@@ -48,7 +48,7 @@ export default {
48
48
return fields
49
49
} ,
50
50
details : ( ) => {
51
- var fields = [ 'name' , 'id' , 'description' , 'type' , 'traffictype' , 'vpcid' , 'vlan' , 'broadcasturi' , 'cidr' , 'ip6cidr' , 'netmask' , 'gateway' , 'aclname' , 'ispersistent' , 'restartrequired' , 'reservediprange' , 'redundantrouter' , 'networkdomain' , 'egressdefaultpolicy' , 'zonename' , 'account' , 'domainpath' , 'associatednetwork' , 'associatednetworkid' , 'ip6firewall' , 'ip6routing' , 'ip6routes' , 'dns1' , 'dns2' , 'ip6dns1' , 'ip6dns2' , 'publicmtu' , 'privatemtu' ]
51
+ 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
52
if ( ! isAdmin ( ) ) {
53
53
fields = fields . filter ( function ( e ) { return e !== 'broadcasturi' } )
54
54
}
@@ -68,14 +68,22 @@ export default {
68
68
name : 'egress.rules' ,
69
69
component : shallowRef ( defineAsyncComponent ( ( ) => import ( '@/views/network/EgressRulesTab.vue' ) ) ) ,
70
70
show : ( record , route , user ) => { return record . type === 'Isolated' && ! ( 'vpcname' in record ) && 'listEgressFirewallRules' in store . getters . apis && ( [ 'Admin' , 'DomainAdmin' ] . includes ( user . roletype ) || record . account === user . account || record . projectid ) }
71
+ } , {
72
+ name : 'bgp.peers' ,
73
+ component : shallowRef ( defineAsyncComponent ( ( ) => import ( '@/views/infra/zone/BgpPeersTab.vue' ) ) ) ,
74
+ show : ( record , route , user ) => { return ! record . vpcid && [ 'Admin' ] . includes ( user . roletype ) && record . ip4routing === 'Dynamic' }
75
+ } , {
76
+ name : 'routing.firewall' ,
77
+ component : shallowRef ( defineAsyncComponent ( ( ) => import ( '@/views/network/RoutingFirewallRulesTab.vue' ) ) ) ,
78
+ show : ( record , route , user ) => { return record . type === 'Isolated' && record . ip4routing && ! ( 'vpcname' in record ) && 'listRoutingFirewallRules' in store . getters . apis && ( [ 'Admin' , 'DomainAdmin' ] . includes ( user . roletype ) || record . account === user . account || record . projectid ) }
71
79
} , {
72
80
name : 'ip.v6.firewall' ,
73
81
component : shallowRef ( defineAsyncComponent ( ( ) => import ( '@/views/network/Ipv6FirewallRulesTab.vue' ) ) ) ,
74
82
show : ( record , route , user ) => { return record . type === 'Isolated' && [ 'IPv6' , 'DualStack' ] . includes ( record . internetprotocol ) && ! ( 'vpcid' in record ) && 'listIpv6FirewallRules' in store . getters . apis && ( [ 'Admin' , 'DomainAdmin' ] . includes ( user . roletype ) || record . account === user . account || record . projectid ) }
75
83
} , {
76
84
name : ( record ) => { return record . type === 'Shared' ? 'ip.addresses' : 'public.ip.addresses' } ,
77
85
component : shallowRef ( defineAsyncComponent ( ( ) => import ( '@/views/network/IpAddressesTab.vue' ) ) ) ,
78
- show : ( record , route , user ) => { return 'listPublicIpAddresses' in store . getters . apis && ( record . type === 'Shared' || ( record . type === 'Isolated' && ! ( 'vpcname' in record ) && ( [ 'Admin' , 'DomainAdmin' ] . includes ( user . roletype ) || record . account === user . account || record . projectid ) ) ) }
86
+ show : ( record , route , user ) => { return 'listPublicIpAddresses' in store . getters . apis && ( record . type === 'Shared' || ( record . type === 'Isolated' && ! record . ip4routing && ! ( 'vpcname' in record ) && ( [ 'Admin' , 'DomainAdmin' ] . includes ( user . roletype ) || record . account === user . account || record . projectid ) ) ) }
79
87
} , {
80
88
name : 'virtual.routers' ,
81
89
component : shallowRef ( defineAsyncComponent ( ( ) => import ( '@/views/network/RoutersTab.vue' ) ) ) ,
@@ -221,8 +229,8 @@ export default {
221
229
fields . push ( ...[ 'domain' , 'zonename' ] )
222
230
return fields
223
231
} ,
224
- details : [ 'name' , 'id' , 'displaytext' , 'cidr' , 'networkdomain' , 'ip6routes' , 'ispersistent' , 'redundantvpcrouter' , 'restartrequired' , 'zonename' , 'account' , 'domain' , 'dns1' , 'dns2' , 'ip6dns1' , 'ip6dns2' , 'publicmtu' ] ,
225
- searchFilters : [ 'name' , 'zoneid' , 'domainid' , 'account' , 'tags' ] ,
232
+ details : [ 'name' , 'id' , 'displaytext' , 'cidr' , 'networkdomain' , 'ip4routing' , 'ip4routes' , ' ip6routes', 'ispersistent' , 'redundantvpcrouter' , 'restartrequired' , 'zonename' , 'account' , 'domain' , 'dns1' , 'dns2' , 'ip6dns1' , 'ip6dns2' , 'publicmtu' ] ,
233
+ searchFilters : [ 'name' , 'zoneid' , 'domainid' , 'account' , 'restartrequired' , ' tags'] ,
226
234
related : [ {
227
235
name : 'vm' ,
228
236
title : 'label.instances' ,
@@ -312,10 +320,7 @@ export default {
312
320
return false
313
321
}
314
322
const listZoneHaveSGEnabled = store . getters . zones . filter ( zone => zone . securitygroupsenabled === true )
315
- if ( ! listZoneHaveSGEnabled || listZoneHaveSGEnabled . length === 0 ) {
316
- return false
317
- }
318
- return true
323
+ return ( listZoneHaveSGEnabled && listZoneHaveSGEnabled . length > 0 ) || store . getters . showSecurityGroups
319
324
} ,
320
325
actions : [
321
326
{
@@ -873,6 +878,54 @@ export default {
873
878
}
874
879
]
875
880
} ,
881
+ {
882
+ name : 'asnumbers' ,
883
+ title : 'label.asnumbers' ,
884
+ icon : 'partition-outlined' ,
885
+ permission : [ 'listASNumbers' ] ,
886
+ show : ( ) => {
887
+ if ( ! store . getters . zones || store . getters . zones . length === 0 ) {
888
+ return false
889
+ }
890
+ const AdvancedZonesWithRoutedmode = store . getters . zones . filter ( zone => zone . routedmodeenabled )
891
+ if ( isAdmin ( ) && ( AdvancedZonesWithRoutedmode && AdvancedZonesWithRoutedmode . length > 0 ) ) {
892
+ return true
893
+ }
894
+ return false
895
+ } ,
896
+ filters : [ 'all' , 'allocatedonly' , 'free' ] ,
897
+ columns : [ 'asnumber' , 'allocationstate' , 'asnrange' , 'associatednetworkname' , 'vpcname' , 'allocated' , 'account' , 'domain' , 'zonename' ] ,
898
+ searchFilters : [ 'zoneid' , 'associatednetworkid' , 'account' , 'domainid' ] ,
899
+ resourceType : 'ASNumber' ,
900
+ actions : [
901
+ {
902
+ api : 'releaseASNumber' ,
903
+ icon : 'delete-outlined' ,
904
+ label : 'label.action.release.asnumber' ,
905
+ message : 'message.action.release.asnumber' ,
906
+ show : ( record ) => { return record . allocationstate === 'Allocated' } ,
907
+ args : [ 'zoneid' , 'asnumber' ] ,
908
+ mapping : {
909
+ zoneid : {
910
+ value : ( record ) => { return record . zoneid }
911
+ } ,
912
+ asnumber : {
913
+ value : ( record ) => { return record . asnumber }
914
+ }
915
+ } ,
916
+ dataView : true ,
917
+ groupAction : true ,
918
+ popup : true ,
919
+ groupShow : ( selectedItems , storegetters ) => {
920
+ return selectedItems . length === 1 && selectedItems [ 0 ] . allocationstate === 'Allocated'
921
+ } ,
922
+ groupMap : ( selectedId , values , records ) => {
923
+ const record = records . filter ( x => { return x . id === selectedId [ 0 ] } )
924
+ return record
925
+ }
926
+ }
927
+ ]
928
+ } ,
876
929
{
877
930
name : 'privategw' ,
878
931
title : 'label.private.gateway' ,
@@ -1397,6 +1450,46 @@ export default {
1397
1450
show : ( record ) => { return ( record . allocationstate === 'Allocated' ) }
1398
1451
} ] ,
1399
1452
show : isZoneCreated
1453
+ } ,
1454
+ {
1455
+ name : 'ipv4subnets' ,
1456
+ title : 'label.ipv4.subnets' ,
1457
+ icon : 'pic-center-outlined' ,
1458
+ permission : [ 'listIpv4SubnetsForGuestNetwork' ] ,
1459
+ columns : [ 'subnet' , 'zonename' , 'parentsubnet' , 'networkname' , 'vpcname' , 'created' , 'allocated' ] ,
1460
+ details : [ 'subnet' , 'zonename' , 'zoneid' , 'parentsubnet' , 'networkname' , 'networkid' , 'vpcname' , 'vpcid' , 'created' , 'allocated' , 'state' ] ,
1461
+ searchFilters : [ 'zoneid' ] ,
1462
+ show : ( ) => {
1463
+ if ( ! store . getters . zones || store . getters . zones . length === 0 ) {
1464
+ return false
1465
+ }
1466
+ const AdvancedZonesWithRoutedmode = store . getters . zones . filter ( zone => zone . routedmodeenabled )
1467
+ if ( isAdmin ( ) && ( AdvancedZonesWithRoutedmode && AdvancedZonesWithRoutedmode . length > 0 ) ) {
1468
+ return true
1469
+ }
1470
+ return false
1471
+ } ,
1472
+ actions : [
1473
+ {
1474
+ api : 'createIpv4SubnetForGuestNetwork' ,
1475
+ icon : 'plus-outlined' ,
1476
+ label : 'label.add.ipv4.subnet' ,
1477
+ listView : true ,
1478
+ popup : true ,
1479
+ component : shallowRef ( defineAsyncComponent ( ( ) => import ( '@/views/network/CreateIpv4SubnetForNetwork.vue' ) ) )
1480
+ } ,
1481
+ {
1482
+ api : 'deleteIpv4SubnetForGuestNetwork' ,
1483
+ icon : 'delete-outlined' ,
1484
+ label : 'label.delete.ipv4.subnet' ,
1485
+ message : 'message.action.delete.ipv4.subnet' ,
1486
+ dataView : true ,
1487
+ show : ( record ) => { return ! record . networkid } ,
1488
+ groupAction : true ,
1489
+ popup : true ,
1490
+ groupMap : ( selection ) => { return selection . map ( x => { return { id : x } } ) }
1491
+ }
1492
+ ]
1400
1493
}
1401
1494
]
1402
1495
}
0 commit comments