Merge "fix: fix the delete permission of volume snapshot"

This commit is contained in:
Zuul 2022-08-24 09:08:08 +00:00 committed by Gerrit Code Review
commit 3b84b0ad9d
4 changed files with 17 additions and 11 deletions

View File

@ -2140,6 +2140,7 @@
"Snapshot Failed": "Snapshot Failed", "Snapshot Failed": "Snapshot Failed",
"Snapshot In Progress": "Snapshot In Progress", "Snapshot In Progress": "Snapshot In Progress",
"Snapshot Instance": "Snapshot Instance", "Snapshot Instance": "Snapshot Instance",
"Snapshot Source": "Snapshot Source",
"Snapshots can be converted into volume and used to create an instance from the volume.": "Snapshots can be converted into volume and used to create an instance from the volume.", "Snapshots can be converted into volume and used to create an instance from the volume.": "Snapshots can be converted into volume and used to create an instance from the volume.",
"Snapshotting": "Snapshotting", "Snapshotting": "Snapshotting",
"Soft Delete Instance": "Soft Delete Instance", "Soft Delete Instance": "Soft Delete Instance",

View File

@ -2140,6 +2140,7 @@
"Snapshot Failed": "生成快照失败", "Snapshot Failed": "生成快照失败",
"Snapshot In Progress": "快照进行中", "Snapshot In Progress": "快照进行中",
"Snapshot Instance": "创建云主机快照", "Snapshot Instance": "创建云主机快照",
"Snapshot Source": "快照源",
"Snapshots can be converted into volume and used to create an instance from the volume.": "快照可以转换成云硬盘,用于从云硬盘启动云主机。", "Snapshots can be converted into volume and used to create an instance from the volume.": "快照可以转换成云硬盘,用于从云硬盘启动云主机。",
"Snapshotting": "创建快照中", "Snapshotting": "创建快照中",
"Soft Delete Instance": "软删除云主机", "Soft Delete Instance": "软删除云主机",

View File

@ -24,16 +24,15 @@ export class BaseDetail extends Base {
const options = [ const options = [
{ {
label: t('Volume'), label: t('Volume'),
dataIndex: 'volume', dataIndex: 'volume_id',
render: (value) => { render: (value, record) => {
if (!value) { if (!value) {
return '-'; return '-';
} }
const { id, name } = value;
const link = this.getLinkRender( const link = this.getLinkRender(
'volumeDetail', 'volumeDetail',
name || id, record.volume_name || value,
{ id }, { id: value },
{ tab: 'snapshot' } { tab: 'snapshot' }
); );
return link; return link;
@ -41,7 +40,7 @@ export class BaseDetail extends Base {
}, },
]; ];
return { return {
title: t('Volume Info'), title: t('Snapshot Source'),
options, options,
}; };
} }

View File

@ -52,11 +52,16 @@ export class SnapshotStore extends Base {
return data; return data;
} }
async detailDidFetch(item) { async detailDidFetch(item, allProjects) {
const { volume_id } = item; const params = {
const { volume } = await this.volumeClient.show(volume_id); uuid: item.id,
item.volume = volume; };
return item; if (allProjects) {
params.all_projects = true;
}
const { volume_snapshots = [] } = await this.listFetchByClient(params);
const { child_volumes = [], volume_name } = volume_snapshots[0] || {};
return { ...item, child_volumes, volume_name };
} }
updateParamsSortPage = (params, sortKey, sortOrder) => { updateParamsSortPage = (params, sortKey, sortOrder) => {