Skip to content

Commit 525c2c6

Browse files
authored
Show in which primary storage volumes are allocated in instance details page and volume migration pop-ups (apache#8835)
1 parent 6fda757 commit 525c2c6

File tree

5 files changed

+33
-6
lines changed

5 files changed

+33
-6
lines changed

ui/public/locales/en.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -595,6 +595,7 @@
595595
"label.crosszones": "Cross zones",
596596
"label.currency": "Currency",
597597
"label.current": "Current",
598+
"label.current.storage": "Current storage",
598599
"label.currentpassword": "Current password",
599600
"label.custom": "Custom",
600601
"label.customconstrained": "Custom constrained",
@@ -1916,6 +1917,7 @@
19161917
"label.select.tier": "Select Network Tier",
19171918
"label.select.zones": "Select zones",
19181919
"label.select.2fa.provider": "Select the provider",
1920+
"label.selected.storage": "Selected storage",
19191921
"label.self": "Mine",
19201922
"label.selfexecutable": "Self",
19211923
"label.semanticversion": "Semantic version",
@@ -3082,7 +3084,7 @@
30823084
"message.migrate.resource.to.ss": "Please confirm that you want to migrate this resource to another secondary storage.",
30833085
"message.migrate.router.confirm": "Please confirm the host you wish to migrate the router to:",
30843086
"message.migrate.systemvm.confirm": "Please confirm the host you wish to migrate the system VM to:",
3085-
"message.migrate.volume": "Please confirm that you want to migrate this volume to another primary storage.",
3087+
"message.migrate.volume": "Please confirm that you want to migrate the volume \"{volume}\" from \"{storage}\" to another primary storage.",
30863088
"message.migrate.volume.failed": "Migrating volume failed.",
30873089
"message.migrate.volume.pool.auto.assign": "Primary storage for the volume will be automatically chosen based on the suitability and Instance destination",
30883090
"message.migrate.volume.processing": "Migrating volume...",

ui/public/locales/pt_BR.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,7 @@
445445
"label.crosszones": "Inter zonas",
446446
"label.currency": "Moeda",
447447
"label.current": "Atual",
448+
"label.current.storage": "Armazenamento atual",
448449
"label.currentpassword": "Senha antiga",
449450
"label.custom": "Customizado",
450451
"label.customconstrained": "Customizado limitado",
@@ -1442,6 +1443,7 @@
14421443
"label.select.projects": "Selecionar projetos",
14431444
"label.select.tier": "Selecionar camada",
14441445
"label.select.zones": "Selecionar zonas",
1446+
"label.selected.storage": "Armazenamento selecionado",
14451447
"label.self": "Meus",
14461448
"label.selfexecutable": "Auto",
14471449
"label.semanticversion": "Vers\u00e3o sem\u00e2ntica",
@@ -2235,7 +2237,7 @@
22352237
"message.migrate.instance.to.ps": "Por favor confirme que voc\u00ea deseja migrar a inst\u00e2ncia para outro armazenamento prim\u00e1rio.",
22362238
"message.migrate.router.confirm": "Por favor confirme o host que voc\u00ea deseja migrar o roteador para:",
22372239
"message.migrate.systemvm.confirm": "Por favor confirme o host para o qual voc\u00ea deseja migrar a VM de sistema:",
2238-
"message.migrate.volume": "Por favor confirme que voc\u00ea deseja migrar o volume para outro armazenamento prim\u00e1rio.",
2240+
"message.migrate.volume": "Por favor confirme que voc\u00ea deseja migrar o volume \"{volume}\" do armazenamento prim\u00e1rio \"{storage}\" para outro.",
22392241
"message.migrate.volume.failed": "Falha ao migrar volume",
22402242
"message.migrate.volume.processing": "Migrando volume...",
22412243
"message.migrating.failed": "Falha na migra\u00e7\u00e3o",

ui/src/components/view/InstanceVolumesStoragePoolSelectListView.vue

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,14 @@ export default {
101101
key: 'size',
102102
title: this.$t('label.size')
103103
},
104+
{
105+
key: 'storage',
106+
title: this.$t('label.current.storage'),
107+
dataIndex: 'storage'
108+
},
104109
{
105110
key: 'selectedstorage',
106-
title: this.$t('label.storage')
111+
title: this.$t('label.selected.storage')
107112
},
108113
{
109114
key: 'select',

ui/src/components/view/VolumesTab.vue

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<a-table
2020
class="table"
2121
size="small"
22-
:columns="volumeColumns"
22+
:columns="columns"
2323
:dataSource="volumes"
2424
:rowKey="item => item.id"
2525
:pagination="false"
@@ -40,6 +40,10 @@
4040
<template v-if="column.key === 'size'">
4141
{{ parseFloat(record.size / (1024.0 * 1024.0 * 1024.0)).toFixed(2) }} GB
4242
</template>
43+
<template v-if="column.key === 'storage'">
44+
<router-link v-if="record.storageid" :to="{ path: '/storagepool/' + record.storageid }">{{ text }}</router-link>
45+
<span v-else>{{ text }}</span>
46+
</template>
4347
</template>
4448
</a-table>
4549
</template>
@@ -64,11 +68,20 @@ export default {
6468
}
6569
},
6670
inject: ['parentFetchData'],
71+
computed: {
72+
columns () {
73+
if (this.volumes?.[0]) {
74+
return this.allColumns.filter(col => col.dataIndex in this.volumes[0])
75+
}
76+
return this.allColumns.filter(col => this.defaultColumns.includes(col.dataIndex))
77+
}
78+
},
6779
data () {
6880
return {
6981
vm: {},
7082
volumes: [],
71-
volumeColumns: [
83+
defaultColumns: ['name', 'state', 'type', 'size'],
84+
allColumns: [
7285
{
7386
key: 'name',
7487
title: this.$t('label.name'),
@@ -87,6 +100,11 @@ export default {
87100
key: 'size',
88101
title: this.$t('label.size'),
89102
dataIndex: 'size'
103+
},
104+
{
105+
key: 'storage',
106+
title: this.$t('label.storage'),
107+
dataIndex: 'storage'
90108
}
91109
]
92110
}

ui/src/views/storage/MigrateVolume.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<a-form class="form" layout="vertical" v-ctrl-enter="handleKeyboardSubmit">
2020
<a-alert class="top-spaced" type="warning">
2121
<template #message>
22-
<span v-html="$t('message.migrate.volume')" />
22+
<span v-html="$t('message.migrate.volume', { volume: resource.name, storage: resource.storage })" />
2323
</template>
2424
</a-alert>
2525
<a-form-item style="margin-top: 10px;">

0 commit comments

Comments
 (0)