From 1b408555787903f9a7926040b17d56df21f841f6 Mon Sep 17 00:00:00 2001 From: fofolee Date: Sun, 8 May 2022 23:30:07 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BF=AB=E6=8D=B7=E5=91=BD=E4=BB=A4=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1=E6=94=B9=E4=B8=BA=E5=86=85=E7=BD=AE=20feature?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugin/plugin.json | 10 ++- src/App.vue | 4 +- src/assets/feature/api.png | Bin 3586 -> 0 bytes src/components/ConfigurationMenu.vue | 72 ++++++++++++------ src/js/options/defaultProfile.js | 5 +- src/js/options/quickFeatures.js | 7 -- ...quickFeaturesPage.vue => FeaturesPage.vue} | 2 - .../ApiServer.vue => pages/ServerPage.vue} | 34 +++++++-- src/router/routes.js | 27 ++++--- 9 files changed, 105 insertions(+), 56 deletions(-) delete mode 100644 src/assets/feature/api.png rename src/pages/{quickFeaturesPage.vue => FeaturesPage.vue} (90%) rename src/{components/quickFeatures/ApiServer.vue => pages/ServerPage.vue} (72%) diff --git a/plugin/plugin.json b/plugin/plugin.json index 9b0e225..a244e4c 100644 --- a/plugin/plugin.json +++ b/plugin/plugin.json @@ -52,6 +52,14 @@ "分享中心", "ShareCenter" ] + }, + { + "code": "server", + "explain": "配置快捷命令后台服务", + "cmds": [ + "快捷命令服务配置", + "quickcommandServer" + ] } ] -} +} \ No newline at end of file diff --git a/src/App.vue b/src/App.vue index 1e529e4..69b2bef 100644 --- a/src/App.vue +++ b/src/App.vue @@ -83,8 +83,8 @@ export default defineComponent({ this.runCronTask(featureCode, cronExp); }); // 快捷命令服务 - if (this.nativeProfile.apiServerStatus && this.profile.apiServerEnable) { - window.quickcommandHttpServer().run(this.profile.apiServerPort); + if (this.nativeProfile.serverStatus && this.profile.apiServerEnable) { + window.quickcommandHttpServer().run(this.nativeProfile.serverPort); console.log("Server Start..."); } }, diff --git a/src/assets/feature/api.png b/src/assets/feature/api.png deleted file mode 100644 index c4233973fa625c8f643e2262cc4fade9959635e5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3586 zcmV+d4*l_oP)D zVF#=vL1=Y+v{D4y(Y`>%sbIAVB*=&c9Y(FSjwNvf)FM^!RU|;jLPA6cgs{mb+1>j% z{UfhU*v;O%dp4VG_cN23+`H%ZJ7>@Do^yWpcODBwi4rABlqgZ6M2QmR{|yrE0_dUC zTDb*4qm;1+-BC?U7ane&7&3PoZ<#2Da$kUSee zx`w2wF%wT-6YBD?B4P{xqTZ%CEhXC1hM7n)00FdDDkZoR5i-6-gaJwymR||LqC+IB zPiD*$5e5Lq>F-hkkqHBlVF2Lv0A%iDUWyP9G6R%amlw>nR^$Y$XWm_v#Q-h|K(w$= zHYn!ay&|*Jy1XD*J-!Hu0TwJSF9MXkJV?VlYvrc7cdy6{SQ!`4(;u|#tg?q=ORdXR zak5+wD4)z3ox4$%9?{}ELsN!Zy z@EkyLJ#M#hl+4|=W6O7X^^F8m1N2q?hX5w}NYVw+=VK7_)O$5Aw)@hv=GjdXD1=1{ z)I|iCK}cZ5q?CeE^$U*UYZQ^+vHrfLBO1SSVfhSj@`up|koA{On{iMOg*5;jtq{V$I6{8A`;&wF<3+~<6!b9yB(GR_Q95Yf?T2dHMzKh*8m`fkwq2de-8psH&D z^!Q80^Bg7@6d^S|gGsh5Nz2GUK~XVyUehz#?2r;^I(PTmpgjKB-24Pit$oyum6zW(L@^WAizV;JJ%3;5g(L7Q$qTW0h6N ziH$WOub>cwyU0nT1oR>387ch0bQE-p@-qO2yy0eBa*>db$TFKzAt5ml*_PZP_Xx0k zS55V2Ec0P%fIZu`T_7NT?!Qhkn~|EXWg2&El9rxHZ2~EB1s`?bO{05)n#tOcfBkfPGN0+B1uvkYm9N%3*W%m{p*zz`!MDcV!R1U zZ@meBdF^dUA}%2g zgy?Tjh8PifSrab0KP5j0wfnx%tmmEG`=F}5ot8N{5!YN%0--OqpJ0l`+^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X^y>t2~&t0MRY11csg)akBXYIy=}*hL0v49d@)dHxIv^q=6v zl38TSoX(C8G&UU7GUw}51Yz=rue|hquz50R0SZ-q13#4y0E(jGSi=#VZDkrxVM6Qa z(`YzySnGtlk(XsA8xezU0duVtIXuV_0J;`lri?QqXHuTl<6%OEtjK7#+0fpu+p%#I z9+zlc1?`KV!^S*>7($eGy+@X{pKpW1(TU8gY?#fdK!7JB27~>=1vH%)@bh&+2+mU_ z_%(__cR_VEn;JNx&H>Ze8b? z_R&gIGOw;?Q$w&t8B@nruG&y_UGG*MbC2>?S-Ve}K zfTpwW#@?}&{jfT?^^x^2rt>l4BC4oX0&Ozmhap3*!n`Y?A@5a0DHgmGL5+Dx%@Z6j*_Kz;^$HNF|6nI$` zgx?41GtXO8`4}MxC>Bo$T~qs7^}0Z0e_XaSO%}Od^=-@Q2u0-sA^e$-QtR>p1+x3Y znrg2r>9jKMuF7J<<4_>7R6)rHZ&cL>lYg(9EyS=GaJ>-`zq3+mt*nRc-w+^&>T0%3 z2}yw%68@7@wegl-0SZ;OOgM-P1E}iTdPR7S*DVtcBBBcdfKqFv4S?3AaZPnKRg=K* zc*#%^87%++p?F7YS_<+OBB1ht2r>W&)!e1 - + + 启用后,在主输入框输入「快捷命令服务」可以进入配置一个后台服务
- 通过本地监听{{ - $root.profile.apiServerPort - }}端口的形式,接收用户传送过来的参数,然后根据参数执行不同的操作 + >通过本地监听 + {{ $root.nativeProfile.serverPort }} + 端口的形式,接收用户传送过来的参数,然后根据参数执行不同的操作
- 本功能的意义在于,将 utools - 的接口暴露出来,可以通过命令行等外部途径
- 直接启用 ubrowser 或者直接redirect 到相应的插件
- 需要配置插件跟随 utools 启动和保留后台 + 需要配置插件跟随 utools 启动和保留后台
+ 也可在主输入框通过关键字「快捷命令服务配置」进入
-
+ + + + + + + + + + 一个可以直接运行代码的代码编辑器
+ 也可在主输入框输入关键字「RunCode」进入 +
+
@@ -384,6 +405,7 @@ export default { showAbout: false, showPanelConf: false, features: features, + redirect: utools.redirect, }; }, computed: { @@ -457,7 +479,7 @@ export default { this.$root.utools.whole.setFeature(_.cloneDeep(this.features[type])); if (type === "apiServer" && !this.$root.profile.apiServerEnable) { window.quickcommandHttpServer().stop(); - this.$root.nativeProfile.apiServerStatus = false; + this.$root.nativeProfile.serverStatus = false; } }, }, diff --git a/src/js/options/defaultProfile.js b/src/js/options/defaultProfile.js index d2f51d6..7468960 100644 --- a/src/js/options/defaultProfile.js +++ b/src/js/options/defaultProfile.js @@ -12,11 +12,10 @@ export default { quickUrlTag: "网址", pluNickNameEnable: false, pluNickNameTag: "别名", - apiServerEnable: false, - apiServerPort: 33442, }, native: { crontabs: {}, - apiServerStatus: false + serverPort: 33442, + serverStatus: false } } \ No newline at end of file diff --git a/src/js/options/quickFeatures.js b/src/js/options/quickFeatures.js index f77a6f3..00a844e 100644 --- a/src/js/options/quickFeatures.js +++ b/src/js/options/quickFeatures.js @@ -42,13 +42,6 @@ const quickFeatures = { cmds: ["插件别名"], icon: require("../../assets/feature/plugin.png"), platform: ["win32", "darwin", "linux"], - }, - apiServer: { - code: "feature_apiServer", - explain: "配置快捷命令后台服务", - cmds: ["快捷命令服务配置", "quickcommandServer"], - icon: require("../../assets/feature/api.png"), - platform: ["win32", "darwin", "linux"], } } diff --git a/src/pages/quickFeaturesPage.vue b/src/pages/FeaturesPage.vue similarity index 90% rename from src/pages/quickFeaturesPage.vue rename to src/pages/FeaturesPage.vue index 52004a0..268c0a2 100644 --- a/src/pages/quickFeaturesPage.vue +++ b/src/pages/FeaturesPage.vue @@ -4,7 +4,6 @@