Skip to content

Commit 175d9d3

Browse files
sureshanapartivishesh92
authored andcommitted
[UI] Fix primary storage details display when the uuid has divergent pattern (apache#12307)
* [UI] Fix primary storage details display when the uuid has different pattern (eg. for pools with SolidFireShared provider) * Fix on refresh --------- Co-authored-by: vishesh92 <vishesh92@gmail.com>
1 parent ce335f7 commit 175d9d3

File tree

7 files changed

+8
-8
lines changed

7 files changed

+8
-8
lines changed

ui/src/components/view/InfoCard.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -709,7 +709,7 @@
709709
<div class="resource-detail-item__label">{{ $t('label.storagepool') }}</div>
710710
<div class="resource-detail-item__details">
711711
<database-outlined />
712-
<router-link v-if="!isStatic && $router.resolve('/storagepool/' + resource.storageid).matched[0].redirect !== '/exception/404'" :to="{ path: '/storagepool/' + resource.storageid }">{{ resource.storage || resource.storageid }} </router-link>
712+
<router-link v-if="!isStatic && $router.resolve('/storagepool/' + encodeURIComponent(resource.storageid)).matched[0].redirect !== '/exception/404'" :to="{ path: '/storagepool/' + encodeURIComponent(resource.storageid) }">{{ resource.storage || resource.storageid }} </router-link>
713713
<span v-else>{{ resource.storage || resource.storageid }}</span>
714714
<a-tag style="margin-left: 5px;" v-if="resource.storagetype">
715715
{{ resource.storagetype }}

ui/src/components/view/VolumesTab.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
{{ parseFloat(record.size / (1024.0 * 1024.0 * 1024.0)).toFixed(2) }} GB
4242
</template>
4343
<template v-if="column.key === 'storage'">
44-
<router-link v-if="record.storageid" :to="{ path: '/storagepool/' + record.storageid }">{{ text }}</router-link>
44+
<router-link v-if="record.storageid" :to="{ path: '/storagepool/' + encodeURIComponent(record.storageid) }">{{ text }}</router-link>
4545
<span v-else>{{ text }}</span>
4646
</template>
4747
</template>

ui/src/components/widgets/Breadcrumb.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ export default {
100100
this.breadList = []
101101
this.$route.matched.forEach((item, idx) => {
102102
const parent = this.$route.matched[idx - 1]
103-
if (item && parent && parent.name !== 'index' && !item.path.endsWith(':id')) {
103+
if (item && parent && parent.name !== 'index' && !item.path.endsWith(':id') && !item.path.endsWith(':id(.*)')) {
104104
this.breadList.pop()
105105
}
106106
this.breadList.push(item)

ui/src/config/router.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ function generateRouterMap (section) {
9292
hideChildrenInMenu: true,
9393
children: [
9494
{
95-
path: '/' + child.name + '/:id',
95+
path: '/' + child.name + '/:id(.*)',
9696
hidden: child.hidden,
9797
meta: {
9898
title: child.title,
@@ -147,7 +147,7 @@ function generateRouterMap (section) {
147147
map.meta.tabs = section.tabs
148148

149149
map.children = [{
150-
path: '/' + section.name + '/:id',
150+
path: '/' + section.name + '/:id(.*)',
151151
actions: section.actions ? section.actions : [],
152152
meta: {
153153
title: section.title,

ui/src/views/image/IsoZones.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@
9999
:rowKey="record => record.zoneid">
100100
<template #bodyCell="{ text, record, column }">
101101
<template v-if="column.dataIndex === 'datastore' && record.datastoreId">
102-
<router-link :to="{ path: '/storagepool/' + record.datastoreId }">
102+
<router-link :to="{ path: '/storagepool/' + encodeURIComponent(record.datastoreId) }">
103103
{{ text }}
104104
</router-link>
105105
</template>

ui/src/views/image/TemplateZones.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@
9191
:rowKey="record => record.datastoreId">
9292
<template #bodyCell="{ text, record, column }">
9393
<template v-if="column.dataIndex === 'datastore' && record.datastoreId">
94-
<router-link :to="{ path: '/storagepool/' + record.datastoreId }">
94+
<router-link :to="{ path: '/storagepool/' + encodeURIComponent(record.datastoreId) }">
9595
{{ text }}
9696
</router-link>
9797
</template>

ui/src/views/storage/SnapshotZones.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
<template #bodyCell="{ column, record }">
3939
<template v-if="column.key === 'zonename'">
4040
<span v-if="record.datastoreid">
41-
<router-link :to="{ path: (record.datastoretype === 'Primary' ? '/storagepool/' : '/imagestore/') + record.datastoreid }">
41+
<router-link :to="{ path: (record.datastoretype === 'Primary' ? '/storagepool/' : '/imagestore/') + encodeURIComponent(record.datastoreid) }">
4242
<span v-if="fetchZoneIcon(record.zoneid)">
4343
<resource-icon :image="zoneIcon" size="1x" style="margin-right: 5px"/>
4444
</span>

0 commit comments

Comments
 (0)