mirror of
https://github.com/lWolvesl/antigravity-usage-monitor.git
synced 2026-11-26 17:09:28 +08:00
perf(panel): isolate host main.mjs startup, fix standalone CLI args, and close P0 audit bugs
This commit is contained in:
@@ -107,20 +107,24 @@ export const TopSessionHeader = defineComponent({
|
||||
|
||||
let lastActiveCascadeId = '';
|
||||
|
||||
function syncSessionScopeOnCascadeChange(telemetry) {
|
||||
const currentCascadeId = telemetry?.activeConversation?.cascadeId || '';
|
||||
if (!currentCascadeId) return;
|
||||
if (lastActiveCascadeId && currentCascadeId !== lastActiveCascadeId) {
|
||||
lastActiveCascadeId = currentCascadeId;
|
||||
const uiSt = uiStore.getState();
|
||||
if (uiSt.selectedAgentScope !== 'all' || uiSt.ctxInspectorAgentId !== 'auto') {
|
||||
uiStore.setState({ selectedAgentScope: 'all', ctxInspectorAgentId: 'auto' });
|
||||
}
|
||||
} else {
|
||||
lastActiveCascadeId = currentCascadeId;
|
||||
}
|
||||
}
|
||||
|
||||
function renderHeaderState() {
|
||||
const telSt = telemetryStore.getState();
|
||||
const uiSt = uiStore.getState();
|
||||
const telemetry = telSt.telemetry;
|
||||
const currentCascadeId = telemetry?.activeConversation?.cascadeId || '';
|
||||
if (currentCascadeId && lastActiveCascadeId && currentCascadeId !== lastActiveCascadeId) {
|
||||
lastActiveCascadeId = currentCascadeId;
|
||||
if (uiSt.selectedAgentScope !== 'all' || uiSt.ctxInspectorAgentId !== 'auto') {
|
||||
uiStore.setState({ selectedAgentScope: 'all', ctxInspectorAgentId: 'auto' });
|
||||
return;
|
||||
}
|
||||
} else if (currentCascadeId) {
|
||||
lastActiveCascadeId = currentCascadeId;
|
||||
}
|
||||
if (!uiSt.monitorVisible) return;
|
||||
|
||||
patchAttr(updateBtn, 'aria-label', t('header.ariaUpdate'));
|
||||
@@ -278,7 +282,10 @@ export const TopSessionHeader = defineComponent({
|
||||
syncState: st.syncState,
|
||||
telemetry: st.telemetry,
|
||||
}),
|
||||
() => renderHeaderState()
|
||||
(slice) => {
|
||||
syncSessionScopeOnCascadeChange(slice.telemetry);
|
||||
renderHeaderState();
|
||||
}
|
||||
);
|
||||
|
||||
const unsubI18n = i18nStore.subscribe(
|
||||
|
||||
@@ -182,6 +182,7 @@ export const I18N_MESSAGES_EN_US = Object.freeze({
|
||||
'live.currentSession': 'Current Session',
|
||||
'live.switchSessionTitle': 'Switch monitor to session: {title}',
|
||||
'live.thinking': 'Thinking',
|
||||
'live.generating': 'Generating',
|
||||
'live.running': 'Running',
|
||||
'live.done': 'Done',
|
||||
'live.doneWithSteps': 'Done ({steps} steps)',
|
||||
|
||||
@@ -182,6 +182,7 @@ export const I18N_MESSAGES_ZH_CN = Object.freeze({
|
||||
'live.currentSession': '当前会话',
|
||||
'live.switchSessionTitle': '点击切换查看会话:{title}',
|
||||
'live.thinking': '推理中',
|
||||
'live.generating': '生成中',
|
||||
'live.running': '运行中',
|
||||
'live.done': '已完成',
|
||||
'live.doneWithSteps': '已完成 ({steps} 步)',
|
||||
|
||||
@@ -800,7 +800,7 @@ export const SettingsStructureTab = defineComponent({
|
||||
items: draftStepColumns,
|
||||
options: getStepColumnOptions(draftStepTokenComboFormat),
|
||||
minItems: 2,
|
||||
maxItems: 15,
|
||||
maxItems: 14,
|
||||
addBtnTextFn: (count, max) => t('settings.str.addStepCol', { count, max }),
|
||||
onPreview: (previewItems) => {
|
||||
draftStepColumns = normalizeClientStepColumns(previewItems);
|
||||
|
||||
Reference in New Issue
Block a user