Browse Source

hide system view cards and rename express to server

sutcalag 3 years ago
parent
commit
6ace37819a
61 changed files with 30 additions and 31 deletions
  1. 5 5
      .github/workflows/dev.yml
  2. 5 5
      .github/workflows/electron.yml
  3. 4 4
      .gitignore
  4. 5 5
      Dockerfile
  5. 11 12
      client/src/plugins/system/SystemView.tsx
  6. 0 0
      server/.prettierrc
  7. 0 0
      server/electron-starter.js
  8. 0 0
      server/generate-csv.ts
  9. 0 0
      server/package.json
  10. 0 0
      server/src/__tests__/__mocks__/consts.ts
  11. 0 0
      server/src/__tests__/__mocks__/milvus/milvusClient.ts
  12. 0 0
      server/src/__tests__/__mocks__/milvus/milvusService.ts
  13. 0 0
      server/src/__tests__/collections/collections.service.test.ts
  14. 0 0
      server/src/__tests__/crons/crons.service.test.ts
  15. 0 0
      server/src/__tests__/milvus/milvus.controller.test.ts
  16. 0 0
      server/src/__tests__/milvus/milvus.service.test.ts
  17. 0 0
      server/src/__tests__/partitions/partitions.service.test.ts
  18. 0 0
      server/src/__tests__/schema/schema.service.test.ts
  19. 0 0
      server/src/__tests__/utils/constants.ts
  20. 0 0
      server/src/__tests__/utils/mock.util.ts
  21. 0 0
      server/src/app.ts
  22. 0 0
      server/src/collections/collections.controller.ts
  23. 0 0
      server/src/collections/collections.service.ts
  24. 0 0
      server/src/collections/dto.ts
  25. 0 0
      server/src/collections/index.ts
  26. 0 0
      server/src/collections/swagger.yml
  27. 0 0
      server/src/crons/crons.controller.ts
  28. 0 0
      server/src/crons/crons.service.ts
  29. 0 0
      server/src/crons/dto.ts
  30. 0 0
      server/src/crons/index.ts
  31. 0 0
      server/src/crons/swagger.yml
  32. 0 0
      server/src/events/index.ts
  33. 0 0
      server/src/exception/HttpException.ts
  34. 0 0
      server/src/middlewares/index.ts
  35. 0 0
      server/src/middlewares/validation.ts
  36. 0 0
      server/src/milvus/dto.ts
  37. 0 0
      server/src/milvus/index.ts
  38. 0 0
      server/src/milvus/milvus.controller.ts
  39. 0 0
      server/src/milvus/milvus.service.ts
  40. 0 0
      server/src/milvus/swagger.yml
  41. 0 0
      server/src/partitions/dto.ts
  42. 0 0
      server/src/partitions/index.ts
  43. 0 0
      server/src/partitions/partitions.controller.ts
  44. 0 0
      server/src/partitions/partitions.service.ts
  45. 0 0
      server/src/partitions/swagger.yml
  46. 0 0
      server/src/plugins/getServerTime/app.ts
  47. 0 0
      server/src/plugins/getServerTime/config.json
  48. 0 0
      server/src/plugins/getServerTime/package.json
  49. 0 0
      server/src/schema/dto.ts
  50. 0 0
      server/src/schema/index.ts
  51. 0 0
      server/src/schema/schema.controller.ts
  52. 0 0
      server/src/schema/schema.service.ts
  53. 0 0
      server/src/schema/swagger.yml
  54. 0 0
      server/src/swagger.ts
  55. 0 0
      server/src/utils/Const.ts
  56. 0 0
      server/src/utils/Error.ts
  57. 0 0
      server/src/utils/Helper.ts
  58. 0 0
      server/src/utils/index.ts
  59. 0 0
      server/tsconfig.json
  60. 0 0
      server/tslint.json
  61. 0 0
      server/yarn.lock

+ 5 - 5
.github/workflows/dev.yml

@@ -16,9 +16,9 @@ jobs:
         with:
         with:
           node-version: 14
           node-version: 14
 
 
-      - name: Run Express tests
+      - name: Run server tests
         run: |
         run: |
-          cd express
+          cd server
           yarn install
           yarn install
           yarn test:cov
           yarn test:cov
 
 
@@ -27,8 +27,8 @@ jobs:
         with:
         with:
           # public repo needn't pass token
           # public repo needn't pass token
           # token: ${{ secrets.CODECOV_TOKEN }}
           # token: ${{ secrets.CODECOV_TOKEN }}
-          # only upload express test coverage
-          flags: express
+          # only upload server test coverage
+          flags: server
 
 
       - name: Login to DockerHub
       - name: Login to DockerHub
         uses: docker/login-action@v1
         uses: docker/login-action@v1
