diff --git a/.travis.yml b/.travis.yml index f64605737321bf32d9cae2b8082d3d65434b9e92..d88e48b53b496825940cdaed85e75e7688918f44 100644 --- a/.travis.yml +++ b/.travis.yml @@ -63,7 +63,7 @@ jobs: - npm - yarn env: - - PUBLIC_PATH="" + - PUBLIC_PATH="/app" - API_URL="/api" before_install: - cd frontend diff --git a/build.sh b/build.sh deleted file mode 100644 index 7db6329f951aef8d7311347788731b82ddfdec4b..0000000000000000000000000000000000000000 --- a/build.sh +++ /dev/null @@ -1,85 +0,0 @@ -#!/bin/bash -set -ex - -TOP_DIR=$(pwd) -FRONTEND_DIR=$TOP_DIR/frontend -BACKEND_DIR=$TOP_DIR/visualdl -BUILD_DIR=$TOP_DIR/build - -mkdir -p $BUILD_DIR - -check_duplicated() { - filename_format=$1 - file_num=`ls dist/${filename_format} | wc -l | awk '{$1=$1;print}'` - if [ "$file_num" != "1" ]; then - echo "dist have duplicate file for $file_num, please clean and rerun" - exit 1 - fi -} - -build_frontend() { - cd $FRONTEND_DIR -# # Should always rebuild the dist files. -# if [ ! -d "dist" ]; then -# npm install -# npm run build -# fi - npm install - npm run build - for file_name in "manifest.*.js" "index.*.js" "vendor.*.js"; do - echo $file_name - check_duplicated $file_name - done -} - -build_frontend_fake() { - cd $FRONTEND_DIR - mkdir -p dist -} - -build_backend() { - cd $BUILD_DIR - if [[ $WITH_PYTHON3 ]]; then - cmake -DWITH_PYTHON3=ON .. ${PYTHON_FLAGS} - else - cmake .. ${PYTHON_FLAGS} - fi - make -j2 -} - -build_onnx_graph() { - export PATH="$BUILD_DIR/third_party/protobuf/src/extern_protobuf-build/:$PATH" - cd $TOP_DIR/visualdl/server/model/onnx - protoc onnx.proto --python_out . - cd $TOP_DIR/visualdl/server/model/paddle - protoc framework.proto --python_out . -} - -clean_env() { - rm -rf $TOP_DIR/visualdl/server/dist - rm -rf $BUILD_DIR/bdist* - rm -rf $BUILD_DIR/lib* - rm -rf $BUILD_DIR/temp* - rm -rf $BUILD_DIR/scripts* -} - -package() { - cp -rf $FRONTEND_DIR/dist $TOP_DIR/visualdl/server/ - cp $BUILD_DIR/visualdl/logic/core.so $TOP_DIR/visualdl - cp $BUILD_DIR/visualdl/logic/core.so $TOP_DIR/visualdl/python/ -} - -ARG=$1 -echo "ARG: " $ARG - - -if [ "$ARG" = "travis-CI" ]; then - build_frontend_fake -else - build_frontend -fi - -clean_env -build_backend -build_onnx_graph -package diff --git a/frontend/components/Image.tsx b/frontend/components/Image.tsx index 5f541477152ef7829d08a9494471d6c16af8cdc5..46ee287f723a61d613b27f65ddb5ef7284028f94 100644 --- a/frontend/components/Image.tsx +++ b/frontend/components/Image.tsx @@ -1,6 +1,6 @@ import React, {FunctionComponent, useEffect, useState, useRef} from 'react'; -import {useTranslation} from '~/utils/i18n'; import fetch from 'isomorphic-unfetch'; +import {useTranslation} from '~/utils/i18n'; type ImageProps = { src?: string; diff --git a/frontend/components/Navbar.tsx b/frontend/components/Navbar.tsx index 68821c2718fee1f94e59a23b766da94d5fbc9b78..fc44f5761a653ede8ea1c8e74c76af41a0284d67 100644 --- a/frontend/components/Navbar.tsx +++ b/frontend/components/Navbar.tsx @@ -63,8 +63,8 @@ const Navbar: FunctionComponent = () => { return (