mirror of
https://github.com/pompurin404/mihomo-party.git
synced 2024-11-16 03:32:17 +08:00
0.5.4
This commit is contained in:
parent
160537bd48
commit
78d6cd6535
9
changelog.md
Normal file
9
changelog.md
Normal file
|
@ -0,0 +1,9 @@
|
|||
### New Features
|
||||
|
||||
- 托盘图标显示网速信息
|
||||
- MacOS允许隐藏Dock图标
|
||||
- Windows支持数据存储到安装目录
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- 修复修改混合端口后无法检查更新的问题
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "mihomo-party",
|
||||
"version": "0.5.3",
|
||||
"version": "0.5.4",
|
||||
"description": "Mihomo Party",
|
||||
"main": "./out/main/index.js",
|
||||
"author": "mihomo-party",
|
||||
|
|
|
@ -14,6 +14,7 @@ let mihomoLogsWs: WebSocket | null = null
|
|||
let logsRetry = 10
|
||||
let mihomoConnectionsWs: WebSocket | null = null
|
||||
let connectionsRetry = 10
|
||||
let trafficHopping = false
|
||||
|
||||
export const getAxios = async (force: boolean = false): Promise<AxiosInstance> => {
|
||||
if (axiosIns && !force) return axiosIns
|
||||
|
@ -154,17 +155,22 @@ const mihomoTraffic = async (): Promise<void> => {
|
|||
mihomoTrafficWs.onmessage = (e): void => {
|
||||
const data = e.data as string
|
||||
const json = JSON.parse(data) as IMihomoTrafficInfo
|
||||
tray?.setTitle(
|
||||
'↑' +
|
||||
`${calcTraffic(json.up)}/s`.padStart(16) +
|
||||
'\n↓' +
|
||||
`${calcTraffic(json.down)}/s`.padStart(16)
|
||||
)
|
||||
if (trafficHopping) {
|
||||
tray?.setTitle('↑' + `${calcTraffic(json.up)}/s`.padStart(14), {
|
||||
fontType: 'monospacedDigit'
|
||||
})
|
||||
} else {
|
||||
tray?.setTitle('↓' + `${calcTraffic(json.down)}/s`.padStart(14), {
|
||||
fontType: 'monospacedDigit'
|
||||
})
|
||||
}
|
||||
trafficHopping = !trafficHopping
|
||||
|
||||
tray?.setToolTip(
|
||||
'↑' +
|
||||
`${calcTraffic(json.up)}/s`.padStart(16) +
|
||||
`${calcTraffic(json.up)}/s`.padStart(14) +
|
||||
'\n↓' +
|
||||
`${calcTraffic(json.down)}/s`.padStart(16)
|
||||
`${calcTraffic(json.down)}/s`.padStart(14)
|
||||
)
|
||||
trafficRetry = 10
|
||||
mainWindow?.webContents.send('mihomoTraffic', json)
|
||||
|
|
Loading…
Reference in New Issue
Block a user