This repository has been archived by the owner on Feb 5, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 558
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
pompurin404
committed
Sep 28, 2024
1 parent
3611e6f
commit 45ff6d8
Showing
8 changed files
with
88 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
### New Features | ||
|
||
- Windows 允许添加 `noadmin` 参数以普通权限启动程序 | ||
- 支持在 Windows 任务栏显示网速信息 | ||
|
||
### Bug Fixes | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { ChildProcess, spawn } from 'child_process' | ||
import { getAppConfig } from '../config' | ||
import { resourcesFilesDir } from '../utils/dirs' | ||
import path from 'path' | ||
|
||
let child: ChildProcess | ||
|
||
export async function startMonitor(detached = false): Promise<void> { | ||
if (process.platform !== 'win32') return | ||
await stopMonitor() | ||
const { showTraffic = true } = await getAppConfig() | ||
if (!showTraffic) return | ||
child = spawn(path.join(resourcesFilesDir(), 'TrafficMonitor/TrafficMonitor.exe'), [], { | ||
cwd: path.join(resourcesFilesDir(), 'TrafficMonitor'), | ||
detached: detached, | ||
stdio: detached ? 'ignore' : undefined | ||
}) | ||
if (detached) { | ||
child.unref() | ||
} | ||
} | ||
|
||
async function stopMonitor(): Promise<void> { | ||
if (child) { | ||
child.kill('SIGINT') | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters