mirror of
https://github.com/lWolvesl/antigravity-usage-monitor.git
synced 2026-11-26 17:09:28 +08:00
feat(panel): add experimental quota reservation estimator, violet bar indicator, and clipboard log export
This commit is contained in:
@@ -556,6 +556,20 @@ export function normalizeContextAgentMode(raw) {
|
||||
return val === 'auto' ? 'auto' : 'main';
|
||||
}
|
||||
|
||||
/**
|
||||
* 归一化实验性配额预占估算开关(默认 `false`)。
|
||||
*
|
||||
* @param {unknown} val
|
||||
* @returns {boolean}
|
||||
*/
|
||||
export function normalizeExperimentalQuotaReservation(val) {
|
||||
if (typeof val === 'string') {
|
||||
const lower = val.trim().toLowerCase();
|
||||
return lower === 'true' || lower === '1' || lower === 'on';
|
||||
}
|
||||
return Boolean(val);
|
||||
}
|
||||
|
||||
/**
|
||||
* 归一化旧版实验性新 UI 字段(保留兼容,缺省返回 `false`)。
|
||||
*
|
||||
|
||||
@@ -40,6 +40,11 @@ export const BRIDGE_API_ROUTE_DEFS = Object.freeze([
|
||||
}),
|
||||
Object.freeze({ path: '/api/export-file', method: 'POST', action: 'export_file' }),
|
||||
Object.freeze({ path: '/api/reveal-file', method: 'POST', action: 'reveal_file' }),
|
||||
Object.freeze({
|
||||
path: '/api/quota-reservation/log',
|
||||
method: 'GET',
|
||||
action: 'quota_reservation_log',
|
||||
}),
|
||||
]);
|
||||
|
||||
export const BRIDGE_API_PATHS = Object.freeze(BRIDGE_API_ROUTE_DEFS.map((r) => r.path));
|
||||
|
||||
Reference in New Issue
Block a user