first commit
This commit is contained in:
36
index.html
36
index.html
@@ -228,6 +228,32 @@
|
||||
previewVoice: (provider, voice, text) => new Promise(r => setTimeout(r, 600)),
|
||||
testRAGQuery: (agentId, query) => new Promise(r => setTimeout(r, 1000)),
|
||||
createKnowledgeBase: (data) => new Promise(r => setTimeout(r, 600)),
|
||||
listASRModels: (params) => Promise.resolve({ success: true, data: window.__asrModelRegistry || [], params }),
|
||||
createASRModel: (data) => new Promise(r => setTimeout(() => r({ success: true, data }), 300)),
|
||||
updateASRModel: (id, data) => new Promise(r => setTimeout(() => r({ success: true, data: { id, ...data } }), 300)),
|
||||
deleteASRModel: (id) => new Promise(r => setTimeout(() => r({ success: true, data: { id } }), 300)),
|
||||
validateASRModel: (id, data) => new Promise(r => setTimeout(() => r({ success: true, data: { id, ...data } }), 600)),
|
||||
testASRModel: (id, data) => new Promise(r => setTimeout(() => r({ success: true, data: { id, ...data } }), 500)),
|
||||
setASRModelEnabled: (id, enabled) => new Promise(r => setTimeout(() => r({ success: true, data: { id, enabled } }), 250)),
|
||||
listTTSModels: (params) => Promise.resolve({ success: true, data: window.__ttsModelRegistry || [], params }),
|
||||
createTTSModel: (data) => new Promise(r => setTimeout(() => r({ success: true, data }), 300)),
|
||||
updateTTSModel: (id, data) => new Promise(r => setTimeout(() => r({ success: true, data: { id, ...data } }), 300)),
|
||||
deleteTTSModel: (id) => new Promise(r => setTimeout(() => r({ success: true, data: { id } }), 300)),
|
||||
validateTTSModel: (id, data) => new Promise(r => setTimeout(() => r({ success: true, data: { id, ...data } }), 700)),
|
||||
setTTSModelEnabled: (id, enabled) => new Promise(r => setTimeout(() => r({ success: true, data: { id, enabled } }), 250)),
|
||||
listTextModels: (params) => Promise.resolve({ success: true, data: window.__textModelRegistry || [], params }),
|
||||
createTextModel: (data) => new Promise(r => setTimeout(() => r({ success: true, data }), 300)),
|
||||
updateTextModel: (id, data) => new Promise(r => setTimeout(() => r({ success: true, data: { id, ...data } }), 300)),
|
||||
deleteTextModel: (id) => new Promise(r => setTimeout(() => r({ success: true, data: { id } }), 300)),
|
||||
validateTextModel: (id, data) => new Promise(r => setTimeout(() => r({ success: true, data: { id, ...data } }), 700)),
|
||||
setTextModelEnabled: (id, enabled) => new Promise(r => setTimeout(() => r({ success: true, data: { id, enabled } }), 250)),
|
||||
listVariables: (agentId, params) => Promise.resolve({ success: true, data: window.__agentVariables || [], params: { agentId, ...params } }),
|
||||
createVariable: (agentId, data) => new Promise(r => setTimeout(() => r({ success: true, data: { agentId, ...data } }), 300)),
|
||||
updateVariable: (agentId, variableId, data) => new Promise(r => setTimeout(() => r({ success: true, data: { agentId, variableId, ...data } }), 300)),
|
||||
deleteVariable: (agentId, variableId) => new Promise(r => setTimeout(() => r({ success: true, data: { agentId, variableId } }), 250)),
|
||||
injectVariableToPrompt: (agentId, variableId, data) => new Promise(r => setTimeout(() => r({ success: true, data: { agentId, variableId, ...data } }), 250)),
|
||||
getVariableState: (agentId, sessionId, params) => Promise.resolve({ success: true, data: {}, params: { agentId, sessionId, ...params } }),
|
||||
updateVariableState: (agentId, sessionId, data) => new Promise(r => setTimeout(() => r({ success: true, data: { agentId, sessionId, ...data } }), 300)),
|
||||
getHotwordGroups: (params) => Promise.resolve({ success: true, data: window.__agentHotwordGroups || [], params }),
|
||||
createHotwordGroup: (data) => new Promise(r => setTimeout(() => r({ success: true, data }), 500)),
|
||||
updateHotwordGroup: (id, data) => new Promise(r => setTimeout(() => r({ success: true, data: { id, ...data } }), 500)),
|
||||
@@ -560,10 +586,16 @@
|
||||
overlay.className = 'modal-overlay';
|
||||
overlay.innerHTML = `<div class="modal${sizeClass}"><div class="modal-header"><span class="modal-title">${title}</span><button class="modal-close">×</button></div><div class="modal-body">${content}</div><div class="modal-footer">${showCancel ? `<button class="btn btn-outline cancel-btn">${cancelText || '取消'}</button>` : ''}${onConfirm ? `<button class="btn btn-primary confirm-btn${confirmBtnClass}">${confirmText || '确认'}</button>` : ''}</div></div>`;
|
||||
document.body.appendChild(overlay);
|
||||
|
||||
document.body.classList.add('modal-open');
|
||||
|
||||
const close = () => {
|
||||
overlay.classList.remove('open');
|
||||
setTimeout(() => overlay.remove(), 200);
|
||||
setTimeout(() => {
|
||||
overlay.remove();
|
||||
if (!document.querySelector('.modal-overlay')) {
|
||||
document.body.classList.remove('modal-open');
|
||||
}
|
||||
}, 200);
|
||||
};
|
||||
|
||||
overlay.querySelector('.modal-close').addEventListener('click', close);
|
||||
|
||||
Reference in New Issue
Block a user