fix: fix the delete permission of volume snapshot
No delete operation in detail page if the snapshot has created some volumes Change-Id: Iabe91d109c134b256360b377328f2055733ad987
This commit is contained in:
parent
329f810c4d
commit
45178c2e1f
@ -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",
|
||||||
|
@ -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": "软删除云主机",
|
||||||
|
@ -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,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -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) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user