fix: Remove useless actions
Remove useless actions: attach/detach iso volume Change-Id: Ie8cb684649261cf04c6df7ce72d37c0d1304cf58
This commit is contained in:
parent
9c678927d5
commit
b59b9304d7
@ -119,7 +119,6 @@
|
||||
"Attach": "Attach",
|
||||
"Attach Instance": "Attach Instance",
|
||||
"Attach Interface": "Attach Interface",
|
||||
"Attach Iso Volume": "Attach Iso Volume",
|
||||
"Attach Security Group": "Attach Security Group",
|
||||
"Attach USB": "Attach USB",
|
||||
"Attach Volume": "Attach Volume",
|
||||
@ -475,7 +474,6 @@
|
||||
"Detach": "Detach",
|
||||
"Detach Instance": "Detach Instance",
|
||||
"Detach Interface": "Detach Interface",
|
||||
"Detach Iso Volume": "Detach Iso Volume",
|
||||
"Detach Securiry Group": "Detach Securiry Group",
|
||||
"Detach Volume": "Detach Volume",
|
||||
"Detach interface": "Detach interface",
|
||||
@ -675,7 +673,6 @@
|
||||
"Front End": "Front End",
|
||||
"Full": "Full",
|
||||
"Full Backup": "Full Backup",
|
||||
"GPU Accelerated Computing Type": "GPU Accelerated Computing Type",
|
||||
"GPU Count": "GPU Count",
|
||||
"GPU Info": "GPU Info",
|
||||
"GPU Model": "GPU Model",
|
||||
@ -686,7 +683,6 @@
|
||||
"Gateway IP": "Gateway IP",
|
||||
"Gateway Time-out (code: 504) ": "Gateway Time-out (code: 504) ",
|
||||
"Gateway ip {gateway_ip} conflicts with allocation pool {pool}": "Gateway ip {gateway_ip} conflicts with allocation pool {pool}",
|
||||
"General Computing Type": "General Computing Type",
|
||||
"General Purpose": "General Purpose",
|
||||
"Get OpenRC file": "Get OpenRC file",
|
||||
"Get Token": "Get Token",
|
||||
@ -1078,7 +1074,6 @@
|
||||
"Operating System": "Operating System",
|
||||
"Operation Name": "Operation Name",
|
||||
"Operation Time": "Operation Time",
|
||||
"Optimized Computing Type": "Optimized Computing Type",
|
||||
"Optimized Parameters": "Optimized Parameters",
|
||||
"Optional list": "Optional list",
|
||||
"Options": "Options",
|
||||
|
@ -119,7 +119,6 @@
|
||||
"Attach": "挂载",
|
||||
"Attach Instance": "绑定云主机",
|
||||
"Attach Interface": "挂载网卡",
|
||||
"Attach Iso Volume": "挂载ISO光盘",
|
||||
"Attach Security Group": "绑定安全组",
|
||||
"Attach USB": "挂载USB",
|
||||
"Attach Volume": "挂载云硬盘",
|
||||
@ -475,7 +474,6 @@
|
||||
"Detach": "解绑",
|
||||
"Detach Instance": "从云主机解绑",
|
||||
"Detach Interface": "卸载网卡",
|
||||
"Detach Iso Volume": "卸载ISO光盘",
|
||||
"Detach Securiry Group": "解绑安全组",
|
||||
"Detach Volume": "卸载云硬盘",
|
||||
"Detach interface": "卸载网卡",
|
||||
@ -675,7 +673,6 @@
|
||||
"Front End": "前端",
|
||||
"Full": "爆满",
|
||||
"Full Backup": "全量备份",
|
||||
"GPU Accelerated Computing Type": "GPU计算加速型",
|
||||
"GPU Count": "GPU数量",
|
||||
"GPU Info": "GPU信息",
|
||||
"GPU Model": "GPU型号",
|
||||
@ -686,7 +683,6 @@
|
||||
"Gateway IP": "网关IP",
|
||||
"Gateway Time-out (code: 504) ": "网关超时(错误码:504 )",
|
||||
"Gateway ip {gateway_ip} conflicts with allocation pool {pool}": "网关地址 {gateway_ip} 和分配地址池 {pool} 冲突",
|
||||
"General Computing Type": "通用计算型",
|
||||
"General Purpose": "通用型",
|
||||
"Get OpenRC file": "获取Openstack RC 文件",
|
||||
"Get Token": "获取Token",
|
||||
@ -1078,7 +1074,6 @@
|
||||
"Operating System": "操作系统",
|
||||
"Operation Name": "操作名称",
|
||||
"Operation Time": "操作时间",
|
||||
"Optimized Computing Type": "计算优化型",
|
||||
"Optimized Parameters": "优化参数",
|
||||
"Optional list": "可选列表",
|
||||
"Options": "选项",
|
||||
|
@ -1,130 +0,0 @@
|
||||
// Copyright 2021 99cloud
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
import { inject, observer } from 'mobx-react';
|
||||
import globalServerStore from 'stores/nova/instance';
|
||||
import { ModalAction } from 'containers/Action';
|
||||
import {
|
||||
isShutOff,
|
||||
isNotDeleting,
|
||||
isNotLocked,
|
||||
isIronicInstance,
|
||||
} from 'resources/instance';
|
||||
import { multiTip } from 'resources/volume';
|
||||
import { get as _get } from 'lodash';
|
||||
|
||||
export class AttachIsoVolume extends ModalAction {
|
||||
static id = 'attach-iso-volume';
|
||||
|
||||
static title = t('Attach Iso Volume');
|
||||
|
||||
init() {
|
||||
this.store = globalServerStore;
|
||||
}
|
||||
|
||||
get name() {
|
||||
return t('Attach Iso Volume');
|
||||
}
|
||||
|
||||
get isAsyncAction() {
|
||||
return true;
|
||||
}
|
||||
|
||||
static get modalSize() {
|
||||
return 'large';
|
||||
}
|
||||
|
||||
getModalSize() {
|
||||
return 'large';
|
||||
}
|
||||
|
||||
// get tips() {
|
||||
// return <div style={{ display: 'inline-table' }}>
|
||||
// <p style={{ color: '#0068FF' }}>{t('The current operation requires the instance to be shut down:')}</p>
|
||||
// <p>{t('In order to avoid data loss, the instance will shut down and interrupt your business. Please confirm carefully.')}</p>
|
||||
// <p>{t('Forced shutdown may result in data loss or file system damage. You can also take the initiative to shut down and perform operations.')}</p>
|
||||
// </div>;
|
||||
// }
|
||||
|
||||
get defaultValue() {
|
||||
const { name } = this.item;
|
||||
const value = {
|
||||
instance: name,
|
||||
};
|
||||
return value;
|
||||
}
|
||||
|
||||
static policy = 'os_compute_api:os-volumes-attachments:create';
|
||||
|
||||
static allowed = (item, containerProps) => {
|
||||
const { isAdminPage } = containerProps;
|
||||
return Promise.resolve(
|
||||
!isAdminPage &&
|
||||
isNotDeleting(item) &&
|
||||
isNotLocked(item) &&
|
||||
!isIronicInstance(item) &&
|
||||
isShutOff(item)
|
||||
);
|
||||
};
|
||||
|
||||
get formItems() {
|
||||
return [
|
||||
{
|
||||
name: 'instance',
|
||||
label: t('Instance'),
|
||||
type: 'label',
|
||||
iconType: 'instance',
|
||||
},
|
||||
{
|
||||
name: 'volume',
|
||||
label: t('Volume'),
|
||||
type: 'volume-select-table',
|
||||
tip: multiTip,
|
||||
isMulti: false,
|
||||
required: true,
|
||||
serverId: this.item.id,
|
||||
disabledFunc: (record) => {
|
||||
const diskFormat = _get(
|
||||
record,
|
||||
'origin_data.volume_image_metadata.disk_format'
|
||||
);
|
||||
return diskFormat !== 'iso';
|
||||
},
|
||||
},
|
||||
// {
|
||||
// name: 'option',
|
||||
// label: t('Forced Shutdown'),
|
||||
// type: 'check',
|
||||
// content: t('Agree to force shutdown'),
|
||||
// required: true,
|
||||
// },
|
||||
];
|
||||
}
|
||||
|
||||
onSubmit = (values) => {
|
||||
const { volume } = values;
|
||||
const { id } = this.item;
|
||||
const volumeId = volume.selectedRowKeys[0];
|
||||
const body = {
|
||||
volumeAttachment: {
|
||||
volumeId,
|
||||
disk_bus: 'ide',
|
||||
device_type: 'cdrom',
|
||||
},
|
||||
};
|
||||
return this.store.attachVolume({ id, body });
|
||||
};
|
||||
}
|
||||
|
||||
export default inject('rootStore')(observer(AttachIsoVolume));
|
@ -1,145 +0,0 @@
|
||||
// Copyright 2021 99cloud
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
import { inject, observer } from 'mobx-react';
|
||||
import { VolumeStore } from 'stores/cinder/volume';
|
||||
import globalServerStore from 'stores/nova/instance';
|
||||
import { ModalAction } from 'containers/Action';
|
||||
import { volumeStatus, isOsDisk, isAttachIsoVolume } from 'resources/volume';
|
||||
import {
|
||||
isShutOff,
|
||||
isNotLocked,
|
||||
isNotDeleting,
|
||||
isIronicInstance,
|
||||
} from 'resources/instance';
|
||||
|
||||
export class DetachIsoVolume extends ModalAction {
|
||||
static id = 'detach-iso-volume';
|
||||
|
||||
static title = t('Detach Iso Volume');
|
||||
|
||||
init() {
|
||||
this.store = globalServerStore;
|
||||
this.volumeStore = new VolumeStore();
|
||||
this.getVolumes();
|
||||
}
|
||||
|
||||
get name() {
|
||||
return t('Detach Iso Volume');
|
||||
}
|
||||
|
||||
static get modalSize() {
|
||||
return 'large';
|
||||
}
|
||||
|
||||
getModalSize() {
|
||||
return 'large';
|
||||
}
|
||||
|
||||
get volumes() {
|
||||
return (this.volumeStore.list.data || []).filter(
|
||||
(item) => !isOsDisk(item) && isAttachIsoVolume(item)
|
||||
);
|
||||
}
|
||||
|
||||
getVolumes() {
|
||||
const { id } = this.item;
|
||||
this.volumeStore.fetchList({ serverId: id });
|
||||
}
|
||||
|
||||
get defaultValue() {
|
||||
const { name } = this.item;
|
||||
const value = {
|
||||
instance: name,
|
||||
};
|
||||
return value;
|
||||
}
|
||||
|
||||
static policy = 'os_compute_api:os-volumes-attachments:delete';
|
||||
|
||||
// static hasDataVolume = item => item.volumes_attached && item.volumes_attached.length > 1
|
||||
|
||||
// static allowed = item => Promise.resolve(isActive(item) && isNotDeleting(item) && isNotLocked(item) && this.hasDataVolume(item))
|
||||
static allowed = (item, containerProps) => {
|
||||
const { isAdminPage } = containerProps;
|
||||
return Promise.resolve(
|
||||
!isAdminPage &&
|
||||
isNotDeleting(item) &&
|
||||
isNotLocked(item) &&
|
||||
!isIronicInstance(item) &&
|
||||
isShutOff(item)
|
||||
);
|
||||
};
|
||||
|
||||
get formItems() {
|
||||
return [
|
||||
{
|
||||
name: 'instance',
|
||||
label: t('Instance'),
|
||||
type: 'label',
|
||||
iconType: 'instance',
|
||||
},
|
||||
{
|
||||
name: 'volumes',
|
||||
label: t('Volume'),
|
||||
type: 'select-table',
|
||||
required: true,
|
||||
data: this.volumes,
|
||||
isLoading: this.volumeStore.list.isLoading,
|
||||
isMulti: true,
|
||||
filterParams: [
|
||||
{
|
||||
label: t('Name'),
|
||||
name: 'name',
|
||||
},
|
||||
],
|
||||
columns: [
|
||||
{
|
||||
title: t('Name'),
|
||||
dataIndex: 'name',
|
||||
},
|
||||
{
|
||||
title: t('Size'),
|
||||
dataIndex: 'size',
|
||||
render: (value) => `${value}GB`,
|
||||
},
|
||||
{
|
||||
title: t('Status'),
|
||||
dataIndex: 'status',
|
||||
render: (value) => volumeStatus[value] || '-',
|
||||
},
|
||||
{
|
||||
title: t('Type'),
|
||||
dataIndex: 'volume_type',
|
||||
},
|
||||
{
|
||||
title: t('Created At'),
|
||||
dataIndex: 'created_at',
|
||||
valueRender: 'sinceTime',
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
onSubmit = (values) => {
|
||||
const { id } = this.item;
|
||||
const {
|
||||
volumes: { selectedRowKeys = [] },
|
||||
} = values;
|
||||
return this.store.detachVolume({ id, volumes: selectedRowKeys });
|
||||
};
|
||||
}
|
||||
|
||||
export default inject('rootStore')(observer(DetachIsoVolume));
|
@ -31,8 +31,6 @@ import UnlockAction from './Unlock';
|
||||
import SuspendAction from './Suspend';
|
||||
import ResumeAction from './Resume';
|
||||
import AttachVolume from './AttachVolume';
|
||||
import AttachIsoVolume from './AttachIsoVolume';
|
||||
import DetachIsoVolume from './DetachIsoVolume';
|
||||
import DetachVolume from './DetachVolume';
|
||||
import Resize from './Resize';
|
||||
import ResizeOnline from './ResizeOnline';
|
||||
@ -68,8 +66,6 @@ const resourceActions = [
|
||||
AttachInterface,
|
||||
DetachInterface,
|
||||
AttachVolume,
|
||||
AttachIsoVolume,
|
||||
DetachIsoVolume,
|
||||
DetachVolume,
|
||||
AssociateFip,
|
||||
DisassociateFip,
|
||||
|
Loading…
Reference in New Issue
Block a user