Browse Source

Merge pull request #90 from zilliztech/ued-1989

filter error node, update attu icon
nameczz 2 years ago
parent
commit
1694e00817

BIN
client/public/attu.png


+ 85 - 85
client/public/electron.js

@@ -1,120 +1,120 @@
-const { app, Menu, BrowserWindow } = require("electron");
+const { app, Menu, BrowserWindow } = require('electron');
 // Module to control application life.
 // Module to create native browser window.
 
-const path = require("path");
-const url = require("url");
+const path = require('path');
+const url = require('url');
 
-const isMac = process.platform === "darwin";
+const isMac = process.platform === 'darwin';
 
 const template = [
   // { role: 'appMenu' }
   ...(isMac
     ? [
-      {
-        label: app.name,
-        submenu: [
-          { role: "about" },
-          { type: "separator" },
-          { role: "services" },
-          { type: "separator" },
-          { role: "hide" },
-          { role: "hideothers" },
-          { role: "unhide" },
-          { type: "separator" },
-          { role: "quit" }
-        ]
-      }
-    ]
+        {
+          label: app.name,
+          submenu: [
+            { role: 'about' },
+            { type: 'separator' },
+            { role: 'services' },
+            { type: 'separator' },
+            { role: 'hide' },
+            { role: 'hideothers' },
+            { role: 'unhide' },
+            { type: 'separator' },
+            { role: 'quit' },
+          ],
+        },
+      ]
     : []),
   // { role: 'fileMenu' }
   {
-    label: "File",
-    submenu: [isMac ? { role: "close" } : { role: "quit" }]
+    label: 'File',
+    submenu: [isMac ? { role: 'close' } : { role: 'quit' }],
   },
   // { role: 'editMenu' }
   {
-    label: "Edit",
+    label: 'Edit',
     submenu: [
-      { role: "undo" },
-      { role: "redo" },
-      { type: "separator" },
-      { role: "cut" },
-      { role: "copy" },
-      { role: "paste" },
+      { role: 'undo' },
+      { role: 'redo' },
+      { type: 'separator' },
+      { role: 'cut' },
+      { role: 'copy' },
+      { role: 'paste' },
       ...(isMac
         ? [
-          { role: "pasteAndMatchStyle" },
-          { role: "delete" },
-          { role: "selectAll" },
-          { type: "separator" },
-          {
-            label: "Speech",
-            submenu: [{ role: "startspeaking" }, { role: "stopspeaking" }]
-          }
-        ]
-        : [{ role: "delete" }, { type: "separator" }, { role: "selectAll" }])
-    ]
+            { role: 'pasteAndMatchStyle' },
+            { role: 'delete' },
+            { role: 'selectAll' },
+            { type: 'separator' },
+            {
+              label: 'Speech',
+              submenu: [{ role: 'startspeaking' }, { role: 'stopspeaking' }],
+            },
+          ]
+        : [{ role: 'delete' }, { type: 'separator' }, { role: 'selectAll' }]),
+    ],
   },
   // { role: 'viewMenu' }
   {
-    label: "View",
+    label: 'View',
     submenu: [
-      { role: "reload" },
-      { role: "forcereload" },
-      { role: "toggledevtools" },
-      { type: "separator" },
-      { role: "resetzoom" },
-      { role: "zoomin" },
-      { role: "zoomout" },
-      { type: "separator" },
-      { role: "togglefullscreen" }
-    ]
+      { role: 'reload' },
+      { role: 'forcereload' },
+      { role: 'toggledevtools' },
+      { type: 'separator' },
+      { role: 'resetzoom' },
+      { role: 'zoomin' },
+      { role: 'zoomout' },
+      { type: 'separator' },
+      { role: 'togglefullscreen' },
+    ],
   },
   // { role: 'windowMenu' }
   {
-    label: "Window",
+    label: 'Window',
     submenu: [
-      { role: "minimize" },
-      { role: "zoom" },
+      { role: 'minimize' },
+      { role: 'zoom' },
       ...(isMac
         ? [
-          { type: "separator" },
-          { role: "front" },
-          { type: "separator" },
-          { role: "window" }
-        ]
-        : [{ role: "close" }])
-    ]
+            { type: 'separator' },
+            { role: 'front' },
+            { type: 'separator' },
+            { role: 'window' },
+          ]
+        : [{ role: 'close' }]),
+    ],
   },
   {
-    role: "help",
+    role: 'help',
     submenu: [
       {
-        label: "Learn More",
+        label: 'Learn More',
         click: async () => {
-          const { shell } = require("electron");
-          await shell.openExternal("https://www.milvus.io");
-        }
+          const { shell } = require('electron');
+          await shell.openExternal('https://www.milvus.io');
+        },
       },
       {
-        label: "Documentation",
+        label: 'Documentation',
         click: async () => {
-          const { shell } = require("electron");
+          const { shell } = require('electron');
           await shell.openExternal(
-            "https://www.milvus.io/docs/about_milvus/overview.md"
+            'https://www.milvus.io/docs/about_milvus/overview.md'
           );
-        }
+        },
       },
       {
-        label: "Github",
+        label: 'Github',
         click: async () => {
-          const { shell } = require("electron");
-          await shell.openExternal("https://github.com/milvus-io/milvus");
-        }
-      }
-    ]
-  }
+          const { shell } = require('electron');
+          await shell.openExternal('https://github.com/milvus-io/milvus');
+        },
+      },
+    ],
+  },
 ];
 
 const menu = Menu.buildFromTemplate(template);
@@ -130,7 +130,7 @@ function createWindow() {
     width: 1200,
     height: 800,
     webPreferences: { devTools: false },
-    icon: "./zilliz.png"
+    icon: './attu.png',
   });
   // mainWindow.maximize();
   // mainWindow.show();
