From 88562848d3e08d57b199ce2108ba40322ae78817 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E9=A1=BA=E5=81=A5?= Date: Fri, 15 Apr 2022 08:05:08 +0000 Subject: [PATCH 1/2] =?UTF-8?q?build:=20=E6=96=B0=E5=A2=9E=20.gitlab-ci.ym?= =?UTF-8?q?l=20file?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitlab-ci.yml | 99 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 000000000..a2c1a0236 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,99 @@ +# docker镜像 +image: git.mesalab.cn:7443/nezha/nz-build-env:1.3 +# 定义全局变量 +variables: + MINIO_HOST: 'http://192.168.44.36:2020/' + MINIO_USER: 'admin' + MINIO_PWD: "Nezha@02!" +# 依赖的docker服务 +# services: +# - mariadb +# - redis +# 开始执行脚本前所需执行脚本 +before_script: + - echo "begin ci" +# 脚本执行完后的钩子,执行所需脚本 +after_script: + - echo "end ci" +# 该ci pipeline适合的场景 +stages: + - build + - test +# maven setting /usr/share/maven/conf/settings.xml +cache: + paths: + - /builds/nezha/nezha-fronted/nezha-fronted/node_modules/ + + +# dev 分支 +dev_build: + # 所需执行的脚本 + script: + - env | sort + - pwd + - cd nezha-fronted + + # 安装 npm 依赖文件 + - echo "npm install ..." + - npm install --registry=http://registry.npmmirror.com + - echo "npm run build" + - npm run build + + - cd /builds/nezha/nezha-fronted/nezha-fronted/dist + - rm -rf nz-gui*.zip + - export FILE_NAME=nz-gui-$CI_COMMIT_REF_NAME-$CI_COMMIT_SHORT_SHA.zip + # 生成 git log 日志文件 + # - sed -i 's++更新记录\n+g' ./index.html; + - echo "
" > ./static/git-log.html
+    - "git log -100 --pretty=format:'%ad : %s' >> ./static/git-log.html"
+    - echo "
" >> ./static/git-log.html + - zip -q -r $FILE_NAME ./* + + # 将 dist zip 上传到 minio + - mc alias set nz $MINIO_HOST $MINIO_USER $MINIO_PWD + - mc cp $FILE_NAME nz/ci-cd/nz-gui/$FILE_NAME + - mc cp $FILE_NAME nz/ci-cd/nz-gui/nz-gui-$CI_COMMIT_REF_NAME-latest.zip + artifacts: + name: "nz-gui-$CI_COMMIT_REF_NAME-$CI_COMMIT_SHORT_SHA" + when: on_success + paths: + - /builds/nezha/nezha-fronted/nezha-fronted/dist/nz-gui*.zip + expire_in: 1 day + # 在哪个分支上可用 + only: + - /^dev-.*$/i + # 指定哪个ci runner跑该工作 + tags: + - nezha + + +# release build +rel_build: + stage: build + # 所需执行的脚本 + script: + - env | sort + - pwd + - echo "npm install ..." + - cd nezha-fronted + - npm install --registry=http://registry.npmmirror.com + - echo "npm run build" + - npm run build + - cd /builds/nezha/nezha-fronted/nezha-fronted/dist + - mv nz-gui*.zip nz-gui-$CI_COMMIT_SHORT_SHA.zip + - md5sum nz-gui-$CI_COMMIT_SHORT_SHA.zip > nz-gui-$CI_COMMIT_SHORT_SHA.zip.md5sum.txt + - mc alias set nz $MINIO_HOST $MINIO_USER $MINIO_PWD + - mc cp nz-gui-$CI_COMMIT_SHORT_SHA.zip nz/release/nz-gui/nz-gui-$CI_COMMIT_SHORT_SHA.zip + - mc cp nz-gui-$CI_COMMIT_SHORT_SHA.zip.md5sum.txt nz/release/nz-gui/nz-gui-$CI_COMMIT_SHORT_SHA.zip.md5sum.txt + artifacts: + name: "nz-gui-$CI_COMMIT_REF_NAME-$CI_COMMIT_SHORT_SHA" + when: on_success + paths: + - /builds/nezha/nezha-fronted/nezha-fronted/dist/nz-gui-$CI_COMMIT_SHORT_SHA.zip + expire_in: 1 week + # 在哪个分支上可用 + only: + - /^rel-.*$/i + # 指定哪个ci runner跑该工作 + tags: + - nezha \ No newline at end of file From 9c5df8a3540e6b7cf9f7cf3313078b91e314f13b Mon Sep 17 00:00:00 2001 From: zhangyu Date: Fri, 15 Apr 2022 16:29:23 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix=EF=BC=9A=E4=BF=AE=E6=94=B9=E5=AF=BC?= =?UTF-8?q?=E5=87=BApdf=E7=9A=84=E6=96=87=E4=BB=B6=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nezha-fronted/src/components/chart/chartMixin.js | 5 +++-- .../src/components/common/bottomBox/tabs/panelTabNew.vue | 1 + nezha-fronted/src/components/page/dashboard/panel.vue | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/nezha-fronted/src/components/chart/chartMixin.js b/nezha-fronted/src/components/chart/chartMixin.js index 3359143d1..dab16c545 100644 --- a/nezha-fronted/src/components/chart/chartMixin.js +++ b/nezha-fronted/src/components/chart/chartMixin.js @@ -123,7 +123,8 @@ export default { alias += chartInfo.elements[expressionIndex].expression } // proj_status_ - const name = alias + '-' + dataIndex + const legendIndex = expressionIndex + 'and' + dataIndex + const name = alias + '-' + legendIndex // 若需要统计,处理统计数据 const statisticsTypes = chartInfo.param.legend ? chartInfo.param.legend.values : '' @@ -292,7 +293,7 @@ export default { } }, mounted () { - + this.chartId = `${this.chartInfo.id}${this.isFullscreen ? '-fullscreen' : ''}` }, beforeDestroy () { diff --git a/nezha-fronted/src/components/common/bottomBox/tabs/panelTabNew.vue b/nezha-fronted/src/components/common/bottomBox/tabs/panelTabNew.vue index e36add882..7106104be 100644 --- a/nezha-fronted/src/components/common/bottomBox/tabs/panelTabNew.vue +++ b/nezha-fronted/src/components/common/bottomBox/tabs/panelTabNew.vue @@ -180,6 +180,7 @@ export default { return { fromRoute, pdfId: 'pdfDom', + htmlTitle: 'panel', panelTabLoading: false, showTopBtn: false, // top按钮 visible: false, diff --git a/nezha-fronted/src/components/page/dashboard/panel.vue b/nezha-fronted/src/components/page/dashboard/panel.vue index acf705790..65f6cef78 100644 --- a/nezha-fronted/src/components/page/dashboard/panel.vue +++ b/nezha-fronted/src/components/page/dashboard/panel.vue @@ -819,7 +819,7 @@ export default { let dom = document.getElementsByClassName(this.pdfId)[0] if (dom) { // dom = dom.getElementsByClassName('vue-grid-layout')[0] - this.htmlTitle = this.panel.name + this.htmlTitle = this.showPanel.name this.scrollbarWrap.scrollTop = this.scrollbarWrap.scrollHeight this.$refs.chartList.onScroll(this.scrollbarWrap.scrollTop) console.log(dom.children)