misc: dashboard api url

This commit is contained in:
mrFq1
2023-06-03 23:49:11 +08:00
parent e53503cdbe
commit 8fc7bec255
2 changed files with 9 additions and 4 deletions

View File

@@ -26,6 +26,12 @@ public class DashboardWindowController: NSWindowController {
window?.makeKeyAndOrderFront(self) window?.makeKeyAndOrderFront(self)
window?.delegate = 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 { extension DashboardWindowController: NSWindowDelegate {
@@ -266,5 +272,5 @@ extension DashboardViewContoller: NSToolbarDelegate, NSToolbarItemValidation {
.logLevelItem, .logLevelItem,
.searchItem .searchItem
] ]
} }
} }

View File

@@ -22,10 +22,9 @@ class AppDelegate: NSObject, NSApplicationDelegate {
self?.dashboardWindowController = nil self?.dashboardWindowController = nil
} }
} }
dashboardWindowController?.set("http://127.0.0.1:9021")
dashboardWindowController?.showWindow(nil) dashboardWindowController?.showWindow(nil)
} }