feat: support create instance in server group list page
1. Support create instance in server group row actions 2. Set server-group-select required when create instance by server group Change-Id: I2a5f5de985a32a0394fe9501275519c568a4c9ab
This commit is contained in:
parent
5eaa2d8ff4
commit
281b176981
@ -96,6 +96,12 @@ export class SystemStep extends Base {
|
|||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get serverGroupRequired() {
|
||||||
|
const { more } = this.state;
|
||||||
|
const { servergroup } = this.locationParams;
|
||||||
|
return !!servergroup && more;
|
||||||
|
}
|
||||||
|
|
||||||
get inputHelp() {
|
get inputHelp() {
|
||||||
const { input = '' } = this.state;
|
const { input = '' } = this.state;
|
||||||
const maxCount = 1000;
|
const maxCount = 1000;
|
||||||
@ -370,6 +376,7 @@ export class SystemStep extends Base {
|
|||||||
hidden: !more,
|
hidden: !more,
|
||||||
data: this.serverGroups,
|
data: this.serverGroups,
|
||||||
isLoading: this.serverGroupStore.list.isLoading,
|
isLoading: this.serverGroupStore.list.isLoading,
|
||||||
|
required: this.serverGroupRequired,
|
||||||
extra: t(
|
extra: t(
|
||||||
'Using server groups, you can create cloud hosts on the same/different physical nodes as much as possible to meet the affinity/non-affinity requirements of business applications.'
|
'Using server groups, you can create cloud hosts on the same/different physical nodes as much as possible to meet the affinity/non-affinity requirements of business applications.'
|
||||||
),
|
),
|
||||||
|
@ -0,0 +1,34 @@
|
|||||||
|
// Copyright 2022 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 CreateInstance from 'pages/compute/containers/Instance/actions/StepCreate';
|
||||||
|
|
||||||
|
export class StepCreate extends CreateInstance {
|
||||||
|
static id = 'instance-create';
|
||||||
|
|
||||||
|
static title = t('Create Instance');
|
||||||
|
|
||||||
|
static path(item) {
|
||||||
|
return `/compute/instance/create?servergroup=${item.id}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
static policy = 'os_compute_api:servers:create';
|
||||||
|
|
||||||
|
static allowed() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default inject('rootStore')(observer(StepCreate));
|
@ -14,10 +14,16 @@
|
|||||||
|
|
||||||
import Create from './Create';
|
import Create from './Create';
|
||||||
import Delete from './Delete';
|
import Delete from './Delete';
|
||||||
|
import CreateInstance from './CreateInstance';
|
||||||
|
|
||||||
const actionConfigs = {
|
const actionConfigs = {
|
||||||
rowActions: {
|
rowActions: {
|
||||||
firstAction: Delete,
|
firstAction: Delete,
|
||||||
|
moreActions: [
|
||||||
|
{
|
||||||
|
action: CreateInstance,
|
||||||
|
},
|
||||||
|
],
|
||||||
},
|
},
|
||||||
batchActions: [Delete],
|
batchActions: [Delete],
|
||||||
primaryActions: [Create],
|
primaryActions: [Create],
|
||||||
|
Loading…
Reference in New Issue
Block a user