updates to launcer
This commit is contained in:
@@ -59,11 +59,11 @@ struct OrionMenuView: View {
|
||||
}
|
||||
.padding(14)
|
||||
}
|
||||
.frame(height: 570)
|
||||
.frame(height: 610)
|
||||
Divider().overlay(.white.opacity(0.10))
|
||||
footer
|
||||
}
|
||||
.frame(width: 790)
|
||||
.frame(width: 960)
|
||||
.background(
|
||||
LinearGradient(colors: [Color(red: 0.10, green: 0.15, blue: 0.23), Color(red: 0.075, green: 0.09, blue: 0.13)], startPoint: .topTrailing, endPoint: .bottomLeading)
|
||||
)
|
||||
@@ -179,7 +179,7 @@ struct OrionMenuView: View {
|
||||
Circle().fill(color).frame(width: 8, height: 8)
|
||||
Text(status.capitalized).font(.system(size: 12, weight: .medium))
|
||||
.foregroundStyle(color)
|
||||
}.frame(width: 103, alignment: .leading)
|
||||
}.frame(width: 90, alignment: .leading)
|
||||
}
|
||||
|
||||
private func integrated(_ machine: ParallelsVM) -> ServerDefinition? {
|
||||
@@ -189,11 +189,11 @@ struct OrionMenuView: View {
|
||||
private func runningRow(_ machine: ParallelsVM) -> some View {
|
||||
HStack(spacing: 10) {
|
||||
icon(machine)
|
||||
Text(machine.name).font(.system(size: 12, weight: .semibold)).lineLimit(1).frame(width: 150, alignment: .leading)
|
||||
Text(machine.name).font(.system(size: 12, weight: .semibold)).lineLimit(1).frame(width: 210, alignment: .leading)
|
||||
state(machine.status)
|
||||
Text(machine.ipAddress.isEmpty ? "—" : machine.ipAddress)
|
||||
.font(.system(size: 11, design: .monospaced))
|
||||
.foregroundStyle(OrionStyle.muted).lineLimit(1).frame(width: 100, alignment: .leading)
|
||||
.foregroundStyle(OrionStyle.muted).lineLimit(1).frame(width: 125, alignment: .leading)
|
||||
Spacer(minLength: 0)
|
||||
if let server = integrated(machine) {
|
||||
action("SSH", "terminal", tint: OrionStyle.blue) { vm.openSSH(server) }
|
||||
@@ -201,8 +201,14 @@ struct OrionMenuView: View {
|
||||
action("Mailpit", "globe", tint: OrionStyle.blue) { vm.openMailpit(server) }
|
||||
.disabled(server.host.isEmpty || server.mailpitPort == nil)
|
||||
}
|
||||
action("Restart", "arrow.clockwise", tint: OrionStyle.card) { vm.operate(machine, action: "restart") }
|
||||
action("Stop", "stop.fill", tint: OrionStyle.red) { vm.operate(machine, action: "stop") }
|
||||
if vm.busyVMIDs.contains(machine.id) {
|
||||
ProgressView().controlSize(.small)
|
||||
.frame(width: 70)
|
||||
.help("Waiting for Parallels to complete the operation")
|
||||
} else {
|
||||
action("Restart", "arrow.clockwise", tint: OrionStyle.card) { vm.operate(machine, action: "restart") }
|
||||
action("Stop", "stop.fill", tint: OrionStyle.red) { vm.operate(machine, action: "stop") }
|
||||
}
|
||||
Menu {
|
||||
Button("Force Stop", role: .destructive) { pendingForceStop = machine }
|
||||
} label: {
|
||||
@@ -218,7 +224,7 @@ struct OrionMenuView: View {
|
||||
private func machineRow(_ machine: ParallelsVM) -> some View {
|
||||
HStack(spacing: 10) {
|
||||
icon(machine)
|
||||
Text(machine.name).font(.system(size: 12, weight: .semibold)).lineLimit(1).frame(width: 180, alignment: .leading)
|
||||
Text(machine.name).font(.system(size: 12, weight: .semibold)).lineLimit(1).frame(width: 230, alignment: .leading)
|
||||
state(machine.status)
|
||||
Text(machine.ipAddress.isEmpty ? "—" : machine.ipAddress)
|
||||
.font(.system(size: 11, design: .monospaced))
|
||||
@@ -260,11 +266,11 @@ struct OrionMenuView: View {
|
||||
return HStack(spacing: 10) {
|
||||
if let machine { icon(machine) }
|
||||
else { Image(systemName: "server.rack").frame(width: 36, height: 36).foregroundStyle(.cyan) }
|
||||
Text(server.name).font(.system(size: 12, weight: .semibold)).lineLimit(1).frame(width: 125, alignment: .leading)
|
||||
Text(server.name).font(.system(size: 12, weight: .semibold)).lineLimit(1).frame(width: 185, alignment: .leading)
|
||||
state(status)
|
||||
Text(server.host.isEmpty ? "—" : server.host)
|
||||
.font(.system(size: 11, design: .monospaced)).foregroundStyle(OrionStyle.muted)
|
||||
.lineLimit(1).frame(width: 98, alignment: .leading)
|
||||
.lineLimit(1).frame(width: 125, alignment: .leading)
|
||||
Spacer(minLength: 0)
|
||||
if let machine {
|
||||
if status.lowercased() == "running" {
|
||||
@@ -279,6 +285,7 @@ struct OrionMenuView: View {
|
||||
.disabled(status.lowercased() != "running" || server.host.isEmpty || server.mailpitPort == nil)
|
||||
action("Remove", "trash", tint: OrionStyle.card) { pendingRemoval = server }
|
||||
}
|
||||
.disabled(machine.map { vm.busyVMIDs.contains($0.id) } ?? false)
|
||||
.padding(.horizontal, 10).padding(.vertical, 7)
|
||||
.background(OrionStyle.card.opacity(0.75), in: RoundedRectangle(cornerRadius: 10))
|
||||
}
|
||||
@@ -288,7 +295,7 @@ struct OrionMenuView: View {
|
||||
Label(title, systemImage: symbol)
|
||||
.font(.system(size: 11, weight: .semibold))
|
||||
.lineLimit(1)
|
||||
.frame(minWidth: 56)
|
||||
.frame(minWidth: 48)
|
||||
}.buttonStyle(OrionActionStyle(tint: tint))
|
||||
}
|
||||
|
||||
@@ -312,7 +319,7 @@ private struct OrionActionStyle: ButtonStyle {
|
||||
func makeBody(configuration: Configuration) -> some View {
|
||||
configuration.label
|
||||
.foregroundStyle(.white)
|
||||
.padding(.horizontal, 10).padding(.vertical, 8)
|
||||
.padding(.horizontal, 8).padding(.vertical, 7)
|
||||
.background(tint.opacity(configuration.isPressed ? 0.65 : 1), in: RoundedRectangle(cornerRadius: 8))
|
||||
.opacity(configuration.isPressed ? 0.8 : 1)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user