v2.2.17: Google Service Control & Astra Office Flow Layer
This commit is contained in:
@@ -41,6 +41,22 @@
|
||||
const advAutoSteps = $('advAutoSteps');
|
||||
const advCtxSize = $('advCtxSize');
|
||||
|
||||
// ---- Google (Calendar + Sheets) ----
|
||||
const gClientId = $('gClientId');
|
||||
const gClientSecret = $('gClientSecret');
|
||||
const gCalendarId = $('gCalendarId');
|
||||
const gDefaultDur = $('gDefaultDur');
|
||||
const gIcalUrl = $('gIcalUrl');
|
||||
const gIcalDays = $('gIcalDays');
|
||||
const googleConnStatus = $('googleConnStatus');
|
||||
const googleConnStatusInline = $('googleConnStatusInline');
|
||||
const googleConnectBtn = $('googleConnect');
|
||||
const googleDisconnectBtn = $('googleDisconnect');
|
||||
const googleIcalRefreshBtn = $('googleIcalRefresh');
|
||||
const googleIcalStatus = $('googleIcalStatus');
|
||||
const googleFeedback = $('googleFeedback');
|
||||
const googleError = $('googleError');
|
||||
|
||||
// ---- Banner ----
|
||||
const bannerError = $('bannerError');
|
||||
|
||||
@@ -115,6 +131,32 @@
|
||||
document.querySelector('[data-save="advanced.autoSteps"]').addEventListener('click', () =>
|
||||
vscode.postMessage({ type: 'advanced.update', maxAutoSteps: Number(advAutoSteps.value) })
|
||||
);
|
||||
// ---- Google listeners ----
|
||||
document.querySelector('[data-save="google.clientId"]').addEventListener('click', () =>
|
||||
vscode.postMessage({ type: 'google.update', clientId: gClientId.value })
|
||||
);
|
||||
document.querySelector('[data-save="google.clientSecret"]').addEventListener('click', () => {
|
||||
// 저장 후 입력 필드는 비움 — 다음부터는 placeholder 가 "저장됨" 으로 표시됨.
|
||||
vscode.postMessage({ type: 'google.update', clientSecret: gClientSecret.value });
|
||||
gClientSecret.value = '';
|
||||
});
|
||||
document.querySelector('[data-save="google.calendarId"]').addEventListener('click', () =>
|
||||
vscode.postMessage({ type: 'google.update', calendarId: gCalendarId.value })
|
||||
);
|
||||
document.querySelector('[data-save="google.defaultEventDurationMinutes"]').addEventListener('click', () =>
|
||||
vscode.postMessage({ type: 'google.update', defaultEventDurationMinutes: Number(gDefaultDur.value) })
|
||||
);
|
||||
document.querySelector('[data-save="google.icalUrl"]').addEventListener('click', () => {
|
||||
vscode.postMessage({ type: 'google.update', icalUrl: gIcalUrl.value });
|
||||
gIcalUrl.value = '';
|
||||
});
|
||||
document.querySelector('[data-save="google.icalDaysAhead"]').addEventListener('click', () =>
|
||||
vscode.postMessage({ type: 'google.update', icalDaysAhead: Number(gIcalDays.value) })
|
||||
);
|
||||
googleConnectBtn.addEventListener('click', () => vscode.postMessage({ type: 'google.connect' }));
|
||||
googleDisconnectBtn.addEventListener('click', () => vscode.postMessage({ type: 'google.disconnect' }));
|
||||
googleIcalRefreshBtn.addEventListener('click', () => vscode.postMessage({ type: 'google.icalRefresh' }));
|
||||
|
||||
document.querySelector('[data-save="advanced.ctxSize"]').addEventListener('click', () =>
|
||||
vscode.postMessage({ type: 'advanced.update', maxContextSize: Number(advCtxSize.value) })
|
||||
);
|
||||
@@ -264,6 +306,32 @@
|
||||
advMulti.checked = !!adv.multiAgentEnabled;
|
||||
setIfNotFocused(advAutoSteps, adv.maxAutoSteps);
|
||||
setIfNotFocused(advCtxSize, adv.maxContextSize);
|
||||
|
||||
// ---- Google (Calendar + Sheets) ----
|
||||
const g = state.google;
|
||||
if (g) {
|
||||
setIfNotFocused(gClientId, g.clientId);
|
||||
// Secret 은 값 자체를 화면에 안 그림 — 설정 여부만 placeholder 로 표현.
|
||||
gClientSecret.placeholder = g.hasClientSecret ? '••• 저장됨 (덮어쓰려면 새 값 입력)' : 'GOCSPX-...';
|
||||
setIfNotFocused(gCalendarId, g.calendarId);
|
||||
setIfNotFocused(gDefaultDur, g.defaultEventDurationMinutes);
|
||||
gIcalUrl.placeholder = g.hasIcalUrl ? '••• 저장됨 (덮어쓰려면 새 URL 입력)' : 'https://calendar.google.com/calendar/ical/.../basic.ics';
|
||||
setIfNotFocused(gIcalDays, g.icalDaysAhead);
|
||||
// 연결 상태 readout.
|
||||
if (g.connected) {
|
||||
const at = g.connectedAt ? g.connectedAt.slice(0, 16).replace('T', ' ') : '';
|
||||
googleConnStatus.textContent = `✅ 연결됨${g.connectedAs ? ' · ' + g.connectedAs : ''}${at ? ' (' + at + ')' : ''}`;
|
||||
googleConnStatus.style.color = '#10b981';
|
||||
googleDisconnectBtn.disabled = false;
|
||||
} else {
|
||||
googleConnStatus.textContent = '⛔ OAuth 연결 안됨 — Client ID/Secret 저장 후 [OAuth 연결] 클릭';
|
||||
googleConnStatus.style.color = '';
|
||||
googleDisconnectBtn.disabled = true;
|
||||
}
|
||||
googleIcalStatus.textContent = g.lastIcalFetchAt
|
||||
? `마지막 새로고침: ${g.lastIcalFetchAt.slice(0, 16).replace('T', ' ')}`
|
||||
: '';
|
||||
}
|
||||
}
|
||||
|
||||
vscode.postMessage({ type: 'ready' });
|
||||
|
||||
Reference in New Issue
Block a user