mirror of
https://github.com/lWolvesl/antigravity-usage-monitor.git
synced 2026-11-27 01:19:25 +08:00
feat(panel): modularize 3-tab preferences, add model context windows, and optimize telemetry
- Refactor Preferences into decoupled General, Structure, and Other tabs with unified settings schema, factory reset, and trajectory cache rebuild endpoints - Extract standalone widget, metric, and step-table column registries to customize topbar/composer slots, hover popup modules, live overview layout, and step detail columns - Add bilingual zh-CN/en-US i18n dictionaries, theme accent presets, and font scale controls across Shadow DOM overlay and sidebar views - Support per-model host-advertised context window rules across App and IDE transports - Preserve CLEARED step generation timings, memoize per-poll model resolution, optimize LOESS sorted-x fitting, and update bilingual READMEs and test suites
This commit is contained in:
@@ -15,7 +15,10 @@ import { Response, SidecarApp } from 'sidecar_sdk';
|
||||
import {
|
||||
bootWindowBridgeRuntime,
|
||||
executeCloudSyncAction,
|
||||
executeModelContextWindowAction,
|
||||
executePluginUpdateAction,
|
||||
executeRebuildCacheAction,
|
||||
executeResetSettingsAction,
|
||||
executeSettingsAction,
|
||||
executeTelemetryAction,
|
||||
isLocalHostRequest,
|
||||
@@ -98,6 +101,54 @@ app.api('/api/settings', (data, req) => {
|
||||
return out.updated;
|
||||
});
|
||||
|
||||
app.api('/api/context-window', async (data, req) => {
|
||||
if (!isLocalHostRequest(req)) {
|
||||
return new Response(JSON.stringify({ error: 'Forbidden host or origin' }), {
|
||||
status: 403,
|
||||
contentType: 'application/json',
|
||||
});
|
||||
}
|
||||
const out = await executeModelContextWindowAction(data);
|
||||
return new Response(out.body, {
|
||||
status: out.status,
|
||||
contentType: out.contentType,
|
||||
headers: out.headers,
|
||||
});
|
||||
});
|
||||
|
||||
app.api('/api/settings/reset', (_data, req) => {
|
||||
if (!isLocalHostRequest(req)) {
|
||||
return new Response(JSON.stringify({ error: 'Forbidden host or origin' }), {
|
||||
status: 403,
|
||||
contentType: 'application/json',
|
||||
});
|
||||
}
|
||||
const out = executeResetSettingsAction();
|
||||
if (!out.ok) {
|
||||
return new Response(out.body, {
|
||||
status: out.status,
|
||||
contentType: out.contentType,
|
||||
headers: out.headers,
|
||||
});
|
||||
}
|
||||
return out.updated;
|
||||
});
|
||||
|
||||
app.api('/api/cache/rebuild', (_data, req) => {
|
||||
if (!isLocalHostRequest(req)) {
|
||||
return new Response(JSON.stringify({ error: 'Forbidden host or origin' }), {
|
||||
status: 403,
|
||||
contentType: 'application/json',
|
||||
});
|
||||
}
|
||||
const out = executeRebuildCacheAction();
|
||||
return new Response(out.body, {
|
||||
status: out.status,
|
||||
contentType: out.contentType,
|
||||
headers: out.headers,
|
||||
});
|
||||
});
|
||||
|
||||
app.api('/api/cloud-sync', async (_data, req) => {
|
||||
if (!isLocalHostRequest(req)) {
|
||||
return new Response(JSON.stringify({ error: 'Forbidden host or origin' }), {
|
||||
|
||||
Reference in New Issue
Block a user