mirror of
https://github.com/neon443/ShhShell.git
synced 2026-03-11 13:26:16 +00:00
bump version
remove send Ax256 change powerplug.portrait to power reduce time from 10_000 to 1_000 remove sending print add shellview
This commit is contained in:
@@ -5,7 +5,7 @@
|
|||||||
// Created by neon443 on 06/06/2025.
|
// Created by neon443 on 06/06/2025.
|
||||||
//
|
//
|
||||||
|
|
||||||
VERSION = 0.4
|
VERSION = 0.5
|
||||||
BUILD = 3
|
BUILD = 3
|
||||||
|
|
||||||
// Configuration settings file format documentation can be found at:
|
// Configuration settings file format documentation can be found at:
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
A92317282E07111E00ECE1E6 /* SwiftTerm in Frameworks */ = {isa = PBXBuildFile; productRef = A92317272E07111E00ECE1E6 /* SwiftTerm */; };
|
A92317282E07111E00ECE1E6 /* SwiftTerm in Frameworks */ = {isa = PBXBuildFile; productRef = A92317272E07111E00ECE1E6 /* SwiftTerm */; };
|
||||||
A923172A2E07113100ECE1E6 /* TerminalController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A92317292E07113100ECE1E6 /* TerminalController.swift */; };
|
A923172A2E07113100ECE1E6 /* TerminalController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A92317292E07113100ECE1E6 /* TerminalController.swift */; };
|
||||||
A923172D2E07138000ECE1E6 /* SSHTerminalView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A923172C2E07138000ECE1E6 /* SSHTerminalView.swift */; };
|
A923172D2E07138000ECE1E6 /* SSHTerminalView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A923172C2E07138000ECE1E6 /* SSHTerminalView.swift */; };
|
||||||
|
A923172F2E08851200ECE1E6 /* ShellView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A923172E2E08851200ECE1E6 /* ShellView.swift */; };
|
||||||
A92538C82DEE0742007E0A18 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A92538C52DEE0742007E0A18 /* ContentView.swift */; };
|
A92538C82DEE0742007E0A18 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A92538C52DEE0742007E0A18 /* ContentView.swift */; };
|
||||||
A92538C92DEE0742007E0A18 /* ShhShellApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = A92538C62DEE0742007E0A18 /* ShhShellApp.swift */; };
|
A92538C92DEE0742007E0A18 /* ShhShellApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = A92538C62DEE0742007E0A18 /* ShhShellApp.swift */; };
|
||||||
A92538CA2DEE0742007E0A18 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = A92538C42DEE0742007E0A18 /* Assets.xcassets */; };
|
A92538CA2DEE0742007E0A18 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = A92538C42DEE0742007E0A18 /* Assets.xcassets */; };
|
||||||
@@ -70,6 +71,7 @@
|
|||||||
A9083E3F2DF2225A0042906E /* libz.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = usr/lib/libz.tbd; sourceTree = SDKROOT; };
|
A9083E3F2DF2225A0042906E /* libz.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = usr/lib/libz.tbd; sourceTree = SDKROOT; };
|
||||||
A92317292E07113100ECE1E6 /* TerminalController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TerminalController.swift; sourceTree = "<group>"; };
|
A92317292E07113100ECE1E6 /* TerminalController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TerminalController.swift; sourceTree = "<group>"; };
|
||||||
A923172C2E07138000ECE1E6 /* SSHTerminalView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SSHTerminalView.swift; sourceTree = "<group>"; };
|
A923172C2E07138000ECE1E6 /* SSHTerminalView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SSHTerminalView.swift; sourceTree = "<group>"; };
|
||||||
|
A923172E2E08851200ECE1E6 /* ShellView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = ShellView.swift; path = ShhShell/Views/Terminal/ShellView.swift; sourceTree = SOURCE_ROOT; };
|
||||||
A925389A2DEE06DC007E0A18 /* ShhShell.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ShhShell.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
A925389A2DEE06DC007E0A18 /* ShhShell.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ShhShell.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
A92538A72DEE06DE007E0A18 /* ShhShellTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ShhShellTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
|
A92538A72DEE06DE007E0A18 /* ShhShellTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ShhShellTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
A92538B12DEE06DE007E0A18 /* ShhShellUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ShhShellUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
|
A92538B12DEE06DE007E0A18 /* ShhShellUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ShhShellUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
@@ -132,6 +134,7 @@
|
|||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
A92317292E07113100ECE1E6 /* TerminalController.swift */,
|
A92317292E07113100ECE1E6 /* TerminalController.swift */,
|
||||||
|
A923172E2E08851200ECE1E6 /* ShellView.swift */,
|
||||||
A923172C2E07138000ECE1E6 /* SSHTerminalView.swift */,
|
A923172C2E07138000ECE1E6 /* SSHTerminalView.swift */,
|
||||||
);
|
);
|
||||||
path = Terminal;
|
path = Terminal;
|
||||||
@@ -409,6 +412,7 @@
|
|||||||
isa = PBXSourcesBuildPhase;
|
isa = PBXSourcesBuildPhase;
|
||||||
buildActionMask = 2147483647;
|
buildActionMask = 2147483647;
|
||||||
files = (
|
files = (
|
||||||
|
A923172F2E08851200ECE1E6 /* ShellView.swift in Sources */,
|
||||||
A985545F2E056EDD009051BD /* KeychainLayer.swift in Sources */,
|
A985545F2E056EDD009051BD /* KeychainLayer.swift in Sources */,
|
||||||
A93143C62DF61FE300FCD5DB /* ViewModifiers.swift in Sources */,
|
A93143C62DF61FE300FCD5DB /* ViewModifiers.swift in Sources */,
|
||||||
A98554632E0587DF009051BD /* HostsView.swift in Sources */,
|
A98554632E0587DF009051BD /* HostsView.swift in Sources */,
|
||||||
|
|||||||
@@ -19,6 +19,8 @@ class SSHHandler: ObservableObject {
|
|||||||
@Published var authorized: Bool = false
|
@Published var authorized: Bool = false
|
||||||
@Published var testSuceeded: Bool? = nil
|
@Published var testSuceeded: Bool? = nil
|
||||||
|
|
||||||
|
@Published var bell: UUID?
|
||||||
|
|
||||||
@Published var host: Host
|
@Published var host: Host
|
||||||
|
|
||||||
private let userDefaults = NSUbiquitousKeyValueStore.default
|
private let userDefaults = NSUbiquitousKeyValueStore.default
|
||||||
|
|||||||
@@ -132,10 +132,7 @@ struct ConnectionView: View {
|
|||||||
}
|
}
|
||||||
|
|
||||||
NavigationLink() {
|
NavigationLink() {
|
||||||
Button("send Ax256") {
|
ShellView(handler: handler)
|
||||||
handler.writeToChannel(Array(repeating: "A", count: 256).joined())
|
|
||||||
}
|
|
||||||
TerminalController(handler: handler)
|
|
||||||
} label: {
|
} label: {
|
||||||
Label("Open Terminal", systemImage: "apple.terminal")
|
Label("Open Terminal", systemImage: "apple.terminal")
|
||||||
}
|
}
|
||||||
@@ -183,7 +180,7 @@ struct ConnectionView: View {
|
|||||||
}
|
}
|
||||||
handler.openShell()
|
handler.openShell()
|
||||||
} label: {
|
} label: {
|
||||||
Label("Connect", systemImage: "powerplug.portrait")
|
Label("Connect", systemImage: "power")
|
||||||
}
|
}
|
||||||
.disabled(
|
.disabled(
|
||||||
pubkey == nil && privkey == nil &&
|
pubkey == nil && privkey == nil &&
|
||||||
|
|||||||
@@ -27,11 +27,9 @@ class SSHTerminalView: TerminalView, TerminalViewDelegate {
|
|||||||
while handler.connected {
|
while handler.connected {
|
||||||
guard let handler = self.handler else { break }
|
guard let handler = self.handler else { break }
|
||||||
if let read = handler.readFromChannel() {
|
if let read = handler.readFromChannel() {
|
||||||
DispatchQueue.main.async {
|
DispatchQueue.main.async { self.feed(text: read) }
|
||||||
self.feed(text: read)
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
usleep(10_000)
|
usleep(1_000)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -55,8 +53,6 @@ class SSHTerminalView: TerminalView, TerminalViewDelegate {
|
|||||||
|
|
||||||
public func send(source: TerminalView, data: ArraySlice<UInt8>) {
|
public func send(source: TerminalView, data: ArraySlice<UInt8>) {
|
||||||
let data = Data(data)
|
let data = Data(data)
|
||||||
// let dataSlice = Data(bytes: [data], count: data.count)
|
|
||||||
print("sending \(String(data: data, encoding: .utf8))")
|
|
||||||
handler?.writeToChannel(String(data: data, encoding: .utf8))
|
handler?.writeToChannel(String(data: data, encoding: .utf8))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
41
ShhShell/Views/Terminal/ShellView.swift
Normal file
41
ShhShell/Views/Terminal/ShellView.swift
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
//
|
||||||
|
// ShellView.swift
|
||||||
|
// ShhShell
|
||||||
|
//
|
||||||
|
// Created by neon443 on 22/06/2025.
|
||||||
|
//
|
||||||
|
|
||||||
|
import SwiftUI
|
||||||
|
|
||||||
|
struct ShellView: View {
|
||||||
|
@ObservedObject var handler: SSHHandler
|
||||||
|
|
||||||
|
var body: some View {
|
||||||
|
NavigationStack {
|
||||||
|
ZStack {
|
||||||
|
TerminalController(handler: handler)
|
||||||
|
}
|
||||||
|
.toolbar {
|
||||||
|
ToolbarItem {
|
||||||
|
Button() {
|
||||||
|
if handler.connected {
|
||||||
|
handler.disconnect()
|
||||||
|
} else {
|
||||||
|
handler.connect()
|
||||||
|
}
|
||||||
|
} label: {
|
||||||
|
if handler.connected {
|
||||||
|
Label("Disconnect", image: "xmark.square.fill")
|
||||||
|
} else {
|
||||||
|
Label("Connect", image: "power")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#Preview {
|
||||||
|
ShellView(handler: SSHHandler(host: Host.debug))
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user