diff --git a/ui/src/components/widgets/Status.vue b/ui/src/components/widgets/Status.vue index 62438820314..73b1a9af930 100644 --- a/ui/src/components/widgets/Status.vue +++ b/ui/src/components/widgets/Status.vue @@ -166,23 +166,24 @@ export default { if (!(state && this.displayText)) { return '' } + let result if (this.$route.path === '/vmsnapshot' || this.$route.path.includes('/vmsnapshot/')) { - return this.$t('message.vmsnapshot.state.' + state.toLowerCase()) + result = this.$t('message.vmsnapshot.state.' + state.toLowerCase()) + } else if (this.$route.path === '/vm' || this.$route.path.includes('/vm/')) { + result = this.$t('message.vm.state.' + state.toLowerCase()) + } else if (this.$route.path === '/volume' || this.$route.path.includes('/volume/')) { + result = this.$t('message.volume.state.' + state.toLowerCase()) + } else if (this.$route.path === '/guestnetwork' || this.$route.path.includes('/guestnetwork/')) { + result = this.$t('message.guestnetwork.state.' + state.toLowerCase()) + } else if (this.$route.path === '/publicip' || this.$route.path.includes('/publicip/')) { + result = this.$t('message.publicip.state.' + state.toLowerCase()) } - if (this.$route.path === '/vm' || this.$route.path.includes('/vm/')) { - return this.$t('message.vm.state.' + state.toLowerCase()) + + if (!result || (result.startsWith('message.') && result.endsWith('.state.' + state.toLowerCase()))) { + // Nothing for snapshots, vpcs, gateways, vnpnconn, vpnuser, kubectl, event, project, account, infra. They're all self explanatory + result = this.$t(state) } - if (this.$route.path === '/volume' || this.$route.path.includes('/volume/')) { - return this.$t('message.volume.state.' + state.toLowerCase()) - } - if (this.$route.path === '/guestnetwork' || this.$route.path.includes('/guestnetwork/')) { - return this.$t('message.guestnetwork.state.' + state.toLowerCase()) - } - if (this.$route.path === '/publicip' || this.$route.path.includes('/publicip/')) { - return this.$t('message.publicip.state.' + state.toLowerCase()) - } - // Nothing for snapshots, vpcs, gateways, vnpnconn, vpnuser, kubectl, event, project, account, infra. They're all self explanatory - return this.$t(state) + return result }, getStyle () { let styles = { display: 'inline-flex' }