Звонки: preflight сессии перед вызовом и retry; таймаут вынесен в настройки

This commit is contained in:
AidarKC
2026-05-05 18:11:55 +03:00
parent ef0cd2cb7d
commit 6774c26ea1
5 changed files with 116 additions and 3 deletions
+28
View File
@@ -19,6 +19,7 @@ export function render({ navigate }) {
solanaServer: state.entrySettings.solanaServer,
shineServer: state.entrySettings.shineServer,
arweaveServer: state.entrySettings.arweaveServer,
callPreflightTimeoutMs: Number(state.entrySettings.callPreflightTimeoutMs || 6000),
statuses: { ...state.entrySettings.statuses },
};
@@ -108,6 +109,33 @@ export function render({ navigate }) {
body.append(block);
});
const callSettings = document.createElement('div');
callSettings.className = 'stack';
const callTimeoutLabel = document.createElement('label');
callTimeoutLabel.className = 'field-label';
callTimeoutLabel.textContent = 'Таймаут пред-подключения перед звонком (мс)';
const callTimeoutInput = document.createElement('input');
callTimeoutInput.className = 'input';
callTimeoutInput.type = 'number';
callTimeoutInput.min = '1000';
callTimeoutInput.max = '20000';
callTimeoutInput.step = '500';
callTimeoutInput.value = String(Math.max(1000, Math.min(20000, Number(draft.callPreflightTimeoutMs) || 6000)));
callTimeoutInput.addEventListener('input', () => {
const n = Number(callTimeoutInput.value);
if (!Number.isFinite(n)) return;
draft.callPreflightTimeoutMs = Math.max(1000, Math.min(20000, Math.round(n)));
});
const callTimeoutHint = document.createElement('p');
callTimeoutHint.className = 'meta-muted';
callTimeoutHint.textContent = 'Перед исходящим звонком клиент проверяет и восстанавливает WS-сессию. Это время ожидания такой проверки перед ошибкой «Сервер временно недоступен».';
callSettings.append(callTimeoutLabel, callTimeoutInput, callTimeoutHint);
body.append(callSettings);
const actions = document.createElement('div');
actions.className = 'auth-footer-actions';