@@ -66,7 +66,7 @@ jobs:
         uses: golfzaptw/action-connect-ovpn@master
         uses: golfzaptw/action-connect-ovpn@master
         id: connect_vpn
         id: connect_vpn
         with:
         with:
-          FILE_OVPN: '.github/workflows/client.ovpn'
+          FILE_OVPN: ".github/workflows/client.ovpn"
         env:
         env:
           CA_CRT: ${{ secrets.VPN_CA}}
           CA_CRT: ${{ secrets.VPN_CA}}
           USER_CRT: ${{ secrets.VPN_CRT }}
           USER_CRT: ${{ secrets.VPN_CRT }}

+ 5 - 5
.github/workflows/electron.yml

@@ -3,7 +3,7 @@ name: Build electron app
 on:
 on:
   push:
   push:
     tags:
     tags:
-      - '*'
+      - "*"
 
 
 jobs:
 jobs:
   release:
   release:
@@ -21,22 +21,22 @@ jobs:
         uses: actions/setup-node@v1
         uses: actions/setup-node@v1
         with:
         with:
           node-version: 14
           node-version: 14
-    
+
       - name: Build client
       - name: Build client
         run: |
         run: |
           cd client
           cd client
           yarn --network-timeout 100000
           yarn --network-timeout 100000
           yarn build
           yarn build
-          cp -r build ../express
+          cp -r build ../server
 
 
       - name: Build/release Electron app
       - name: Build/release Electron app
         uses: samuelmeuli/action-electron-builder@v1
         uses: samuelmeuli/action-electron-builder@v1
         with:
         with:
-          package_root: './express'
+          package_root: "./server"
           # GitHub token, automatically provided to the action
           # GitHub token, automatically provided to the action
           # (No need to define this secret in the repo settings)
           # (No need to define this secret in the repo settings)
           github_token: ${{ secrets.GH_TOKEN }}
           github_token: ${{ secrets.GH_TOKEN }}
 
 
           # If the commit is tagged with a version (e.g. "v1.0.0"),
           # If the commit is tagged with a version (e.g. "v1.0.0"),
           # release the app after building
           # release the app after building
-          release: ${{ startsWith(github.ref, 'refs/tags/v') }}
+          release: ${{ startsWith(github.ref, 'refs/tags/v') }}

+ 4 - 4
.gitignore

@@ -27,10 +27,10 @@ node_modules
 
 
 .DS_Store
 .DS_Store
 
 
-express/node_modules
-express/dist
-express/build
-express/electron-app
+server/node_modules
+server/dist
+server/build
+server/electron-app
 
 
 
 
 
 

+ 5 - 5
Dockerfile

@@ -8,7 +8,7 @@ WORKDIR /app/client
 RUN yarn install
 RUN yarn install
 RUN yarn build
 RUN yarn build
 # # => Building Server
 # # => Building Server
-WORKDIR /app/express
+WORKDIR /app/server
 RUN yarn install
 RUN yarn install
 ENV NODE_ENV production
 ENV NODE_ENV production
 ENV PORT 80
 ENV PORT 80
@@ -17,11 +17,11 @@ RUN yarn build
 # => Copy to Final container
 # => Copy to Final container
 FROM mhart/alpine-node:14
 FROM mhart/alpine-node:14
 WORKDIR /app
 WORKDIR /app
-COPY --from=builder /app/express/dist /app/dist
+COPY --from=builder /app/server/dist /app/dist
 COPY --from=builder /app/client/build /app/build
 COPY --from=builder /app/client/build /app/build
 # COPY --from=builder /app/server/node_modules /app/node_modules
 # COPY --from=builder /app/server/node_modules /app/node_modules
-COPY --from=builder /app/express/package.json /app/package.json
-COPY --from=builder /app/express/yarn.lock /app/yarn.lock
+COPY --from=builder /app/server/package.json /app/package.json
+COPY --from=builder /app/server/yarn.lock /app/yarn.lock
 
 
 # => Reinstall production dependencies and clean cache
 # => Reinstall production dependencies and clean cache
 RUN yarn install --production && yarn cache clean
 RUN yarn install --production && yarn cache clean
@@ -33,7 +33,7 @@ RUN chmod +x /app/build/env.sh
 
 
 # Make all files accessible such that the image supports arbitrary  user ids
 # Make all files accessible such that the image supports arbitrary  user ids
 RUN chgrp -R 0 /app && \
 RUN chgrp -R 0 /app && \
-    chmod -R g=u /app
+  chmod -R g=u /app
 
 
 EXPOSE 3000
 EXPOSE 3000
 
 

+ 11 - 12
client/src/plugins/system/SystemView.tsx

