diff --git a/cope2n-fe/.dockerignore b/cope2n-fe/.dockerignore new file mode 100644 index 0000000..07e6e47 --- /dev/null +++ b/cope2n-fe/.dockerignore @@ -0,0 +1 @@ +/node_modules diff --git a/cope2n-fe/.env.development b/cope2n-fe/.env.development new file mode 100644 index 0000000..5150853 --- /dev/null +++ b/cope2n-fe/.env.development @@ -0,0 +1,3 @@ +VITE_PORT=8080 +VITE_PROXY=https://107.120.133.22/ +VITE_KUBEFLOW_HOST=https://107.120.133.22:8085 \ No newline at end of file diff --git a/cope2n-fe/.eslintrc b/cope2n-fe/.eslintrc new file mode 100644 index 0000000..3462142 --- /dev/null +++ b/cope2n-fe/.eslintrc @@ -0,0 +1,14 @@ +{ + "env": { + "browser": true, + "es6": true + }, + "extends": [ + "react-app", + "prettier", + "plugin:@tanstack/eslint-plugin-query/recommended" + ], + "ignorePatterns": [ + "**/components/react-via/**/*.js" + ] +} \ No newline at end of file diff --git a/cope2n-fe/.gitignore b/cope2n-fe/.gitignore index 8e6d10e..8f4a9e5 100644 --- a/cope2n-fe/.gitignore +++ b/cope2n-fe/.gitignore @@ -1,27 +1,33 @@ -# Logs -logs -*.log +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +# dependencies +/node_modules +/.pnp +.pnp.js + +# testing +/coverage + +# production +/build +/dist + +# misc +.DS_Store +.env.local +.env.development.local +.env.test.local +.env.production.local + npm-debug.log* yarn-debug.log* yarn-error.log* -pnpm-debug.log* -lerna-debug.log* +# rollup-plugin-visualizer +stats.html + +# Ignore all the installed packages node_modules -dist -dist-ssr -*.local - -# Editor directories and files -.vscode/* -!.vscode/extensions.json -.idea -.DS_Store -*.suo -*.ntvs* -*.njsproj -*.sln -*.sw? # linguijs locales src/locales/**/*.ts diff --git a/cope2n-fe/.gitlab-ci.yml b/cope2n-fe/.gitlab-ci.yml deleted file mode 100644 index 85ebc2c..0000000 --- a/cope2n-fe/.gitlab-ci.yml +++ /dev/null @@ -1,20 +0,0 @@ -stages: - - check - -sonarqube-check: - stage: check - image: - name: sonarsource/sonar-scanner-cli:latest - entrypoint: [''] - variables: - SONAR_USER_HOME: '${CI_PROJECT_DIR}/.sonar' # Defines the location of the analysis task cache - GIT_DEPTH: '0' # Tells git to fetch all the branches of the project, required by the analysis task - # cache: - # key: '${CI_JOB_NAME}' - # paths: - # - .sonar/cache - script: - - sonar-scanner - allow_failure: true - only: - - develop diff --git a/cope2n-fe/.prettierignore b/cope2n-fe/.prettierignore index 781626f..f75951a 100644 --- a/cope2n-fe/.prettierignore +++ b/cope2n-fe/.prettierignore @@ -1,4 +1,11 @@ +.*/ +./dist/ +./data/ +3rdparty/ node_modules/ -dist/ +keys/ logs/ static/ +templates/ +src/components/react-via/js/ +src/components/react-via/styles/ diff --git a/cope2n-fe/.prettierrc b/cope2n-fe/.prettierrc index b9e39c7..e8dbc2c 100644 --- a/cope2n-fe/.prettierrc +++ b/cope2n-fe/.prettierrc @@ -1,9 +1,29 @@ { + "arrowParens": "always", + "bracketSpacing": true, + "embeddedLanguageFormatting": "auto", + "htmlWhitespaceSensitivity": "css", + "insertPragma": false, + "jsxBracketSameLine": false, + "jsxSingleQuote": true, "printWidth": 80, + "proseWrap": "preserve", + "quoteProps": "as-needed", + "requirePragma": false, "semi": true, "singleQuote": true, "tabWidth": 2, "trailingComma": "all", - "endOfLine": "crlf", - "jsxSingleQuote": false + "useTabs": false, + "vueIndentScriptAndStyle": false, + "overrides": [ + { + "files": ["*.json", "*.yml", "*.yaml", "*.md"], + "options": { + "tabWidth": 2 + } + } + ], + "endOfLine": "lf" } + diff --git a/cope2n-fe/Dockerfile b/cope2n-fe/Dockerfile deleted file mode 100644 index 99ed5df..0000000 --- a/cope2n-fe/Dockerfile +++ /dev/null @@ -1,34 +0,0 @@ -################### -# BUILD FOR LOCAL DEVELOPMENT -################### -FROM node:16-alpine AS development -WORKDIR /app/ -COPY --chown=node:node package*.json ./ -RUN npm ci -COPY --chown=node:node . . -USER node - -################### -# BUILD FOR PRODUCTION -################### -FROM node:16-alpine AS build -WORKDIR /app/ -ENV NODE_ENV production -COPY --chown=node:node package*.json ./ -COPY --chown=node:node --from=development /app/node_modules ./node_modules -COPY --chown=node:node . . -RUN npm run build -RUN npm ci --only=production && npm cache clean --force -USER node - -################### -# PRODUCTION -################### -FROM nginx:stable-alpine AS nginx - -COPY --from=build /app/dist/ /usr/share/nginx/html/ -COPY --from=build /app/run.sh /app/ -COPY --from=build /app/nginx.conf /configs/ -RUN chmod +x /app/run.sh - -CMD ["/app/run.sh"] \ No newline at end of file diff --git a/cope2n-fe/Dockerfile- b/cope2n-fe/Dockerfile- deleted file mode 100644 index d3fb61d..0000000 --- a/cope2n-fe/Dockerfile- +++ /dev/null @@ -1,35 +0,0 @@ -################### -# BUILD FOR LOCAL DEVELOPMENT -################### -FROM node:16-alpine AS development -WORKDIR /app/ -COPY --chown=node:node package*.json ./ -RUN npm ci -COPY --chown=node:node . . -USER node - -################### -# BUILD FOR PRODUCTION -################### -FROM node:16-alpine AS build -WORKDIR /app/ -COPY --chown=node:node package*.json ./ -COPY --chown=node:node --from=development /app/node_modules ./node_modules -COPY --chown=node:node . . -RUN npm run build -ENV NODE_ENV production -RUN npm ci --only=production && npm cache clean --force -USER node - -################### -# PRODUCTION -################### -FROM nginx:stable-alpine AS nginx - -ARG PORT=9999 - -COPY --from=build /app/dist/ /usr/share/nginx/html/ -COPY ./nginx.conf /etc/nginx/conf.d/default.conf - -EXPOSE ${PORT} -CMD ["nginx", "-g", "daemon off;" ] \ No newline at end of file diff --git a/cope2n-fe/deploy.sh b/cope2n-fe/deploy.sh deleted file mode 100644 index fe8fe11..0000000 --- a/cope2n-fe/deploy.sh +++ /dev/null @@ -1,27 +0,0 @@ -# Variables -IMAGE_NAME="demoap-fe:latest" -CONTAINER_NAME="demoap-fe" -PORT="9999" -HTTP_PROXY="http://42.96.40.255:8002" # http:\/\/0.0.0.0:8002 - -# Make sure that HTTP_PROXY is not empty -if [ -z "$HTTP_PROXY" ] -then - echo "HTTP_PROXY is empty, you have to specify it in deploy.sh file" - exit 1 -fi - -# Replace #proxy_server in nginx.conf with HTTP_PROXY using sed command -sed -i "s|#proxy_server|$HTTP_PROXY|g" ./nginx.conf - -# Replace #port in nginx.conf with PORT using sed command -sed -i "s|#port|$PORT|g" ./nginx.conf - -# Build image -docker build --build-arg PORT=$PORT --pull --rm -f "Dockerfile" -t $IMAGE_NAME "." - -# Remove exist container -docker container stop $CONTAINER_NAME - -# Run container from new image -docker run --rm -d -p $PORT:$PORT/tcp --name $CONTAINER_NAME $IMAGE_NAME diff --git a/cope2n-fe/index.html b/cope2n-fe/index.html index c86c8c3..d1192b5 100644 --- a/cope2n-fe/index.html +++ b/cope2n-fe/index.html @@ -1,12 +1,27 @@
- - - ->>0}function expectString(e){if("string"!=typeof e)throw new r.FormatError("Malformed CMap: expected string.")}function expectInt(e){if(!Number.isInteger(e))throw new r.FormatError("Malformed CMap: expected int.")}function parseBfChar(e,t){for(;;){let a=t.getObj();if(a===n.EOF)break;if((0,n.isCmd)(a,"endbfchar"))return;expectString(a);const r=strToInt(a);a=t.getObj();expectString(a);const i=a;e.mapOne(r,i)}}function parseBfRange(e,t){for(;;){let a=t.getObj();if(a===n.EOF)break;if((0,n.isCmd)(a,"endbfrange"))return;expectString(a);const r=strToInt(a);a=t.getObj();expectString(a);const i=strToInt(a);a=t.getObj();if(Number.isInteger(a)||"string"==typeof a){const t=Number.isInteger(a)?String.fromCharCode(a):a;e.mapBfRange(r,i,t)}else{if(!(0,n.isCmd)(a,"["))break;{a=t.getObj();const s=[];for(;!(0,n.isCmd)(a,"]")&&a!==n.EOF;){s.push(a);a=t.getObj()}e.mapBfRangeToArray(r,i,s)}}}throw new r.FormatError("Invalid bf range.")}function parseCidChar(e,t){for(;;){let a=t.getObj();if(a===n.EOF)break;if((0,n.isCmd)(a,"endcidchar"))return;expectString(a);const r=strToInt(a);a=t.getObj();expectInt(a);const i=a;e.mapOne(r,i)}}function parseCidRange(e,t){for(;;){let a=t.getObj();if(a===n.EOF)break;if((0,n.isCmd)(a,"endcidrange"))return;expectString(a);const r=strToInt(a);a=t.getObj();expectString(a);const i=strToInt(a);a=t.getObj();expectInt(a);const s=a;e.mapCidRange(r,i,s)}}function parseCodespaceRange(e,t){for(;;){let a=t.getObj();if(a===n.EOF)break;if((0,n.isCmd)(a,"endcodespacerange"))return;if("string"!=typeof a)break;const r=strToInt(a);a=t.getObj();if("string"!=typeof a)break;const i=strToInt(a);e.addCodespaceRange(a.length,r,i)}throw new r.FormatError("Invalid codespace range.")}function parseWMode(e,t){const a=t.getObj();Number.isInteger(a)&&(e.vertical=!!a)}function parseCMapName(e,t){const a=t.getObj();a instanceof n.Name&&(e.name=a.name)}async function parseCMap(e,t,a,i){let s,c;e:for(;;)try{const a=t.getObj();if(a===n.EOF)break;if(a instanceof n.Name){"WMode"===a.name?parseWMode(e,t):"CMapName"===a.name&&parseCMapName(e,t);s=a}else if(a instanceof n.Cmd)switch(a.cmd){case"endcmap":break e;case"usecmap":s instanceof n.Name&&(c=s.name);break;case"begincodespacerange":parseCodespaceRange(e,t);break;case"beginbfchar":parseBfChar(e,t);break;case"begincidchar":parseCidChar(e,t);break;case"beginbfrange":parseBfRange(e,t);break;case"begincidrange":parseCidRange(e,t)}}catch(e){if(e instanceof o.MissingDataException)throw e;(0,r.warn)("Invalid cMap data: "+e);continue}!i&&c&&(i=c);return i?extendCMap(e,a,i):e}async function extendCMap(e,t,a){e.useCMap=await createBuiltInCMap(a,t);if(0===e.numCodespaceRanges){const t=e.useCMap.codespaceRanges;for(let a=0;a>15&1;this.clow=this.clow<<1&65535;this.ct--}while(0==(32768&c));this.a=c;e[t]=r<<1|n;return o}}},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.JpegStream=void 0;var r=a(17),n=a(4),i=a(26),s=a(2);class JpegStream extends r.DecodeStream{constructor(e,t,a){let r;for(;-1!==(r=e.getByte());)if(255===r){e.skip(-1);break}super(t);this.stream=e;this.dict=e.dict;this.maybeLength=t;this.params=a}get bytes(){return(0,s.shadow)(this,"bytes",this.stream.getBytes(this.maybeLength))}ensureBuffer(e){}readBlock(){if(this.eof)return;const e={decodeTransform:void 0,colorTransform:void 0},t=this.dict.getArray("D","Decode");if(this.forceRGB&&Array.isArray(t)){const a=this.dict.get("BPC","BitsPerComponent")||8,r=t.length,n=new Int32Array(r);let i=!1;const s=(1<{Object.defineProperty(t,"__esModule",{value:!0});t.JpegImage=void 0;var r=a(2),n=a(3);class JpegError extends r.BaseException{constructor(e){super(`JPEG error: ${e}`,"JpegError")}}class DNLMarkerError extends r.BaseException{constructor(e,t){super(e,"DNLMarkerError");this.scanLines=t}}class EOIMarkerError extends r.BaseException{constructor(e){super(e,"EOIMarkerError")}}const i=new Uint8Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]),s=4017,o=799,c=3406,l=2276,h=1567,u=3784,d=5793,f=2896;function buildHuffmanTable(e,t){let a,r,n=0,i=16;for(;i>0&&!e[i-1];)i--;const s=[{children:[],index:0}];let o,c=s[0];for(a=0;a0;)c=s.pop();c.index++;s.push(c);for(;s.length<=a;){s.push(o={children:[],index:0});c.children[c.index]=o.children;c=o}n++}if(a+10){b--;return m>>b&1}m=e[t++];if(255===m){const r=e[t++];if(r){if(220===r&&d){t+=2;const r=(0,n.readUint16)(e,t);t+=2;if(r>0&&r!==a.scanLines)throw new DNLMarkerError("Found DNL marker (0xFFDC) while parsing scan data",r)}else if(217===r){if(d){const e=x*(8===a.precision?8:0);if(e>0&&Math.round(a.scanLines/e)>=5)throw new DNLMarkerError("Found EOI marker (0xFFD9) while parsing scan data, possibly caused by incorrect `scanLines` parameter",e)}throw new EOIMarkerError("Found EOI marker (0xFFD9) while parsing scan data")}throw new JpegError(`unexpected marker ${(m<<8|r).toString(16)}`)}}b=7;return m>>>7}function decodeHuffman(e){let t=e;for(;;){t=t[readBit()];switch(typeof t){case"number":return t;case"object":continue}throw new JpegError("invalid huffman sequence")}}function receive(e){let t=0;for(;e>0;){t=t<<1|readBit();e--}return t}function receiveAndExtend(e){if(1===e)return 1===readBit()?1:-1;const t=receive(e);return t>=1<>4;if(0===n)if(o<15){y=receive(o)+(1<>4==0)for(m=0;m<64;m++){x=i[m];a[x]=e[o++]}else{if(t>>4!=1)throw new JpegError("DQT - invalid table spec");for(m=0;m<64;m++){x=i[m];a[x]=(0,n.readUint16)(e,o);o+=2}}u[15&t]=a}break;case 65472:case 65473:case 65474:if(a)throw new JpegError("Only single frame JPEGs supported");o+=2;a={};a.extended=65473===g;a.progressive=65474===g;a.precision=e[o++];const C=(0,n.readUint16)(e,o);o+=2;a.scanLines=t||C;a.samplesPerLine=(0,n.readUint16)(e,o);o+=2;a.components=[];a.componentIds={};const k=e[o++];let v=0,F=0;for(p=0;p0?Math.min(r.xcb,n.PPx-1):Math.min(r.xcb,n.PPx);n.ycb_=a>0?Math.min(r.ycb,n.PPy-1):Math.min(r.ycb,n.PPy);return n}function buildPrecincts(e,t,a){const r=1<=0;t--){d[t]=o[a];a=l[a]}}else d[f++]=d[0]}if(n){l[s]=u;c[s]=c[u]+1;o[s]=d[0];s++;h=s+i&s+i-1?h:0|Math.min(Math.log(s+i)/.6931471805599453+1,12)}u=e;g+=f;if(r