Merge "fix: fix the router path and logs in zun container"
This commit is contained in:
commit
b41b121a33
@ -878,39 +878,39 @@ const renderMenu = (t) => {
|
||||
icon: <ContainerOutlined />,
|
||||
children: [
|
||||
{
|
||||
path: '/container/containers-admin',
|
||||
path: '/container-service/containers-admin',
|
||||
name: t('Containers'),
|
||||
key: 'zunContainersAdmin',
|
||||
endpoints: 'zun',
|
||||
level: 1,
|
||||
children: [
|
||||
{
|
||||
path: /^\/container\/containers-admin\/detail\/.[^/]+$/,
|
||||
path: /^\/container-service\/containers-admin\/detail\/.[^/]+$/,
|
||||
name: t('Container Detail'),
|
||||
key: 'zunContainerDetailAdmin',
|
||||
level: 2,
|
||||
routePath: '/container/containers-admin/detail/:id',
|
||||
routePath: '/container-service/containers-admin/detail/:id',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: '/container/hosts-admin',
|
||||
path: '/container-service/hosts-admin',
|
||||
name: t('Hosts'),
|
||||
key: 'zunHostsAdmin',
|
||||
endpoints: 'zun',
|
||||
level: 1,
|
||||
children: [
|
||||
{
|
||||
path: /^\/container\/hosts-admin\/detail\/.[^/]+$/,
|
||||
path: /^\/container-service\/hosts-admin\/detail\/.[^/]+$/,
|
||||
name: t('Host Detail'),
|
||||
key: 'zuHostsDetailAdmin',
|
||||
level: 2,
|
||||
routePath: '/container/hosts-admin/detail/:id',
|
||||
routePath: '/container-service/hosts-admin/detail/:id',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: '/container/services-admin',
|
||||
path: '/container-service/services-admin',
|
||||
name: t('Services'),
|
||||
key: 'zunServicesAdmin',
|
||||
endpoints: 'zun',
|
||||
|
@ -637,40 +637,40 @@ const renderMenu = (t) => {
|
||||
icon: <ContainerOutlined />,
|
||||
children: [
|
||||
{
|
||||
path: '/container/containers',
|
||||
path: '/container-service/containers',
|
||||
name: t('Containers'),
|
||||
key: 'zunContainers',
|
||||
endpoints: 'zun',
|
||||
level: 1,
|
||||
children: [
|
||||
{
|
||||
path: '/container/containers/create',
|
||||
path: '/container-service/containers/create',
|
||||
name: t('Create Container'),
|
||||
key: 'zunContainersCreateContainer',
|
||||
level: 2,
|
||||
},
|
||||
{
|
||||
path: /^\/container\/containers\/detail\/.[^/]+$/,
|
||||
path: /^\/container-service\/containers\/detail\/.[^/]+$/,
|
||||
name: t('Container Detail'),
|
||||
key: 'zunContainerDetail',
|
||||
level: 2,
|
||||
routePath: '/container/containers/detail/:id',
|
||||
routePath: '/container-service/containers/detail/:id',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: '/container/capsules',
|
||||
path: '/container-service/capsules',
|
||||
name: t('Capsules'),
|
||||
key: 'zunCapsules',
|
||||
endpoints: 'zun',
|
||||
level: 1,
|
||||
children: [
|
||||
{
|
||||
path: /^\/container\/capsules\/detail\/.[^/]+$/,
|
||||
path: /^\/container-service\/capsules\/detail\/.[^/]+$/,
|
||||
name: t('Capsule Detail'),
|
||||
key: 'zunCapsuleDetail',
|
||||
level: 2,
|
||||
routePath: '/container/capsules/detail/:id',
|
||||
routePath: '/container-service/capsules/detail/:id',
|
||||
},
|
||||
],
|
||||
},
|
||||
|
@ -53,7 +53,7 @@ const Share = lazy(() =>
|
||||
const ContainerInfra = lazy(() =>
|
||||
import(/* webpackChunkName: "container-infra" */ 'pages/container-infra/App')
|
||||
);
|
||||
const Containers = lazy(() =>
|
||||
const ContainerService = lazy(() =>
|
||||
import(/* webpackChunkName: "Container" */ 'pages/container-service/App')
|
||||
);
|
||||
const E404 = lazy(() =>
|
||||
@ -113,8 +113,8 @@ export default [
|
||||
component: ContainerInfra,
|
||||
},
|
||||
{
|
||||
path: `/container`,
|
||||
component: Containers,
|
||||
path: `/container-service`,
|
||||
component: ContainerService,
|
||||
},
|
||||
{ path: '*', component: E404 },
|
||||
],
|
||||
|
@ -36,7 +36,8 @@ export class Capsules extends Base {
|
||||
return actionConfigs;
|
||||
}
|
||||
|
||||
getColumns = () => [
|
||||
getColumns() {
|
||||
return [
|
||||
{
|
||||
title: t('ID/Name'),
|
||||
dataIndex: 'meta_name',
|
||||
@ -61,6 +62,7 @@ export class Capsules extends Base {
|
||||
dataIndex: 'memory',
|
||||
},
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
export default inject('rootStore')(observer(Capsules));
|
||||
|
@ -59,7 +59,9 @@ export class ContainerDetail extends Base {
|
||||
}
|
||||
|
||||
get showLogs() {
|
||||
return checkPolicyRule('container:logs');
|
||||
const { status } = this.detailData || {};
|
||||
const acceptedStatus = ['Created', 'Running', 'Stopped', 'Paused'];
|
||||
return checkPolicyRule('container:logs') && acceptedStatus.includes(status);
|
||||
}
|
||||
|
||||
get tabs() {
|
||||
|
@ -34,7 +34,7 @@ export class StepCreate extends StepAction {
|
||||
|
||||
static title = t('Create Container');
|
||||
|
||||
static path = '/container/containers/create';
|
||||
static path = '/container-service/containers/create';
|
||||
|
||||
static policy = 'container:create';
|
||||
|
||||
|
@ -39,11 +39,8 @@ export class Containers extends Base {
|
||||
return actionConfigs.actionConfigs;
|
||||
}
|
||||
|
||||
get rowKey() {
|
||||
return 'uuid';
|
||||
}
|
||||
|
||||
getColumns = () => [
|
||||
getColumns() {
|
||||
return [
|
||||
{
|
||||
title: t('ID/Name'),
|
||||
dataIndex: 'name',
|
||||
@ -69,6 +66,7 @@ export class Containers extends Base {
|
||||
valueMap: containerTaskStatus,
|
||||
},
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
export default inject('rootStore')(observer(Containers));
|
||||
|
@ -32,7 +32,8 @@ export class Hosts extends Base {
|
||||
return 'host:get_all';
|
||||
}
|
||||
|
||||
getColumns = () => [
|
||||
getColumns() {
|
||||
return [
|
||||
{
|
||||
title: t('ID/Name'),
|
||||
dataIndex: 'name',
|
||||
@ -52,7 +53,10 @@ export class Hosts extends Base {
|
||||
title: t('CPU (Core)'),
|
||||
dataIndex: 'cpu_percent',
|
||||
render: (value, record) => (
|
||||
<Progress value={value} label={`${record.cpu_used} / ${record.cpus}`} />
|
||||
<Progress
|
||||
value={value}
|
||||
label={`${record.cpu_used} / ${record.cpus}`}
|
||||
/>
|
||||
),
|
||||
width: 180,
|
||||
stringify: (value, record) =>
|
||||
@ -91,6 +95,7 @@ export class Hosts extends Base {
|
||||
})`,
|
||||
},
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
export default inject('rootStore')(observer(Hosts));
|
||||
|
@ -32,7 +32,8 @@ export class Services extends Base {
|
||||
return 'zun-service:get_all';
|
||||
}
|
||||
|
||||
getColumns = () => [
|
||||
getColumns() {
|
||||
return [
|
||||
{
|
||||
title: t('Name'),
|
||||
dataIndex: 'binary',
|
||||
@ -76,6 +77,7 @@ export class Services extends Base {
|
||||
valueRender: 'sinceTime',
|
||||
},
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
export default inject('rootStore')(observer(Services));
|
||||
|
@ -23,7 +23,7 @@ import HostsDetail from '../containers/Hosts/Detail';
|
||||
import StepCreateContainer from '../containers/Containers/actions/StepCreate';
|
||||
import Services from '../containers/Services';
|
||||
|
||||
const PATH = '/container';
|
||||
const PATH = '/container-service';
|
||||
export default [
|
||||
{
|
||||
path: PATH,
|
||||
|
@ -21,6 +21,13 @@ export class CapsulesStore extends Base {
|
||||
return client.zun.capsules;
|
||||
}
|
||||
|
||||
get mapper() {
|
||||
return (data) => ({
|
||||
...data,
|
||||
id: data.uuid,
|
||||
});
|
||||
}
|
||||
|
||||
@action
|
||||
async create(newbody) {
|
||||
return this.client.create(newbody);
|
||||
|
@ -22,6 +22,13 @@ export class ContainersStore extends Base {
|
||||
return client.zun.containers;
|
||||
}
|
||||
|
||||
get mapper() {
|
||||
return (data) => ({
|
||||
...data,
|
||||
id: data.uuid,
|
||||
});
|
||||
}
|
||||
|
||||
@action
|
||||
async create(newbody) {
|
||||
return this.submitting(this.client.create(newbody));
|
||||
|
@ -19,6 +19,13 @@ export class ServicesStore extends Base {
|
||||
get client() {
|
||||
return client.zun.services;
|
||||
}
|
||||
|
||||
get mapper() {
|
||||
return (data) => ({
|
||||
...data,
|
||||
id: data.uuid,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
const globalServicesStore = new ServicesStore();
|
||||
|
Loading…
Reference in New Issue
Block a user