diff --git a/src/pages/container-service/containers/Containers/Detail/BaseDetail.jsx b/src/pages/container-service/containers/Containers/Detail/BaseDetail.jsx
index 76292d32..6fc35909 100644
--- a/src/pages/container-service/containers/Containers/Detail/BaseDetail.jsx
+++ b/src/pages/container-service/containers/Containers/Detail/BaseDetail.jsx
@@ -15,6 +15,8 @@
import Base from 'containers/BaseDetail';
import React from 'react';
import { inject, observer } from 'mobx-react';
+import { containerStatus } from 'resources/zun/container';
+import { isEmpty } from 'lodash';
export class BaseDetail extends Base {
get leftCards() {
@@ -26,11 +28,23 @@ export class BaseDetail extends Base {
return [this.specCard];
}
+ get stringifyContent() {
+ return (value) =>
+ isEmpty(value) ? (
+ '-'
+ ) : (
+
+
{JSON.stringify(value, null, 4)}
+
+ );
+ }
+
get baseInfoCard() {
const options = [
{
label: t('Status Detail'),
dataIndex: 'status_detail',
+ render: (value) => containerStatus[value] || value,
},
{
label: t('Status Reason'),
@@ -43,6 +57,7 @@ export class BaseDetail extends Base {
{
label: t('Command'),
dataIndex: 'command',
+ render: this.stringifyContent,
},
];
@@ -53,12 +68,6 @@ export class BaseDetail extends Base {
}
get miscellaneousCard() {
- const content = (
-
-
{JSON.stringify(this.detailData.environment, null, 4)}
-
- );
-
const options = [
{
label: t('Host'),
@@ -71,7 +80,7 @@ export class BaseDetail extends Base {
{
label: t('Environment'),
dataIndex: 'environment',
- content,
+ render: this.stringifyContent,
},
{
label: t('Interactive'),
@@ -81,16 +90,7 @@ export class BaseDetail extends Base {
{
label: t('Labels'),
dataIndex: 'labels',
- render: (value) => value['cloud-shell'] || '-',
- },
- {
- label: t('Links'),
- dataIndex: 'links',
- render: (value) => (
-
-
{JSON.stringify(value, null, 4)}
-
- ),
+ render: this.stringifyContent,
},
];
@@ -123,25 +123,21 @@ export class BaseDetail extends Base {
dataIndex: 'runtime',
},
{
- label: t('CPU'),
+ label: t('CPU (Core)'),
dataIndex: 'cpu',
},
{
- label: t('Memory'),
+ label: t('Memory (MiB)'),
dataIndex: 'memory',
},
{
- label: t('Disk'),
+ label: t('Disk (GiB)'),
dataIndex: 'disk',
},
{
label: t('Restart Policy'),
dataIndex: 'restart_policy',
- render: (value) => (
-
-
{JSON.stringify(value, null, 4)}
-
- ),
+ render: this.stringifyContent,
},
{
label: t('Auto Remove'),
@@ -154,29 +150,17 @@ export class BaseDetail extends Base {
{
label: t('Addresses'),
dataIndex: 'addresses',
- render: (value) => (
-
-
{JSON.stringify(value, null, 4)}
-
- ),
+ render: this.stringifyContent,
},
{
label: t('Ports'),
dataIndex: 'ports',
- render: (value) => (
-
-
{JSON.stringify(value, null, 4)}
-
- ),
+ render: this.stringifyContent,
},
{
label: t('Security Groups'),
dataIndex: 'security_groups',
- render: (value) => (
-
-
{JSON.stringify(value, null, 4)}
-
- ),
+ render: this.stringifyContent,
},
];
diff --git a/src/pages/container-service/containers/Containers/actions/Edit.jsx b/src/pages/container-service/containers/Containers/actions/Edit.jsx
index a7809eeb..0ee4c2a7 100644
--- a/src/pages/container-service/containers/Containers/actions/Edit.jsx
+++ b/src/pages/container-service/containers/Containers/actions/Edit.jsx
@@ -52,16 +52,16 @@ export class EditContainer extends ModalAction {
},
{
name: 'cpu',
- label: t('CPU'),
+ label: t('CPU (Core)'),
type: 'input-int',
- placeholder: t('The number of virtual cpu for this container'),
+ tip: t('The number of virtual cpu for this container'),
min: 1,
},
{
name: 'memory',
label: t('Memory (MiB)'),
type: 'input-int',
- placeholder: t('The container memory size in MiB'),
+ tip: t('The container memory size in MiB'),
min: 4,
},
];
diff --git a/src/pages/container-service/containers/Containers/actions/StepCreate/StepSpec/index.jsx b/src/pages/container-service/containers/Containers/actions/StepCreate/StepSpec/index.jsx
index 7cb7944a..8c29e6ca 100644
--- a/src/pages/container-service/containers/Containers/actions/StepCreate/StepSpec/index.jsx
+++ b/src/pages/container-service/containers/Containers/actions/StepCreate/StepSpec/index.jsx
@@ -58,7 +58,7 @@ export class StepSpec extends Base {
},
{
name: 'cpu',
- label: t('CPU'),
+ label: t('CPU (Core)'),
type: 'input-int',
tip: t('The number of virtual cpu for this container'),
min: 1,