Red indication if OpenSSH key is not valid, #3093
Ylian Saint-Hilaire committed
Sep 2, 2021 at 18:16 UTC
6f03c026c64f125368abaf60157aed2b5aebbc6b
1 file changed
+2
-1
views/default.handlebars
+2
-1
@@ -9040,7 +9040,7 @@
9040
x += '<div id=d2passauth>';
9041
x += addHtmlValue("Password", '<input type=password id=dp2pass style=width:230px maxlength=64 autocomplete=off onkeyup=sshAuthUpdate(event) />');
9042
x += '</div><div id=d2keyauth style=display:none>';
9043
- x += addHtmlValue("Key File", '<input type=file id=dp2key style=width:230px maxlength=64 autocomplete=off onchange=sshAuthUpdate(event) />' + '<div style=font-size:x-small>' + "Key file must be in OpenSSH format." + '</div>');
9043
+ x += addHtmlValue("Key File", '<input type=file id=dp2key style=width:230px maxlength=64 autocomplete=off onchange=sshAuthUpdate(event) />' + '<div id=d2badkey style=font-size:x-small>' + "Key file must be in OpenSSH format." + '</div>');
9044
x += addHtmlValue("Key Password", '<input type=password id=dp2keypass style=width:230px maxlength=64 autocomplete=off onkeyup=sshAuthUpdate(event) />');
9045
x += '</div>';
9046
x += addHtmlValue('', '<label><input id=dp2keep type=checkbox>' + "Remember credentials" + '</label>');
@@ -9074,6 +9074,7 @@
9074
reader.onload = function (e) {
9075
var validkey = ((e.target.result.indexOf('-----BEGIN OPENSSH PRIVATE KEY-----') >= 0) && (e.target.result.indexOf('-----END OPENSSH PRIVATE KEY-----') >= 0));
9076
QE('idx_dlgOkButton', validkey);
9077
+ QS('d2badkey')['color'] = validkey?'#000':'#F00';
9078
}
9079
reader.readAsText(Q('dp2key').files[0]);
9080
}