From 768982f6e3242866a9b7a6c979fdcd1b2d9a55d4 Mon Sep 17 00:00:00 2001 From: kubbo <390378816@qq.com> Date: Fri, 17 Feb 2023 11:38:30 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4ws=E8=BF=94=E5=9B=9E=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/websocket/custom/getZip.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/websocket/custom/getZip.js b/src/websocket/custom/getZip.js index b3498ba..13a0e7e 100644 --- a/src/websocket/custom/getZip.js +++ b/src/websocket/custom/getZip.js @@ -17,23 +17,23 @@ const handleZip = (id, ws) => { }, 6000) } - set(progress, remark) { + set(progress, id) { if (this.timer) clearInterval(this.timer) this.count = progress - sendMessage({code: 0, progress: this.count, remark}) + sendMessage({code: 0, progress: this.count, id}) this.timer = setInterval(() => { - sendMessage({code: 0, progress: ++this.count, remark}) + sendMessage({code: 0, progress: ++this.count, id}) }, 4000) } stop(row) { if (this.timer) clearInterval(this.timer) - sendMessage({code: 1, row}) + sendMessage({code: 1, row, id: row.id}) } finish(row) { if (this.timer) clearInterval(this.timer) - sendMessage({code: 0, progress: 100, row}) + sendMessage({code: 0, progress: 100, row, id: row.id}) } } @@ -47,12 +47,12 @@ const handleZip = (id, ws) => { let path = `../${buildPath}`, {dist} = info dist = dist || `../zips/${info.name}v${info.version || "1.0.0"}` Promise.all([db.query(`update node_custom_config set download=null,error=null,zipTime='${dayjs().format("YYYY-MM-DD HH:mm:ss")}' where ${uniCon}`), execute(`./shell/update.sh ${info.name} ${path}`, signal)]) - .then(cmd => progress.set(30, cmd)) + .then(cmd => progress.set(30, info?.id)) .then(() => execute(`cd ${path}&&npm run apps&&node bin/pages.js ${id}&&npm run build`, signal)) - .then(cmd => progress.set(70, cmd)) + .then(cmd => progress.set(70, info?.id)) .then(() => fse.emptyDir(dist)) .then(() => execute(`./shell/move.sh ${info.type} ${path} ${dist}`, signal)) - .then(cmd => progress.set(90, cmd)) + .then(cmd => progress.set(90, info?.id)) .then(() => db.query(`update node_custom_config set download='${dayjs().format("YYYY-MM-DD HH:mm:ss")}',error='' where ${uniCon}`)) .then(() => db.detail({table: "node_custom_config", id})) .then(row => progress.finish(row))