mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-10-20 15:37:27 +08:00
fix(operation-trace): repair export URL, drop dead action, prune unused keys
- Export download failed because the URL builder appended the path to a "/" base, producing a protocol-relative "//api/..." URL that the browser read as host "api"; the request never reached the backend. Resolve the base to the current origin, mirroring the other URL builders. - Remove the orphan ``clear_prune`` action: the branch has no prune/clear route and no route rule maps to it, so it could never be produced. Its i18n key is removed too. - Remove ``tamperedCount``, now unreferenced after the verification badge was split into integrity/chain counters. The operationTrace catalogue is now free of unproduced keys. - Correct the settings controller docstring: only governance, operation logs, filters and export routes exist; there is no on-demand delete. Verified: no producer for clear_prune, classify() can no longer emit it, operationTrace orphan scan returns none, tsc/check-i18n/prettier/py_compile all pass.
This commit is contained in:
@@ -1867,12 +1867,19 @@ export class BackendClient extends BaseHttpClient {
|
||||
params.set(key, String(value));
|
||||
}
|
||||
const suffix = params.toString();
|
||||
return `${this.getBaseUrl()}/api/v1/settings/operation-logs/export${
|
||||
// A base of "/" means "same origin". Appending the path directly produced
|
||||
// a protocol-relative "//api/..." URL, which a browser reads as the host
|
||||
// "api" — the export request then never reached the backend. Resolve the
|
||||
// base to the current origin first, mirroring the other URL builders here.
|
||||
const apiBase =
|
||||
this.instance.defaults.baseURL === '/' || !this.instance.defaults.baseURL
|
||||
? window.location.origin
|
||||
: this.instance.defaults.baseURL.replace(/\/$/, '');
|
||||
return `${apiBase}/api/v1/settings/operation-logs/export${
|
||||
suffix ? `?${suffix}` : ''
|
||||
}`;
|
||||
}
|
||||
|
||||
|
||||
public setPassword(
|
||||
newPassword: string,
|
||||
currentPassword?: string,
|
||||
|
||||
Reference in New Issue
Block a user