Add approval mode selection
CI / Rust Checks (push) Successful in 5m35s
CI / UI Checks (push) Successful in 5s
CI / Deployment Manifests (push) Successful in 2s
CI / Frontend E2E (push) Successful in 3m28s
CI / Deploy (push) Successful in 1m38s

This commit is contained in:
github-ops
2026-06-27 07:55:38 +00:00
parent 2b2ff92146
commit 700a684257
15 changed files with 425 additions and 31 deletions
+15
View File
@@ -43,10 +43,14 @@ function buildApprovalPolicy() {
return {
required: true,
mode: textValue('approval-mode') || 'custom',
risk_level: 'normal',
ttl_seconds: normalizeApprovalTtlSeconds(textValue('approval-ttl-seconds')),
show_payload_preview: checkedValue('approval-show-payload-preview'),
payload_preview_mode: textValue('approval-payload-preview-mode') || 'summary',
elicitation_message: textValue('approval-mode') === 'elicitation'
? (textValue('approval-elicitation-message') || null)
: null,
};
}
@@ -186,6 +190,8 @@ function setApprovalPolicyEditor(policy) {
var enabled = !!(policy && policy.required);
var required = document.getElementById('approval-required');
if (required) required.checked = enabled;
setValue('approval-mode', policy && policy.mode ? policy.mode : 'custom');
setValue('approval-elicitation-message', policy && policy.elicitation_message ? policy.elicitation_message : '');
setValue('approval-ttl-seconds', policy && policy.ttl_seconds ? String(policy.ttl_seconds) : '300');
var showPayload = document.getElementById('approval-show-payload-preview');
if (showPayload) {
@@ -199,13 +205,22 @@ function updateApprovalPolicyUi() {
var enabled = checkedValue('approval-required');
var toggle = document.getElementById('approval-required-toggle');
var fields = document.getElementById('approval-config-fields');
var mode = textValue('approval-mode') || 'custom';
var customInfo = document.getElementById('approval-custom-info');
var elicitationInfo = document.getElementById('approval-elicitation-info');
var elicitationMessage = document.getElementById('approval-elicitation-message-group');
if (toggle) toggle.classList.toggle('on', enabled);
if (fields) fields.hidden = !enabled;
if (customInfo) customInfo.hidden = mode !== 'custom';
if (elicitationInfo) elicitationInfo.hidden = mode !== 'elicitation';
if (elicitationMessage) elicitationMessage.hidden = mode !== 'elicitation';
}
function bindApprovalPolicyControls() {
[
'approval-required',
'approval-mode',
'approval-elicitation-message',
'approval-ttl-seconds',
'approval-show-payload-preview',
'approval-payload-preview-mode',