UI: Add VM state to Volume list view (#10341)

* Add vm state to volume list view

* Change size column order

---------

Co-authored-by: Lucas Martins <lucas.martins@scclouds.com.br>
This commit is contained in:
Lucas Martins 2025-02-12 11:50:58 -03:00 committed by GitHub
parent a7beaaf73b
commit 0a92cc0349
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 14 additions and 3 deletions

View File

@ -2454,7 +2454,7 @@
"label.users": "Users", "label.users": "Users",
"label.usersource": "User type", "label.usersource": "User type",
"label.using.cli": "Using CLI", "label.using.cli": "Using CLI",
"label.utilization": "Utilisation", "label.utilization": "Utilization",
"label.uuid": "ID", "label.uuid": "ID",
"label.value": "Value", "label.value": "Value",
"label.vcenter": "VMware datacenter vCenter", "label.vcenter": "VMware datacenter vCenter",

View File

@ -256,6 +256,9 @@
<template v-if="column.key === 'quotastate'"> <template v-if="column.key === 'quotastate'">
<status :text="text ? text : ''" displayText /> <status :text="text ? text : ''" displayText />
</template> </template>
<template v-if="column.key === 'vmstate'">
<status :text="text ? text : ''" displayText vmState/>
</template>
<template v-if="column.key === 'vlan'"> <template v-if="column.key === 'vlan'">
<a href="javascript:;"> <a href="javascript:;">
<router-link v-if="$route.path === '/guestvlans'" :to="{ path: '/guestvlans/' + record.id }">{{ text }}</router-link> <router-link v-if="$route.path === '/guestvlans'" :to="{ path: '/guestvlans/' + record.id }">{{ text }}</router-link>

View File

@ -44,6 +44,10 @@ export default {
styles: { styles: {
type: Object, type: Object,
default: () => {} default: () => {}
},
vmState: {
type: Boolean,
default: false
} }
}, },
methods: { methods: {
@ -182,7 +186,11 @@ export default {
} else if (this.$route.path === '/vm' || this.$route.path.includes('/vm/')) { } else if (this.$route.path === '/vm' || this.$route.path.includes('/vm/')) {
result = this.$t('message.vm.state.' + state.toLowerCase()) result = this.$t('message.vm.state.' + state.toLowerCase())
} else if (this.$route.path === '/volume' || this.$route.path.includes('/volume/')) { } else if (this.$route.path === '/volume' || this.$route.path.includes('/volume/')) {
result = this.$t('message.volume.state.' + state.toLowerCase()) if (this.vmState) {
result = this.$t('message.vm.state.' + state.toLowerCase())
} else {
result = this.$t('message.volume.state.' + state.toLowerCase())
}
} else if (this.$route.path === '/guestnetwork' || this.$route.path.includes('/guestnetwork/')) { } else if (this.$route.path === '/guestnetwork' || this.$route.path.includes('/guestnetwork/')) {
result = this.$t('message.guestnetwork.state.' + state.toLowerCase()) result = this.$t('message.guestnetwork.state.' + state.toLowerCase())
} else if (this.$route.path === '/publicip' || this.$route.path.includes('/publicip/')) { } else if (this.$route.path === '/publicip' || this.$route.path.includes('/publicip/')) {

View File

@ -38,7 +38,7 @@ export default {
} }
}, },
columns: () => { columns: () => {
const fields = ['name', 'state', 'sizegb', 'type', 'vmname'] const fields = ['name', 'state', 'sizegb', 'type', 'vmname', 'vmstate']
const metricsFields = ['diskkbsread', 'diskkbswrite', 'diskiopstotal'] const metricsFields = ['diskkbsread', 'diskkbswrite', 'diskiopstotal']
if (store.getters.userInfo.roletype === 'Admin') { if (store.getters.userInfo.roletype === 'Admin') {