mirror of
https://github.com/yJason/ClashX-Dashboard.git
synced 2026-02-04 10:02:26 +08:00
misc: dashboard api url
This commit is contained in:
@@ -26,6 +26,12 @@ public class DashboardWindowController: NSWindowController {
|
||||
window?.makeKeyAndOrderFront(self)
|
||||
window?.delegate = self
|
||||
}
|
||||
|
||||
public func set(_ apiURL: String, secret: String? = nil) {
|
||||
ConfigManager.shared.isRunning = true
|
||||
ConfigManager.shared.overrideApiURL = .init(string: apiURL)
|
||||
ConfigManager.shared.overrideSecret = secret
|
||||
}
|
||||
}
|
||||
|
||||
extension DashboardWindowController: NSWindowDelegate {
|
||||
@@ -266,5 +272,5 @@ extension DashboardViewContoller: NSToolbarDelegate, NSToolbarItemValidation {
|
||||
.logLevelItem,
|
||||
.searchItem
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,10 +22,9 @@ class AppDelegate: NSObject, NSApplicationDelegate {
|
||||
self?.dashboardWindowController = nil
|
||||
}
|
||||
}
|
||||
|
||||
dashboardWindowController?.set("http://127.0.0.1:9021")
|
||||
dashboardWindowController?.showWindow(nil)
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user