diff --git a/ui/docs/api/apis.remaining b/ui/docs/api/apis.remaining index c776794c788..a9775d34d75 100644 --- a/ui/docs/api/apis.remaining +++ b/ui/docs/api/apis.remaining @@ -2,24 +2,16 @@ addNetworkServiceProvider addResourceDetail addTrafficType assignCertToLoadBalancer -assignToLoadBalancerRule authorizeSamlSso -authorizeSecurityGroupEgress -authorizeSecurityGroupIngress configureInternalLoadBalancerElement configureVirtualRouterElement -createEgressFirewallRule -createFirewallRule createLBHealthCheckPolicy -createLBStickinessPolicy createLoadBalancer -createLoadBalancerRule createManagementNetworkIpRange createNetworkACL createNetworkACLList createPhysicalNetwork createPortableIpRange -createPortForwardingRule createPrivateGateway createSecondaryStagingStore createSnapshotFromVMSnapshot @@ -30,25 +22,17 @@ createVpnConnection createVpnGateway dedicateGuestVlanRange dedicatePublicIpRange -deleteAccountFromProject -deleteEgressFirewallRule -deleteFirewallRule deleteLBHealthCheckPolicy -deleteLBStickinessPolicy -deleteLdapConfiguration deleteLoadBalancer -deleteLoadBalancerRule deleteManagementNetworkIpRange deleteNetworkACL deleteNetworkACLList deleteNetworkServiceProvider deletePhysicalNetwork deletePortableIpRange -deletePortForwardingRule deletePrivateGateway deleteProjectInvitation deleteSecondaryStagingStore -deleteSnapshotPolicies deleteStaticRoute deleteStorageNetworkIpRange deleteVlanIpRange @@ -57,74 +41,47 @@ deleteVpnGateway findStoragePoolsForMigration importLdapUsers ldapCreateAccount -linkDomainToLdap listAffinityGroupTypes listAndSwitchSamlAccount -listCapabilities listDedicatedClusters listDedicatedGuestVlanRanges listDedicatedHosts listDedicatedPods listDedicatedZones listDeploymentPlanners -listEgressFirewallRules -listFirewallRules listHostHAProviders listHostTags -listHypervisors listIdps listInternalLoadBalancerElements listInternalLoadBalancerVMs listLBHealthCheckPolicies -listLBStickinessPolicies listLdapUsers -listLoadBalancerRuleInstances -listLoadBalancerRules listLoadBalancers -listNetworkACLLists listNetworkACLs listNetworkServiceProviders listOsCategories listPortableIpRanges -listPortForwardingRules -listPrivateGateways -listProjectAccounts -listProjectInvitations listRegisteredServicePackages -listRemoteAccessVpns -listResourceLimits listSamlAuthorization listSecondaryStagingStores -listSnapshotPolicies listStaticRoutes listStorageNetworkIpRange listStorageProviders listStorageTags listSupportedNetworkServices listTemplateOvfProperties -listTemplatePermissions listTrafficTypes listVirtualRouterElements listVlanIpRanges listVmwareDcs -listVpnConnections -listVpnGateways moveNetworkAclItem releaseDedicatedGuestVlanRange releasePublicIpRange -removeFromLoadBalancerRule -replaceNetworkACLList resetVpnConnection -revokeSecurityGroupEgress -revokeSecurityGroupIngress startInternalLoadBalancerVM stopInternalLoadBalancerVM -updateLoadBalancerRule updateNetworkACLItem updateNetworkACLList updateNetworkServiceProvider updatePhysicalNetwork -updateProjectInvitation -updateResourceLimit updateTrafficType -updateVpnCustomerGateway diff --git a/ui/legacy/generateOldLayout.js b/ui/legacy/generateOldLayout.js index df7424c0ae1..985016227cb 100644 --- a/ui/legacy/generateOldLayout.js +++ b/ui/legacy/generateOldLayout.js @@ -13,8 +13,8 @@ var loadLabel = function (allFields, fieldDict, prefix) { allFields[fieldId].components.push(prefix) } else { allFields[fieldId] = { - 'labels': [fieldDict[fieldId].label], - 'components': [prefix] + labels: [fieldDict[fieldId].label], + components: [prefix] } } cols = cols + "'" + fieldId + "', " @@ -28,8 +28,8 @@ var loadLabel = function (allFields, fieldDict, prefix) { allFields[colId].components.push(prefix) } else { allFields[colId] = { - 'labels': [columns[colId].label], - 'components': [prefix] + labels: [columns[colId].label], + components: [prefix] } } }) @@ -63,9 +63,9 @@ var loadFields = function (data, prefix) { var curActions = [] $.each(Object.keys(acVal), function (idx, acKey) { if (acVal[acKey].createForm) { - curActions.push({ 'action': acKey, 'label': acVal[acKey].label, 'keys': acVal[acKey].createForm.fields }) + curActions.push({ action: acKey, label: acVal[acKey].label, keys: acVal[acKey].createForm.fields }) } else { - curActions.push({ 'action': acKey, 'label': acVal[acKey].label }) + curActions.push({ action: acKey, label: acVal[acKey].label }) } }) countActions = countActions + curActions.length @@ -77,5 +77,5 @@ var loadFields = function (data, prefix) { $.extend(actions, recRes.actions) } }) - return { 'allFields': allFields, 'columnsOrder': columnsOrder, 'actions': actions } + return { allFields: allFields, columnsOrder: columnsOrder, actions: actions } } diff --git a/ui/src/components/view/InfoCard.vue b/ui/src/components/view/InfoCard.vue index 7ac739bb93e..e63a31a4bcb 100644 --- a/ui/src/components/view/InfoCard.vue +++ b/ui/src/components/view/InfoCard.vue @@ -29,7 +29,7 @@

