Browse Source

fix system view display issue

sutcalag 3 years ago
parent
commit
ba09414575

+ 3 - 2
client/src/plugins/system/DataCard.tsx

@@ -155,6 +155,7 @@ const DataCard: FC<DataCardProps & React.HTMLAttributes<HTMLDivElement>> = (prop
     system_configurations,
   } = node?.infos || {};
 
+
   const {
     cpu_core_count: cpu = 0,
     cpu_core_usage: cpuUsage = 0,
@@ -189,8 +190,8 @@ const DataCard: FC<DataCardProps & React.HTMLAttributes<HTMLDivElement>> = (prop
   } = system_info;
   systemContent.push({ label: t('thVersion'), value: version });
   systemContent.push({ label: t('thDeployMode'), value: mode });
-  systemContent.push({ label: t('thCreateTime'), value: createTime ? new Date(createTime.substr(0, 37)).toLocaleString() : '' });
-  systemContent.push({ label: t('thUpdateTime'), value: updateTime ? new Date(updateTime.substr(0, 37)).toLocaleString() : '' });
+  systemContent.push({ label: t('thCreateTime'), value: createTime ? new Date(createTime.substring(0, 29)).toLocaleString() : '' });
+  systemContent.push({ label: t('thUpdateTime'), value: updateTime ? new Date(updateTime.substring(0, 29)).toLocaleString() : '' });
 
   return (
     <div className={classes.root}>

+ 1 - 1
client/src/plugins/system/SystemView.tsx

@@ -79,7 +79,7 @@ const parseJson = (jsonData: any) => {
   jsonData?.response?.nodes_info.forEach((node: any) => {
     const type = node?.infos?.type;
     // coordinator node
-    if (type.includes("Coord")) {
+    if (type?.toLowerCase().includes("coord")) {
       nodes.push(node);
       // other nodes
     } else {

+ 1 - 1
client/src/plugins/system/Topology.tsx

@@ -159,7 +159,7 @@ const Topo = (props: any) => {
       <svg width={WIDTH} height={HEIGHT} viewBox={`0 0 ${WIDTH} ${HEIGHT}`} xmlns="http://www.w3.org/2000/svg">
         <rect width="100%" height="100%" fill="white" />
         {nodes.map((node: any, index: number) => {
-          if (node?.infos?.type === 'RootCoord') {
+          if (node?.infos?.type?.toLowerCase() === 'rootcoord') {
             centerNode = node;
             return null;
           }

+ 8 - 1
client/src/plugins/system/config.json

@@ -1,4 +1,11 @@
 {
   "name": "system-view",
-  "version": "0.1.0"
+  "version": "0.1.0",
+  "client": {
+    "path": "system",
+    "entry": "SystemView.tsx",
+    "label": "System View",
+    "iconName": "navSystem",
+    "auth": true
+  }
 }