@@ -139,9 +139,9 @@ function createWindow() {
   const startUrl =
     process.env.ELECTRON_START_URL ||
     url.format({
-      pathname: path.join(__dirname, "./index.html"),
-      protocol: "file:",
-      slashes: true
+      pathname: path.join(__dirname, './index.html'),
+      protocol: 'file:',
+      slashes: true,
     });
   mainWindow.loadURL(startUrl);
 
@@ -149,7 +149,7 @@ function createWindow() {
   //   mainWindow.webContents.openDevTools();
 
   // Emitted when the window is closed.
-  mainWindow.on("closed", function () {
+  mainWindow.on('closed', function () {
     // Dereference the window object, usually you would store windows
     // in an array if your app supports multi windows, this is the time
     // when you should delete the corresponding element.
@@ -160,18 +160,18 @@ function createWindow() {
 // This method will be called when Electron has finished
 // initialization and is ready to create browser windows.
 // Some APIs can only be used after this event occurs.
-app.on("ready", createWindow);
+app.on('ready', createWindow);
 
 // Quit when all windows are closed.
-app.on("window-all-closed", function () {
+app.on('window-all-closed', function () {
   // On OS X it is common for applications and their menu bar
   // to stay active until the user quits explicitly with Cmd + Q
-  if (process.platform !== "darwin") {
+  if (process.platform !== 'darwin') {
     app.quit();
   }
 });
 
-app.on("activate", function () {
+app.on('activate', function () {
   // On OS X it's common to re-create a window in the app when the
   // dock icon is clicked and there are no other windows open.
   if (mainWindow === null) {

+ 2 - 2
client/public/index.html

@@ -3,7 +3,7 @@
 
 <head>
   <meta charset="utf-8" />
-  <link rel="icon" href="%PUBLIC_URL%/zilliz.png" />
+  <link rel="icon" href="%PUBLIC_URL%/attu.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" />
@@ -44,4 +44,4 @@
     -->
 </body>
 
-</html>
+</html>

+ 5 - 0
client/src/assets/icons/attu.svg

@@ -0,0 +1,5 @@
+<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M15.9719 2.06803C16.0242 1.97732 16.1551 1.97732 16.2073 2.06803L19.4178 7.64077L9.56067 24.8547C6.78737 24.9881 4.22773 25.4339 2.25155 25.8838L15.9719 2.06803Z" fill="white"/>
+<path d="M26.3931 27.7963C29.8222 27.7963 33.4739 26.151 35.7404 24.9101L24.5049 5.28918C24.4527 5.19806 24.3213 5.19806 24.2691 5.28918L13.0455 24.8894C15.7146 25.1104 17.7436 25.785 19.6798 26.4288C21.7915 27.1309 23.7927 27.7963 26.3931 27.7963Z" fill="white"/>
+<path d="M19.2985 29.0903C21.1596 29.7053 22.9289 30.2899 24.4937 30.5205C28.3671 31.0914 33.7215 29.3788 36 27.2096C34.2911 30.5205 29.962 34.0598 24.4937 34.0598C20.0719 34.0598 16.6998 32.7612 13.2767 31.4429C12.4664 31.1309 11.6533 30.8178 10.8228 30.5205C8.10961 29.5494 3.4184 29.6521 1.02534 29.7045C0.604887 29.7137 0.255375 29.7213 0 29.7213C2.05063 28.1229 6.1519 27.2096 10.8228 27.2096C13.6067 27.2096 16.5526 28.183 19.2985 29.0903Z" fill="white"/>
+</svg>

+ 2 - 2
client/src/components/icons/Icons.tsx

@@ -27,7 +27,7 @@ import GetAppIcon from '@material-ui/icons/GetApp';
 // import PersonOutlineIcon from '@material-ui/icons/PersonOutline';
 import PersonOutlineIcon from '@material-ui/icons/Person';
 import { SvgIcon } from '@material-ui/core';
-import { ReactComponent as ZillizIcon } from '../../assets/icons/zilliz.svg';
+import { ReactComponent as ZillizIcon } from '../../assets/icons/attu.svg';
 import { ReactComponent as OverviewIcon } from '../../assets/icons/overview.svg';
 import { ReactComponent as CollectionIcon } from '../../assets/icons/collecion.svg';
 import { ReactComponent as ConsoleIcon } from '../../assets/icons/console.svg';
@@ -68,7 +68,7 @@ const icons: { [x in IconsType]: (props?: any) => React.ReactElement } = {
   download: (props = {}) => <GetAppIcon {...props} />,
 
   zilliz: (props = {}) => (
-    <SvgIcon viewBox="0 0 30 30" component={ZillizIcon} {...props} />
+    <SvgIcon viewBox="0 0 36 36" component={ZillizIcon} {...props} />
   ),
   navPerson: (props = {}) => (
     <SvgIcon

+ 6 - 0
client/src/plugins/system/SystemView.tsx

@@ -77,6 +77,12 @@ const parseJson = (jsonData: any) => {
 
   jsonData?.response?.nodes_info.forEach((node: any) => {
     const type = node?.infos?.type;
+    const has_error = node?.infos?.has_error;
+
+    if (has_error) {
+      return;
+    }
+
     // coordinator node
     if (type?.toLowerCase().includes('coord')) {
       nodes.push(node);

+ 2 - 2
server/package.json

@@ -132,7 +132,7 @@
       "target": "dmg"
     },
     "win": {
-      "icon": "./build/zilliz.png",
+      "icon": "./build/attu.png",
       "target": [
         {
           "target": "nsis"
@@ -140,4 +140,4 @@
       ]
     }
   }
-}
+}