mirror of
https://github.com/neon443/ShhShell.git
synced 2026-03-11 21:36:17 +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 {
|
var body: some View {
|
||||||
NavigationStack {
|
NavigationStack {
|
||||||
|
ZStack {
|
||||||
|
hostsManager.selectedTheme.background.suiColor.opacity(0.7)
|
||||||
|
.ignoresSafeArea(.all)
|
||||||
List {
|
List {
|
||||||
SessionsListView(
|
SessionsListView(
|
||||||
handler: handler,
|
handler: handler,
|
||||||
@@ -39,6 +42,8 @@ struct ContentView: View {
|
|||||||
Label("Hostkey Fingerprints", systemImage: "lock.display")
|
Label("Hostkey Fingerprints", systemImage: "lock.display")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.scrollContentBackground(.hidden)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,7 +24,9 @@ struct ConnectionView: View {
|
|||||||
@State var hostKeyChangedAlert: Bool = false
|
@State var hostKeyChangedAlert: Bool = false
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
NavigationStack {
|
ZStack {
|
||||||
|
hostsManager.selectedTheme.background.suiColor.opacity(0.7)
|
||||||
|
.ignoresSafeArea(.all)
|
||||||
List {
|
List {
|
||||||
Section {
|
Section {
|
||||||
ScrollView(.horizontal) {
|
ScrollView(.horizontal) {
|
||||||
@@ -128,42 +130,8 @@ struct ConnectionView: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.alert("Hostkey changed", isPresented: $hostKeyChangedAlert) {
|
.scrollContentBackground(.hidden)
|
||||||
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")
|
|
||||||
}
|
|
||||||
.transition(.opacity)
|
.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
|
.onChange(of: handler.host.key) { _ in
|
||||||
guard let previousKnownHost = hostsManager.getHostMatching(handler.host) else { return }
|
guard let previousKnownHost = hostsManager.getHostMatching(handler.host) else { return }
|
||||||
guard handler.host.key == previousKnownHost.key else {
|
guard handler.host.key == previousKnownHost.key else {
|
||||||
@@ -190,6 +158,41 @@ struct ConnectionView: View {
|
|||||||
.onAppear {
|
.onAppear {
|
||||||
hostsManager.addHostIfNeeded(handler.host)
|
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
|
@ObservedObject var hostsManager: HostsManager
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
|
ZStack {
|
||||||
|
hostsManager.selectedTheme.background.suiColor.opacity(0.7)
|
||||||
|
.ignoresSafeArea(.all)
|
||||||
NavigationStack {
|
NavigationStack {
|
||||||
List {
|
List {
|
||||||
if hostsManager.hosts.isEmpty {
|
if hostsManager.hosts.isEmpty {
|
||||||
@@ -48,9 +51,11 @@ struct HostkeysView: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.scrollContentBackground(.hidden)
|
||||||
.navigationTitle("Hostkeys")
|
.navigationTitle("Hostkeys")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#Preview {
|
#Preview {
|
||||||
|
|||||||
@@ -13,6 +13,9 @@ struct KeyDetailView: View {
|
|||||||
@State private var reveal: Bool = false
|
@State private var reveal: Bool = false
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
|
ZStack {
|
||||||
|
hostsManager.selectedTheme.background.suiColor.opacity(0.7)
|
||||||
|
.ignoresSafeArea(.all)
|
||||||
List {
|
List {
|
||||||
VStack(alignment: .leading) {
|
VStack(alignment: .leading) {
|
||||||
Text("Used on")
|
Text("Used on")
|
||||||
@@ -68,6 +71,8 @@ struct KeyDetailView: View {
|
|||||||
}
|
}
|
||||||
.listRowSeparator(.hidden)
|
.listRowSeparator(.hidden)
|
||||||
}
|
}
|
||||||
|
.scrollContentBackground(.hidden)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -12,6 +12,9 @@ struct KeyManagerView: View {
|
|||||||
@ObservedObject var keyManager: KeyManager
|
@ObservedObject var keyManager: KeyManager
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
|
ZStack {
|
||||||
|
hostsManager.selectedTheme.background.suiColor.opacity(0.7)
|
||||||
|
.ignoresSafeArea(.all)
|
||||||
NavigationStack {
|
NavigationStack {
|
||||||
List {
|
List {
|
||||||
Section {
|
Section {
|
||||||
@@ -37,9 +40,11 @@ struct KeyManagerView: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.scrollContentBackground(.hidden)
|
||||||
.navigationTitle("Keys")
|
.navigationTitle("Keys")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#Preview {
|
#Preview {
|
||||||
|
|||||||
@@ -25,6 +25,9 @@ struct ThemeManagerView: View {
|
|||||||
)
|
)
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
|
ZStack {
|
||||||
|
hostsManager.selectedTheme.background.suiColor.opacity(0.7)
|
||||||
|
.ignoresSafeArea(.all)
|
||||||
GeometryReader { geo in
|
GeometryReader { geo in
|
||||||
let columns: Int = Int(geo.size.width)/200
|
let columns: Int = Int(geo.size.width)/200
|
||||||
let layout = Array(repeating: grid, count: columns)
|
let layout = Array(repeating: grid, count: columns)
|
||||||
@@ -98,6 +101,7 @@ struct ThemeManagerView: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#Preview {
|
#Preview {
|
||||||
|
|||||||
Reference in New Issue
Block a user