mirror of
https://github.com/Finesssee/ProxyPilot.git
synced 2026-11-20 12:23:26 +00:00
Remove /management.html, pp_open_legacy_ui tray binding, disable-control-panel and panel-github-repository config options. OpenManagementUI now opens /proxypilot.html directly.
30 lines
584 B
Go
30 lines
584 B
Go
package desktopctl
|
|
|
|
import (
|
|
"os/exec"
|
|
"runtime"
|
|
)
|
|
|
|
func OpenBrowser(url string) error {
|
|
switch runtime.GOOS {
|
|
case "windows":
|
|
return exec.Command("rundll32", "url.dll,FileProtocolHandler", url).Start()
|
|
case "darwin":
|
|
return exec.Command("open", url).Start()
|
|
default:
|
|
return exec.Command("xdg-open", url).Start()
|
|
}
|
|
}
|
|
|
|
func OpenFolder(path string) error {
|
|
switch runtime.GOOS {
|
|
case "windows":
|
|
return exec.Command("explorer.exe", path).Start()
|
|
case "darwin":
|
|
return exec.Command("open", path).Start()
|
|
default:
|
|
return exec.Command("xdg-open", path).Start()
|
|
}
|
|
}
|
|
|