-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathConfigForgeApp.swift
More file actions
55 lines (49 loc) · 1.72 KB
/
ConfigForgeApp.swift
File metadata and controls
55 lines (49 loc) · 1.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import SwiftUI
@main
struct ConfigForgeApp: App {
var body: some Scene {
WindowGroup {
ContentView()
}
.commands {
CommandGroup(after: .saveItem) {
Divider()
Button("Backup SSH configuration...") {
triggerSshBackup()
}
.keyboardShortcut("b", modifiers: [.command, .shift])
Button("Restore SSH configuration...") {
triggerSshRestore()
}
.keyboardShortcut("r", modifiers: [.command, .shift])
Divider()
Button("Backup Kubeconfig...") {
triggerKubeBackup()
}
.keyboardShortcut("k", modifiers: [.command, .option])
Button("Restore Kubeconfig...") {
triggerKubeRestore()
}
.keyboardShortcut("j", modifiers: [.command, .option])
}
}
}
private func getViewModelFromActiveScene() -> MainViewModel? {
print("Attempting to find ViewModel - requires proper implementation based on app structure.")
return nil
}
private func triggerSshBackup() {
print("Trigger SSH Backup (Needs ViewModel access)")
}
private func triggerSshRestore() {
print("Trigger SSH Restore (Needs ViewModel access)")
}
private func triggerKubeBackup() {
print("Trigger Kube Backup (Needs ViewModel access)")
getViewModelFromActiveScene()?.backupKubeConfig()
}
private func triggerKubeRestore() {
print("Trigger Kube Restore (Needs ViewModel access)")
getViewModelFromActiveScene()?.restoreKubeConfig()
}
}