mirror of
https://github.com/neon443/ShhShell.git
synced 2026-03-11 13:26:16 +00:00
ui background matches theme
ui bg is 70% opacity
This commit is contained in:
@@ -14,6 +14,9 @@ struct ContentView: View {
|
||||
|
||||
var body: some View {
|
||||
NavigationStack {
|
||||
ZStack {
|
||||
hostsManager.selectedTheme.background.suiColor.opacity(0.7)
|
||||
.ignoresSafeArea(.all)
|
||||
List {
|
||||
SessionsListView(
|
||||
handler: handler,
|
||||
@@ -39,6 +42,8 @@ struct ContentView: View {
|
||||
Label("Hostkey Fingerprints", systemImage: "lock.display")
|
||||
}
|
||||
}
|
||||
.scrollContentBackground(.hidden)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,7 +24,9 @@ struct ConnectionView: View {
|
||||
@State var hostKeyChangedAlert: Bool = false
|
||||
|
||||
var body: some View {
|
||||
NavigationStack {
|
||||
ZStack {
|
||||
hostsManager.selectedTheme.background.suiColor.opacity(0.7)
|
||||
.ignoresSafeArea(.all)
|
||||
List {
|
||||
Section {
|
||||
ScrollView(.horizontal) {
|
||||
@@ -128,42 +130,8 @@ struct ConnectionView: View {
|
||||
}
|
||||
}
|
||||
}
|
||||
.alert("Hostkey changed", isPresented: $hostKeyChangedAlert) {
|
||||
Button("Accept New Hostkey", role: .destructive) {
|
||||
hostsManager.updateHost(handler.host)
|
||||
handler.go()
|
||||
}
|
||||
|
||||
Button("Disconnect", role: .cancel) {
|
||||
handler.disconnect()
|
||||
handler.host.key = hostsManager.getHostMatching(handler.host)?.key
|
||||
}
|
||||
} message: {
|
||||
Text("Expected \(handler.host.key ?? "nil")\nbut recieved \(handler.getHostkey() ?? "nil") from the server")
|
||||
}
|
||||
.scrollContentBackground(.hidden)
|
||||
.transition(.opacity)
|
||||
.toolbar {
|
||||
ToolbarItem() {
|
||||
Button() {
|
||||
handler.go()
|
||||
showTerminal = checkShell(handler.state)
|
||||
} label: {
|
||||
Label(
|
||||
handler.connected ? "Disconnect" : "Connect",
|
||||
systemImage: handler.connected ? "xmark.app.fill" : "power"
|
||||
)
|
||||
}
|
||||
.disabled(handler.hostInvalid())
|
||||
}
|
||||
}
|
||||
}
|
||||
.fullScreenCover(isPresented: $showTerminal) {
|
||||
if let shellView {
|
||||
shellView
|
||||
} else {
|
||||
Text("no shellview")
|
||||
}
|
||||
}
|
||||
.onChange(of: handler.host.key) { _ in
|
||||
guard let previousKnownHost = hostsManager.getHostMatching(handler.host) else { return }
|
||||
guard handler.host.key == previousKnownHost.key else {
|
||||
@@ -190,6 +158,41 @@ struct ConnectionView: View {
|
||||
.onAppear {
|
||||
hostsManager.addHostIfNeeded(handler.host)
|
||||
}
|
||||
.alert("Hostkey changed", isPresented: $hostKeyChangedAlert) {
|
||||
Button("Accept New Hostkey", role: .destructive) {
|
||||
hostsManager.updateHost(handler.host)
|
||||
handler.go()
|
||||
}
|
||||
|
||||
Button("Disconnect", role: .cancel) {
|
||||
handler.disconnect()
|
||||
handler.host.key = hostsManager.getHostMatching(handler.host)?.key
|
||||
}
|
||||
} message: {
|
||||
Text("Expected \(handler.host.key ?? "nil")\nbut recieved \(handler.getHostkey() ?? "nil") from the server")
|
||||
}
|
||||
.toolbar {
|
||||
ToolbarItem() {
|
||||
Button() {
|
||||
handler.go()
|
||||
showTerminal = checkShell(handler.state)
|
||||
} label: {
|
||||
Label(
|
||||
handler.connected ? "Disconnect" : "Connect",
|
||||
systemImage: handler.connected ? "xmark.app.fill" : "power"
|
||||
)
|
||||
}
|
||||
.disabled(handler.hostInvalid())
|
||||
}
|
||||
}
|
||||
.fullScreenCover(isPresented: $showTerminal) {
|
||||
if let shellView {
|
||||
shellView
|
||||
} else {
|
||||
Text("no shellview")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -11,6 +11,9 @@ struct HostkeysView: View {
|
||||
@ObservedObject var hostsManager: HostsManager
|
||||
|
||||
var body: some View {
|
||||
ZStack {
|
||||
hostsManager.selectedTheme.background.suiColor.opacity(0.7)
|
||||
.ignoresSafeArea(.all)
|
||||
NavigationStack {
|
||||
List {
|
||||
if hostsManager.hosts.isEmpty {
|
||||
@@ -48,10 +51,12 @@ struct HostkeysView: View {
|
||||
}
|
||||
}
|
||||
}
|
||||
.scrollContentBackground(.hidden)
|
||||
.navigationTitle("Hostkeys")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#Preview {
|
||||
HostkeysView(hostsManager: HostsManager())
|
||||
|
||||
@@ -13,6 +13,9 @@ struct KeyDetailView: View {
|
||||
@State private var reveal: Bool = false
|
||||
|
||||
var body: some View {
|
||||
ZStack {
|
||||
hostsManager.selectedTheme.background.suiColor.opacity(0.7)
|
||||
.ignoresSafeArea(.all)
|
||||
List {
|
||||
VStack(alignment: .leading) {
|
||||
Text("Used on")
|
||||
@@ -68,6 +71,8 @@ struct KeyDetailView: View {
|
||||
}
|
||||
.listRowSeparator(.hidden)
|
||||
}
|
||||
.scrollContentBackground(.hidden)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -12,6 +12,9 @@ struct KeyManagerView: View {
|
||||
@ObservedObject var keyManager: KeyManager
|
||||
|
||||
var body: some View {
|
||||
ZStack {
|
||||
hostsManager.selectedTheme.background.suiColor.opacity(0.7)
|
||||
.ignoresSafeArea(.all)
|
||||
NavigationStack {
|
||||
List {
|
||||
Section {
|
||||
@@ -37,10 +40,12 @@ struct KeyManagerView: View {
|
||||
}
|
||||
}
|
||||
}
|
||||
.scrollContentBackground(.hidden)
|
||||
.navigationTitle("Keys")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#Preview {
|
||||
KeyManagerView(
|
||||
|
||||
@@ -25,6 +25,9 @@ struct ThemeManagerView: View {
|
||||
)
|
||||
|
||||
var body: some View {
|
||||
ZStack {
|
||||
hostsManager.selectedTheme.background.suiColor.opacity(0.7)
|
||||
.ignoresSafeArea(.all)
|
||||
GeometryReader { geo in
|
||||
let columns: Int = Int(geo.size.width)/200
|
||||
let layout = Array(repeating: grid, count: columns)
|
||||
@@ -99,6 +102,7 @@ struct ThemeManagerView: View {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#Preview {
|
||||
NavigationStack {
|
||||
|
||||
Reference in New Issue
Block a user