@@ -1,5 +1,5 @@
 import { useState, useEffect, useRef } from 'react';
 import { useState, useEffect, useRef } from 'react';
-import { useTranslation } from 'react-i18next';
+// import { useTranslation } from 'react-i18next';
 import { makeStyles, Theme } from '@material-ui/core';
 import { makeStyles, Theme } from '@material-ui/core';
 import clsx from 'clsx';
 import clsx from 'clsx';
 import { useNavigationHook } from '../../hooks/Navigation';
 import { useNavigationHook } from '../../hooks/Navigation';
@@ -8,8 +8,8 @@ import { MilvusHttp } from '../../http/Milvus';
 import { useInterval } from '../../hooks/SystemView';
 import { useInterval } from '../../hooks/SystemView';
 import Topo from './Topology';
 import Topo from './Topology';
 import NodeListView from './NodeListView';
 import NodeListView from './NodeListView';
-import LineChartCard from './LineChartCard';
-import ProgressCard from './ProgressCard';
+// import LineChartCard from './LineChartCard';
+// import ProgressCard from './ProgressCard';
 import DataCard from './DataCard';
 import DataCard from './DataCard';
 
 
 const getStyles = makeStyles((theme: Theme) => ({
 const getStyles = makeStyles((theme: Theme) => ({
@@ -100,7 +100,7 @@ const parseJson = (jsonData: any) => {
  */
  */
 const SystemView: any = () => {
 const SystemView: any = () => {
   useNavigationHook(ALL_ROUTER_TYPES.SYSTEM);
   useNavigationHook(ALL_ROUTER_TYPES.SYSTEM);
-  const { t } = useTranslation('systemView');
+  // const { t } = useTranslation('systemView');
 
 
   const classes = getStyles();
   const classes = getStyles();
   const INTERVAL = 10000;
   const INTERVAL = 10000;
@@ -129,13 +129,14 @@ const SystemView: any = () => {
     fetchData();
     fetchData();
   }, []);
   }, []);
 
 
-  let qps = system?.qps || 0;
-  const latency = system?.latency || 0;
+  // let qps = system?.qps || 0;
+  // const latency = system?.latency || 0;
   const childView = useRef<HTMLInputElement>(null);
   const childView = useRef<HTMLInputElement>(null);
 
 
   return (
   return (
     <div className={classes.root}>
     <div className={classes.root}>
-      <div
+      {/* hide cards until metrics api can provide enough data*/}
+      {/* <div
         className={clsx(
         className={clsx(
           classes.cardContainer,
           classes.cardContainer,
           selectedCord && classes.transparent
           selectedCord && classes.transparent
@@ -146,16 +147,14 @@ const SystemView: any = () => {
           usage={system.diskUsage}
           usage={system.diskUsage}
           total={system.disk}
           total={system.disk}
         />
         />
-        {/* <ProgressCard
+        <ProgressCard
           title={t('memoryTitle')}
           title={t('memoryTitle')}
           usage={system.memoryUsage}
           usage={system.memoryUsage}
           total={system.memory}
           total={system.memory}
-        /> */}
-        <LineChartCard title={t('memoryTitle')} value={qps} />
-
+        />
         <LineChartCard title={t('qpsTitle')} value={qps} />
         <LineChartCard title={t('qpsTitle')} value={qps} />
         <LineChartCard title={t('latencyTitle')} value={latency} />
         <LineChartCard title={t('latencyTitle')} value={latency} />
-      </div>
+      </div> */}
       <div className={classes.contentContainer}>
       <div className={classes.contentContainer}>
         <Topo nodes={nodes} setNode={setNode} setCord={setCord} />
         <Topo nodes={nodes} setNode={setNode} setCord={setCord} />
         <DataCard node={selectedNode} extend />
         <DataCard node={selectedNode} extend />

+ 0 - 0
express/.prettierrc → server/.prettierrc


+ 0 - 0
express/electron-starter.js → server/electron-starter.js


+ 0 - 0
express/generate-csv.ts → server/generate-csv.ts


+ 0 - 0
express/package.json → server/package.json


+ 0 - 0
express/src/__tests__/__mocks__/consts.ts → server/src/__tests__/__mocks__/consts.ts


+ 0 - 0
express/src/__tests__/__mocks__/milvus/milvusClient.ts → server/src/__tests__/__mocks__/milvus/milvusClient.ts


+ 0 - 0
express/src/__tests__/__mocks__/milvus/milvusService.ts → server/src/__tests__/__mocks__/milvus/milvusService.ts


+ 0 - 0
express/src/__tests__/collections/collections.service.test.ts → server/src/__tests__/collections/collections.service.test.ts


+ 0 - 0
express/src/__tests__/crons/crons.service.test.ts → server/src/__tests__/crons/crons.service.test.ts


+ 0 - 0
express/src/__tests__/milvus/milvus.controller.test.ts → server/src/__tests__/milvus/milvus.controller.test.ts


+ 0 - 0
express/src/__tests__/milvus/milvus.service.test.ts → server/src/__tests__/milvus/milvus.service.test.ts


+ 0 - 0
express/src/__tests__/partitions/partitions.service.test.ts → server/src/__tests__/partitions/partitions.service.test.ts


+ 0 - 0
express/src/__tests__/schema/schema.service.test.ts → server/src/__tests__/schema/schema.service.test.ts


+ 0 - 0
express/src/__tests__/utils/constants.ts → server/src/__tests__/utils/constants.ts


+ 0 - 0
express/src/__tests__/utils/mock.util.ts → server/src/__tests__/utils/mock.util.ts


+ 0 - 0
express/src/app.ts → server/src/app.ts


+ 0 - 0
express/src/collections/collections.controller.ts → server/src/collections/collections.controller.ts


+ 0 - 0
express/src/collections/collections.service.ts → server/src/collections/collections.service.ts


+ 0 - 0
express/src/collections/dto.ts → server/src/collections/dto.ts


+ 0 - 0
express/src/collections/index.ts → server/src/collections/index.ts


+ 0 - 0
express/src/collections/swagger.yml → server/src/collections/swagger.yml


+ 0 - 0
express/src/crons/crons.controller.ts → server/src/crons/crons.controller.ts


+ 0 - 0
express/src/crons/crons.service.ts → server/src/crons/crons.service.ts


+ 0 - 0
express/src/crons/dto.ts → server/src/crons/dto.ts


+ 0 - 0
express/src/crons/index.ts → server/src/crons/index.ts


+ 0 - 0
express/src/crons/swagger.yml → server/src/crons/swagger.yml


+ 0 - 0
express/src/events/index.ts → server/src/events/index.ts


+ 0 - 0
express/src/exception/HttpException.ts → server/src/exception/HttpException.ts


+ 0 - 0
express/src/middlewares/index.ts → server/src/middlewares/index.ts


+ 0 - 0
express/src/middlewares/validation.ts → server/src/middlewares/validation.ts


+ 0 - 0
express/src/milvus/dto.ts → server/src/milvus/dto.ts


+ 0 - 0
express/src/milvus/index.ts → server/src/milvus/index.ts


+ 0 - 0
express/src/milvus/milvus.controller.ts → server/src/milvus/milvus.controller.ts


+ 0 - 0
express/src/milvus/milvus.service.ts → server/src/milvus/milvus.service.ts


+ 0 - 0
express/src/milvus/swagger.yml → server/src/milvus/swagger.yml


+ 0 - 0
express/src/partitions/dto.ts → server/src/partitions/dto.ts


+ 0 - 0
express/src/partitions/index.ts → server/src/partitions/index.ts


+ 0 - 0
express/src/partitions/partitions.controller.ts → server/src/partitions/partitions.controller.ts


+ 0 - 0
express/src/partitions/partitions.service.ts → server/src/partitions/partitions.service.ts


+ 0 - 0
express/src/partitions/swagger.yml → server/src/partitions/swagger.yml


+ 0 - 0
express/src/plugins/getServerTime/app.ts → server/src/plugins/getServerTime/app.ts


+ 0 - 0
express/src/plugins/getServerTime/config.json → server/src/plugins/getServerTime/config.json


+ 0 - 0
express/src/plugins/getServerTime/package.json → server/src/plugins/getServerTime/package.json


+ 0 - 0
express/src/schema/dto.ts → server/src/schema/dto.ts


+ 0 - 0
express/src/schema/index.ts → server/src/schema/index.ts


+ 0 - 0
express/src/schema/schema.controller.ts → server/src/schema/schema.controller.ts


+ 0 - 0
express/src/schema/schema.service.ts → server/src/schema/schema.service.ts


+ 0 - 0
express/src/schema/swagger.yml → server/src/schema/swagger.yml


+ 0 - 0
express/src/swagger.ts → server/src/swagger.ts


+ 0 - 0
express/src/utils/Const.ts → server/src/utils/Const.ts


+ 0 - 0
express/src/utils/Error.ts → server/src/utils/Error.ts


+ 0 - 0
express/src/utils/Helper.ts → server/src/utils/Helper.ts


+ 0 - 0
express/src/utils/index.ts → server/src/utils/index.ts


+ 0 - 0
express/tsconfig.json → server/tsconfig.json


+ 0 - 0
express/tslint.json → server/tslint.json


+ 0 - 0
express/yarn.lock → server/yarn.lock