fix: Fix the status list of volume

Administrators can reset the volume status to in-use

If the volume status is 'error', the volume can not be deleted or
detached, we need to change the status to 'in-use' then do this

Change-Id: Ia250a449fea4dc96186bd1440eadfc0c791f48ac
This commit is contained in:
xusongfu 2022-02-21 18:47:15 +08:00
parent 438772f6f3
commit 0dcf7bd0e3
3 changed files with 17 additions and 0 deletions

View File

@ -1924,6 +1924,7 @@
"The user has been disabled, please contact the administrator": "The user has been disabled, please contact the administrator",
"The user needs to ensure that the input is a shell script that can run completely and normally.": "The user needs to ensure that the input is a shell script that can run completely and normally.",
"The volume associated with the backup is not available, unable to restore.": "The volume associated with the backup is not available, unable to restore.",
"The volume status can be reset to in-use only when the previous status is in-use.": "The volume status can be reset to in-use only when the previous status is in-use.",
"The volume type needs to be consistent with the volume type when the snapshot is created.": "The volume type needs to be consistent with the volume type when the snapshot is created.",
"The volume type needs to set \"multiattach\" in the metadata to support shared volume attributes.": "The volume type needs to set \"multiattach\" in the metadata to support shared volume attributes.",
"The {action} instruction has been issued, instance: {name}. \n You can wait for a few seconds to follow the changes of the list data or manually refresh the data to get the final display result.": "The {action} instruction has been issued, instance: {name}. \n You can wait for a few seconds to follow the changes of the list data or manually refresh the data to get the final display result.",

View File

@ -1924,6 +1924,7 @@
"The user has been disabled, please contact the administrator": "用户已被禁用,请联系管理员",
"The user needs to ensure that the input is a shell script that can run completely and normally.": "请确保输入的是能完整正常运行的 shell 脚本。",
"The volume associated with the backup is not available, unable to restore.": "云硬盘不处于可用状态,不支持恢复备份操作。",
"The volume status can be reset to in-use only when the previous status is in-use.": "只有当之前的状态为使用中时,才将云硬盘状态重置为使用中。",
"The volume type needs to be consistent with the volume type when the snapshot is created.": "创建云硬盘的云硬盘类型需要和创建快照时间点的云硬盘类型保持一致。",
"The volume type needs to set \"multiattach\" in the metadata to support shared volume attributes.": "云硬盘类型需在元数据中设置\"multiattach\",才可支持共享盘属性。",
"The {action} instruction has been issued, instance: {name}. \n You can wait for a few seconds to follow the changes of the list data or manually refresh the data to get the final display result.": "{action}指令已下发,实例名称:{name}。 \n 您可等待几秒关注列表数据的变更或是手动刷新数据,以获取最终展示结果。",

View File

@ -47,10 +47,12 @@ export default class UpdateStatus extends ModalAction {
}
get formItems() {
const { status } = this.state;
const statusList = [
{ value: 'available', label: t('Available') },
{ value: 'maintenance', label: t('Maintained') },
{ value: 'error', label: t('Error') },
{ value: 'in-use', label: t('In Use') },
];
return [
{
@ -64,10 +66,23 @@ export default class UpdateStatus extends ModalAction {
label: t('Status'),
type: 'select',
options: statusList,
onChange: this.handleStatusChange,
extra:
status === 'in-use'
? t(
'The volume status can be reset to in-use only when the previous status is in-use.'
)
: '',
},
];
}
handleStatusChange = (status) => {
this.setState({
status,
});
};
init() {
this.store = globalVolumeStore;
}