new features
This commit is contained in:
@@ -2,6 +2,7 @@ import SwiftUI
|
||||
import AppKit
|
||||
|
||||
@MainActor final class ComposeModel: ObservableObject {
|
||||
@Published var projectName = ""
|
||||
@Published var projectURL: URL?
|
||||
@Published var services: [ComposeService] = []
|
||||
@Published var selectedService: String?
|
||||
@@ -17,6 +18,7 @@ import AppKit
|
||||
func load(_ url: URL) {
|
||||
do {
|
||||
let project = try ComposeProject(file: url)
|
||||
projectName = project.name
|
||||
projectURL = url; services = project.services
|
||||
selectedService = services.first?.id
|
||||
output += "Loaded \(url.path) (\(services.count) services)\n"
|
||||
@@ -33,7 +35,8 @@ import AppKit
|
||||
}
|
||||
private func run(url: URL, action: String) {
|
||||
guard !busy else { return }
|
||||
busy = true; status = "Running \(action)…"; output += "\n$ acccompose \(action)\n"
|
||||
guard !CommandLine.arguments.contains("--demo") else { output += "Demo mode is read-only. Relaunch normally to run Compose actions.\n"; return }
|
||||
busy = true; status = "Running \(action)…"; output += "\n$ container-compose \(action)\n"
|
||||
Task.detached {
|
||||
let result: String
|
||||
do { result = try ComposeEngine(ComposeProject(file: url)).execute(action) }
|
||||
|
||||
Reference in New Issue
Block a user