Add show_page and show_file, and let file tools reach any path
This commit is contained in:
@@ -30,6 +30,7 @@ private let signScript = """
|
||||
@MainActor
|
||||
final class Remote {
|
||||
let api: API
|
||||
weak var store: Store?
|
||||
private var ws: URLSessionWebSocketTask?
|
||||
private var stopped = false
|
||||
private var heard = Date()
|
||||
@@ -188,6 +189,12 @@ final class Remote {
|
||||
case .sign:
|
||||
let (code, status, signature) = try await sign(Data(req.data?.data ?? []), as: req.ident ?? "", timeoutMs: req.timeoutMs ?? 120_000)
|
||||
return ClientReply(id: req.id, exitCode: code, output: status, data: Base64EncodedData(signature))
|
||||
case .openPage:
|
||||
store!.showPage(req.task ?? "", req.path ?? "")
|
||||
return ClientReply(id: req.id)
|
||||
case .openFile:
|
||||
store!.showInFiles(req.task ?? "", req.path ?? "")
|
||||
return ClientReply(id: req.id)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user