@@ -23,16 +24,16 @@ export default {
diff --git a/packages/gui/src/view/pages/setting.vue b/packages/gui/src/view/pages/setting.vue
index 8e05ba6..2f0386d 100644
--- a/packages/gui/src/view/pages/setting.vue
+++ b/packages/gui/src/view/pages/setting.vue
@@ -338,9 +338,9 @@ export default {
设置
-
- 查看日志
-
+
+
+ 查看日志
diff --git a/packages/gui/src/view/style/theme/dark.scss b/packages/gui/src/view/style/theme/dark.scss
index c914dca..e11740f 100644
--- a/packages/gui/src/view/style/theme/dark.scss
+++ b/packages/gui/src/view/style/theme/dark.scss
@@ -17,7 +17,7 @@ $dark-input: #777; //输入框:背景色
.ds-container,
.ds-container .container-header,
.ant-layout-footer {
- background: $dark-bg;
+ background-color: $dark-bg;
color: $dark-text;
}
div,
@@ -36,7 +36,7 @@ $dark-input: #777; //输入框:背景色
/* 高亮块:背景色和字体颜色 */
/* 警告类型 */
.ant-alert-warning {
- background: $dark-bg-highlight;
+ background-color: $dark-bg-highlight;
border-color: $dark-bg-highlight;
color: $dark-text;
/* 关闭图标颜色 */
@@ -46,7 +46,7 @@ $dark-input: #777; //输入框:背景色
}
/* 消息类型 */
.ant-alert-info {
- background: $dark-bg-highlight;
+ background-color: $dark-bg-highlight;
border-color: $dark-bg-highlight;
color: $dark-text;
}
@@ -66,7 +66,7 @@ $dark-input: #777; //输入框:背景色
background-color: #666;
}
.ant-divider {
- background: $dark-bd;
+ background-color: $dark-bd;
}
.help-list .title1 {
@@ -76,7 +76,7 @@ $dark-input: #777; //输入框:背景色
/* 左侧 */
/** 背景色 **/
.ant-layout-sider {
- background: $dark-bg;
+ background-color: $dark-bg;
}
/** Logo **/
.logo {
@@ -84,14 +84,14 @@ $dark-input: #777; //输入框:背景色
}
/** 菜单 **/
.ant-menu {
- background: $dark-bg;
+ background-color: $dark-bg;
color: $dark-text;
}
/* 菜单选中时,或鼠标移到菜单上时的样式 */
.ant-menu-item:hover,
.ant-menu-submenu .ant-menu-submenu-title:hover,
.ant-menu:not(.ant-menu-horizontal) .ant-menu-item-selected {
- background: $dark-bg-highlight;
+ background-color: $dark-bg-highlight;
color: #1890ff;
span {
color: #1890ff;
@@ -104,7 +104,7 @@ $dark-input: #777; //输入框:背景色
.ant-input-number,
.ant-select-selection,
.ant-input-group-addon {
- background: $dark-input;
+ background-color: $dark-input;
border-color: #aaa;
color: $dark-text;
&:hover,
@@ -115,7 +115,7 @@ $dark-input: #777; //输入框:背景色
/* 卡片消息:IP测速 */
.ant-card {
- background: $dark-input;
+ background-color: $dark-input;
border-color: $dark-input;
.ant-card-head {
border-bottom-color: #929292;
@@ -124,26 +124,26 @@ $dark-input: #777; //输入框:背景色
/* 标签:未启用 */
.ant-tag-red {
- background: #4f4749;
+ background-color: #4f4749;
border-color: #4f4749;
color: #bf8285;
}
/* 标签:已启用 */
.ant-tag-green {
- background: #505f5f;
+ background-color: #505f5f;
border-color: #505f5f;
color: #90cb9f;
}
/* 标签:警告 */
.ant-tag-orange {
- background: #5a5750;
+ background-color: #5a5750;
border-color: #5a5750;
color: #cfa572;
}
/* 按钮 */
.ant-btn:not(.ant-btn-danger, .ant-btn-primary) {
- background: $dark-btn;
+ background-color: $dark-btn;
border-color: $dark-btn;
color: $dark-text;
&:hover {
@@ -153,7 +153,7 @@ $dark-input: #777; //输入框:背景色
/* 单选框:开关式 */
.ant-switch:not(.ant-switch-checked) {
- background: $dark-btn;
+ background-color: $dark-btn;
border-color: $dark-btn;
&:hover {
opacity: 0.8;
@@ -161,7 +161,7 @@ $dark-input: #777; //输入框:背景色
}
/* 单选框:按钮式 */
.ant-radio-button-wrapper {
- background: $dark-btn;
+ background-color: $dark-btn;
border-color: $dark-btn;
color: $dark-text;
&:hover {
@@ -173,24 +173,24 @@ $dark-input: #777; //输入框:背景色
.jsoneditor-vue {
/*整个编辑框:背景色和边框*/
div.jsoneditor {
- background: $dark-bg-highlight;
+ background-color: $dark-bg-highlight;
border: none;
}
/* 头部菜单栏:边框 */
div.jsoneditor-menu {
- background: $dark-bg-highlight;
+ background-color: $dark-bg-highlight;
border-color: $dark-bg-highlight;
}
/* 内容区域左边:行号 */
.ace_gutter {
- background: #444;
+ background-color: #444;
.ace_gutter-cell {
color: #aaa;
}
}
/* 内容区域右边:JSON内容 */
.ace_scroller {
- background: #555;
+ background-color: #555;
}
/* key的颜色 */
.ace_variable,
@@ -215,12 +215,12 @@ $dark-input: #777; //输入框:背景色
/* 当前行高亮样式 */
.ace_gutter-active-line,
.ace_marker-layer .ace_active-line {
- background: #838774;
+ background-color: #838774;
}
/* 选中行高亮样式 */
.ace-jsoneditor {
.ace_marker-layer .ace_selection {
- background: #8b2929; /* 同时应用于当前选中的搜索结果项的背景色,建议与搜索结果边框颜色保持一致 */
+ background-color: #8b2929; /* 同时应用于当前选中的搜索结果项的背景色,建议与搜索结果边框颜色保持一致 */
}
/* 光标颜色 */
diff --git a/packages/mitmproxy/src/lib/interceptor/impl/res/AfterOPTIONSHeaders.js b/packages/mitmproxy/src/lib/interceptor/impl/res/AfterOPTIONSHeaders.js
index de72111..2008818 100644
--- a/packages/mitmproxy/src/lib/interceptor/impl/res/AfterOPTIONSHeaders.js
+++ b/packages/mitmproxy/src/lib/interceptor/impl/res/AfterOPTIONSHeaders.js
@@ -17,11 +17,10 @@ module.exports = {
'Cross-Origin-Resource-Policy': interceptOpt.optionsCrossPolicy || 'cross-origin',
}
- res.setHeader('DS-AfterOPTIONSHeaders-Interceptor', '1')
-
// 替换响应头
if (responseReplaceApi.replaceResponseHeaders({ ...headers }, res, proxyRes)) {
log.info('AfterOPTIONSHeaders intercept:', JSON.stringify(headers))
+ res.setHeader('DS-AfterOPTIONSHeaders-Interceptor', '1')
} else {
res.setHeader('DS-AfterOPTIONSHeaders-Interceptor', '0')
}
diff --git a/packages/mitmproxy/src/options.js b/packages/mitmproxy/src/options.js
index e3b3b89..6504dee 100644
--- a/packages/mitmproxy/src/options.js
+++ b/packages/mitmproxy/src/options.js
@@ -108,7 +108,7 @@ module.exports = (serverConfig) => {
const hostname = req.url.split(':')[0]
// 配置了白名单的域名,将跳过代理
- const inWhiteList = matchUtil.matchHostname(whiteList, hostname, 'in whiteList') != null
+ const inWhiteList = !!matchUtil.matchHostname(whiteList, hostname, 'in whiteList')
if (inWhiteList) {
log.info(`为白名单域名,不拦截: ${hostname}, headers:`, jsonApi.stringify2(req.headers))
return false // 不拦截
From 67c7e39000a2a5c726f698dbe3fc7d59807fdd28 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E7=8E=8B=E8=89=AF?= <841369634@qq.com>
Date: Wed, 26 Feb 2025 11:22:00 +0800
Subject: [PATCH 4/5] =?UTF-8?q?feature:=20=E6=96=B0=E5=A2=9E=E5=86=85?=
=?UTF-8?q?=E5=AE=B9=E6=90=9C=E7=B4=A2=E5=8A=9F=E8=83=BD=EF=BC=8C=E5=BF=AB?=
=?UTF-8?q?=E6=8D=B7=E9=94=AE=EF=BC=9A`Ctrl=20+=20F`?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
packages/gui/package.json | 1 +
packages/gui/src/background.js | 36 ++++---
packages/gui/src/main.js | 2 +
packages/gui/src/view/App.vue | 103 +++++++++++++++++++-
packages/gui/src/view/pages/setting.vue | 10 +-
packages/gui/src/view/style/theme/dark.scss | 9 ++
pnpm-lock.yaml | 12 +++
7 files changed, 156 insertions(+), 17 deletions(-)
diff --git a/packages/gui/package.json b/packages/gui/package.json
index e5fe7cd..24af998 100644
--- a/packages/gui/package.json
+++ b/packages/gui/package.json
@@ -34,6 +34,7 @@
"request-progress": "^3.0.0",
"sass": "^1.81.0",
"sass-loader": "^16.0.3",
+ "search-bar-vue2": "^1.0.0",
"vue": "^2.7.16",
"vue-json-editor-fix-cn": "^1.4.3",
"vue-router": "^3.6.5"
diff --git a/packages/gui/src/background.js b/packages/gui/src/background.js
index 0b2763c..5be8601 100644
--- a/packages/gui/src/background.js
+++ b/packages/gui/src/background.js
@@ -298,28 +298,38 @@ function createWindow (startHideWindow, autoQuitIfError = true) {
})
const shortcut = (event, input) => {
- // 按 F12,打开/关闭 开发者工具
- if (input.key === 'F12') {
- // 阻止默认的按键事件行为
+ if (input.key === 'F12' && input.type === 'keyUp' && !input.control && !input.shift && !input.alt && !input.meta) {
+ // 按 F12,打开/关闭 开发者工具
event.preventDefault()
- // 切换开发者工具显示状态
switchDevTools()
- // eslint-disable-next-line style/brace-style
- }
- // 按 F5,刷新页面
- else if (input.key === 'F5') {
- // 阻止默认的按键事件行为
+ } else if (input.key === 'F5' && input.type === 'keyUp' && !input.control && !input.shift && !input.alt && !input.meta) {
+ // 按 F5,刷新页面
event.preventDefault()
- // 刷新页面
win.webContents.reload()
+ } else {
+ // 全文检索框(SearchBar)相关快捷键
+ if ((input.key === 'F' || input.key === 'f') && input.type === 'keyDown' && input.control && !input.shift && !input.alt && !input.meta) {
+ // 按 Ctrl + F,显示或隐藏全文检索框(SearchBar)
+ event.preventDefault()
+ win.webContents.send('search-bar', { key: 'show-hide' })
+ } else if (input.key === 'Escape' && input.type === 'keyUp' && !input.control && !input.shift && !input.alt && !input.meta) {
+ // 按 ESC,隐藏全文检索框(SearchBar)
+ event.preventDefault()
+ win.webContents.send('search-bar', { key: 'hide' })
+ } else if (input.key === 'F3' && input.type === 'keyDown' && !input.control && !input.shift && !input.alt && !input.meta) {
+ // 按 F3,全文检索框(SearchBar)定位到下一个
+ event.preventDefault()
+ win.webContents.send('search-bar', { key: 'next' })
+ } else if (input.key === 'F3' && input.type === 'keyDown' && !input.control && input.shift && !input.alt && !input.meta) {
+ // 按 Shift + F3,全文检索框(SearchBar)定位到上一个
+ event.preventDefault()
+ win.webContents.send('search-bar', { key: 'previous' })
+ }
}
}
// 监听键盘事件
win.webContents.on('before-input-event', (event, input) => {
- if (input.type !== 'keyUp' || input.control || input.alt || input.shift || input.meta) {
- return
- }
win.webContents.executeJavaScript('config')
.then((value) => {
console.info('window.config:', value, ', key:', input.key)
diff --git a/packages/gui/src/main.js b/packages/gui/src/main.js
index 198abb9..e89daaa 100644
--- a/packages/gui/src/main.js
+++ b/packages/gui/src/main.js
@@ -1,6 +1,7 @@
import antd from 'ant-design-vue'
import Vue from 'vue'
import VueRouter from 'vue-router'
+import SearchBar from 'search-bar-vue2'
import { ipcRenderer } from 'electron'
import view from './view'
import App from './view/App.vue'
@@ -25,6 +26,7 @@ try {
Vue.config.productionTip = false
Vue.use(antd)
Vue.use(VueRouter)
+ Vue.use(SearchBar)
Vue.component(DsContainer)
// 3. 创建 router 实例,然后传 `routes` 配置
// 你还可以传别的配置参数, 不过先这么简单着吧。
diff --git a/packages/gui/src/view/App.vue b/packages/gui/src/view/App.vue
index 8b1bb95..a47d7b9 100644
--- a/packages/gui/src/view/App.vue
+++ b/packages/gui/src/view/App.vue
@@ -1,4 +1,5 @@
+
+
+
+
+
+
diff --git a/packages/gui/src/view/pages/plugin/git.vue b/packages/gui/src/view/pages/plugin/git.vue
index d0605a5..fcaad6a 100644
--- a/packages/gui/src/view/pages/plugin/git.vue
+++ b/packages/gui/src/view/pages/plugin/git.vue
@@ -1,8 +1,10 @@