hide if ssh migration

This commit is contained in:
pomidorry
2026-06-08 15:32:44 +03:00
parent 3e1102a25a
commit 5a7a5511d6
+8 -9
View File
@@ -78,20 +78,19 @@ export function initRepoMigrationForm() {
const url = cloneAddrInput!.value.trim();
const isSSH = isSSHURL(url);
const usernameField = authUsernameInput!.parentElement!;
const passwordField = authPasswordInput!.parentElement!;
if (isSSH) {
// Disable auth fields for SSH URLs
authUsernameInput!.disabled = true;
authPasswordInput!.disabled = true;
// Hide auth fields entirely for SSH URLs (key-based auth only)
authUsernameInput!.value = '';
authPasswordInput!.value = '';
authUsernameInput!.parentElement?.classList.add('disabled');
authPasswordInput!.parentElement?.classList.add('disabled');
hideElem(usernameField);
hideElem(passwordField);
showElem(sshHelpText!);
} else {
authUsernameInput!.disabled = false;
authPasswordInput!.disabled = false;
authUsernameInput!.parentElement?.classList.remove('disabled');
authPasswordInput!.parentElement?.classList.remove('disabled');
showElem(usernameField);
showElem(passwordField);
hideElem(sshHelpText!);
}
}