mirror of
https://github.com/yJason/ClashX-Dashboard.git
synced 2026-03-01 00:35:19 +08:00
fix: spm
This commit is contained in:
34
Examples/ClashX Dashboard/AppDelegate.swift
Normal file
34
Examples/ClashX Dashboard/AppDelegate.swift
Normal file
@@ -0,0 +1,34 @@
|
||||
//
|
||||
// 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) {
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user