@@ -166,23 +166,24 @@ export default {
166166 if (! (state && this .displayText )) {
167167 return ' '
168168 }
169+ let result
169170 if (this .$route .path === ' /vmsnapshot' || this .$route .path .includes (' /vmsnapshot/' )) {
170- return this .$t (' message.vmsnapshot.state.' + state .toLowerCase ())
171+ result = this .$t (' message.vmsnapshot.state.' + state .toLowerCase ())
172+ } else if (this .$route .path === ' /vm' || this .$route .path .includes (' /vm/' )) {
173+ result = this .$t (' message.vm.state.' + state .toLowerCase ())
174+ } else if (this .$route .path === ' /volume' || this .$route .path .includes (' /volume/' )) {
175+ result = this .$t (' message.volume.state.' + state .toLowerCase ())
176+ } else if (this .$route .path === ' /guestnetwork' || this .$route .path .includes (' /guestnetwork/' )) {
177+ result = this .$t (' message.guestnetwork.state.' + state .toLowerCase ())
178+ } else if (this .$route .path === ' /publicip' || this .$route .path .includes (' /publicip/' )) {
179+ result = this .$t (' message.publicip.state.' + state .toLowerCase ())
171180 }
172- if (this .$route .path === ' /vm' || this .$route .path .includes (' /vm/' )) {
173- return this .$t (' message.vm.state.' + state .toLowerCase ())
174- }
175- if (this .$route .path === ' /volume' || this .$route .path .includes (' /volume/' )) {
176- return this .$t (' message.volume.state.' + state .toLowerCase ())
177- }
178- if (this .$route .path === ' /guestnetwork' || this .$route .path .includes (' /guestnetwork/' )) {
179- return this .$t (' message.guestnetwork.state.' + state .toLowerCase ())
180- }
181- if (this .$route .path === ' /publicip' || this .$route .path .includes (' /publicip/' )) {
182- return this .$t (' message.publicip.state.' + state .toLowerCase ())
181+
182+ if (! result || (result .startsWith (' message.' ) && result .endsWith (' .state.' + state .toLowerCase ()))) {
183+ // Nothing for snapshots, vpcs, gateways, vnpnconn, vpnuser, kubectl, event, project, account, infra. They're all self explanatory
184+ result = this .$t (state)
183185 }
184- // Nothing for snapshots, vpcs, gateways, vnpnconn, vpnuser, kubectl, event, project, account, infra. They're all self explanatory
185- return this .$t (state)
186+ return result
186187 },
187188 getStyle () {
188189 let styles = { display: ' inline-flex' }
0 commit comments