Browse Source

Merge pull request #211 from nameczz/main

fix hemlet and update readme
Tumao 3 years ago
parent
commit
87f1f338e6
2 changed files with 19 additions and 6 deletions
  1. 11 4
      README.md
  2. 8 2
      server/src/main.ts

+ 11 - 4
README.md

@@ -5,7 +5,9 @@ Milvus insight provides an intuitive and efficient GUI for Milvus, allowing you
 <img src="./.github/images/screenshot.png" alt="Miluvs insight" />
 <img src="./.github/images/screenshot.png" alt="Miluvs insight" />
 
 
 ## Features and Roadmap
 ## Features and Roadmap
+
 Milvus insight is under rapid development nad we are adding new features weekly, here are the current plan, we will release a version once a feature is available.
 Milvus insight is under rapid development nad we are adding new features weekly, here are the current plan, we will release a version once a feature is available.
+
 - Manage collections/partitions
 - Manage collections/partitions
 - Manage index
 - Manage index
 - Basic statistics overview
 - Basic statistics overview
@@ -27,21 +29,26 @@ Ensure you have Milvus installed on [your server](https://milvus.io/docs/install
 ### ⭐️ Start a Milvus insight instance
 ### ⭐️ Start a Milvus insight instance
 
 
 ```code
 ```code
-docker run -p 8000:3000 -e HOST_URL=http://192.168.0.1:8000 -e MILVUS_URL=192.168.0.1:19530 milvusdb/milvus-insight:latest
+docker run -p 8000:3000 -e HOST_URL=http://{ your machine IP }:8000 -e MILVUS_URL={your machine IP}:19530 milvusdb/milvus-insight:latest
 ```
 ```
 
 
-Once you start the docker, open the browser, type `http://192.168.0.1:8000`, you can view the Milvus insight.
+Once you start the docker, open the browser, type `http://{ your machine IP }:8000`, you can view the Milvus insight.
 
 
 #### Params
 #### Params
+
 | Parameter  | Example                 | required | description                                 |
 | Parameter  | Example                 | required | description                                 |
 | :--------- | :---------------------- | :------: | ------------------------------------------- |
 | :--------- | :---------------------- | :------: | ------------------------------------------- |
 | HOST_URL   | http://192.168.0.1:8000 |   true   | Where Milvus insight container is installed |
 | HOST_URL   | http://192.168.0.1:8000 |   true   | Where Milvus insight container is installed |
 | MILVUS_URL | 192.168.0.1:19530       |  false   | Optional, Milvus server URL                 |
 | MILVUS_URL | 192.168.0.1:19530       |  false   | Optional, Milvus server URL                 |
 
 
+Tip: **127.0.0.1 or localhost will not working when run by docker**
+
 #### Try the dev build
 #### Try the dev build
-***note*** We plan to release Milvus insight once a feature is done. Also, if you want to try the nightly build, please pull the docker image with the `dev` tag.
+
+**_note_** We plan to release Milvus insight once a feature is done. Also, if you want to try the nightly build, please pull the docker image with the `dev` tag.
+
 ```code
 ```code
-docker run -p 8000:3000 -e HOST_URL=192.168.0.1:8000 -e MILVUS_URL=192.168.0.1:19530 milvusdb/milvus-insight:dev
+docker run -p 8000:3000 -e HOST_URL=http://{ your machine IP }:8000 -e MILVUS_URL={ your machine IP }:19530 milvusdb/milvus-insight:dev
 ```
 ```
 
 
 ## ✨ Building and Running Milvus insight, and/or Contributing Code
 ## ✨ Building and Running Milvus insight, and/or Contributing Code

+ 8 - 2
server/src/main.ts

@@ -3,7 +3,7 @@ import { NestFactory } from '@nestjs/core';
 import { SwaggerModule, DocumentBuilder } from '@nestjs/swagger';
 import { SwaggerModule, DocumentBuilder } from '@nestjs/swagger';
 import { AppModule } from './app.module';
 import { AppModule } from './app.module';
 import { json } from 'body-parser';
 import { json } from 'body-parser';
-const hyperlinker = require('hyperlinker');
+import * as hyperlinker from 'hyperlinker';
 
 
 /*
 /*
   Milvus insight API server bootstrap function
   Milvus insight API server bootstrap function
@@ -14,7 +14,12 @@ async function bootstrap() {
   // create the nest application with Cross-origin resource sharing
   // create the nest application with Cross-origin resource sharing
   const app = await NestFactory.create(AppModule, { cors: true });
   const app = await NestFactory.create(AppModule, { cors: true });
   // security patches
   // security patches
-  app.use(helmet());
+  app.use(
+    helmet({
+      // If true will cause blank page after client build.
+      contentSecurityPolicy: false,
+    }),
+  );
   // set upload file size limit
   // set upload file size limit
   app.use(json({ limit: '150mb' }));
   app.use(json({ limit: '150mb' }));
   // add an API prefix
   // add an API prefix
@@ -34,6 +39,7 @@ async function bootstrap() {
   await app.listen(port);
   await app.listen(port);
 
 
   // output server info
   // output server info
+  // eslint-disable-next-line @typescript-eslint/no-var-requires
   require('dns').lookup(require('os').hostname(), (err, add, fam) => {
   require('dns').lookup(require('os').hostname(), (err, add, fam) => {
     // get link
     // get link
     // add = `127.0.0.1`;
     // add = `127.0.0.1`;