Restore original Web Console login and navigation
This commit is contained in:
1 parent
d748f7cc69
commit
81a86d0e6c
5 files changed
+290
-7
No files matched your search
@@ -9,7 +9,8 @@ struct MenuBarServer: App {
|
||||
MenuBarExtra {
|
||||
ServerPanel(model: model)
|
||||
} label: {
|
||||
Label("EzServer", systemImage: model.running ? "externaldrive.fill.badge.checkmark" : "externaldrive")
|
||||
Label("ezServer", systemImage: "externaldrive")
|
||||
.labelStyle(.titleAndIcon)
|
||||
}
|
||||
.menuBarExtraStyle(.window)
|
||||
}
|
||||
@@ -134,7 +135,22 @@ private struct ServerPanel: View {
|
||||
@ObservedObject var model: ServerControl
|
||||
|
||||
var body: some View {
|
||||
VStack(alignment: .leading, spacing: 12) {
|
||||
VStack(alignment: .leading, spacing: 14) {
|
||||
HStack(spacing: 10) {
|
||||
Image(systemName: "externaldrive.fill")
|
||||
.font(.system(size: 17, weight: .medium))
|
||||
.foregroundStyle(Color.accentColor)
|
||||
.frame(width: 34, height: 34)
|
||||
.background(Color.accentColor.opacity(0.12), in: RoundedRectangle(cornerRadius: 8))
|
||||
Text("ezServer")
|
||||
.font(.title3.weight(.semibold))
|
||||
.accessibilityAddTraits(.isHeader)
|
||||
Spacer()
|
||||
Label(serverStatus, systemImage: "circle.fill")
|
||||
.font(.caption.weight(.medium))
|
||||
.foregroundStyle(model.running ? Color.green : Color.secondary)
|
||||
}
|
||||
Divider()
|
||||
HStack {
|
||||
Text("Порт")
|
||||
TextField("55005", text: $model.port)
|
||||
@@ -161,10 +177,22 @@ private struct ServerPanel: View {
|
||||
if let notice = model.notice {
|
||||
Text(notice).font(.caption).foregroundStyle(.secondary).textSelection(.enabled)
|
||||
}
|
||||
Button("Открыть Web Console", action: model.openConsole)
|
||||
.disabled(!model.running)
|
||||
Divider()
|
||||
Button(action: model.openConsole) {
|
||||
Label("Открыть Web Console", systemImage: "arrow.up.right.square")
|
||||
.frame(maxWidth: .infinity)
|
||||
}
|
||||
.buttonStyle(.borderedProminent)
|
||||
.controlSize(.large)
|
||||
.disabled(!model.running)
|
||||
}
|
||||
.padding(16)
|
||||
.frame(width: 360)
|
||||
}
|
||||
|
||||
private var serverStatus: String {
|
||||
if model.starting { return "Запускается" }
|
||||
if model.stopping { return "Останавливается" }
|
||||
return model.running ? "Работает" : "Остановлен"
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user