@@ -48,7 +48,7 @@ export default {
4848 return fields
4949 } ,
5050 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' ]
5252 if ( ! isAdmin ( ) ) {
5353 fields = fields . filter ( function ( e ) { return e !== 'broadcasturi' } )
5454 }
@@ -68,14 +68,22 @@ export default {
6868 name : 'egress.rules' ,
6969 component : shallowRef ( defineAsyncComponent ( ( ) => import ( '@/views/network/EgressRulesTab.vue' ) ) ) ,
7070 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 ) }
7179 } , {
7280 name : 'ip.v6.firewall' ,
7381 component : shallowRef ( defineAsyncComponent ( ( ) => import ( '@/views/network/Ipv6FirewallRulesTab.vue' ) ) ) ,
7482 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 ) }
7583 } , {
7684 name : ( record ) => { return record . type === 'Shared' ? 'ip.addresses' : 'public.ip.addresses' } ,
7785 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 ) ) ) }
7987 } , {
8088 name : 'virtual.routers' ,
8189 component : shallowRef ( defineAsyncComponent ( ( ) => import ( '@/views/network/RoutersTab.vue' ) ) ) ,
@@ -221,8 +229,8 @@ export default {
221229 fields . push ( ...[ 'domain' , 'zonename' ] )
222230 return fields
223231 } ,
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'] ,
226234 related : [ {
227235 name : 'vm' ,
228236 title : 'label.instances' ,
@@ -312,10 +320,7 @@ export default {
312320 return false
313321 }
314322 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
319324 } ,
320325 actions : [
321326 {
@@ -873,6 +878,54 @@ export default {
873878 }
874879 ]
875880 } ,
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+ } ,
876929 {
877930 name : 'privategw' ,
878931 title : 'label.private.gateway' ,
@@ -1397,6 +1450,46 @@ export default {
13971450 show : ( record ) => { return ( record . allocationstate === 'Allocated' ) }
13981451 } ] ,
13991452 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+ ]
14001493 }
14011494 ]
14021495}
0 commit comments