完善folder页面的web接口实现

This commit is contained in:
xintaofei
2026-03-25 15:27:43 +08:00
parent ac09d3db9e
commit 218055ab01
18 changed files with 569 additions and 37 deletions

View File

@@ -852,7 +852,14 @@ export async function openFolderWindow(path: string): Promise<void> {
}
export async function openCommitWindow(folderId: number): Promise<void> {
return getTransport().call("open_commit_window", { folderId })
if (getTransport().isDesktop()) {
return getTransport().call("open_commit_window", { folderId })
}
const result = await getTransport().call<{ path: string }>(
"open_commit_window",
{ folderId },
)
window.location.href = result.path
}
export type SettingsSection =
@@ -871,10 +878,21 @@ export async function openSettingsWindow(
section?: SettingsSection,
options?: OpenSettingsWindowOptions
): Promise<void> {
return getTransport().call("open_settings_window", {
section: section ?? null,
agentType: options?.agentType ?? null,
})
if (getTransport().isDesktop()) {
return getTransport().call("open_settings_window", {
section: section ?? null,
agentType: options?.agentType ?? null,
})
}
// Web mode: get navigation path from backend and navigate
const result = await getTransport().call<{ path: string }>(
"open_settings_window",
{
section: section ?? null,
agentType: options?.agentType ?? null,
},
)
window.location.href = result.path
}
export async function listOpenFolders(): Promise<FolderHistoryEntry[]> {