File tree Expand file tree Collapse file tree 6 files changed +17
-9
lines changed
src/libs/model-runtime/utils Expand file tree Collapse file tree 6 files changed +17
-9
lines changed Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ export const appBrowsers = {
36
36
autoHideMenuBar : true ,
37
37
height : 800 ,
38
38
identifier : 'settings' ,
39
- // keepAlive: true,
39
+ keepAlive : true ,
40
40
minWidth : 600 ,
41
41
parentIdentifier : 'chat' ,
42
42
path : '/settings' ,
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ import { IpcClientEventSender } from '@/types/ipcClientEvent';
7
7
import { ControllerModule , ipcClientEvent , shortcut } from './index' ;
8
8
9
9
export default class BrowserWindowsCtr extends ControllerModule {
10
- @shortcut ( 'toggleMainWindow ' )
10
+ @shortcut ( 'showMainWindow ' )
11
11
async toggleMainWindow ( ) {
12
12
const mainWindow = this . app . browserManager . getMainWindow ( ) ;
13
13
mainWindow . toggleVisible ( ) ;
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ export default class TrayMenuCtr extends ControllerModule {
15
15
/**
16
16
* 使用快捷键切换窗口可见性
17
17
*/
18
- @shortcut ( 'toggleMainWindow ' )
18
+ @shortcut ( 'showMainWindow ' )
19
19
async toggleMainWindow ( ) {
20
20
logger . debug ( '通过快捷键切换主窗口可见性' ) ;
21
21
const mainWindow = this . app . browserManager . getMainWindow ( ) ;
@@ -47,7 +47,7 @@ export default class TrayMenuCtr extends ControllerModule {
47
47
48
48
return {
49
49
error : '托盘通知仅在 Windows 平台支持' ,
50
- success : false
50
+ success : false ,
51
51
} ;
52
52
}
53
53
@@ -71,15 +71,15 @@ export default class TrayMenuCtr extends ControllerModule {
71
71
logger . error ( '更新托盘图标失败:' , error ) ;
72
72
return {
73
73
error : String ( error ) ,
74
- success : false
74
+ success : false ,
75
75
} ;
76
76
}
77
77
}
78
78
}
79
79
80
80
return {
81
81
error : '托盘功能仅在 Windows 平台支持' ,
82
- success : false
82
+ success : false ,
83
83
} ;
84
84
}
85
85
@@ -103,7 +103,7 @@ export default class TrayMenuCtr extends ControllerModule {
103
103
104
104
return {
105
105
error : '托盘功能仅在 Windows 平台支持' ,
106
- success : false
106
+ success : false ,
107
107
} ;
108
108
}
109
109
}
Original file line number Diff line number Diff line change @@ -164,6 +164,12 @@ export class ShortcutManager {
164
164
Object . entries ( this . shortcutsConfig ) . forEach ( ( [ id , accelerator ] ) => {
165
165
logger . debug ( `Registering shortcut '${ id } ' with ${ accelerator } ` ) ;
166
166
167
+ // 只注册在 DEFAULT_SHORTCUTS_CONFIG 中存在的快捷键
168
+ if ( ! DEFAULT_SHORTCUTS_CONFIG [ id ] ) {
169
+ logger . debug ( `Skipping shortcut '${ id } ' - not found in DEFAULT_SHORTCUTS_CONFIG` ) ;
170
+ return ;
171
+ }
172
+
167
173
const method = this . shortcuts . get ( id ) ;
168
174
if ( accelerator && method ) {
169
175
this . registerShortcut ( accelerator , method ) ;
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ export const ShortcutActionEnum = {
5
5
/**
6
6
* 显示/隐藏主窗口
7
7
*/
8
- toggleMainWindow : 'toggleMainWindow ' ,
8
+ showMainWindow : 'showMainWindow ' ,
9
9
} as const ;
10
10
11
11
export type ShortcutActionType = ( typeof ShortcutActionEnum ) [ keyof typeof ShortcutActionEnum ] ;
@@ -14,5 +14,5 @@ export type ShortcutActionType = (typeof ShortcutActionEnum)[keyof typeof Shortc
14
14
* 默认快捷键配置
15
15
*/
16
16
export const DEFAULT_SHORTCUTS_CONFIG : Record < ShortcutActionType , string > = {
17
- [ ShortcutActionEnum . toggleMainWindow ] : 'CommandOrControl +E' ,
17
+ [ ShortcutActionEnum . showMainWindow ] : 'Control +E' ,
18
18
} ;
Original file line number Diff line number Diff line change @@ -6,6 +6,8 @@ export const StreamingResponse = (
6
6
headers : {
7
7
'Cache-Control' : 'no-cache' ,
8
8
'Content-Type' : 'text/event-stream' ,
9
+ // for Nginx: disable chunk buffering
10
+ 'X-Accel-Buffering' : 'no' ,
9
11
...options ?. headers ,
10
12
} ,
11
13
} ) ;
You can’t perform that action at this time.
0 commit comments