From b02660c1743b26b4849af9e40e6efe53af50adea Mon Sep 17 00:00:00 2001 From: guiaria Date: Wed, 3 May 2023 10:07:07 +0200 Subject: [PATCH 1/6] Add placeholder section --- ui/public/locales/en.json | 3 +- ui/src/components/view/ResourceManagement.vue | 158 ++++++++++++++++++ ui/src/config/router.js | 3 +- ui/src/config/section/gpu.js | 27 +++ 4 files changed, 189 insertions(+), 2 deletions(-) create mode 100644 ui/src/components/view/ResourceManagement.vue create mode 100644 ui/src/config/section/gpu.js diff --git a/ui/public/locales/en.json b/ui/public/locales/en.json index dfa813238be8..aa5e92d6fab8 100644 --- a/ui/public/locales/en.json +++ b/ui/public/locales/en.json @@ -3111,5 +3111,6 @@ "state.stopping": "Stopping", "state.suspended": "Suspended", "user.login": "Login", -"user.logout": "Logout" +"user.logout": "Logout", +"label.gpuMgn": "GPU Management" } diff --git a/ui/src/components/view/ResourceManagement.vue b/ui/src/components/view/ResourceManagement.vue new file mode 100644 index 000000000000..912a49ce5871 --- /dev/null +++ b/ui/src/components/view/ResourceManagement.vue @@ -0,0 +1,158 @@ +// 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/config/router.js b/ui/src/config/router.js index 9f4616e97f03..ae4b0da658f0 100644 --- a/ui/src/config/router.js +++ b/ui/src/config/router.js @@ -39,6 +39,7 @@ import config from '@/config/section/config' import tools from '@/config/section/tools' import quota from '@/config/section/plugin/quota' import cloudian from '@/config/section/plugin/cloudian' +import gpu from '@/config/section/gpu' function generateRouterMap (section) { var map = { @@ -240,7 +241,7 @@ export function asyncRouterMap () { generateRouterMap(tools), generateRouterMap(quota), generateRouterMap(cloudian), - + generateRouterMap(gpu), { path: '/exception', name: 'exception', diff --git a/ui/src/config/section/gpu.js b/ui/src/config/section/gpu.js new file mode 100644 index 000000000000..80b067d3f35e --- /dev/null +++ b/ui/src/config/section/gpu.js @@ -0,0 +1,27 @@ +// 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. + +import { shallowRef, defineAsyncComponent } from 'vue' +// import store from '@/store' + +export default { + name: 'Resource Management', + title: 'label.gpuMgn', + icon: 'project-outlined', + resourceType: 'Rmgn', + component: shallowRef(defineAsyncComponent(() => import('@/components/view/ResourceManagement.vue'))) +} From 6eceb652272c39111f61c781de145359ef5524e7 Mon Sep 17 00:00:00 2001 From: guiaria Date: Wed, 3 May 2023 12:26:50 +0200 Subject: [PATCH 2/6] change variable name/ add more column --- ui/public/locales/en.json | 5 ++- ui/src/components/view/ResourceManagement.vue | 33 ++++++++++++------- 2 files changed, 26 insertions(+), 12 deletions(-) diff --git a/ui/public/locales/en.json b/ui/public/locales/en.json index aa5e92d6fab8..53577aeffd4b 100644 --- a/ui/public/locales/en.json +++ b/ui/public/locales/en.json @@ -3112,5 +3112,8 @@ "state.suspended": "Suspended", "user.login": "Login", "user.logout": "Logout", -"label.gpuMgn": "GPU Management" +"label.gpuMgn": "GPU Management", +"label.gpuResource": "GPU Resource", +"label.gpuUUID": "UUID", +"label.resouce.owner": "Resource Owner" } diff --git a/ui/src/components/view/ResourceManagement.vue b/ui/src/components/view/ResourceManagement.vue index 912a49ce5871..0f58720f11a6 100644 --- a/ui/src/components/view/ResourceManagement.vue +++ b/ui/src/components/view/ResourceManagement.vue @@ -40,13 +40,13 @@ Date: Fri, 26 May 2023 18:35:23 +0200 Subject: [PATCH 3/6] Change Autogenview Logic to add data without API --- ui/package.json | 1 + ui/src/components/view/ResourceManagement.vue | 169 ------------------ ui/src/config/section/gpu.js | 18 +- ui/src/constant/mockingData.js | 37 ++++ ui/src/views/AutogenView.vue | 50 ++++++ 5 files changed, 102 insertions(+), 173 deletions(-) delete mode 100644 ui/src/components/view/ResourceManagement.vue create mode 100644 ui/src/constant/mockingData.js diff --git a/ui/package.json b/ui/package.json index 62777e9ccbcc..06383ed2a4cf 100644 --- a/ui/package.json +++ b/ui/package.json @@ -27,6 +27,7 @@ "prebuild": "./prebuild.sh", "start": "vue-cli-service lint --no-fix && vue-cli-service serve", "serve": "vue-cli-service lint --no-fix && vue-cli-service serve", + "serve:lint": "vue-cli-service lint --fix && vue-cli-service serve", "build": "vue-cli-service build", "postbuild": "./postbuild.sh", "lint": "vue-cli-service lint", diff --git a/ui/src/components/view/ResourceManagement.vue b/ui/src/components/view/ResourceManagement.vue deleted file mode 100644 index 0f58720f11a6..000000000000 --- a/ui/src/components/view/ResourceManagement.vue +++ /dev/null @@ -1,169 +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/config/section/gpu.js b/ui/src/config/section/gpu.js index 80b067d3f35e..9c49792b04d7 100644 --- a/ui/src/config/section/gpu.js +++ b/ui/src/config/section/gpu.js @@ -15,13 +15,23 @@ // specific language governing permissions and limitations // under the License. -import { shallowRef, defineAsyncComponent } from 'vue' +// import { shallowRef, defineAsyncComponent } from 'vue' // import store from '@/store' export default { - name: 'Resource Management', + name: 'GPUManagement', title: 'label.gpuMgn', icon: 'project-outlined', - resourceType: 'Rmgn', - component: shallowRef(defineAsyncComponent(() => import('@/components/view/ResourceManagement.vue'))) + resourceType: 'GPUmgn', + columns: ['name', 'uuid', 'owners'], + actions: [ + { + api: 'deployVirtualMachine', + icon: 'plus-outlined', + label: 'label.vm.add', + docHelp: 'adminguide/virtual_machines.html#creating-vms', + listView: true, + component: () => import('@/views/compute/DeployVM.vue') + } + ] } diff --git a/ui/src/constant/mockingData.js b/ui/src/constant/mockingData.js new file mode 100644 index 000000000000..e8ea3198e5e3 --- /dev/null +++ b/ui/src/constant/mockingData.js @@ -0,0 +1,37 @@ +export const mockingData = [ + { + name: 'Dummy GPU', + uuid: 2738917389127422, + owners: 'Admin' + }, + { + name: 'Dummy GPU2', + uuid: 3458368292545454, + owners: 'User1' + }, + { + name: 'Dummy GPU3', + uuid: 1481384368656542, + owners: 'Admin' + }, + { + name: 'Dummy GPU4', + uuid: 1236128184282573, + owners: 'Admin' + }, + { + name: 'Dummy GPU5', + uuid: 3147314561345134, + owners: 'Admin' + }, + { + name: 'Dummy GPU6', + uuid: 1312351253123661, + owners: 'Admin' + }, + { + name: 'Dummy GPU7', + uuid: 2472134124517173, + owners: 'Admin' + } +] diff --git a/ui/src/views/AutogenView.vue b/ui/src/views/AutogenView.vue index fd241fee1633..88fd1e6a61fd 100644 --- a/ui/src/views/AutogenView.vue +++ b/ui/src/views/AutogenView.vue @@ -459,6 +459,7 @@ import OsLogo from '@/components/widgets/OsLogo' import ResourceIcon from '@/components/view/ResourceIcon' import BulkActionProgress from '@/components/view/BulkActionProgress' import TooltipLabel from '@/components/widgets/TooltipLabel' +import { mockingData } from '@/constant/mockingData' export default { name: 'Resource', @@ -727,6 +728,10 @@ export default { }) }, fetchData (params = {}) { + if (this.$route.name === 'GPUManagement') { + this.handleGPUCase(mockingData) + return + } if (this.$route.name === 'deployVirtualMachine') { return } @@ -814,6 +819,10 @@ export default { } if (this.apiName === '' || this.apiName === undefined) { + if (this.$route.path.includes('GPUManagement')) { + this.handleGPUparam(mockingData) + return + } return } @@ -1825,6 +1834,47 @@ export default { if (screenWidth <= 768) { this.modalWidth = '450px' } + }, + handleGPUCase (resource) { + this.resource = resource + this.items = resource + this.columnKeys = this.$route.meta.columns + this.itemCount = this.resource.length + + if (this.$route.meta.actions) { + this.actions = this.$route.meta.actions + } + + for (var columnKey of this.columnKeys) { + let key = columnKey + let title = columnKey === 'cidr' && this.columnKeys.includes('ip6cidr') ? 'ipv4.cidr' : columnKey + if (typeof columnKey === 'object') { + if ('customTitle' in columnKey && 'field' in columnKey) { + key = columnKey.field + title = columnKey.customTitle + } else { + key = Object.keys(columnKey)[0] + title = Object.keys(columnKey)[0] + } + } + this.columns.push({ + key: key, + title: this.$t('label.' + String(title).toLowerCase()), + dataIndex: key, + sorter: function (a, b) { return genericCompare(a[key] || '', b[key] || '') } + }) + this.selectedColumns.push(key) + } + this.dataView = false + + // this.$emit('change-resource', this.resource) + }, + handleGPUparam (resource) { + console.warn('GPU') + const idx = resource.findIndex(x => x.name === this.$route.params.id) + const data = resource[idx] + this.resource = data + this.$emit('change-resource', this.resource) } } } From e2b83facf6fc351a3bfd5b32522bf9079bfb6adb Mon Sep 17 00:00:00 2001 From: guiaria Date: Mon, 5 Jun 2023 11:38:22 +0200 Subject: [PATCH 4/6] Add GPUmanagement to quickview --- ui/src/components/view/ListView.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/src/components/view/ListView.vue b/ui/src/components/view/ListView.vue index a9163ce63cd4..88be2c4b7a2e 100644 --- a/ui/src/components/view/ListView.vue +++ b/ui/src/components/view/ListView.vue @@ -512,7 +512,7 @@ export default { '/project', '/account', '/zone', '/pod', '/cluster', '/host', '/storagepool', '/imagestore', '/systemvm', '/router', '/ilbvm', '/annotation', '/computeoffering', '/systemoffering', '/diskoffering', '/backupoffering', '/networkoffering', '/vpcoffering', - '/tungstenfabric'].join('|')) + '/tungstenfabric', '/GPUManagement'].join('|')) .test(this.$route.path) }, enableGroupAction () { From b3798b775185a298047e6e8fedae68ecbce70125 Mon Sep 17 00:00:00 2001 From: guiaria Date: Mon, 5 Jun 2023 11:39:17 +0200 Subject: [PATCH 5/6] Create more detailed mocking data --- ui/src/config/section/gpu.js | 53 +++- ui/src/constant/mockingData.js | 460 ++++++++++++++++++++++++++++++--- ui/src/views/AutogenView.vue | 2 +- 3 files changed, 475 insertions(+), 40 deletions(-) diff --git a/ui/src/config/section/gpu.js b/ui/src/config/section/gpu.js index 9c49792b04d7..cf7c2057b240 100644 --- a/ui/src/config/section/gpu.js +++ b/ui/src/config/section/gpu.js @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. -// import { shallowRef, defineAsyncComponent } from 'vue' +import { shallowRef, defineAsyncComponent } from 'vue' // import store from '@/store' export default { @@ -23,7 +23,7 @@ export default { title: 'label.gpuMgn', icon: 'project-outlined', resourceType: 'GPUmgn', - columns: ['name', 'uuid', 'owners'], + columns: ['name', 'displayname', 'state', 'ipaddress', 'account', 'hostname'], actions: [ { api: 'deployVirtualMachine', @@ -32,6 +32,55 @@ export default { docHelp: 'adminguide/virtual_machines.html#creating-vms', listView: true, component: () => import('@/views/compute/DeployVM.vue') + }, + { + api: 'updateVirtualMachine', + icon: 'edit-outlined', + label: 'label.action.edit.instance', + docHelp: 'adminguide/virtual_machines.html#changing-the-vm-name-os-or-group', + dataView: true, + popup: true, + component: shallowRef(defineAsyncComponent(() => import('@/views/compute/EditVM.vue'))) + }, + { + api: 'startVirtualMachine', + icon: 'caret-right-outlined', + label: 'label.action.start.instance', + message: 'message.action.start.instance', + docHelp: 'adminguide/virtual_machines.html#stopping-and-starting-vms', + dataView: true, + groupAction: true, + popup: true, + groupMap: (selection, values) => { return selection.map(x => { return { id: x, considerlasthost: values.considerlasthost } }) }, + args: ['considerlasthost'], + show: (record) => { return ['Stopped'].includes(record.state) }, + component: shallowRef(defineAsyncComponent(() => import('@/views/compute/StartVirtualMachine.vue'))) + }, + { + api: 'expungeVirtualMachine', + icon: 'delete-outlined', + label: 'label.action.expunge.instance', + message: (record) => { return record.backupofferingid ? 'message.action.expunge.instance.with.backups' : 'message.action.expunge.instance' }, + docHelp: 'adminguide/virtual_machines.html#deleting-vms', + dataView: true, + show: (record, store) => { return ['Destroyed', 'Expunging'].includes(record.state) && store.features.allowuserexpungerecovervm } + }, + { + api: 'destroyVirtualMachine', + icon: 'delete-outlined', + label: 'label.action.destroy.instance', + message: 'message.action.destroy.instance', + docHelp: 'adminguide/virtual_machines.html#deleting-vms', + dataView: true, + groupAction: true, + args: (record, store, group) => { + return (['Admin'].includes(store.userInfo.roletype) || store.features.allowuserexpungerecovervm) + ? ['expunge'] : [] + }, + popup: true, + groupMap: (selection, values) => { return selection.map(x => { return { id: x, expunge: values.expunge } }) }, + show: (record) => { return ['Running', 'Stopped', 'Error'].includes(record.state) }, + component: shallowRef(defineAsyncComponent(() => import('@/views/compute/DestroyVM.vue'))) } ] } diff --git a/ui/src/constant/mockingData.js b/ui/src/constant/mockingData.js index e8ea3198e5e3..ad118bd6f1d0 100644 --- a/ui/src/constant/mockingData.js +++ b/ui/src/constant/mockingData.js @@ -1,37 +1,423 @@ -export const mockingData = [ - { - name: 'Dummy GPU', - uuid: 2738917389127422, - owners: 'Admin' - }, - { - name: 'Dummy GPU2', - uuid: 3458368292545454, - owners: 'User1' - }, - { - name: 'Dummy GPU3', - uuid: 1481384368656542, - owners: 'Admin' - }, - { - name: 'Dummy GPU4', - uuid: 1236128184282573, - owners: 'Admin' - }, - { - name: 'Dummy GPU5', - uuid: 3147314561345134, - owners: 'Admin' - }, - { - name: 'Dummy GPU6', - uuid: 1312351253123661, - owners: 'Admin' - }, - { - name: 'Dummy GPU7', - uuid: 2472134124517173, - owners: 'Admin' - } -] +export const mockingData = + [ + { + ipaddress: '192.168.1.135', + cputotal: '1.0 Ghz', + memorytotal: '1.00 GiB', + networkread: '32.00 MiB', + networkwrite: '16.00 MiB', + diskread: '0.00 MiB', + diskwrite: '0.00 MiB', + diskiopstotal: 0, + id: '920454ce-d9b8-454f-bccf-2fd9385d8b98', + name: 'VM-920454ce-d9b8-454f-bccf-2fd9385d8b98', + displayname: 'VM-920454ce-d9b8-454f-bccf-2fd9385d8b98', + account: 'rick', + userid: '44f2ad70-0d73-4fa7-9791-be7a66d26b3a', + username: 'rick', + domainid: 'b32b3316-6c14-11ed-86c2-1e0093003d07', + domain: 'ROOT', + created: '2023-04-14T04:34:35+0000', + lastupdated: '2023-04-14T04:34:39+0000', + state: 'Running', + haenable: false, + zoneid: '673911f1-d15d-453a-a021-4556b0a6495f', + zonename: 'Sim-Basic', + hostid: '137033ae-9a3c-4d0f-b998-64de09753280', + hostname: 'SimulatedAgent.4d3186fc-ca14-4b28-a859-983b8f347e64', + hostcontrolstate: 'Enabled', + templateid: '0c044204-6c15-11ed-86c2-1e0093003d07', + templatename: 'CentOS 5.6 (64-bit) no GUI (Simulator)', + templatedisplaytext: 'CentOS 5.6 (64-bit) no GUI (Simulator)', + passwordenabled: false, + serviceofferingid: '30e662ef-a37e-46ad-b7c5-35fb6270d6ee', + serviceofferingname: 'Medium Instance', + cpunumber: 1, + cpuspeed: 1000, + memory: 1024, + cpuused: '10%', + networkkbsread: 32768, + networkkbswrite: 16384, + diskkbsread: 0, + diskkbswrite: 0, + memorykbs: 0, + memoryintfreekbs: 0, + memorytargetkbs: 0, + diskioread: 0, + diskiowrite: 0, + guestosid: 'b3471af4-6c14-11ed-86c2-1e0093003d07', + rootdeviceid: 0, + rootdevicetype: 'ROOT', + securitygroup: [ + { + id: 'd0e03822-c9f6-49e9-9d91-aebc762557e3', + name: 'default', + description: 'Default Security Group', + account: 'rick', + ingressrule: [], + egressrule: [], + tags: [], + virtualmachineids: [] + } + ], + nic: [ + { + id: '8372f7ae-36ea-4994-b6cf-400e92fbe612', + networkid: '0158f28f-47c1-413f-99ff-ad78e4915a7a', + networkname: 'defaultGuestNetwork', + netmask: '255.255.255.0', + gateway: '192.168.1.1', + ipaddress: '192.168.1.135', + broadcasturi: 'vlan://untagged', + traffictype: 'Guest', + type: 'Shared', + isdefault: true, + macaddress: '1e:00:de:00:00:b0', + secondaryip: [], + extradhcpoption: [], + deviceid: '0' + } + ], + hypervisor: 'Simulator', + instancename: 'i-39-119-VM', + details: {}, + affinitygroup: [], + displayvm: true, + isdynamicallyscalable: false, + ostypeid: 'b3471af4-6c14-11ed-86c2-1e0093003d07', + osdisplayname: 'CentOS 5.6 (64-bit)', + bootmode: 'legacy', + boottype: 'Bios', + pooltype: 'NetworkFilesystem', + tags: [], + hasannotations: false + }, + { + ipaddress: '192.168.50.10', + cputotal: '0.5 Ghz', + memorytotal: '0.50 GiB', + networkread: '32.00 MiB', + networkwrite: '16.00 MiB', + diskread: '0.00 MiB', + diskwrite: '0.00 MiB', + diskiopstotal: 0, + id: '85b89915-f399-4575-8ac4-e4671cb4c4c8', + name: 'user-vm1', + displayname: 'user-vm1', + account: 'user', + userid: '62748632-2c71-4181-8559-b12f0b072fc1', + username: 'user', + domainid: 'b32b3316-6c14-11ed-86c2-1e0093003d07', + domain: 'ROOT', + created: '2023-05-24T11:00:10+0000', + lastupdated: '2023-05-24T11:00:14+0000', + state: 'Running', + haenable: false, + zoneid: 'c843ba49-21c3-4616-a3ff-07bb91db3a6b', + zonename: 'Sim-Adv Zone', + hostid: 'ee632f8a-1c75-4eaf-b807-0385050dc5b9', + hostname: 'SimulatedAgent.3d4d6bb6-fe4d-4cc4-8fa0-cc0b51020ff2', + hostcontrolstate: 'Enabled', + templateid: '0c044204-6c15-11ed-86c2-1e0093003d07', + templatename: 'CentOS 5.6 (64-bit) no GUI (Simulator)', + templatedisplaytext: 'CentOS 5.6 (64-bit) no GUI (Simulator)', + passwordenabled: false, + serviceofferingid: '1be5e5c5-1a1e-4a61-b717-b19ba10579aa', + serviceofferingname: 'Small Instance', + cpunumber: 1, + cpuspeed: 500, + memory: 512, + cpuused: '10%', + networkkbsread: 32768, + networkkbswrite: 16384, + diskkbsread: 0, + diskkbswrite: 0, + memorykbs: 0, + memoryintfreekbs: 0, + memorytargetkbs: 0, + diskioread: 0, + diskiowrite: 0, + guestosid: 'b3471af4-6c14-11ed-86c2-1e0093003d07', + rootdeviceid: 0, + rootdevicetype: 'ROOT', + securitygroup: [], + nic: [ + { + id: 'dca0aedb-3f74-456d-8924-790e2b2e6218', + networkid: 'eaa6b5e7-3294-4818-923e-14ecf38514d2', + networkname: 'Admin Shared Network', + netmask: '255.255.255.0', + gateway: '192.168.50.1', + ipaddress: '192.168.50.10', + isolationuri: 'vlan://50', + broadcasturi: 'vlan://50', + traffictype: 'Guest', + type: 'Shared', + isdefault: true, + macaddress: '1e:00:55:00:00:f2', + secondaryip: [], + extradhcpoption: [], + deviceid: '0' + } + ], + hypervisor: 'Simulator', + instancename: 'i-57-151-VM', + details: {}, + affinitygroup: [], + displayvm: true, + isdynamicallyscalable: false, + ostypeid: 'b3471af4-6c14-11ed-86c2-1e0093003d07', + osdisplayname: 'CentOS 5.6 (64-bit)', + bootmode: 'legacy', + boottype: 'Bios', + pooltype: 'NetworkFilesystem', + tags: [], + hasannotations: false + }, + { + ipaddress: '10.1.1.123', + cputotal: '1.0 Ghz', + memorytotal: '1.00 GiB', + networkread: '32.00 MiB', + networkwrite: '16.00 MiB', + diskread: '0.00 MiB', + diskwrite: '0.00 MiB', + diskiopstotal: 0, + id: '1745f33a-478d-40d8-ae49-0e0bde4c25ff', + name: 'VM-1745f33a-478d-40d8-ae49-0e0bde4c25ff', + displayname: 'VM-1745f33a-478d-40d8-ae49-0e0bde4c25ff', + account: 'admin', + userid: 'fda46cff-6c14-11ed-86c2-1e0093003d07', + username: 'admin', + domainid: 'b32b3316-6c14-11ed-86c2-1e0093003d07', + domain: 'ROOT', + created: '2023-04-11T09:11:59+0000', + lastupdated: '2023-04-11T09:12:04+0000', + state: 'Running', + haenable: false, + zoneid: 'c843ba49-21c3-4616-a3ff-07bb91db3a6b', + zonename: 'Sim-Adv Zone', + hostid: 'ee632f8a-1c75-4eaf-b807-0385050dc5b9', + hostname: 'SimulatedAgent.3d4d6bb6-fe4d-4cc4-8fa0-cc0b51020ff2', + hostcontrolstate: 'Enabled', + templateid: '0c044204-6c15-11ed-86c2-1e0093003d07', + templatename: 'CentOS 5.6 (64-bit) no GUI (Simulator)', + templatedisplaytext: 'CentOS 5.6 (64-bit) no GUI (Simulator)', + passwordenabled: false, + serviceofferingid: '30e662ef-a37e-46ad-b7c5-35fb6270d6ee', + serviceofferingname: 'Medium Instance', + cpunumber: 1, + cpuspeed: 1000, + memory: 1024, + cpuused: '10%', + networkkbsread: 32768, + networkkbswrite: 16384, + diskkbsread: 0, + diskkbswrite: 0, + memorykbs: 0, + memoryintfreekbs: 0, + memorytargetkbs: 0, + diskioread: 0, + diskiowrite: 0, + guestosid: 'b3471af4-6c14-11ed-86c2-1e0093003d07', + rootdeviceid: 0, + rootdevicetype: 'ROOT', + securitygroup: [], + nic: [ + { + id: 'fad1120f-aae5-4692-99b5-604925c0dd75', + networkid: '6d625e42-f1cc-4fe1-be95-a28256fc6df2', + networkname: 'Sim-Adv Admin Isolated Network', + netmask: '255.255.255.0', + gateway: '10.1.1.1', + ipaddress: '10.1.1.123', + isolationuri: 'vlan://3773', + broadcasturi: 'vlan://3773', + traffictype: 'Guest', + type: 'Isolated', + isdefault: true, + macaddress: '02:00:70:1b:00:0f', + secondaryip: [], + extradhcpoption: [], + deviceid: '0' + } + ], + hypervisor: 'Simulator', + instancename: 'i-2-118-VM', + details: {}, + affinitygroup: [], + displayvm: true, + isdynamicallyscalable: false, + ostypeid: 'b3471af4-6c14-11ed-86c2-1e0093003d07', + osdisplayname: 'CentOS 5.6 (64-bit)', + bootmode: 'legacy', + boottype: 'Bios', + pooltype: 'NetworkFilesystem', + tags: [], + hasannotations: false + }, + { + ipaddress: '10.7.7.777', + cputotal: '1.0 Ghz', + memorytotal: '1.00 GiB', + networkread: '32.00 MiB', + networkwrite: '16.00 MiB', + diskread: '0.00 MiB', + diskwrite: '0.00 MiB', + diskiopstotal: 0, + id: '2139vm-0b9j-8124098n124vn', + name: 'VM-83210vn-478d-40d8-ae49-weivrm93148v', + displayname: 'Dummy VM 1', + account: 'admin', + userid: 'fda46cff-6c14-11ed-86c2-1e0093003d07', + username: 'admin', + domainid: 'b32b3316-6c14-11ed-86c2-1e0093003d07', + domain: 'ROOT', + created: '2023-04-11T09:11:59+0000', + lastupdated: '2023-04-11T09:12:04+0000', + state: 'Running', + haenable: false, + zoneid: 'c843ba49-21c3-4616-a3ff-07bb91db3a6b', + zonename: 'Sim-Adv Zone', + hostid: 'ee632f8a-1c75-4eaf-b807-0385050dc5b9', + hostname: 'SimulatedAgent.3d4d6bb6-fe4d-4cc4-8fa0-cc0b51020ff2', + hostcontrolstate: 'Enabled', + templateid: '0c044204-6c15-11ed-86c2-1e0093003d07', + templatename: 'CentOS 5.6 (64-bit) no GUI (Simulator)', + templatedisplaytext: 'CentOS 5.6 (64-bit) no GUI (Simulator)', + passwordenabled: false, + serviceofferingid: '30e662ef-a37e-46ad-b7c5-35fb6270d6ee', + serviceofferingname: 'Medium Instance', + cpunumber: 1, + cpuspeed: 1000, + memory: 1024, + cpuused: '10%', + networkkbsread: 32768, + networkkbswrite: 16384, + diskkbsread: 0, + diskkbswrite: 0, + memorykbs: 0, + memoryintfreekbs: 0, + memorytargetkbs: 0, + diskioread: 0, + diskiowrite: 0, + guestosid: 'b3471af4-6c14-11ed-86c2-1e0093003d07', + rootdeviceid: 0, + rootdevicetype: 'ROOT', + securitygroup: [], + nic: [ + { + id: 'fad1120f-aae5-4692-99b5-604925c0dd75', + networkid: '6d625e42-f1cc-4fe1-be95-a28256fc6df2', + networkname: 'Sim-Adv Admin Isolated Network', + netmask: '255.255.255.0', + gateway: '10.1.1.1', + ipaddress: '10.1.1.123', + isolationuri: 'vlan://3773', + broadcasturi: 'vlan://3773', + traffictype: 'Guest', + type: 'Isolated', + isdefault: true, + macaddress: '02:00:70:1b:00:0f', + secondaryip: [], + extradhcpoption: [], + deviceid: '0' + } + ], + hypervisor: 'Simulator', + instancename: 'i-2-118-VM', + details: {}, + affinitygroup: [], + displayvm: true, + isdynamicallyscalable: false, + ostypeid: 'b3471af4-6c14-11ed-86c2-1e0093003d07', + osdisplayname: 'CentOS 5.6 (64-bit)', + bootmode: 'legacy', + boottype: 'Bios', + pooltype: 'NetworkFilesystem', + tags: [], + hasannotations: false + }, + { + ipaddress: '10.9.9.999', + cputotal: '1.0 Ghz', + memorytotal: '1.00 GiB', + networkread: '32.00 MiB', + networkwrite: '16.00 MiB', + diskread: '0.00 MiB', + diskwrite: '0.00 MiB', + diskiopstotal: 0, + id: '128390128ae49-8124098n124vn', + name: 'VM-1745f33a-478d-40d8-ae49-0e0bde4c25ff', + displayname: 'Dummy VM 2', + account: 'admin', + userid: 'fda46cff-6c14-11ed-86c2-1e0093003d07', + username: 'admin', + domainid: 'b32b3316-6c14-11ed-86c2-1e0093003d07', + domain: 'ROOT', + created: '2023-04-11T09:11:59+0000', + lastupdated: '2023-04-11T09:12:04+0000', + state: 'Running', + haenable: false, + zoneid: 'c843ba49-21c3-4616-a3ff-07bb91db3a6b', + zonename: 'Sim-Adv Zone', + hostid: 'ee632f8a-1c75-4eaf-b807-0385050dc5b9', + hostname: 'SimulatedAgent.3d4d6bb6-fe4d-4cc4-8fa0-cc0b51020ff2', + hostcontrolstate: 'Enabled', + templateid: '0c044204-6c15-11ed-86c2-1e0093003d07', + templatename: 'CentOS 5.6 (64-bit) no GUI (Simulator)', + templatedisplaytext: 'CentOS 5.6 (64-bit) no GUI (Simulator)', + passwordenabled: false, + serviceofferingid: '30e662ef-a37e-46ad-b7c5-35fb6270d6ee', + serviceofferingname: 'Medium Instance', + cpunumber: 1, + cpuspeed: 1000, + memory: 1024, + cpuused: '10%', + networkkbsread: 32768, + networkkbswrite: 16384, + diskkbsread: 0, + diskkbswrite: 0, + memorykbs: 0, + memoryintfreekbs: 0, + memorytargetkbs: 0, + diskioread: 0, + diskiowrite: 0, + guestosid: 'b3471af4-6c14-11ed-86c2-1e0093003d07', + rootdeviceid: 0, + rootdevicetype: 'ROOT', + securitygroup: [], + nic: [ + { + id: 'fad1120f-aae5-4692-99b5-604925c0dd75', + networkid: '6d625e42-f1cc-4fe1-be95-a28256fc6df2', + networkname: 'Sim-Adv Admin Isolated Network', + netmask: '255.255.255.0', + gateway: '10.1.1.1', + ipaddress: '10.1.1.123', + isolationuri: 'vlan://3773', + broadcasturi: 'vlan://3773', + traffictype: 'Guest', + type: 'Isolated', + isdefault: true, + macaddress: '02:00:70:1b:00:0f', + secondaryip: [], + extradhcpoption: [], + deviceid: '0' + } + ], + hypervisor: 'Simulator', + instancename: 'i-2-118-VM', + details: {}, + affinitygroup: [], + displayvm: true, + isdynamicallyscalable: false, + ostypeid: 'b3471af4-6c14-11ed-86c2-1e0093003d07', + osdisplayname: 'CentOS 5.6 (64-bit)', + bootmode: 'legacy', + boottype: 'Bios', + pooltype: 'NetworkFilesystem', + tags: [], + hasannotations: false + } + ] diff --git a/ui/src/views/AutogenView.vue b/ui/src/views/AutogenView.vue index 88fd1e6a61fd..34b70a0388fa 100644 --- a/ui/src/views/AutogenView.vue +++ b/ui/src/views/AutogenView.vue @@ -1871,7 +1871,7 @@ export default { }, handleGPUparam (resource) { console.warn('GPU') - const idx = resource.findIndex(x => x.name === this.$route.params.id) + const idx = resource.findIndex(x => x.id === this.$route.params.id) const data = resource[idx] this.resource = data this.$emit('change-resource', this.resource) From 0aa4cadd6e759740482c5cc2bfabe4797333e789 Mon Sep 17 00:00:00 2001 From: guiaria Date: Wed, 7 Jun 2023 12:36:55 +0200 Subject: [PATCH 6/6] Add extra config section --- ui/public/locales/en.json | 3 ++- ui/src/config/section/gpu.js | 3 +++ ui/src/constant/mockingData.js | 2 +- ui/src/views/compute/EditVM.vue | 12 ++++++++++++ 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/ui/public/locales/en.json b/ui/public/locales/en.json index 53577aeffd4b..c9984acae4ba 100644 --- a/ui/public/locales/en.json +++ b/ui/public/locales/en.json @@ -3115,5 +3115,6 @@ "label.gpuMgn": "GPU Management", "label.gpuResource": "GPU Resource", "label.gpuUUID": "UUID", -"label.resouce.owner": "Resource Owner" +"label.resouce.owner": "Resource Owner", +"label.extra.config" : "Extra Config" } diff --git a/ui/src/config/section/gpu.js b/ui/src/config/section/gpu.js index cf7c2057b240..1feb0d9d884d 100644 --- a/ui/src/config/section/gpu.js +++ b/ui/src/config/section/gpu.js @@ -24,6 +24,9 @@ export default { icon: 'project-outlined', resourceType: 'GPUmgn', columns: ['name', 'displayname', 'state', 'ipaddress', 'account', 'hostname'], + details: ['displayname', 'name', 'id', 'state', 'ipaddress', 'ip6address', 'templatename', 'ostypename', + 'serviceofferingname', 'isdynamicallyscalable', 'haenable', 'hypervisor', 'boottype', 'bootmode', 'account', + 'domain', 'zonename', 'userdataid', 'userdataname', 'userdataparams', 'userdatadetails', 'userdatapolicy', 'hostcontrolstate'], actions: [ { api: 'deployVirtualMachine', diff --git a/ui/src/constant/mockingData.js b/ui/src/constant/mockingData.js index ad118bd6f1d0..c8af67a22ae8 100644 --- a/ui/src/constant/mockingData.js +++ b/ui/src/constant/mockingData.js @@ -357,7 +357,7 @@ export const mockingData = domain: 'ROOT', created: '2023-04-11T09:11:59+0000', lastupdated: '2023-04-11T09:12:04+0000', - state: 'Running', + state: 'Stopped', haenable: false, zoneid: 'c843ba49-21c3-4616-a3ff-07bb91db3a6b', zonename: 'Sim-Adv Zone', diff --git a/ui/src/views/compute/EditVM.vue b/ui/src/views/compute/EditVM.vue index a90f50fc5401..604c375a6b28 100644 --- a/ui/src/views/compute/EditVM.vue +++ b/ui/src/views/compute/EditVM.vue @@ -91,6 +91,13 @@ + + + + +