From 447241f3932f161a78c965a86a8f9140c5543ae1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E7=8E=8B=E8=89=AF?= <841369634@qq.com>
Date: Sat, 30 Nov 2024 21:57:24 +0800
Subject: [PATCH 1/7] =?UTF-8?q?optimize:=20`api`=20=E5=B8=B8=E9=87=8F?=
=?UTF-8?q?=E5=AE=9A=E4=B9=89=E6=8F=90=E5=89=8D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
packages/mitmproxy/src/index.js | 84 ++++++++++++++++-----------------
1 file changed, 42 insertions(+), 42 deletions(-)
diff --git a/packages/mitmproxy/src/index.js b/packages/mitmproxy/src/index.js
index 4e0dba6..e46bd79 100644
--- a/packages/mitmproxy/src/index.js
+++ b/packages/mitmproxy/src/index.js
@@ -7,48 +7,6 @@ const { fireError, fireStatus } = require('./utils/util.process')
let servers = []
-function registerProcessListener () {
- process.on('message', (msg) => {
- log.info('child get msg:', JSON.stringify(msg))
- if (msg.type === 'action') {
- api[msg.event.key](msg.event.params)
- } else if (msg.type === 'speed') {
- speedTest.action(msg.event)
- }
- })
-
- process.on('SIGINT', () => {
- log.info('on sigint : closed ')
- process.exit(0)
- })
-
- // 避免异常崩溃
- process.on('uncaughtException', (err) => {
- if (err.code === 'ECONNABORTED') {
- // log.error(err.errno)
- return
- }
- log.error('Process uncaughtException:', err)
- })
-
- process.on('unhandledRejection', (err, p) => {
- log.info('Process unhandledRejection at: Promise', p, 'err:', err)
- // application specific logging, throwing an error, or other logic here
- })
- process.on('uncaughtExceptionMonitor', (err, origin) => {
- log.info('Process uncaughtExceptionMonitor:', err, origin)
- })
- process.on('exit', (code, signal) => {
- log.info('代理服务进程被关闭:', code, signal)
- })
- process.on('beforeExit', (code, signal) => {
- console.log('Process beforeExit event with code: ', code, signal)
- })
- process.on('SIGPIPE', (code, signal) => {
- log.warn('sub Process SIGPIPE', code, signal)
- })
-}
-
const api = {
async start (config) {
const proxyOptions = ProxyOptions(config)
@@ -119,6 +77,48 @@ const api = {
},
}
+function registerProcessListener () {
+ process.on('message', (msg) => {
+ log.info('child get msg:', JSON.stringify(msg))
+ if (msg.type === 'action') {
+ api[msg.event.key](msg.event.params)
+ } else if (msg.type === 'speed') {
+ speedTest.action(msg.event)
+ }
+ })
+
+ process.on('SIGINT', () => {
+ log.info('on sigint : closed ')
+ process.exit(0)
+ })
+
+ // 避免异常崩溃
+ process.on('uncaughtException', (err) => {
+ if (err.code === 'ECONNABORTED') {
+ // log.error(err.errno)
+ return
+ }
+ log.error('Process uncaughtException:', err)
+ })
+
+ process.on('unhandledRejection', (err, p) => {
+ log.info('Process unhandledRejection at: Promise', p, 'err:', err)
+ // application specific logging, throwing an error, or other logic here
+ })
+ process.on('uncaughtExceptionMonitor', (err, origin) => {
+ log.info('Process uncaughtExceptionMonitor:', err, origin)
+ })
+ process.on('exit', (code, signal) => {
+ log.info('代理服务进程被关闭:', code, signal)
+ })
+ process.on('beforeExit', (code, signal) => {
+ console.log('Process beforeExit event with code: ', code, signal)
+ })
+ process.on('SIGPIPE', (code, signal) => {
+ log.warn('sub Process SIGPIPE', code, signal)
+ })
+}
+
module.exports = {
...api,
config: proxyConfig,
From b57ddec8c005c9195911726893a74c8271da1dec Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E7=8E=8B=E8=89=AF?= <841369634@qq.com>
Date: Sun, 1 Dec 2024 03:58:31 +0800
Subject: [PATCH 2/7] =?UTF-8?q?feature:=20=E6=96=B0=E5=A2=9E=E5=8F=AF?=
=?UTF-8?q?=E9=85=8D=E7=BD=AE=E5=8C=96=E7=9A=84=20`=E5=B8=AE=E5=8A=A9?=
=?UTF-8?q?=E4=B8=AD=E5=BF=83`=20=E9=A1=B5=E9=9D=A2=20(#408)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
packages/core/src/config/index.js | 11 ++++++
packages/gui/src/view/App.vue | 6 +--
.../gui/src/view/components/tree-node.vue | 25 +++++++++++++
packages/gui/src/view/pages/help.vue | 37 +++++++++++++++++++
packages/gui/src/view/router/index.js | 2 +
packages/gui/src/view/router/menu.js | 1 +
packages/gui/src/view/style/index.scss | 26 +++++++++++++
7 files changed, 105 insertions(+), 3 deletions(-)
create mode 100644 packages/gui/src/view/components/tree-node.vue
create mode 100644 packages/gui/src/view/pages/help.vue
diff --git a/packages/core/src/config/index.js b/packages/core/src/config/index.js
index 8417d3a..5020f34 100644
--- a/packages/core/src/config/index.js
+++ b/packages/core/src/config/index.js
@@ -419,4 +419,15 @@ module.exports = {
},
proxy: {},
plugin: {},
+ help: {
+ data: [
+ {
+ title: '查看DevSidecar的说明文档(Wiki)',
+ url: 'https://github.com/docmirror/dev-sidecar/wiki',
+ },
+ {
+ title: '为了展示更多帮助信息,请启用 “远程配置” 功能!!!',
+ },
+ ],
+ },
}
diff --git a/packages/gui/src/view/App.vue b/packages/gui/src/view/App.vue
index bf54a31..45744f7 100644
--- a/packages/gui/src/view/App.vue
+++ b/packages/gui/src/view/App.vue
@@ -42,11 +42,11 @@ export default {
handleClick (e) {
console.log('click', e)
},
- titleClick (e) {
- console.log('titleClick', e)
+ titleClick (item) {
+ console.log('title click:', item)
},
menuClick (item) {
- console.log('menu click', item)
+ console.log('menu click:', item)
this.$router.replace(item.path)
},
},
diff --git a/packages/gui/src/view/components/tree-node.vue b/packages/gui/src/view/components/tree-node.vue
new file mode 100644
index 0000000..3e50a40
--- /dev/null
+++ b/packages/gui/src/view/components/tree-node.vue
@@ -0,0 +1,25 @@
+
+
+
+
+
diff --git a/packages/gui/src/view/pages/help.vue b/packages/gui/src/view/pages/help.vue
new file mode 100644
index 0000000..295c3b7
--- /dev/null
+++ b/packages/gui/src/view/pages/help.vue
@@ -0,0 +1,37 @@
+
+
+
+
+
+ 帮助中心
+
+ 反馈问题
+
+
+
+
+
+
+
+
diff --git a/packages/gui/src/view/router/index.js b/packages/gui/src/view/router/index.js
index d237950..c67242f 100644
--- a/packages/gui/src/view/router/index.js
+++ b/packages/gui/src/view/router/index.js
@@ -6,6 +6,7 @@ import Pip from '../pages/plugin/pip'
import Proxy from '../pages/proxy'
import Server from '../pages/server'
import Setting from '../pages/setting'
+import Help from '../pages/help'
const routes = [
{ path: '/', redirect: '/index' },
@@ -13,6 +14,7 @@ const routes = [
{ path: '/server', component: Server },
{ path: '/proxy', component: Proxy },
{ path: '/setting', component: Setting },
+ { path: '/help', component: Help },
{ path: '/plugin/node', component: Node },
{ path: '/plugin/git', component: Git },
{ path: '/plugin/pip', component: Pip },
diff --git a/packages/gui/src/view/router/menu.js b/packages/gui/src/view/router/menu.js
index f03e97c..5b06b4b 100644
--- a/packages/gui/src/view/router/menu.js
+++ b/packages/gui/src/view/router/menu.js
@@ -15,6 +15,7 @@ export default function createMenus (app) {
icon: 'api',
children: plugins,
},
+ { title: '帮助中心', path: '/help', icon: 'star' },
]
if (app.$global && app.$global.setting && app.$global.setting.overwall) {
plugins.push({ title: '功能增强', path: '/plugin/overwall', icon: 'global' })
diff --git a/packages/gui/src/view/style/index.scss b/packages/gui/src/view/style/index.scss
index cae2839..6c50d5b 100644
--- a/packages/gui/src/view/style/index.scss
+++ b/packages/gui/src/view/style/index.scss
@@ -138,3 +138,29 @@ hr {
margin: 0 5px 5px 5px;
}
}
+
+.help-list {
+ ul {
+ padding-left: 10px;
+ li {
+ list-style: none;
+ line-height: 35px;
+
+ span {
+ display: block;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ }
+
+ a:hover {
+ text-decoration: underline;
+ }
+ }
+
+ // 嵌套列表
+ ul {
+ padding-left: 20px;
+ }
+ }
+}
\ No newline at end of file
From 37bfddacdf871765318c71c3862f50b3f7aa75f7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E7=8E=8B=E8=89=AF?= <841369634@qq.com>
Date: Sun, 1 Dec 2024 03:53:53 +0800
Subject: [PATCH 3/7] =?UTF-8?q?=E5=B0=8F=E8=B0=83=E6=95=B4=E3=80=82?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
packages/gui/src/view/router/index.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/packages/gui/src/view/router/index.js b/packages/gui/src/view/router/index.js
index c67242f..3ba09b9 100644
--- a/packages/gui/src/view/router/index.js
+++ b/packages/gui/src/view/router/index.js
@@ -14,11 +14,11 @@ const routes = [
{ path: '/server', component: Server },
{ path: '/proxy', component: Proxy },
{ path: '/setting', component: Setting },
- { path: '/help', component: Help },
{ path: '/plugin/node', component: Node },
{ path: '/plugin/git', component: Git },
{ path: '/plugin/pip', component: Pip },
{ path: '/plugin/overwall', component: Overwall },
+ { path: '/help', component: Help },
]
export default routes
From 24552240050c71ff113fbc299746440cd950b92a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E7=8E=8B=E8=89=AF?= <841369634@qq.com>
Date: Sun, 1 Dec 2024 05:00:07 +0800
Subject: [PATCH 4/7] =?UTF-8?q?=E5=B8=AE=E5=8A=A9=E9=A1=B5=E9=9D=A2?=
=?UTF-8?q?=E8=A1=8C=E9=AB=98=E8=B0=83=E6=95=B4=E3=80=82?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
packages/gui/src/view/style/index.scss | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/packages/gui/src/view/style/index.scss b/packages/gui/src/view/style/index.scss
index 6c50d5b..06c0ebd 100644
--- a/packages/gui/src/view/style/index.scss
+++ b/packages/gui/src/view/style/index.scss
@@ -144,7 +144,7 @@ hr {
padding-left: 10px;
li {
list-style: none;
- line-height: 35px;
+ line-height: 30px;
span {
display: block;
From b905d50c39aef47bed241799e933f4241e7bcc9e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E7=8E=8B=E8=89=AF?= <841369634@qq.com>
Date: Mon, 2 Dec 2024 11:46:16 +0800
Subject: [PATCH 5/7] =?UTF-8?q?feature:=20=E5=B8=AE=E5=8A=A9=E9=A1=B5?=
=?UTF-8?q?=E9=9D=A2=E6=95=B0=E6=8D=AE=EF=BC=8C=E6=B7=BB=E5=8A=A0tip?=
=?UTF-8?q?=E5=B1=9E=E6=80=A7=EF=BC=8C=E9=BC=A0=E6=A0=87=E7=A7=BB=E4=B8=8A?=
=?UTF-8?q?=E5=8E=BB=E5=8F=AF=E4=BB=A5=E6=9F=A5=E7=9C=8B=E3=80=82?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
packages/gui/src/view/components/tree-node.vue | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/packages/gui/src/view/components/tree-node.vue b/packages/gui/src/view/components/tree-node.vue
index 3e50a40..7f25d0f 100644
--- a/packages/gui/src/view/components/tree-node.vue
+++ b/packages/gui/src/view/components/tree-node.vue
@@ -15,10 +15,10 @@ export default {
From 57349482075fc6feb175eef568da480d4f209310 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E7=8E=8B=E8=89=AF?= <841369634@qq.com>
Date: Mon, 2 Dec 2024 15:14:27 +0800
Subject: [PATCH 6/7] =?UTF-8?q?bugfix:=20=E6=A3=80=E6=9F=A5=E6=9B=B4?=
=?UTF-8?q?=E6=96=B0=E5=8A=9F=E8=83=BD=EF=BC=8C=E8=B7=B3=E8=BF=87=20`?=
=?UTF-8?q?=E5=8D=B3=E4=B8=8D=E6=98=AF=E6=AD=A3=E5=BC=8F=E4=B9=9F=E4=B8=8D?=
=?UTF-8?q?=E6=98=AF=E9=A2=84=E5=8F=91=E5=B8=83`=20=E7=9A=84=E7=89=88?=
=?UTF-8?q?=E6=9C=AC=EF=BC=88=E6=B3=A8=EF=BC=9A=E9=83=A8=E5=88=86=E7=89=88?=
=?UTF-8?q?=E6=9C=AC=E4=BB=85=E7=94=A8=E6=9D=A5=E6=B5=8B=E8=AF=95=EF=BC=89?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
packages/gui/src/bridge/update/backend.js | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/packages/gui/src/bridge/update/backend.js b/packages/gui/src/bridge/update/backend.js
index 3b8eda1..a113780 100644
--- a/packages/gui/src/bridge/update/backend.js
+++ b/packages/gui/src/bridge/update/backend.js
@@ -171,20 +171,28 @@ function updateHandle (app, api, win, beforeQuit, quit, log) {
return
}
- // log.info('github api返回的release数据:', JSON.stringify(data, null, '\t'))
+ log.debug('github api返回的release数据:', JSON.stringify(data, null, '\t'))
// 检查更新
for (let i = 0; i < data.length; i++) {
const versionData = data[i]
+ // log.debug('版本数据:', versionData)
+
if (!versionData.assets || versionData.assets.length === 0) {
+ log.info('跳过空版本,即未上传过安装包:', versionData.name)
continue // 跳过空版本,即未上传过安装包
}
+ if (!versionData.name.match(/^v?\d+(\.\d+)*(-.+)?$/g)) {
+ log.info('跳过即 “不是正式,又不是预发布” 的版本:', versionData.name)
+ continue // 跳过即 “不是正式,又不是预发布” 的版本
+ }
if (!isPreRelease && DevSidecar.api.config.get().app.skipPreRelease && versionData.name.includes('-')) {
+ log.info('跳过预发布版本:', versionData.name)
continue // 跳过预发布版本
}
- // log.info('最近正式版本数据:', versionData)
+ log.info('最近正式版本:', versionData.name)
// 获取版本号
let version = versionData.name
From 3b604d0fbb47dde25dedcb0d375afc88913f3dd7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E7=8E=8B=E8=89=AF?= <841369634@qq.com>
Date: Mon, 2 Dec 2024 15:50:48 +0800
Subject: [PATCH 7/7] =?UTF-8?q?optimize:=20=E9=A2=84=E5=8F=91=E5=B8=83?=
=?UTF-8?q?=E7=89=88=E6=9C=AC=E5=88=A4=E6=96=AD=E6=9D=A1=E4=BB=B6=E4=BC=98?=
=?UTF-8?q?=E5=8C=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
packages/gui/src/bridge/update/backend.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/packages/gui/src/bridge/update/backend.js b/packages/gui/src/bridge/update/backend.js
index a113780..5365717 100644
--- a/packages/gui/src/bridge/update/backend.js
+++ b/packages/gui/src/bridge/update/backend.js
@@ -187,7 +187,7 @@ function updateHandle (app, api, win, beforeQuit, quit, log) {
log.info('跳过即 “不是正式,又不是预发布” 的版本:', versionData.name)
continue // 跳过即 “不是正式,又不是预发布” 的版本
}
- if (!isPreRelease && DevSidecar.api.config.get().app.skipPreRelease && versionData.name.includes('-')) {
+ if (!isPreRelease && DevSidecar.api.config.get().app.skipPreRelease && (versionData.name.includes('-') || versionData.prerelease)) {
log.info('跳过预发布版本:', versionData.name)
continue // 跳过预发布版本
}