fix: rowid column shift in get_message_with_rowid; add file logging and frontend error reporting

This commit is contained in:
Xianren Studio
2026-08-13 23:31:06 +08:00
parent 57df39e4ce
commit 00624d81cf
8 changed files with 77 additions and 4 deletions
+19 -1
View File
@@ -1,10 +1,28 @@
import { invoke } from "@tauri-apps/api/core";
import { invoke as rawInvoke } from "@tauri-apps/api/core";
import { listen } from "@tauri-apps/api/event";
/** 统一命令包装:失败时自动上报错误到本地日志,再抛出给界面。 */
async function invoke<T>(command: string, args?: Record<string, unknown>): Promise<T> {
try {
return await rawInvoke<T>(command, args);
} catch (error) {
try {
await rawInvoke("report_error", {
source: command,
message: String(error),
});
} catch {
// 上报失败不影响主流程
}
throw error;
}
}
export interface AppInfo {
version: string;
platform: string;
models_dir: string;
logs_dir: string;
engine_bin: string | null;
engine_exists: boolean;
db_path: string;
+13 -1
View File
@@ -30,6 +30,19 @@ export default function SettingsPage() {
<div>
<span className="text-slate-300">{info?.db_path}</span>
</div>
<div className="flex items-center gap-2">
<span>
<span className="text-slate-300">{info?.logs_dir}</span>
</span>
{info?.logs_dir ? (
<button
className="text-xs text-slate-400 hover:text-slate-200"
onClick={() => api.openPath(info.logs_dir!)}
>
</button>
) : null}
</div>
<div>
{info?.engine_exists ? (
@@ -103,4 +116,3 @@ function SettingInput({
</label>
);
}