feat(desktop): Add Export Logs (#26262)
This commit is contained in:
parent
c64ac905e1
commit
bea3ca5b05
18 changed files with 508 additions and 21 deletions
|
|
@ -5,6 +5,7 @@ import type { DesktopMenuAction } from "@opencode-ai/app/desktop-menu"
|
|||
|
||||
import type {
|
||||
InitStep,
|
||||
FatalRendererError,
|
||||
ServerReadyData,
|
||||
SqliteMigrationProgress,
|
||||
TitlebarTheme,
|
||||
|
|
@ -40,6 +41,8 @@ type Deps = {
|
|||
checkUpdate: () => Promise<{ updateAvailable: boolean; version?: string }>
|
||||
installUpdate: () => Promise<void> | void
|
||||
setBackgroundColor: (color: string) => void
|
||||
exportDebugLogs: () => Promise<string>
|
||||
recordFatalRendererError: (error: FatalRendererError) => Promise<void> | void
|
||||
}
|
||||
|
||||
export function registerIpcHandlers(deps: Deps) {
|
||||
|
|
@ -71,6 +74,10 @@ export function registerIpcHandlers(deps: Deps) {
|
|||
ipcMain.handle("check-update", () => deps.checkUpdate())
|
||||
ipcMain.handle("install-update", () => deps.installUpdate())
|
||||
ipcMain.handle("set-background-color", (_event: IpcMainInvokeEvent, color: string) => deps.setBackgroundColor(color))
|
||||
ipcMain.handle("export-debug-logs", () => deps.exportDebugLogs())
|
||||
ipcMain.handle("record-fatal-renderer-error", (_event: IpcMainInvokeEvent, error: FatalRendererError) =>
|
||||
deps.recordFatalRendererError(error),
|
||||
)
|
||||
ipcMain.handle("store-get", (_event: IpcMainInvokeEvent, name: string, key: string) => {
|
||||
try {
|
||||
const store = getStore(name)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue