Browse Source

Merge pull request #19 from sutcalag/main

fix system view display issue & enable system view
nameczz 3 years ago
parent
commit
dc5a8a763b

BIN
client/public/favicon.png


+ 1 - 1
client/public/index.html

@@ -3,7 +3,7 @@
 
 <head>
   <meta charset="utf-8" />
-  <link rel="icon" href="%PUBLIC_URL%/favicon.png" />
+  <link rel="icon" href="%PUBLIC_URL%/zilliz.png" />
   <meta name="viewport" content="width=device-width, initial-scale=1" />
   <meta name="theme-color" content="#000000" />
   <meta name="description" content="Web site created using create-react-app" />

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

@@ -189,8 +189,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
+  }
 }