From 3373911b7b18d61f075b8e6746e9b912971ba8ae Mon Sep 17 00:00:00 2001 From: whyour Date: Tue, 11 May 2021 23:33:57 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=87=AA=E5=8A=A8=E7=BC=96?= =?UTF-8?q?=E8=AF=91=20action?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ build.yml | 34 ++++++++++++++++++++++++++++++++++ src/pages/crontab/index.tsx | 1 + src/pages/crontab/logModal.tsx | 2 +- 3 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/ build.yml diff --git a/.github/workflows/ build.yml b/.github/workflows/ build.yml new file mode 100644 index 00000000..4e9737d8 --- /dev/null +++ b/.github/workflows/ build.yml @@ -0,0 +1,34 @@ +name: build static + +on: + push: + branches: [ master ] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v1 + with: + node-version: '14' + + - name: build front and back + run: | + yarn install + yarn build + yarn build-back + + - name: copy to static repo + env: + GITHUB_REPO: gitee.com/whyour/qinglong-static + run: | + mkdir -p static + cd ./static + cp -rf ../dist ./ && cp -rf ../build ./ + git init && git add . + git config user.name "whyour" + git config user.email "imwhyour@gmail.com" + git add . + git commit -m "copy static at $(date +'%Y-%m-%d %H:%M:%S')" + git push --force --quiet "https://whyour:${{ secrets.API_TOKEN }}@${GITHUB_REPO}.git" master:master \ No newline at end of file diff --git a/src/pages/crontab/index.tsx b/src/pages/crontab/index.tsx index 0d9288d1..2dc52192 100644 --- a/src/pages/crontab/index.tsx +++ b/src/pages/crontab/index.tsx @@ -284,6 +284,7 @@ const Crontab = () => { const result = [...value]; result.splice(index, 1, { ...record, + pid: null, status: CrontabStatus.idle, }); setValue(result); diff --git a/src/pages/crontab/logModal.tsx b/src/pages/crontab/logModal.tsx index a5323890..6e27246d 100644 --- a/src/pages/crontab/logModal.tsx +++ b/src/pages/crontab/logModal.tsx @@ -31,7 +31,7 @@ const CronLogModal = ({ if (localStorage.getItem('logCron') === cron._id) { const log = data.data as string; setValue(log || '暂无日志'); - if (log && !log.includes('执行结束')) { + if (log && !log.includes('执行结束') && visible) { setTimeout(() => { getCronLog(); }, 2000);