mirror of
https://github.com/yJason/ClashX-Dashboard.git
synced 2026-02-04 10:02:26 +08:00
35 lines
696 B
Swift
35 lines
696 B
Swift
//
|
|
// AppDelegate.swift
|
|
// ClashX Dashboard
|
|
//
|
|
//
|
|
|
|
import Cocoa
|
|
import ClashX_Dashboard_Kit
|
|
|
|
|
|
@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) {
|
|
|
|
}
|
|
}
|