- {{ resource.displayname || resource.name }} + {{ resource.displayname || resource.name || resource.displaytext || resource.hostname || resource.username || resource.ipaddress }}

diff --git a/ui/src/components/view/ResourceView.vue b/ui/src/components/view/ResourceView.vue index f19762810d1..a1c4bf71f0f 100644 --- a/ui/src/components/view/ResourceView.vue +++ b/ui/src/components/view/ResourceView.vue @@ -36,7 +36,7 @@ v-for="tab in tabs" :tab="$t(tab.name)" :key="tab.name" - v-if="'show' in tab ? tab.show(resource, $route, $store.getters.userInfo) : true"> + v-if="showHideTab(tab)"> @@ -49,6 +49,7 @@ import DetailsTab from '@/components/view/DetailsTab' import InfoCard from '@/components/view/InfoCard' import ResourceLayout from '@/layouts/ResourceLayout' +import { api } from '@/api' export default { name: 'ResourceView', @@ -77,12 +78,45 @@ export default { }, data () { return { - activeTab: '' + activeTab: '', + networkService: null, + vpnEnabled: false + } + }, + watch: { + resource: function (newItem, oldItem) { + this.resource = newItem + if (newItem.id === oldItem.id) return + + if (this.resource.associatednetworkid) { + api('listNetworks', { id: this.resource.associatednetworkid }).then(response => { + this.networkService = response.listnetworksresponse.network[0] + }) + } + + if (this.resource.id && this.resource.ipaddress) { + api('listRemoteAccessVpns', { + publicipid: this.resource.id, + listAll: true + }).then(response => { + this.vpnEnabled = response.listremoteaccessvpnsresponse.remoteaccessvpn && response.listremoteaccessvpnsresponse.remoteaccessvpn.length > 0 + }) + } } }, methods: { onTabChange (key) { this.activeTab = key + }, + showHideTab (tab) { + if ('networkServiceFilter' in tab) { + return this.networkService && this.networkService.service && + tab.networkServiceFilter(this.networkService.service) + } else if ('show' in tab) { + return tab.show(this.resource, this.$route, this.$store.getters.userInfo) + } else { + return true + } } } } diff --git a/ui/src/config/section/network.js b/ui/src/config/section/network.js index 6fbb7813bc2..a2a429a937f 100644 --- a/ui/src/config/section/network.js +++ b/ui/src/config/section/network.js @@ -45,8 +45,9 @@ export default { name: 'details', component: () => import('@/components/view/DetailsTab.vue') }, { - name: 'egress-rules', - component: () => import('@/views/network/EgressConfigure.vue') + name: 'Egress Rules', + component: () => import('@/views/network/EgressConfigure.vue'), + show: () => true }], actions: [ { @@ -227,14 +228,23 @@ export default { columns: ['ipaddress', 'state', 'associatednetworkname', 'virtualmachinename', 'allocated', 'account', 'zonename'], details: ['ipaddress', 'id', 'associatednetworkname', 'virtualmachinename', 'networkid', 'issourcenat', 'isstaticnat', 'virtualmachinename', 'vmipaddress', 'vlan', 'allocated', 'account', 'zonename'], tabs: [{ - name: 'configure', - component: () => import('@/views/network/IpConfigure.vue') - }, { - name: 'vpn', - component: () => import('@/views/network/VpnDetails.vue') - }, { name: 'details', component: () => import('@/components/view/DetailsTab.vue') + }, { + name: 'Firewall', + component: () => import('@/views/network/FirewallRules.vue'), + networkServiceFilter: networkService => networkService.filter(x => x.name === 'Firewall').length > 0 + }, { + name: 'Port Forwarding', + component: () => import('@/views/network/PortForwarding.vue'), + networkServiceFilter: networkService => networkService.filter(x => x.name === 'PortForwarding').length > 0 + }, { + name: 'Load Balancing', + component: () => import('@/views/network/LoadBalancing.vue'), + networkServiceFilter: networkService => networkService.filter(x => x.name === 'Lb').length > 0 + }, { + name: 'VPN', + component: () => import('@/views/network/VpnDetails.vue') }], actions: [ { @@ -244,39 +254,6 @@ export default { listView: true, args: ['networkid'] }, - { - api: 'createRemoteAccessVpn', - icon: 'link', - label: 'Enable Remote Access VPN', - dataView: true, - args: ['publicipid', 'domainid', 'account'], - mapping: { - publicipid: { - value: (record) => { return record.id } - }, - domainid: { - value: (record) => { return record.domainid } - }, - account: { - value: (record) => { return record.account } - } - } - }, - { - api: 'deleteRemoteAccessVpn', - icon: 'disconnect', - label: 'Disable Remove Access VPN', - dataView: true, - args: ['publicipid', 'domainid'], - mapping: { - publicipid: { - value: (record) => { return record.id } - }, - domainid: { - value: (record) => { return record.domainid } - } - } - }, { api: 'enableStaticNat', icon: 'plus-circle', @@ -306,7 +283,7 @@ export default { { api: 'disassociateIpAddress', icon: 'delete', - label: 'Delete IP', + label: 'Release IP', dataView: true, show: (record) => { return !record.issourcenat } } diff --git a/ui/src/locales/en.json b/ui/src/locales/en.json index 86d1684aca2..f4abfaf4424 100644 --- a/ui/src/locales/en.json +++ b/ui/src/locales/en.json @@ -2,6 +2,7 @@ "Accounts": "Accounts", "Affinity Groups": "Affinity Groups", "Alerts": "Alerts", +"cancel": "Cancel", "CPU Sockets": "CPU Sockets", "Cloudian Storage": "Cloudian Storage", "Clusters": "Clusters", @@ -13,6 +14,7 @@ "Dashboard": "Dashboard", "Disk Offerings": "Disk Offerings", "Domains": "Domains", +"done": "Done", "Events": "Events", "Global Settings": "Global Settings", "Hosts": "Hosts", @@ -77,6 +79,7 @@ "agentUsername": "Agent Username", "agentstate": "Agent State", "algorithm": "Algorithm", +"all": "All", "allocatediops": "IOPS Allocated", "allocationstate": "Allocation State", "annotation": "Annotation", @@ -256,6 +259,7 @@ "hypervisortype": "Hypervisor", "hypervisorversion": "Hypervisor version", "hypervnetworklabel": "HyperV Traffic Label", +"icmp": "ICMP", "icmpcode": "ICMP Code", "icmptype": "ICMP Type", "id": "ID", @@ -340,6 +344,7 @@ "label.action.cancel.maintenance.mode": "Cancel Maintenance Mode", "label.action.change.password": "Change Password", "label.action.configure.samlauthorization": "Configure SAML SSO Authorization", +"label.action.configure.stickiness": "Stickiness", "label.action.copy.ISO": "Copy ISO", "label.action.copy.template": "Copy Template", "label.action.create.volume": "Create Volume", @@ -430,6 +435,8 @@ "label.add.OpenDaylight.device": "Add OpenDaylight Controller", "label.add.PA.device": "Add Palo Alto device", "label.add.SRX.device": "Add SRX device", +"label.add.VM": "Add VM", +"label.add.VMs": "Add VMs", "label.add.VM.to.tier": "Add VM to tier", "label.add.account": "Add Account", "label.add.acl.list": "Add ACL List", @@ -460,8 +467,10 @@ "label.add.primary.storage": "Add Primary Storage", "label.add.region": "Add Region", "label.add.role": "Add Role", +"label.add.rule": "Add Rule", "label.add.secondary.storage": "Add Secondary Storage", "label.add.security.group": "Add Security Group", +"label.add.setting": "Add Setting", "label.add.system.service.offering": "Add System Service Offering", "label.add.ucs.manager": "Add UCS Manager", "label.add.user": "Add User", @@ -840,6 +849,7 @@ "secretkey": "Secret Key", "securityGroups": "Security Groups", "securitygroup": "Security Group", +"select": "Select", "sent": "Date", "sentbytes": "Bytes Sent", "server": "Server", @@ -872,6 +882,7 @@ "snmpCommunity": "SNMP Community", "snmpPort": "SNMP Port", "sockettimeout": "Socket Timeout", +"sourcecidr": "Source CIDR", "sourceNat": "Source NAT", "sourceipaddress": "Source IP Address", "sourceport": "Source Port", @@ -905,6 +916,7 @@ "systemvmtype": "System VM Type", "tags": "Tags", "tariffValue": "Tariff Value", +"tcp": "TCP", "template": "Select a template", "templateFileUpload": "Local file", "templateLimit": "Template Limits", @@ -926,6 +938,7 @@ "traffictype": "Traffic Type", "transportzoneuuid": "Transport Zone Uuid", "type": "Type", +"udp": "UDP", "unit": "Usage Unit", "url": "URL", "usageName": "Usage Type", @@ -964,6 +977,7 @@ "vlanRange": "VLAN/VNI Range", "vlanname": "VLAN", "vlanrange": "VLAN/VNI Range", +"vm": "VM", "vmLimit": "Instance Limits", "vmTotal": "Instances", "vmdisplayname": "VM display name", diff --git a/ui/src/utils/device.js b/ui/src/utils/device.js index 8c31370dfa5..731270d83b8 100644 --- a/ui/src/utils/device.js +++ b/ui/src/utils/device.js @@ -45,6 +45,6 @@ export const deviceEnquire = function (callback) { // screen and (max-width: 1087.99px) enquireJs .register('screen and (max-width: 576px)', matchMobile) - .register('screen and (min-width: 576px) and (max-width: 1366px)', matchTablet) - .register('screen and (min-width: 1367px)', matchDesktop) + .register('screen and (min-width: 576px) and (max-width: 1280px)', matchTablet) + .register('screen and (min-width: 1281px)', matchDesktop) } diff --git a/ui/src/views/network/EgressConfigure.vue b/ui/src/views/network/EgressConfigure.vue index 1bd3670a829..22d9db61ded 100644 --- a/ui/src/views/network/EgressConfigure.vue +++ b/ui/src/views/network/EgressConfigure.vue @@ -17,24 +17,287 @@ - diff --git a/ui/src/views/network/FirewallRules.vue b/ui/src/views/network/FirewallRules.vue new file mode 100644 index 00000000000..a0a247915b5 --- /dev/null +++ b/ui/src/views/network/FirewallRules.vue @@ -0,0 +1,476 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + + + + + + diff --git a/ui/src/views/network/IngressEgressRuleConfigure.vue b/ui/src/views/network/IngressEgressRuleConfigure.vue index 8d17bba8226..24b6cfcf7f0 100644 --- a/ui/src/views/network/IngressEgressRuleConfigure.vue +++ b/ui/src/views/network/IngressEgressRuleConfigure.vue @@ -107,7 +107,7 @@ okText="Yes" cancelText="No" > - + diff --git a/ui/src/views/network/IpConfigure.vue b/ui/src/views/network/IpConfigure.vue deleted file mode 100644 index d0c6213ed1d..00000000000 --- a/ui/src/views/network/IpConfigure.vue +++ /dev/null @@ -1,40 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - - - - - - diff --git a/ui/src/views/network/LoadBalancing.vue b/ui/src/views/network/LoadBalancing.vue new file mode 100644 index 00000000000..5f175b6384a --- /dev/null +++ b/ui/src/views/network/LoadBalancing.vue @@ -0,0 +1,1373 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + + + + + + diff --git a/ui/src/views/network/PortForwarding.vue b/ui/src/views/network/PortForwarding.vue new file mode 100644 index 00000000000..eb196a7932f --- /dev/null +++ b/ui/src/views/network/PortForwarding.vue @@ -0,0 +1,675 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + + + + + + diff --git a/ui/src/views/network/VpnDetails.vue b/ui/src/views/network/VpnDetails.vue index a0b23adb93a..f630d18598a 100644 --- a/ui/src/views/network/VpnDetails.vue +++ b/ui/src/views/network/VpnDetails.vue @@ -16,25 +16,190 @@ // under the License. -