diff --git a/.gitignore b/.gitignore index 45d064eaea9c39de066256dec13bc753d3c981b7..25c8fdbaba62c31aacfa2307975b06fbfd017485 100644 --- a/.gitignore +++ b/.gitignore @@ -1,27 +1,2 @@ -.DS_Store node_modules -/dist -mock - - -# local env files -.env.local -.env.*.local - -# Log files -npm-debug.log* -yarn-debug.log* -yarn-error.log* -pnpm-debug.log* - -# Editor directories and files -.idea -.vscode -*.suo -*.ntvs* -*.njsproj -*.sln -*.sw? -*.gitignore - -*package-lock.json +package-lock.json \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 98e194154625340b5737b15e6ee6b38822d86666..07a2773a9d04ac695eb7a2cc5c5b80108c5eed4b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM node:alpine as Builder +FROM node:lts-alpine3.14 as Builder MAINTAINER zhangxiaopan @@ -6,10 +6,11 @@ RUN mkdir -p /home/openeuler/crystal-ci-web WORKDIR /home/openeuler/crystal-ci-web COPY . /home/openeuler/crystal-ci-web -RUN npm install && \ +RUN npm i --legacy-peer-deps --registry=https://mirrors.huaweicloud.com/repository/npm/ && \ + npm install && \ npm run build -FROM nginx:1.19.2 +FROM nginx:1.20.0 COPY --from=Builder /home/openeuler/crystal-ci-web/dist /usr/share/nginx/html/ RUN chmod -R 755 /usr/share/nginx/html diff --git a/README.en.md b/README.en.md index 501a9b902529f4b4299ffec59e532d181182860a..30c50ae2862f7b944ffb4ec20ccd69f82bc32cab 100644 --- a/README.en.md +++ b/README.en.md @@ -6,11 +6,18 @@ Crystal CI #### Software Architecture Software architecture description -#### Installation - -1. xxxx -2. xxxx -3. xxxx +#### Deploy in local + +1. configuration + - crystal-ci/src/utils/axios.utils.js: change 'const BASEURL' like + ``` + https://$you_host:$you_web-backend_port; # if you hadn't changed web-bachend port, you can use default port: 20003 + ``` + - crystal-ci/src/utils/baseUrl.js: change export const BASEURLRESULT like + ``` + http://$your_host:$your_srv_http_result_port'; # if you hadn't changed srv-http-result port, you can use default port: 20007 + ``` +2. run: crystal-ci/build && crystal-ci/start #### Instructions diff --git a/README.md b/README.md index a7d16ebb899ac5694028d001e553608c8426c5f4..5497102431096abf76ca75590121ff4e6b4aae19 100644 --- a/README.md +++ b/README.md @@ -1,37 +1,9 @@ # crystal-ci -#### 介绍 -Crystal CI - -#### 软件架构 -软件架构说明 - - -#### 安装教程 - -1. xxxx -2. xxxx -3. xxxx - #### 使用说明 -1. xxxx -2. xxxx -3. xxxx - -#### 参与贡献 - -1. Fork 本仓库 -2. 新建 Feat_xxx 分支 -3. 提交代码 -4. 新建 Pull Request - - -#### 码云特技 +1. 安装node.js(自带npm) +2. cd crystal-ci +3. npm install +4. npm run serve -1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md -2. 码云官方博客 [blog.gitee.com](https://blog.gitee.com) -3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解码云上的优秀开源项目 -4. [GVP](https://gitee.com/gvp) 全称是码云最有价值开源项目,是码云综合评定出的优秀开源项目 -5. 码云官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help) -6. 码云封面人物是一档用来展示码云会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) diff --git a/build b/build new file mode 100755 index 0000000000000000000000000000000000000000..15d64046120446fc39108d36cc607c5c92d43d1c --- /dev/null +++ b/build @@ -0,0 +1,8 @@ +#!/bin/bash +# SPDX-License-Identifier: MulanPSL-2.0+ +# Copyright (c) 2020 Huawei Technologies Co., Ltd. All rights reserved. + +yum -y install nodejs +npm install +npm run build +docker build -t web . diff --git a/deploy/nginx/nginx.conf b/deploy/nginx/nginx.conf index 1c23ea1ca8ad2060ea5f04ca120f121251a2587e..4ef0115d8959153bed23089cb73e9921fdd2e33d 100644 --- a/deploy/nginx/nginx.conf +++ b/deploy/nginx/nginx.conf @@ -53,7 +53,7 @@ http { add_header Cache-Control no-store; add_header Pragma no-cache; add_header X-Frame-Options "SAMEORIGIN"; - add_header Content-Security-Policy "script-src 'self' 'unsafe-eval';object-src 'none';frame-ancestors 'self'"; + add_header Content-Security-Policy "script-src 'self' 'unsafe-eval' *.baidu.com ers.baidu.com www.googletagmanager.com 'unsafe-inline';object-src 'none';frame-ancestors 'self'"; proxy_hide_header X-Powered-By; diff --git a/package.json b/package.json index c5450726e45fdab204c8d67a9786c7dee091e801..a679e9130b79981db2c77679a42a3c5c7960ff91 100644 --- a/package.json +++ b/package.json @@ -5,16 +5,22 @@ "scripts": { "serve": "vue-cli-service serve", "build": "vue-cli-service build", - "lint": "vue-cli-service lint" + "lint": "vue-cli-service lint", + "test": "vue-cli-service build --mode test" }, "dependencies": { "axios": "^0.20.0", "core-js": "^3.6.5", + "echarts": "^4.9.0", "element-ui": "^2.13.2", + "file-saver": "^2.0.5", + "less-loader": "^7.0.1", "vue": "^2.6.11", "vue-axios": "^2.1.5", - "less-loader": "^7.0.1", - "vue-router": "^3.2.0" + "vue-echarts": "^6.0.0-rc.6", + "vue-router": "^3.2.0", + "xlsx": "^0.17.4", + "xlsx-style": "^0.8.13" }, "devDependencies": { "@vue/cli-plugin-babel": "~4.5.0", @@ -22,10 +28,11 @@ "@vue/cli-plugin-router": "~4.5.0", "@vue/cli-service": "~4.5.0", "babel-eslint": "^10.1.0", + "babel-plugin-component": "^1.1.1", "eslint": "^6.7.2", "eslint-plugin-vue": "^6.2.2", - "node-sass": "^4.14.1", - "sass-loader": "^10.0.2", + "less": "^3.0.4", + "less-loader": "^5.0.0", "vue-template-compiler": "^2.6.11" } } diff --git a/public/favicon.ico b/public/favicon.ico deleted file mode 100644 index df36fcfb72584e00488330b560ebcf34a41c64c2..0000000000000000000000000000000000000000 Binary files a/public/favicon.ico and /dev/null differ diff --git a/public/img/footer.png b/public/img/footer.png index 99ac288ee1f8f4b3018ead2325899bdc3f7aac65..920add58c7d501493210ad9abaf512726dfd19d4 100644 Binary files a/public/img/footer.png and b/public/img/footer.png differ diff --git a/public/img/header.png b/public/img/header.png index 11298e5636d3413cbdff4adc3bef9cd8ec4900aa..eaf1e05692099fe12da5038d4beb214160fc6885 100644 Binary files a/public/img/header.png and b/public/img/header.png differ diff --git a/public/img/home_header.png b/public/img/home_header.png index 2d0b26866cd42c510a8f195830412d414af710c6..dd4721c1240932aa2c722398b1bed0e48bce2808 100644 Binary files a/public/img/home_header.png and b/public/img/home_header.png differ diff --git a/public/index.html b/public/index.html index 06b08901d7931511bf956fdc0f0f64599599ea6f..2148b6b28e41aae32e6e22b98dca1cfb8a305aff 100644 --- a/public/index.html +++ b/public/index.html @@ -3,10 +3,13 @@ - Crystal CI + Compass CI + + + - + diff --git a/public/style/base.css b/public/style/base.css index 4f5e4a9700de997779b8d8499df6884348bed287..396b47ca094035a43e153fc730800da9edc79268 100644 --- a/public/style/base.css +++ b/public/style/base.css @@ -1,5 +1,8 @@ /* CSS Document */ + + /*css reset*/ + html { box-sizing: border-box; } @@ -47,6 +50,21 @@ img { border: 0; } +pre { + font-family: Consolas; + font-size: 14px; + white-space: pre-wrap; + /* css-3 */ + white-space: -moz-pre-wrap; + /* Mozilla, since 1999 */ + white-space: -pre-wrap; + /* Opera 4-6 */ + white-space: -o-pre-wrap; + /* Opera 7 */ + word-wrap: break-word; + /* Internet Explorer 5.5+ */ +} + address, caption, cite, @@ -90,7 +108,9 @@ acronym { border: 0; } + /*定位*/ + .tl { text-align: left; } diff --git a/public/style/public.css b/public/style/public.css index fdd39d742ce633fdca2a2ae7be36b61c6a8c25ed..efd30985ee2d6b8787852d74f38ebc8b9fc02cb7 100644 --- a/public/style/public.css +++ b/public/style/public.css @@ -5,7 +5,7 @@ .title { font-size: 36px; - margin: 150px 0 20px; + margin: 50px 0 20px; } .summary { @@ -29,8 +29,31 @@ margin-top: 30px; width: 100%; } + .wrap { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; +} + +.ci-logo { + margin-left: 10%; + margin-top: 25px; + width: 40px; + height: 40px; + border-radius: 50%; + border: 2px solid #fff; + background-color: rgba(0, 0, 0, 0); + color: #fff; + font-size: 20px; + font-weight: bold; + text-align: center; + line-height: 36px; + cursor: pointer; +} + +.nav-div { + float: right; + margin-right: 10%; + border-bottom: none; } \ No newline at end of file diff --git a/src/App.vue b/src/App.vue index cca9ca0c8ddb9cdb977fa6cb11f5579a92f02b70..cb5b5ff695e7c021e1144cf88f10658aeeabe745 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,24 +1,41 @@ - diff --git a/src/api/jobs.js b/src/api/jobs.js index 7f3f59ed643473649dcb7391a259c152f9bda7ff..c3c5815147978283659bf6e82669ee92d5267071 100644 --- a/src/api/jobs.js +++ b/src/api/jobs.js @@ -1,11 +1,62 @@ /** * @file jobs接口文档入口 * */ -import {service} from '../utils/axios.utils'; +import { service } from '../utils/axios.utils'; export function getJobs(data) { return service({ url: '/get_jobs', method: 'get', params: data }); -} \ No newline at end of file +} + +export function getSrpms(data) { + return service({ + url: '/srpm_info', + method: 'get', + params: data + }); +} + +export function getJobsSummary(data) { + return service({ + url: '/get_jobs_summary', + method: 'get', + params: data + }); +} + +export function getErrorList(data) { + return service({ + url: '/get_job_error', + method: 'get', + params: data + }); +} +export function getPerformanceResult(data) { + return service({ + url: '/performance_result', + method: 'post', + data: data, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded' + } + }); +} +export function QueryField(data) { + return service({ + url: '/query_field', + method: 'post', + data: data, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded' + } + }); +} +export function getHostInfo(data) { + return service({ + url: '/host_info', + method: 'get', + params: data + }); +} diff --git a/src/api/testMatrix.js b/src/api/testMatrix.js new file mode 100644 index 0000000000000000000000000000000000000000..086d389572b401a9f6530905d49a1690186668d4 --- /dev/null +++ b/src/api/testMatrix.js @@ -0,0 +1,11 @@ +/** + * @file testMatrix接口文档入口 + * */ +import { service } from '../utils/axios.utils'; +export function testMatrix(data) { + return service({ + url: '/test_matrix', + method: 'get', + params: data + }); +} diff --git a/src/assets/fail.png b/src/assets/fail.png new file mode 100644 index 0000000000000000000000000000000000000000..1a8a251ef9962df4be46500a8c39a47f5c223719 Binary files /dev/null and b/src/assets/fail.png differ diff --git a/src/assets/null.png b/src/assets/null.png new file mode 100644 index 0000000000000000000000000000000000000000..fe5d9b73f86e46fff317e02456220ea85f3c2e45 Binary files /dev/null and b/src/assets/null.png differ diff --git a/src/assets/success.png b/src/assets/success.png new file mode 100644 index 0000000000000000000000000000000000000000..c074d2c12f396a3d07020887dc173b7cb766b597 Binary files /dev/null and b/src/assets/success.png differ diff --git a/src/components/Footer/index.vue b/src/components/Footer/index.vue index efbe6266548841327cee4f96d284cbe245d572b6..5b43701077f9505e68236110a0930ca3850d315b 100644 --- a/src/components/Footer/index.vue +++ b/src/components/Footer/index.vue @@ -1,130 +1,154 @@ - diff --git a/src/components/Header/index.vue b/src/components/Header/index.vue index 9efc6e0be2c0f349b37b07ca11d4a7b5d2229524..61ea3f363503baacb6bf8cbdc16887ab317012ac 100644 --- a/src/components/Header/index.vue +++ b/src/components/Header/index.vue @@ -1,7 +1,8 @@ @@ -24,8 +25,8 @@ export default { }; - diff --git a/src/components/error/error.vue b/src/components/error/error.vue new file mode 100644 index 0000000000000000000000000000000000000000..dd3cf7df0c50f67121f9297f91d7178e30357fd5 --- /dev/null +++ b/src/components/error/error.vue @@ -0,0 +1,26 @@ + + + \ No newline at end of file diff --git a/src/components/homeHeader/index.vue b/src/components/homeHeader/index.vue index 302b700c1fb1db5a103d129ede7309a821684466..70708c8fbf1730585d1fcfe050c07921f605565c 100644 --- a/src/components/homeHeader/index.vue +++ b/src/components/homeHeader/index.vue @@ -1,5 +1,20 @@