Browse Source

fix docker build bug

Signed-off-by: nameczz <zizhao.chen@zilliz.com>
nameczz 3 years ago
parent
commit
69fb3a0aa6

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

@@ -66,7 +66,7 @@ const icons: { [x in IconsType]: (props?: any) => React.ReactElement } = {
   download: (props = {}) => <GetAppIcon {...props} />,
 
   zilliz: (props = {}) => (
-    <SvgIcon viewBox="0 0 44 31" component={ZillizIcon} {...props} />
+    <SvgIcon viewBox="0 0 30 30" component={ZillizIcon} {...props} />
   ),
   navOverview: (props = {}) => (
     <SvgIcon viewBox="0 0 20 20" component={OverviewIcon} {...props} />

+ 0 - 1
client/src/pages/connect/Connect.tsx

@@ -38,7 +38,6 @@ const useStyles = makeStyles((theme: Theme) => ({
   logo: {
     width: '42px',
     height: 'auto',
-    marginRight: theme.spacing(2),
   },
   input: {
     margin: theme.spacing(3, 0, 0.5),

+ 14 - 6
express/src/middlewares/index.ts

@@ -11,14 +11,22 @@ export const ReqHeaderMiddleware = (
   next: NextFunction
 ) => {
   const insightCache = req.app.get(INSIGHT_CACHE);
-  // all request need set milvus address in header.
+  // all ape requests need set milvus address in header.
   // server will set activeaddress in milvus service.
   const milvusAddress = (req.headers[MILVUS_ADDRESS] as string) || '';
-  MilvusService.activeAddress = milvusAddress;
-  // insight cache will update expire time when use insightCache.get
-  MilvusService.activeMilvusClient = insightCache.get(
-    MilvusService.formatAddress(milvusAddress)
-  );
+  /**
+   *  only api request has MILVUS_ADDRESS.
+   *  When client run in express, we dont need static files like: xx.js run this logic.
+   *  Otherwise will cause 401 error.
+   * */
+  if (milvusAddress && insightCache.has(milvusAddress)) {
+    MilvusService.activeAddress = milvusAddress;
+    // insight cache will update expire time when use insightCache.get
+    MilvusService.activeMilvusClient = insightCache.get(
+      MilvusService.formatAddress(milvusAddress)
+    );
+  }
+
   next();
 };