From 8cd035c020888adf1e22144fbc53c9b927ec6443 Mon Sep 17 00:00:00 2001 From: fofolee Date: Sun, 17 Apr 2022 21:03:25 +0800 Subject: [PATCH] =?UTF-8?q?=E8=87=AA=E5=8A=A8=E9=87=8D=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/quickFeatures/ApiServer.vue | 47 ++++++++++++++-------- 1 file changed, 30 insertions(+), 17 deletions(-) diff --git a/src/components/quickFeatures/ApiServer.vue b/src/components/quickFeatures/ApiServer.vue index dc0fbaa..47e4195 100644 --- a/src/components/quickFeatures/ApiServer.vue +++ b/src/components/quickFeatures/ApiServer.vue @@ -6,8 +6,10 @@ ref="editor" @typing=" (val) => { - $profile.quickFeatures.apiServer.cmd = val; - serverStatus && (needRestart = true); + if ($profile.quickFeatures.apiServer.cmd !== val) { + $profile.quickFeatures.apiServer.cmd = val; + } + restartServer(); } " :style="{ @@ -36,13 +38,13 @@ 的参数,均会作为本脚本里的变量 - + @@ -50,9 +52,9 @@ flat color="warning" icon="restart_alt" - v-else-if="serverStatus && needRestart" + v-else-if="serverStatus && !!restartTimer" @click="restartServer" - label="重启服务" + label="正在重载" /> { + window.quickcommandHttpServer().stop(); + window + .quickcommandHttpServer() + .run( + this.$profile.quickFeatures.apiServer.cmd, + this.$profile.quickFeatures.apiServer.port + ); + this.restartTimer = null; + }, 1000); + }, + showHelp() { + utools.ubrowser + .goto("https://www.yuque.com/fofolee-awga0/cpbg1m/bg31vl#GNjEg") + .run({ + width: 1380, + height: 750, + }); }, }, };