mirror of
https://github.com/samsonjs/vibetunnel.git
synced 2026-06-28 05:29:29 +00:00
iOS: Add @MainActor to SSEClient.start() and update SystemLogsView theme
This commit is contained in:
parent
10fcf79884
commit
892737e9a3
2 changed files with 15 additions and 4 deletions
|
|
@ -31,6 +31,7 @@ final class SSEClient: NSObject, @unchecked Sendable {
|
|||
self.session = URLSession(configuration: configuration, delegate: self, delegateQueue: .main)
|
||||
}
|
||||
|
||||
@MainActor
|
||||
func start() {
|
||||
var request = URLRequest(url: url)
|
||||
request.setValue("text/event-stream", forHTTPHeaderField: "Accept")
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ struct SystemLogsView: View {
|
|||
var body: some View {
|
||||
NavigationStack {
|
||||
ZStack {
|
||||
Theme.Colors.background
|
||||
Theme.Colors.terminalBackground
|
||||
.ignoresSafeArea()
|
||||
|
||||
VStack(spacing: 0) {
|
||||
|
|
@ -96,10 +96,20 @@ struct SystemLogsView: View {
|
|||
.progressViewStyle(CircularProgressViewStyle(tint: Theme.Colors.primaryAccent))
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||
} else if let error = error {
|
||||
ErrorView(message: error) {
|
||||
Task {
|
||||
await loadLogs()
|
||||
VStack {
|
||||
Text("Error loading logs")
|
||||
.font(.headline)
|
||||
.foregroundColor(Theme.Colors.errorAccent)
|
||||
Text(error)
|
||||
.font(.subheadline)
|
||||
.foregroundColor(Theme.Colors.terminalForeground)
|
||||
.multilineTextAlignment(.center)
|
||||
Button("Retry") {
|
||||
Task {
|
||||
await loadLogs()
|
||||
}
|
||||
}
|
||||
.terminalButton()
|
||||
}
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in a new issue