Update login token modal and button behavior (#7360)

* Update login token modal and button behavior

Removes orange background from username and password fields in the login token modal,
updates modal title to 'Login Token Created', disables the OK button, and changes
the Cancel button text to 'Close'. Also adds a 'return false' statement to
account_createLoginTokenEx to keep the modal open upon token creation.

* Added Close and Login Token Created

Added Close and Login Token Created

* Add translations for 'Login Token Created'

Added multiple language translations for the 'Login Token Created' message in translate.json to improve localization support.
This commit is contained in:
TheDevRyan 2025-10-20 15:02:04 +01:00 committed by GitHub
parent 64ece1df90
commit dd01abc38e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3101 additions and 3066 deletions

File diff suppressed because it is too large Load Diff

View File

@ -4557,10 +4557,11 @@
var x = "Take note of this username and password, the password cannot be shown again." + '<br /><br />';
x += addHtmlValue("Name", EscapeHtml(message.name))
if (message.expire != 0) { x += addHtmlValue("Expire", EscapeHtml(printDateTime(new Date(message.expire)))); }
x += addHtmlValue("Username", '<i class="fa-regular fa-copy" title="' + "Copy link to clipboard" + '" style="margin:9px;cursor:pointer;float:right" onclick=copyTextToClip2("' + encodeURIComponentEx(message.tokenUser) + '")></i><div class=selecttext style=width:230px;padding:5px;background-color:orange;border-radius:5px;font-size:15px>' + EscapeHtml(message.tokenUser) + '</div>');
x += addHtmlValue("Password", '<i class="fa-regular fa-copy" title="' + "Copy link to clipboard" + '" style="margin:9px;cursor:pointer;float:right" onclick=copyTextToClip2("' + encodeURIComponentEx(message.tokenPass) + '")></i><div class=selecttext style=width:230px;padding:5px;background-color:orange;border-radius:5px;font-size:15px>' + EscapeHtml(message.tokenPass) + '</div>');
setModalContent('xxAddAgent', "Create Login Token", x);
showModal('xxAddAgentModal', 'idx_dlgOkButton');
x += addHtmlValue("Username", '<i class="fa-regular fa-copy" title="' + "Copy link to clipboard" + '" style="margin:9px;cursor:pointer;float:right" onclick=copyTextToClip2("' + encodeURIComponentEx(message.tokenUser) + '")></i><div class=selecttext style=width:230px;padding:5px;border-radius:5px;font-size:15px>' + EscapeHtml(message.tokenUser) + '</div>');
x += addHtmlValue("Password", '<i class="fa-regular fa-copy" title="' + "Copy link to clipboard" + '" style="margin:9px;cursor:pointer;float:right" onclick=copyTextToClip2("' + encodeURIComponentEx(message.tokenPass) + '")></i><div class=selecttext style=width:230px;padding:5px;border-radius:5px;font-size:15px>' + EscapeHtml(message.tokenPass) + '</div>');
setModalContent('xxAddAgent', "Login Token Created", x);
QV('idx_dlgOkButton', false);
Q('idx_dlgCancelButton').innerHTML = "Close";
break;
}
case 'loginTokens': { // Reveiced the list of login tokens
@ -14121,6 +14122,7 @@
function account_createLoginTokenEx() {
meshserver.send({ action: 'createLoginToken', name: Q('d2tokenName').value, expire: parseInt(Q('d2tokenExpire').value) });
return false;
}
function account_showAccountNotifySettings() {