File tree Expand file tree Collapse file tree 5 files changed +20
-5
lines changed
Expand file tree Collapse file tree 5 files changed +20
-5
lines changed Original file line number Diff line number Diff line change 9898 </span >
9999
100100 <span v-if =" record.hasannotations" >
101- <span v-if =" record.id && $route.path !== '/ssh' " >
101+ <span v-if =" record.id" >
102102 <router-link :to =" { path: $route.path + '/' + record.id }" >{{ text }}</router-link >
103103 <router-link :to =" { path: $route.path + '/' + record.id, query: { tab: 'comments' } }" ><message-filled style =" padding-left : 10px " size =" small" /></router-link >
104104 </span >
110110 <router-link :to =" { path: $route.path + '/' + record.name }" v-else >{{ $t(text.toLowerCase()) }}</router-link >
111111 </span >
112112 <span v-else >
113- <router-link :to =" { path: $route.path + '/' + record.id }" v-if =" record.id && $route.path !== '/ssh' " >{{ text }}</router-link >
113+ <router-link :to =" { path: $route.path + '/' + record.id }" v-if =" record.id" >{{ text }}</router-link >
114114 <router-link :to =" { path: $route.path + '/' + record.name }" v-else >{{ text }}</router-link >
115115 </span >
116116 </span >
Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ import {
3434 showIconPlugin ,
3535 resourceTypePlugin ,
3636 fileSizeUtilPlugin ,
37+ genericUtilPlugin ,
3738 localesPlugin
3839} from './utils/plugins'
3940import { VueAxios } from './utils/request'
@@ -49,6 +50,7 @@ vueApp.use(showIconPlugin)
4950vueApp . use ( resourceTypePlugin )
5051vueApp . use ( fileSizeUtilPlugin )
5152vueApp . use ( localesPlugin )
53+ vueApp . use ( genericUtilPlugin )
5254vueApp . use ( extensions )
5355vueApp . use ( directives )
5456
Original file line number Diff line number Diff line change @@ -464,3 +464,12 @@ export const fileSizeUtilPlugin = {
464464 }
465465 }
466466}
467+
468+ export const genericUtilPlugin = {
469+ install ( app ) {
470+ app . config . globalProperties . $isValidUuid = function ( uuid ) {
471+ const regexExp = / ^ [ 0 - 9 a - f A - F ] { 8 } \b - [ 0 - 9 a - f A - F ] { 4 } \b - [ 0 - 9 a - f A - F ] { 4 } \b - [ 0 - 9 a - f A - F ] { 4 } \b - [ 0 - 9 a - f A - F ] { 12 } $ / gi
472+ return regexExp . test ( uuid )
473+ }
474+ }
475+ }
Original file line number Diff line number Diff line change @@ -851,8 +851,10 @@ export default {
851851 if (this .$route .params && this .$route .params .id ) {
852852 params .id = this .$route .params .id
853853 if ([' listSSHKeyPairs' ].includes (this .apiName )) {
854- delete params .id
855- params .name = this .$route .params .id
854+ if (! this .$isValidUuid (params .id )) {
855+ delete params .id
856+ params .name = this .$route .params .id
857+ }
856858 }
857859 if ([' listPublicIpAddresses' ].includes (this .apiName )) {
858860 params .allocatedonly = false
Original file line number Diff line number Diff line change @@ -30,7 +30,8 @@ import {
3030 apiMetaUtilPlugin ,
3131 showIconPlugin ,
3232 resourceTypePlugin ,
33- fileSizeUtilPlugin
33+ fileSizeUtilPlugin ,
34+ genericUtilPlugin
3435} from '@/utils/plugins'
3536
3637function createMockRouter ( newRoutes = [ ] ) {
@@ -86,6 +87,7 @@ function createFactory (component, options) {
8687 showIconPlugin ,
8788 resourceTypePlugin ,
8889 fileSizeUtilPlugin ,
90+ genericUtilPlugin ,
8991 StoragePlugin
9092 ] ,
9193 mocks
You can’t perform that action at this time.
0 commit comments