mirror of
https://github.com/yJason/ClashX-Dashboard.git
synced 2026-02-07 11:32:25 +08:00
35 lines
692 B
Swift
35 lines
692 B
Swift
//
|
|
// AppDelegate.swift
|
|
// ClashX Dashboard
|
|
//
|
|
//
|
|
|
|
import Cocoa
|
|
import ClashX_Dashboard
|
|
|
|
|
|
@main
|
|
class AppDelegate: NSObject, NSApplicationDelegate {
|
|
|
|
var dashboardWindowController: DashboardWindowController?
|
|
|
|
func applicationDidFinishLaunching(_ notification: Notification) {
|
|
|
|
if dashboardWindowController == nil {
|
|
dashboardWindowController = DashboardWindowController.create()
|
|
dashboardWindowController?.onWindowClose = {
|
|
[weak self] in
|
|
self?.dashboardWindowController = nil
|
|
}
|
|
}
|
|
|
|
dashboardWindowController?.set("http://127.0.0.1:9021")
|
|
dashboardWindowController?.showWindow(nil)
|
|
}
|
|
|
|
|
|
func applicationWillTerminate(_ notification: Notification) {
|
|
|
|
}
|
|
}
|