Исправить регистрацию и навести порядок в UI deploy

This commit is contained in:
AidarKC
2026-07-16 11:46:42 +04:00
parent 24cca1f1c6
commit d2c0ecdf62
31 changed files with 207 additions and 65 deletions
+3 -12
View File
@@ -103,7 +103,9 @@ export function render({ navigate }) {
draft.shineServer = resolved.wsUrl;
applyStatus(resolved.status, resolved.httpBase);
} else {
const next = await checkServerAvailabilityByKey(field.key, input.value);
const next = await checkServerAvailabilityByKey(field.key, input.value, {
solanaEndpoint: draft.solanaServer,
});
applyStatus(next);
}
} finally {
@@ -171,16 +173,6 @@ export function render({ navigate }) {
actions.append(serverUiButton, cancelButton, saveButton);
const help = document.createElement('button');
help.className = 'help-fab';
help.type = 'button';
help.textContent = '?';
help.addEventListener('click', () => {
window.alert(
'Текст для разработчиков: для SHiNE вводится логин серверного аккаунта. Клиент читает его PDA, берёт server_address, показывает точный https-адрес и проверяет доступность WS-канала автоматически.',
);
});
screen.append(
renderHeader({
title: 'Настройки входа',
@@ -188,7 +180,6 @@ export function render({ navigate }) {
}),
body,
actions,
help,
);
screen.cleanup = () => {
+10 -7
View File
@@ -163,6 +163,7 @@ export function render({ navigate }) {
words: passwordWords,
onInput: (index, value) => {
passwordWords[index] = value;
passwordInput.value = composePasswordFromWords(passwordWords);
passwordWordsLinked = true;
syncDraftState();
updateWordsPreview();
@@ -258,11 +259,13 @@ export function render({ navigate }) {
let generationRunId = 0;
function getCurrentPassword() {
return passwordMode === 'words' ? composePasswordFromWords(passwordWords) : String(passwordInput.value || '');
return String(passwordInput.value || '');
}
function updateWordsPreview() {
const password = getCurrentPassword();
const password = passwordMode === 'words'
? composePasswordFromWords(passwordWords)
: String(passwordInput.value || '');
const text = `Итоговая длина пароля: ${password.length} символов.`;
wordsPreview.textContent = text;
passwordLengthText.textContent = text;
@@ -306,8 +309,8 @@ export function render({ navigate }) {
function updatePasswordModeVisibility() {
const wordsMode = passwordMode === 'words';
wordsSection.style.display = wordsMode ? 'grid' : 'none';
if (passwordField) passwordField.style.display = wordsMode ? 'none' : 'grid';
passwordInputRow.style.display = wordsMode ? 'grid' : 'none';
if (passwordField) passwordField.style.display = 'grid';
passwordInputRow.style.display = 'grid';
updateWordsPreview();
}
@@ -480,11 +483,11 @@ export function render({ navigate }) {
wordInputs.forEach((input) => {
input.value = '';
});
passwordInput.value = '';
} else {
passwordInput.value = composePasswordFromWords(passwordWords);
}
} else {
} else if (passwordWordsLinked) {
passwordInput.value = composePasswordFromWords(passwordWords);
passwordWordsLinked = true;
}
passwordMode = nextMode;
updatePasswordModeVisibility();
+3 -1
View File
@@ -86,7 +86,9 @@ export function render({ navigate }) {
draft.shineServer = resolved.wsUrl;
applyStatus(resolved.status, resolved.httpBase);
} else {
const next = await checkServerAvailabilityByKey(field.key, input.value);
const next = await checkServerAvailabilityByKey(field.key, input.value, {
solanaEndpoint: draft.solanaServer,
});
applyStatus(next);
}
} finally {