Commit 78d6cd6 pompurin404
committed
1 parent 160537b commit 78d6cd6 Copy full SHA for 78d6cd6
File tree 3 files changed +24
-9
lines changed
3 files changed +24
-9
lines changed Original file line number Diff line number Diff line change
1
+ ### New Features
2
+
3
+ - 托盘图标显示网速信息
4
+ - MacOS允许隐藏Dock图标
5
+ - Windows支持数据存储到安装目录
6
+
7
+ ### Bug Fixes
8
+
9
+ - 修复修改混合端口后无法检查更新的问题
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " mihomo-party" ,
3
- "version" : " 0.5.3 " ,
3
+ "version" : " 0.5.4 " ,
4
4
"description" : " Mihomo Party" ,
5
5
"main" : " ./out/main/index.js" ,
6
6
"author" : " mihomo-party" ,
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ let mihomoLogsWs: WebSocket | null = null
14
14
let logsRetry = 10
15
15
let mihomoConnectionsWs : WebSocket | null = null
16
16
let connectionsRetry = 10
17
+ let trafficHopping = false
17
18
18
19
export const getAxios = async ( force : boolean = false ) : Promise < AxiosInstance > => {
19
20
if ( axiosIns && ! force ) return axiosIns
@@ -154,17 +155,22 @@ const mihomoTraffic = async (): Promise<void> => {
154
155
mihomoTrafficWs . onmessage = ( e ) : void => {
155
156
const data = e . data as string
156
157
const json = JSON . parse ( data ) as IMihomoTrafficInfo
157
- tray ?. setTitle (
158
- '↑' +
159
- `${ calcTraffic ( json . up ) } /s` . padStart ( 16 ) +
160
- '\n↓' +
161
- `${ calcTraffic ( json . down ) } /s` . padStart ( 16 )
162
- )
158
+ if ( trafficHopping ) {
159
+ tray ?. setTitle ( '↑' + `${ calcTraffic ( json . up ) } /s` . padStart ( 14 ) , {
160
+ fontType : 'monospacedDigit'
161
+ } )
162
+ } else {
163
+ tray ?. setTitle ( '↓' + `${ calcTraffic ( json . down ) } /s` . padStart ( 14 ) , {
164
+ fontType : 'monospacedDigit'
165
+ } )
166
+ }
167
+ trafficHopping = ! trafficHopping
168
+
163
169
tray ?. setToolTip (
164
170
'↑' +
165
- `${ calcTraffic ( json . up ) } /s` . padStart ( 16 ) +
171
+ `${ calcTraffic ( json . up ) } /s` . padStart ( 14 ) +
166
172
'\n↓' +
167
- `${ calcTraffic ( json . down ) } /s` . padStart ( 16 )
173
+ `${ calcTraffic ( json . down ) } /s` . padStart ( 14 )
168
174
)
169
175
trafficRetry = 10
170
176
mainWindow ?. webContents . send ( 'mihomoTraffic' , json )
You can’t perform that action at this time.
0 commit comments