更新后刷新配置到设备
This commit is contained in:
@@ -287,6 +287,7 @@ export async function executeFrontendTool(
|
||||
}
|
||||
}
|
||||
await api.setSetting(params);
|
||||
await api.refreshState();
|
||||
// 回传给 AI 的仍以人类可读的 dB 展示
|
||||
return { ok: true, content: { ok: true, updated: rawParams } };
|
||||
}
|
||||
@@ -334,11 +335,13 @@ export async function executeFrontendTool(
|
||||
canDel: p.canDel,
|
||||
},
|
||||
});
|
||||
await api.refreshState();
|
||||
return { ok: true, content: { ok: true, name: p.name } };
|
||||
}
|
||||
case "delete_peqs": {
|
||||
const names = (block.input?.names ?? []) as string[];
|
||||
await api.removePeq(names);
|
||||
await api.refreshState();
|
||||
return { ok: true, content: { ok: true, deleted: names } };
|
||||
}
|
||||
default:
|
||||
|
||||
@@ -218,6 +218,10 @@ export class LuxsinAPI {
|
||||
return parseInt(text.trim(), 10);
|
||||
}
|
||||
|
||||
async refreshState(): Promise<void> {
|
||||
await fetch(`${this.baseUrl}/msgAdd`);
|
||||
}
|
||||
|
||||
async setSetting(params: Record<string, string | number>): Promise<void> {
|
||||
const query = Object.entries(params)
|
||||
.map(([k, v]) => `${k}=${v}`)
|
||||
|
||||
@@ -586,6 +586,7 @@ export default function AIPage({ variant = "page", onClose }: AIPageProps = {})
|
||||
},
|
||||
});
|
||||
await updateMessageApplied(msg.id, nextApplied);
|
||||
await api.refreshState();
|
||||
setMessages((prev) =>
|
||||
prev.map((m) =>
|
||||
m.kind === "optimize" && m.id === msg.id
|
||||
|
||||
Reference in New Issue
Block a user