Add files via upload

This commit is contained in:
公明
2026-07-14 14:34:48 +08:00
committed by GitHub
parent 6bafb8fe70
commit bbbe77e90c
6 changed files with 126 additions and 4 deletions
+74
View File
@@ -37068,6 +37068,80 @@ html[data-theme="dark"] .workflow-status-toggle.is-disabled {
transform: translateX(16px);
}
.workflow-dry-run-modal-content {
width: min(420px, calc(100vw - 32px));
max-width: 420px;
height: auto !important;
margin: 14vh auto auto;
border-radius: 14px;
}
.workflow-dry-run-modal-content .workflow-dry-run-modal-header {
padding: 14px 18px;
box-shadow: none;
}
.workflow-dry-run-modal-title-group {
display: flex;
align-items: center;
gap: 10px;
}
.workflow-dry-run-modal-icon {
width: 30px;
height: 30px;
display: inline-grid;
flex: 0 0 30px;
place-items: center;
color: var(--accent-color);
border-radius: 9px;
background: color-mix(in srgb, var(--accent-color) 10%, var(--bg-primary));
}
.workflow-dry-run-modal-content .workflow-dry-run-modal-header h2 {
margin: 0;
font-size: 15px;
font-weight: 700;
}
.workflow-dry-run-modal-content .workflow-dry-run-modal-body {
padding: 18px;
overflow: visible;
}
.workflow-dry-run-modal-field.form-group {
gap: 7px;
margin: 0;
}
.workflow-dry-run-modal-field label {
color: var(--text-primary);
font-size: 13px;
font-weight: 600;
}
.workflow-dry-run-modal-field .form-input {
height: 38px;
box-sizing: border-box;
}
.workflow-dry-run-modal-field .form-hint {
margin: 0;
color: var(--text-secondary);
font-size: 11px;
line-height: 1.45;
}
.workflow-dry-run-modal-content .workflow-dry-run-modal-footer {
gap: 8px;
padding: 12px 18px;
}
html[data-theme="dark"] .workflow-dry-run-modal-icon {
color: #bfdbfe;
background: rgba(59, 130, 246, 0.14);
}
.form-required {
color: #ef4444;
}
+1
View File
@@ -3322,6 +3322,7 @@
"loadFailed": "Failed to load workflows",
"saveFailed": "Failed to save workflow",
"dryRunPrompt": "Input message for dry-run",
"dryRunPromptHint": "This message is passed to the Start node as the message input.",
"dryRunFailed": "Dry-run failed",
"dryRunDone": "Dry-run completed",
"dryRunTrace": "Dry-run trace",
+1
View File
@@ -3310,6 +3310,7 @@
"loadFailed": "加载工作流失败",
"saveFailed": "保存工作流失败",
"dryRunPrompt": "输入试运行消息",
"dryRunPromptHint": "该消息将作为开始节点的 message 输入。",
"dryRunFailed": "试运行失败",
"dryRunDone": "试运行完成",
"dryRunTrace": "试运行轨迹",
+1
View File
@@ -14,6 +14,7 @@
'batch-manage-modal',
'create-group-modal',
'workflow-meta-modal',
'workflow-dry-run-modal',
'login-overlay',
]);
+25 -4
View File
@@ -1678,7 +1678,7 @@
}
};
window.dryRunWorkflowDraft = async function () {
window.dryRunWorkflowDraft = function () {
initCy();
const graph = elementsToGraph();
const errors = validateWorkflowGraph(graph);
@@ -1686,8 +1686,29 @@
showNotification(errors.slice(0, 4).join(''), 'error');
return;
}
const message = window.prompt(_t('workflows.dryRunPrompt') || 'Input message for dry-run', 'ping');
if (message === null) return;
const input = document.getElementById('workflow-dry-run-message');
if (input) input.value = 'ping';
if (typeof openAppModal === 'function') {
openAppModal('workflow-dry-run-modal', { focusEl: input });
if (input) requestAnimationFrame(function () { input.select(); });
}
};
window.closeWorkflowDryRunModal = function () {
if (typeof closeAppModal === 'function') closeAppModal('workflow-dry-run-modal');
};
window.submitWorkflowDryRun = async function () {
initCy();
const graph = elementsToGraph();
const errors = validateWorkflowGraph(graph);
if (errors.length) {
showNotification(errors.slice(0, 4).join(''), 'error');
return;
}
const input = document.getElementById('workflow-dry-run-message');
const message = input && input.value.trim() ? input.value.trim() : 'ping';
closeWorkflowDryRunModal();
try {
const response = await apiFetch('/api/workflows/dry-run', {
method: 'POST',
@@ -2437,7 +2458,7 @@
if (page && typeof window.applyTranslations === 'function') {
window.applyTranslations(page);
}
['workflow-package-import-modal', 'workflow-package-overwrite-modal'].forEach(function (id) {
['workflow-dry-run-modal', 'workflow-package-import-modal', 'workflow-package-overwrite-modal'].forEach(function (id) {
const modal = document.getElementById(id);
if (modal && typeof window.applyTranslations === 'function') window.applyTranslations(modal);
});
+24
View File
@@ -4920,6 +4920,30 @@
</div>
</div>
</div>
<div id="workflow-dry-run-modal" class="modal" style="display: none;" role="dialog" aria-modal="true" aria-labelledby="workflow-dry-run-modal-title" onclick="if(event.target===this)closeWorkflowDryRunModal()" onkeydown="if(event.key==='Escape')closeWorkflowDryRunModal()">
<form class="modal-content workflow-dry-run-modal-content" onsubmit="event.preventDefault(); submitWorkflowDryRun()" onclick="event.stopPropagation()">
<div class="modal-header workflow-dry-run-modal-header">
<div class="workflow-dry-run-modal-title-group">
<span class="workflow-dry-run-modal-icon" aria-hidden="true">
<svg width="17" height="17" viewBox="0 0 24 24" fill="currentColor"><path d="M8 5.4v13.2a1 1 0 0 0 1.55.84l9.2-6.6a1 1 0 0 0 0-1.68l-9.2-6.6A1 1 0 0 0 8 5.4Z"/></svg>
</span>
<h2 id="workflow-dry-run-modal-title" data-i18n="workflows.dryRun">试运行</h2>
</div>
<button type="button" class="modal-close" onclick="closeWorkflowDryRunModal()" data-i18n="common.close" data-i18n-attr="aria-label" data-i18n-skip-text="true" aria-label="关闭"></button>
</div>
<div class="modal-body workflow-dry-run-modal-body">
<div class="form-group workflow-dry-run-modal-field">
<label for="workflow-dry-run-message" data-i18n="workflows.dryRunPrompt">输入试运行消息</label>
<input type="text" id="workflow-dry-run-message" class="form-input" value="ping" autocomplete="off" spellcheck="false">
<small class="form-hint" data-i18n="workflows.dryRunPromptHint">该消息将作为开始节点的 message 输入。</small>
</div>
</div>
<div class="modal-footer workflow-dry-run-modal-footer">
<button type="button" class="btn-secondary btn-small" onclick="closeWorkflowDryRunModal()" data-i18n="common.cancel">取消</button>
<button type="submit" class="btn-primary btn-small" data-i18n="workflows.dryRun">试运行</button>
</div>
</form>
</div>
<div id="workflow-package-import-modal" class="modal workflow-package-modal" style="display: none;" role="dialog" aria-modal="true" aria-labelledby="workflow-package-import-title">
<div class="modal-content workflow-package-modal-content">
<div class="modal-header workflow-package-modal-header">