mirror of
https://github.com/neon443/ShhShell.git
synced 2026-03-11 13:26:16 +00:00
fix servers with no auth
improve theme view column calculation
This commit is contained in:
@@ -66,7 +66,11 @@ class SSHHandler: @unchecked Sendable, ObservableObject {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
try? authWithNone()
|
do {
|
||||||
|
try authWithNone()
|
||||||
|
} catch {
|
||||||
|
|
||||||
|
}
|
||||||
getAuthMethods()
|
getAuthMethods()
|
||||||
|
|
||||||
if self.host.key != getHostkey() {
|
if self.host.key != getHostkey() {
|
||||||
@@ -74,6 +78,7 @@ class SSHHandler: @unchecked Sendable, ObservableObject {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if state != .authorized {
|
||||||
if !host.password.isEmpty {
|
if !host.password.isEmpty {
|
||||||
do { try authWithPw() } catch {
|
do { try authWithPw() } catch {
|
||||||
print("pw auth error")
|
print("pw auth error")
|
||||||
@@ -90,6 +95,7 @@ class SSHHandler: @unchecked Sendable, ObservableObject {
|
|||||||
print(error.localizedDescription)
|
print(error.localizedDescription)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ssh_channel_request_env(channel, "TERM", "xterm-256color")
|
ssh_channel_request_env(channel, "TERM", "xterm-256color")
|
||||||
ssh_channel_request_env(channel, "LANG", "en_US.UTF-8")
|
ssh_channel_request_env(channel, "LANG", "en_US.UTF-8")
|
||||||
@@ -342,7 +348,6 @@ class SSHHandler: @unchecked Sendable, ObservableObject {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
//always unknown idk why
|
|
||||||
func getAuthMethods() {
|
func getAuthMethods() {
|
||||||
var recievedMethod: CInt
|
var recievedMethod: CInt
|
||||||
recievedMethod = ssh_userauth_list(session, nil)
|
recievedMethod = ssh_userauth_list(session, nil)
|
||||||
|
|||||||
@@ -18,18 +18,22 @@ struct ThemeManagerView: View {
|
|||||||
@State var themeToRename: Theme?
|
@State var themeToRename: Theme?
|
||||||
@State var rename: String = ""
|
@State var rename: String = ""
|
||||||
|
|
||||||
let grid: GridItem = GridItem(
|
var minColWidth: CGFloat {150}
|
||||||
.flexible(minimum: 150, maximum: 250),
|
var spacing: CGFloat {8}
|
||||||
spacing: 8,
|
var grid: GridItem {
|
||||||
|
GridItem(
|
||||||
|
.flexible(minimum: minColWidth, maximum: 250),
|
||||||
|
spacing: spacing,
|
||||||
alignment: .center
|
alignment: .center
|
||||||
)
|
)
|
||||||
|
}
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
ZStack {
|
ZStack {
|
||||||
hostsManager.selectedTheme.background.suiColor.opacity(0.7)
|
hostsManager.selectedTheme.background.suiColor.opacity(0.7)
|
||||||
.ignoresSafeArea(.all)
|
.ignoresSafeArea(.all)
|
||||||
GeometryReader { geo in
|
GeometryReader { geo in
|
||||||
let columns: Int = Int(geo.size.width)/200
|
let columns: Int = max(1, Int((geo.size.width + 8) / (minColWidth + spacing)))
|
||||||
let layout = Array(repeating: grid, count: columns)
|
let layout = Array(repeating: grid, count: columns)
|
||||||
ScrollView {
|
ScrollView {
|
||||||
if hostsManager.themes.isEmpty {
|
if hostsManager.themes.isEmpty {
|
||||||
|
|||||||
Reference in New Issue
Block a user