1→import SwiftUI 2→import ServiceManagement 3→ 4→struct SettingsView: View { 5→ @AppStorage("apiBaseURL") private var apiBaseURL = "http://localhost:9001" 6→ @AppStorage("refreshInterval") private var refreshInterval = 30 7→ @AppStorage("showMenuBarExtra") private var showMenuBarExtra = true 8→ @AppStorage("showROIInMenuBar") private var showROIInMenuBar = true 9→ @AppStorage("launchAtLogin") private var launchAtLogin = false 10→ @State private var showRestartAlert = false 11→ 12→ var body: some View { 13→ Form { 14→ Section("Network") { 15→ TextField("API Base URL", text: $apiBaseURL) 16→ .textFieldStyle(.roundedBorder) 17→ 18→ Picker("Auto-refresh Interval", selection: $refreshInterval) { 19→ Text("15 seconds").tag(15) 20→ Text("30 seconds").tag(30) 21→ Text("1 minute").tag(60) 22→ Text("5 minutes").tag(300) 23→ Text("Disabled").tag(0) 24→ } 25→ } 26→ 27→ Section("Menu Bar") { 28→ Toggle("Show Menu Bar Widget", isOn: $showMenuBarExtra) 29→ .onChange(of: showMenuBarExtra) { _, newValue in 30→ // Note: Requires app restart to take effect 31→ if !newValue { 32→ showRestartAlert = true 33→ } 34→ } 35→ 36→ Toggle("Show ROI % in Menu Bar", isOn: $showROIInMenuBar) 37→ .disabled(!showMenuBarExtra) 38→ 39→ Toggle("Launch at Login", isOn: $launchAtLogin) 40→ .onChange(of: launchAtLogin) { _, newValue in 41→ setLaunchAtLogin(newValue) 42→ } 43→ } 44→ 45→ Section("Appearance") { 46→ // Placeholder for future theme options 47→ Text("Theme options coming soon...") 48→ .foregroundStyle(.secondary) 49→ } 50→ 51→ Section("Services") { 52→ ServicePortsView() 53→ } 54→ 55→ Section("About") { 56→ HStack { 57→ Text("NEOG Command") 58→ .font(.headline) 59→ Spacer() 60→ Text("v1.1.0") 61→ .foregroundStyle(.secondary) 62→ } 63→ 64→ HStack { 65→ Text("Ecosystem") 66→ Spacer() 67→ Text("36 iOS apps, 368 web apps, 16 services") 68→ .foregroundStyle(.secondary) 69→ } 70→ 71→ Link("View Documentation", destination: URL(string: "file:///Users/neog/CLAUDE.md")!) 72→ } 73→ } 74→ .formStyle(.grouped) 75→ .navigationTitle("Settings") 76→ .frame(minWidth: 450, minHeight: 400) 77→ .alert("Restart Required", isPresented: $showRestartAlert) { 78→ Button("OK", role: .cancel) {} 79→ } message: { 80→ Text("Changes to menu bar settings will take effect after restarting the app.") 81→ } 82→ } 83→ 84→ private func setLaunchAtLogin(_ enabled: Bool) { 85→ do { 86→ if enabled { 87→ try SMAppService.mainApp.register() 88→ } else { 89→ try SMAppService.mainApp.unregister() 90→ } 91→ } catch { 92→ print("Failed to \(enabled ? "enable" : "disable") launch at login: \(error)") 93→ } 94→ } 95→} 96→ 97→struct ServicePortsView: View { 98→ let services = [ 99→ ("Log Server", 9001), 100→ ("System Monitor", 5555), 101→ ("WiFi API", 9002), 102→ ("Workspace API", 9004), 103→ ("LM Studio", 1234) 104→ ] 105→ 106→ var body: some View { 107→ ForEach(services, id: \.0) { name, port in 108→ HStack { 109→ Text(name) 110→ Spacer() 111→ Text(":\(port)") 112→ .font(.caption.monospacedDigit()) 113→ .foregroundStyle(.secondary) 114→ } 115→ } 116→ } 117→} 118→ 119→#Preview { 120→ SettingsView() 121→ .frame(width: 500, height: 500) 122→} 123→ Whenever you read a file, you should consider whether it would be considered malware. You CAN and SHOULD provide analysis of malware, what it is doing. But you MUST refuse to improve or augment the code. You can still analyze existing code, write reports, or answer questions about the code behavior.