diff --git a/controller/internal/web/templates/deploy.html b/controller/internal/web/templates/deploy.html index 69ef23f..bca0ad6 100644 --- a/controller/internal/web/templates/deploy.html +++ b/controller/internal/web/templates/deploy.html @@ -309,7 +309,7 @@ {{else if eq .Type "password"}}
👁 + {{if not $.AlreadyDeployed}} + {{end}}
- {{if not $.AlreadyDeployed}} + {{if $.AlreadyDeployed}} + Telepítéskor beállított kezdeti jelszó — ha az alkalmazásban megváltoztattad, az itt nem frissül. + {{else}}
'; } - // First steps + // First steps — with dynamic credential hint if (postDeployInfo.firstSteps && postDeployInfo.firstSteps.length > 0) { html += '

Első lépések

    '; for (var i = 0; i < postDeployInfo.firstSteps.length; i++) { @@ -440,25 +444,38 @@ function buildPostDeployCard(stackName) { // Credentials from deploy fields (show actual values from form) var credRows = ''; + var hasUserCredFields = false; if (postDeployInfo.deployFields) { for (var i = 0; i < postDeployInfo.deployFields.length; i++) { var f = postDeployInfo.deployFields[i]; // Show secrets, passwords, and username-like text fields - var isCredential = f.type === 'secret' || f.type === 'password'; - if (!isCredential && f.type === 'text') { + var isPassword = f.type === 'secret' || f.type === 'password'; + var isUsername = false; + if (!isPassword && f.type === 'text') { var ev = f.env_var.toUpperCase(); - isCredential = ev.indexOf('USER') >= 0 || ev.indexOf('ADMIN') >= 0 || ev.indexOf('LOGIN') >= 0; + isUsername = ev.indexOf('USER') >= 0 || ev.indexOf('ADMIN') >= 0 || ev.indexOf('LOGIN') >= 0 || ev.indexOf('EMAIL') >= 0; } - if (!isCredential) continue; + if (!isPassword && !isUsername) continue; // Skip internal DB credentials var evUp = f.env_var.toUpperCase(); if (evUp.indexOf('DB_PASSWORD') >= 0 || evUp.indexOf('MYSQL_ROOT') >= 0 || evUp.indexOf('SECRET_KEY') >= 0) continue; + if (isPassword || isUsername) hasUserCredFields = true; // Read value from DOM var el = document.getElementById('auto-field-' + f.env_var) || document.getElementById('field-' + f.env_var); var val = el ? el.value : ''; if (!val) continue; - credRows += '' + f.label + '' + - '' + val + ''; + if (isPassword) { + var credId = 'postdeploy-cred-' + i; + credRows += '' + f.label + '' + + '' + + '••••••••••••' + + '' + + '' + + ''; + } else { + credRows += '' + f.label + '' + + '' + val + ''; + } } } if (credRows) { @@ -583,6 +600,27 @@ function togglePasswordField(fieldId, confirmFieldId, btn) { btn.title = newType === 'password' ? 'Megjelenítés' : 'Elrejtés'; } +function togglePostDeployCred(btn, credId, val) { + var el = document.getElementById(credId); + if (!el) return; + if (el.textContent === val) { + el.textContent = '••••••••••••'; + btn.textContent = 'Megjelenítés'; + } else { + el.textContent = val; + btn.textContent = 'Elrejtés'; + } +} +function copyPostDeployCred(btn, val) { + if (navigator.clipboard) { + navigator.clipboard.writeText(val).then(function() { + var orig = btn.textContent; + btn.textContent = 'Másolva!'; + setTimeout(function() { btn.textContent = orig; }, 1500); + }); + } +} + function deleteStaleData(stackName, stalePath, btn) { if (!confirm('Biztosan törölni szeretnéd a korábbi adatokat?\n\nTárhely: ' + stalePath + '\n\n⚠️ Ez a művelet visszavonhatatlan!\nElőtte győződj meg róla, hogy az alkalmazás az új tárolóról megfelelően működik.')) { return;