feature: Support magnum in administrator platform
1. Show list and detail of cluster instance 2. Show list and detail of cluster template 3. Hide the keypair if in administrator platform Change-Id: I61532a12312383cdedf2fdfca10633b16064f77b
This commit is contained in:
parent
9df7b6ca0f
commit
47b3cead09
@ -0,0 +1,10 @@
|
|||||||
|
---
|
||||||
|
features:
|
||||||
|
- |
|
||||||
|
Support magnum in administrator platform:
|
||||||
|
|
||||||
|
1. Show list and detail of cluster instance
|
||||||
|
|
||||||
|
2. Show list and detail of cluster template
|
||||||
|
|
||||||
|
3. Hide the keypair if in administrator platform
|
@ -88,14 +88,16 @@ const renderLabel = (option) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const renderOptions = (options, data, loading, labelCol, contentCol) =>
|
const renderOptions = (options, data, loading, labelCol, contentCol) =>
|
||||||
options.map((option, index) => (
|
options
|
||||||
<Skeleton loading={loading} key={`detail-row-${index}`}>
|
.filter((option) => !option.hidden)
|
||||||
<Row className={classnames(styles['card-item'], 'sl-card-item')}>
|
.map((option, index) => (
|
||||||
<Col span={labelCol}>{renderLabel(option)}</Col>
|
<Skeleton loading={loading} key={`detail-row-${index}`}>
|
||||||
<Col span={contentCol}>{getContent(data, option)}</Col>
|
<Row className={classnames(styles['card-item'], 'sl-card-item')}>
|
||||||
</Row>
|
<Col span={labelCol}>{renderLabel(option)}</Col>
|
||||||
</Skeleton>
|
<Col span={contentCol}>{getContent(data, option)}</Col>
|
||||||
));
|
</Row>
|
||||||
|
</Skeleton>
|
||||||
|
));
|
||||||
|
|
||||||
const DetailCard = ({
|
const DetailCard = ({
|
||||||
title,
|
title,
|
||||||
|
@ -916,6 +916,38 @@ const renderMenu = (t) => {
|
|||||||
endpoints: 'zun',
|
endpoints: 'zun',
|
||||||
level: 1,
|
level: 1,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: '/container-infra/clusters-admin',
|
||||||
|
name: t('Cluster Instance'),
|
||||||
|
key: 'containerInfraClustersAdmin',
|
||||||
|
endpoints: 'magnum',
|
||||||
|
level: 1,
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: /^\/container-infra\/clusters-admin\/detail\/.[^/]+$/,
|
||||||
|
name: t('Cluster Instance Detail'),
|
||||||
|
key: 'containerInfraClusterDetailAdmin',
|
||||||
|
level: 2,
|
||||||
|
routePath: '/container-infra/clusters-admin/detail/:id',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: '/container-infra/cluster-template-admin',
|
||||||
|
name: t('Cluster Templates'),
|
||||||
|
key: 'clusterTemplateAdmin',
|
||||||
|
endpoints: 'magnum',
|
||||||
|
level: 1,
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: /^\/container-infra\/cluster-template-admin\/detail\/.[^/]+$/,
|
||||||
|
name: t('Cluster Template Detail'),
|
||||||
|
key: 'containerInfraClusterTemplateDetailAdmin',
|
||||||
|
level: 2,
|
||||||
|
routePath: '/container-infra/cluster-template-admin/detail/:id',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
@ -361,6 +361,8 @@
|
|||||||
"Cluster Detail": "Cluster Detail",
|
"Cluster Detail": "Cluster Detail",
|
||||||
"Cluster Distro": "Cluster Distro",
|
"Cluster Distro": "Cluster Distro",
|
||||||
"Cluster Info": "Cluster Info",
|
"Cluster Info": "Cluster Info",
|
||||||
|
"Cluster Instance": "Cluster Instance",
|
||||||
|
"Cluster Instance Detail": "Cluster Instance Detail",
|
||||||
"Cluster Management": "Cluster Management",
|
"Cluster Management": "Cluster Management",
|
||||||
"Cluster Name": "Cluster Name",
|
"Cluster Name": "Cluster Name",
|
||||||
"Cluster Network": "Cluster Network",
|
"Cluster Network": "Cluster Network",
|
||||||
|
@ -361,6 +361,8 @@
|
|||||||
"Cluster Detail": "集群详情",
|
"Cluster Detail": "集群详情",
|
||||||
"Cluster Distro": "集群发行版",
|
"Cluster Distro": "集群发行版",
|
||||||
"Cluster Info": "集群信息",
|
"Cluster Info": "集群信息",
|
||||||
|
"Cluster Instance": "集群实例",
|
||||||
|
"Cluster Instance Detail": "集群实例详情",
|
||||||
"Cluster Management": "集群管理",
|
"Cluster Management": "集群管理",
|
||||||
"Cluster Name": "集群名称",
|
"Cluster Name": "集群名称",
|
||||||
"Cluster Network": "集群网络",
|
"Cluster Network": "集群网络",
|
||||||
|
@ -166,6 +166,7 @@ export class BaseDetail extends Base {
|
|||||||
{
|
{
|
||||||
label: t('Keypair'),
|
label: t('Keypair'),
|
||||||
content: keypairUrl,
|
content: keypairUrl,
|
||||||
|
hidden: this.isAdminPage,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('Flavor ID'),
|
label: t('Flavor ID'),
|
||||||
|
@ -34,7 +34,10 @@ export class ClusterTemplateDetail extends Base {
|
|||||||
}
|
}
|
||||||
|
|
||||||
get actionConfigs() {
|
get actionConfigs() {
|
||||||
return actionConfigs;
|
if (this.isAdminPage) {
|
||||||
|
return actionConfigs.actionConfigsAdmin;
|
||||||
|
}
|
||||||
|
return actionConfigs.actionConfigs;
|
||||||
}
|
}
|
||||||
|
|
||||||
get detailInfos() {
|
get detailInfos() {
|
||||||
|
@ -23,4 +23,13 @@ const actionConfigs = {
|
|||||||
primaryActions: [Create],
|
primaryActions: [Create],
|
||||||
};
|
};
|
||||||
|
|
||||||
export default actionConfigs;
|
const actionConfigsAdmin = {
|
||||||
|
rowActions: {
|
||||||
|
firstAction: Delete,
|
||||||
|
moreActions: [],
|
||||||
|
},
|
||||||
|
batchActions: [Delete],
|
||||||
|
primaryActions: [],
|
||||||
|
};
|
||||||
|
|
||||||
|
export default { actionConfigs, actionConfigsAdmin };
|
||||||
|
@ -30,8 +30,15 @@ export class ClusterTemplates extends Base {
|
|||||||
return 'clustertemplate:get_all';
|
return 'clustertemplate:get_all';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get fetchDataByAllProjects() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
get actionConfigs() {
|
get actionConfigs() {
|
||||||
return actionConfigs;
|
if (this.isAdminPage) {
|
||||||
|
return actionConfigs.actionConfigsAdmin;
|
||||||
|
}
|
||||||
|
return actionConfigs.actionConfigs;
|
||||||
}
|
}
|
||||||
|
|
||||||
getColumns = () => getBaseTemplateColumns(this);
|
getColumns = () => getBaseTemplateColumns(this);
|
||||||
|
@ -105,6 +105,7 @@ export class BaseDetail extends Base {
|
|||||||
{
|
{
|
||||||
label: t('Keypair'),
|
label: t('Keypair'),
|
||||||
content: keypairUrl,
|
content: keypairUrl,
|
||||||
|
hidden: this.isAdminPage,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('Docker Volume Size (GiB)'),
|
label: t('Docker Volume Size (GiB)'),
|
||||||
|
@ -38,7 +38,10 @@ export class ClustersDetail extends Base {
|
|||||||
}
|
}
|
||||||
|
|
||||||
get actionConfigs() {
|
get actionConfigs() {
|
||||||
return actionConfigs;
|
if (this.isAdminPage) {
|
||||||
|
return actionConfigs.actionConfigsAdmin;
|
||||||
|
}
|
||||||
|
return actionConfigs.actionConfigs;
|
||||||
}
|
}
|
||||||
|
|
||||||
get detailInfos() {
|
get detailInfos() {
|
||||||
|
@ -22,4 +22,13 @@ const actionConfigs = {
|
|||||||
primaryActions: [Create],
|
primaryActions: [Create],
|
||||||
};
|
};
|
||||||
|
|
||||||
export default actionConfigs;
|
const actionConfigsAdmin = {
|
||||||
|
rowActions: {
|
||||||
|
firstAction: Delete,
|
||||||
|
moreActions: [],
|
||||||
|
},
|
||||||
|
batchActions: [Delete],
|
||||||
|
primaryActions: [],
|
||||||
|
};
|
||||||
|
|
||||||
|
export default { actionConfigs, actionConfigsAdmin };
|
||||||
|
@ -32,8 +32,15 @@ export class Clusters extends Base {
|
|||||||
return 'cluster:get_all';
|
return 'cluster:get_all';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get fetchDataByAllProjects() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
get actionConfigs() {
|
get actionConfigs() {
|
||||||
return actionConfigs;
|
if (this.isAdminPage) {
|
||||||
|
return actionConfigs.actionConfigsAdmin;
|
||||||
|
}
|
||||||
|
return actionConfigs.actionConfigs;
|
||||||
}
|
}
|
||||||
|
|
||||||
getColumns = () => [
|
getColumns = () => [
|
||||||
@ -58,6 +65,7 @@ export class Clusters extends Base {
|
|||||||
title: t('Keypair'),
|
title: t('Keypair'),
|
||||||
isHideable: true,
|
isHideable: true,
|
||||||
dataIndex: 'keypair',
|
dataIndex: 'keypair',
|
||||||
|
hidden: this.isAdminPage,
|
||||||
render: (value) => {
|
render: (value) => {
|
||||||
return value
|
return value
|
||||||
? this.getLinkRender('keypairDetail', value, { id: value })
|
? this.getLinkRender('keypairDetail', value, { id: value })
|
||||||
|
@ -39,6 +39,12 @@ export default [
|
|||||||
component: ClustersCreate,
|
component: ClustersCreate,
|
||||||
exact: true,
|
exact: true,
|
||||||
},
|
},
|
||||||
|
{ path: `${PATH}/clusters-admin`, component: Clusters, exact: true },
|
||||||
|
{
|
||||||
|
path: `${PATH}/clusters-admin/detail/:id`,
|
||||||
|
component: ClustersDetail,
|
||||||
|
exact: true,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: `${PATH}/cluster-template`,
|
path: `${PATH}/cluster-template`,
|
||||||
component: ClusterTemplates,
|
component: ClusterTemplates,
|
||||||
@ -59,6 +65,16 @@ export default [
|
|||||||
component: ClusterTemplateUpdate,
|
component: ClusterTemplateUpdate,
|
||||||
exact: true,
|
exact: true,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: `${PATH}/cluster-template-admin`,
|
||||||
|
component: ClusterTemplates,
|
||||||
|
exact: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: `${PATH}/cluster-template-admin/detail/:id`,
|
||||||
|
component: ClusterTemplateDetail,
|
||||||
|
exact: true,
|
||||||
|
},
|
||||||
{ path: '*', component: E404 },
|
{ path: '*', component: E404 },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
@ -32,6 +32,7 @@ export const getBaseTemplateColumns = (self) => [
|
|||||||
title: t('Keypair'),
|
title: t('Keypair'),
|
||||||
isHideable: true,
|
isHideable: true,
|
||||||
dataIndex: 'keypair_id',
|
dataIndex: 'keypair_id',
|
||||||
|
hidden: self.isAdminPage,
|
||||||
render: (value) => {
|
render: (value) => {
|
||||||
return value
|
return value
|
||||||
? self.getLinkRender('keypairDetail', value, { id: value })
|
? self.getLinkRender('keypairDetail', value, { id: value })
|
||||||
|
Loading…
Reference in New Issue
Block a user