Skip to content

Commit 0a92cc0

Browse files
lucas-a-martinsLucas Martins
and
Lucas Martins
authored
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>
1 parent a7beaaf commit 0a92cc0

File tree

4 files changed

+14
-3
lines changed

4 files changed

+14
-3
lines changed

ui/public/locales/en.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2454,7 +2454,7 @@
24542454
"label.users": "Users",
24552455
"label.usersource": "User type",
24562456
"label.using.cli": "Using CLI",
2457-
"label.utilization": "Utilisation",
2457+
"label.utilization": "Utilization",
24582458
"label.uuid": "ID",
24592459
"label.value": "Value",
24602460
"label.vcenter": "VMware datacenter vCenter",

ui/src/components/view/ListView.vue

+3
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,9 @@
256256
<template v-if="column.key === 'quotastate'">
257257
<status :text="text ? text : ''" displayText />
258258
</template>
259+
<template v-if="column.key === 'vmstate'">
260+
<status :text="text ? text : ''" displayText vmState/>
261+
</template>
259262
<template v-if="column.key === 'vlan'">
260263
<a href="javascript:;">
261264
<router-link v-if="$route.path === '/guestvlans'" :to="{ path: '/guestvlans/' + record.id }">{{ text }}</router-link>

ui/src/components/widgets/Status.vue

+9-1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ export default {
4444
styles: {
4545
type: Object,
4646
default: () => {}
47+
},
48+
vmState: {
49+
type: Boolean,
50+
default: false
4751
}
4852
},
4953
methods: {
@@ -182,7 +186,11 @@ export default {
182186
} else if (this.$route.path === '/vm' || this.$route.path.includes('/vm/')) {
183187
result = this.$t('message.vm.state.' + state.toLowerCase())
184188
} else if (this.$route.path === '/volume' || this.$route.path.includes('/volume/')) {
185-
result = this.$t('message.volume.state.' + state.toLowerCase())
189+
if (this.vmState) {
190+
result = this.$t('message.vm.state.' + state.toLowerCase())
191+
} else {
192+
result = this.$t('message.volume.state.' + state.toLowerCase())
193+
}
186194
} else if (this.$route.path === '/guestnetwork' || this.$route.path.includes('/guestnetwork/')) {
187195
result = this.$t('message.guestnetwork.state.' + state.toLowerCase())
188196
} else if (this.$route.path === '/publicip' || this.$route.path.includes('/publicip/')) {

ui/src/config/section/storage.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export default {
3838
}
3939
},
4040
columns: () => {
41-
const fields = ['name', 'state', 'sizegb', 'type', 'vmname']
41+
const fields = ['name', 'state', 'sizegb', 'type', 'vmname', 'vmstate']
4242
const metricsFields = ['diskkbsread', 'diskkbswrite', 'diskiopstotal']
4343

4444
if (store.getters.userInfo.roletype === 'Admin') {

0 commit comments

Comments
 (0)