mirror of
https://github.com/lWolvesl/antigravity-usage-monitor.git
synced 2026-11-26 17:09:28 +08:00
fix(panel): auto-provision Desktop argv.json and surface CDP bridge diagnostics for 2.33.0+ (Refs #26)
This commit is contained in:
@@ -103,9 +103,22 @@ export const SettingsView = defineComponent({
|
||||
const telemetry = telemetryStore.getState().telemetry;
|
||||
const settings = telemetry?.settings;
|
||||
if (settingsSubTab === 'structure') {
|
||||
if (settings) structureTab.refs.renderSettings(settings);
|
||||
if (settings) {
|
||||
structureTab.refs.renderSettings(
|
||||
settings,
|
||||
telemetry?.windowBridge,
|
||||
telemetry?.hostPlatform
|
||||
);
|
||||
}
|
||||
} else if (settingsSubTab === 'other') {
|
||||
if (settings) otherTab.refs.renderSettings(settings, telemetry.contextWindowModels || []);
|
||||
if (settings) {
|
||||
otherTab.refs.renderSettings(
|
||||
settings,
|
||||
telemetry.contextWindowModels || [],
|
||||
telemetry?.windowBridge,
|
||||
telemetry?.hostPlatform
|
||||
);
|
||||
}
|
||||
} else if (accountTab && settingsSubTab === 'account') {
|
||||
accountTab.refs.renderAccount(telemetry?.account, telemetry?.quotas);
|
||||
} else {
|
||||
@@ -118,6 +131,8 @@ export const SettingsView = defineComponent({
|
||||
const unsubTelemetry = telemetryStore.subscribe(
|
||||
(st) => ({
|
||||
settings: st.telemetry?.settings,
|
||||
windowBridge: st.telemetry?.windowBridge,
|
||||
hostPlatform: st.telemetry?.hostPlatform,
|
||||
cloudStatus: st.telemetry?.cloudStatus,
|
||||
contextWindowModels: st.telemetry?.contextWindowModels,
|
||||
account: st.telemetry?.account,
|
||||
|
||||
@@ -17,6 +17,7 @@ import {
|
||||
saveSettingsPatch,
|
||||
} from '../../store/telemetryStore.js';
|
||||
import { CustomSelect } from '../../components/ui/CustomSelect.js';
|
||||
import { BridgeStatusNotice } from '../../components/settings/BridgeStatusNotice.js';
|
||||
|
||||
function getStepModelDisplayOptions() {
|
||||
return [
|
||||
@@ -41,6 +42,8 @@ export const SettingsOtherTab = defineComponent({
|
||||
let draftContextRiskAccepted = false;
|
||||
let acceptingContextRisk = false;
|
||||
let latestSettings = null;
|
||||
let latestWindowBridge = null;
|
||||
let latestHostPlatform = 'win32';
|
||||
let contextWindowModels = [];
|
||||
let contextModelId = '';
|
||||
let savingContextWindow = false;
|
||||
@@ -190,9 +193,11 @@ export const SettingsOtherTab = defineComponent({
|
||||
}
|
||||
},
|
||||
});
|
||||
const ctxBridgeNotice = BridgeStatusNotice({ contextMode: true });
|
||||
const ctxModelRow = h('div', { className: 'form-row' }, [ctxModelLabel, ctxModelSelect.el]);
|
||||
const ctxWindowRow = h('div', { className: 'form-row' }, [ctxWindowLabel, ctxWindowSelect.el]);
|
||||
const ctxControlsBody = h('div', { className: 'ctx-controls-body is-locked' }, [
|
||||
ctxBridgeNotice.el,
|
||||
ctxModelRow,
|
||||
ctxWindowRow,
|
||||
h('div', { className: 'form-row' }, [ctxHint]),
|
||||
@@ -269,6 +274,11 @@ export const SettingsOtherTab = defineComponent({
|
||||
patchAttr(ctxRiskAcceptBtn, 'disabled', acceptingContextRisk);
|
||||
|
||||
const saved = latestSettings?.modelContextWindows || {};
|
||||
ctxBridgeNotice.refs.update({
|
||||
visible: unlocked && Object.keys(saved).length > 0,
|
||||
windowBridge: latestWindowBridge,
|
||||
hostPlatform: latestHostPlatform,
|
||||
});
|
||||
const models = new Map(contextWindowModels.map((model) => [model.id, model]));
|
||||
const knownIds = new Set(contextWindowModels.flatMap(({ id, members = [] }) => [id, ...members]));
|
||||
for (const id of Object.keys(saved)) {
|
||||
@@ -483,10 +493,17 @@ export const SettingsOtherTab = defineComponent({
|
||||
maintPanel,
|
||||
]);
|
||||
|
||||
function renderSettings(settings, models = contextWindowModels) {
|
||||
function renderSettings(
|
||||
settings,
|
||||
models = contextWindowModels,
|
||||
windowBridge = latestWindowBridge,
|
||||
hostPlatform = latestHostPlatform
|
||||
) {
|
||||
if (!settings) return;
|
||||
latestSettings = settings;
|
||||
contextWindowModels = models;
|
||||
if (windowBridge !== undefined) latestWindowBridge = windowBridge;
|
||||
if (hostPlatform) latestHostPlatform = hostPlatform;
|
||||
draftModelDisplayMode = normalizeClientModelDisplayMode(
|
||||
settings.modelDisplayMode,
|
||||
settings.showUpstreamModel
|
||||
@@ -544,6 +561,7 @@ export const SettingsOtherTab = defineComponent({
|
||||
if (resetConfirmTimer) clearTimeout(resetConfirmTimer);
|
||||
stepModelSelect.destroy();
|
||||
orchestratorIdSelect.destroy();
|
||||
ctxBridgeNotice.destroy();
|
||||
ctxModelSelect.destroy();
|
||||
ctxWindowSelect.destroy();
|
||||
});
|
||||
@@ -553,6 +571,7 @@ export const SettingsOtherTab = defineComponent({
|
||||
refs: {
|
||||
stepModelSelect,
|
||||
orchestratorIdSelect,
|
||||
ctxBridgeNotice,
|
||||
ctxModelSelect,
|
||||
ctxWindowSelect,
|
||||
rebuildCacheBtn,
|
||||
|
||||
@@ -41,6 +41,7 @@ import {
|
||||
saveSettingsPatch,
|
||||
} from '../../store/telemetryStore.js';
|
||||
import { getVisibleMonitorView, uiStore } from '../../store/uiStore.js';
|
||||
import { BridgeStatusNotice } from '../../components/settings/BridgeStatusNotice.js';
|
||||
import { CollapsibleSection } from '../../components/settings/CollapsibleSection.js';
|
||||
import { EditableSlotList } from '../../components/settings/EditableSlotList.js';
|
||||
import { buildStructurePreviewTelemetry } from '../../components/settings/structurePreviewMock.js';
|
||||
@@ -119,6 +120,8 @@ export const SettingsStructureTab = defineComponent({
|
||||
let rawStepTokenComboText = DEFAULT_CLIENT_STEP_TOKEN_COMBO_FORMAT;
|
||||
let draftStepColumns = [...DEFAULT_CLIENT_STEP_COLUMNS];
|
||||
let latestSettings = null;
|
||||
let latestWindowBridge = null;
|
||||
let latestHostPlatform = 'win32';
|
||||
|
||||
function isStructureVisible() {
|
||||
const st = uiStore.getState();
|
||||
@@ -329,6 +332,8 @@ export const SettingsStructureTab = defineComponent({
|
||||
},
|
||||
});
|
||||
|
||||
const mountBridgeNotice = BridgeStatusNotice({});
|
||||
|
||||
const mountSection = CollapsibleSection({
|
||||
collapsible: false,
|
||||
icon: 'dock',
|
||||
@@ -362,6 +367,7 @@ export const SettingsStructureTab = defineComponent({
|
||||
mountPreviewCanvas,
|
||||
h('div', { className: 'settings-divider' }),
|
||||
h('div', { className: 'form-row' }, [mountModeLabelEl, windowMountSelect.el]),
|
||||
mountBridgeNotice.el,
|
||||
h('div', { className: 'form-row' }, [
|
||||
h('div', { className: 'settings-inline-row' }, [
|
||||
popoverWidthLabelEl,
|
||||
@@ -394,6 +400,11 @@ export const SettingsStructureTab = defineComponent({
|
||||
modelValue: draftWindowMountMode,
|
||||
options: getMountModeOptions(),
|
||||
});
|
||||
mountBridgeNotice.refs.update({
|
||||
visible: draftWindowMountMode !== 'sidebar',
|
||||
windowBridge: latestWindowBridge,
|
||||
hostPlatform: latestHostPlatform,
|
||||
});
|
||||
popoverWidthModeToggle.setProps({
|
||||
modelValue: draftPopoverWidthMode,
|
||||
options: getPopoverWidthModeOptions(),
|
||||
@@ -983,9 +994,15 @@ export const SettingsStructureTab = defineComponent({
|
||||
stepsSection.el,
|
||||
]);
|
||||
|
||||
function renderSettings(settings) {
|
||||
function renderSettings(
|
||||
settings,
|
||||
windowBridge = latestWindowBridge,
|
||||
hostPlatform = latestHostPlatform
|
||||
) {
|
||||
if (!settings) return;
|
||||
latestSettings = settings;
|
||||
if (windowBridge !== undefined) latestWindowBridge = windowBridge;
|
||||
if (hostPlatform) latestHostPlatform = hostPlatform;
|
||||
draftWindowMountMode = normalizeClientWindowMountMode(
|
||||
settings.windowMountMode,
|
||||
settings.enableWindowOverlay
|
||||
@@ -1087,6 +1104,7 @@ export const SettingsStructureTab = defineComponent({
|
||||
|
||||
onCleanup(() => {
|
||||
unsubUi();
|
||||
mountBridgeNotice.destroy();
|
||||
capsulePreviewWidget.destroy();
|
||||
hoverPreviewHost.destroy();
|
||||
overviewPreviewHost.destroy();
|
||||
@@ -1115,6 +1133,7 @@ export const SettingsStructureTab = defineComponent({
|
||||
refs: {
|
||||
thirdNavBar,
|
||||
capsulePreviewWidget,
|
||||
mountBridgeNotice,
|
||||
hoverPreviewHost,
|
||||
overviewPreviewHost,
|
||||
stepTablePreview,
|
||||
|
||||
Reference in New Issue
Block a user