|
@@ -56,7 +56,9 @@
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
+ <div id="ui error message">
|
|
|
|
|
|
|
|
+ </div>
|
|
|
|
|
|
<div style="float: right;">
|
|
<div style="float: right;">
|
|
<button class="ui basic button" onclick="connectSSH()"><i class="ui blue exchange icon"></i> Connect</button>
|
|
<button class="ui basic button" onclick="connectSSH()"><i class="ui blue exchange icon"></i> Connect</button>
|
|
@@ -170,6 +172,11 @@
|
|
|
|
|
|
|
|
|
|
function isValidServerNameOrIPAddress(str) {
|
|
function isValidServerNameOrIPAddress(str) {
|
|
|
|
+ //Do not allow loopback
|
|
|
|
+ if (str == "localhost" || str == "127.0.0.1"){
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+
|
|
// First, check if the string is a valid IP address
|
|
// First, check if the string is a valid IP address
|
|
const ipAddressRegex = /^(\d{1,3}\.){3}\d{1,3}$/;
|
|
const ipAddressRegex = /^(\d{1,3}\.){3}\d{1,3}$/;
|
|
if (ipAddressRegex.test(str)) {
|
|
if (ipAddressRegex.test(str)) {
|
|
@@ -182,6 +189,8 @@
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+
|
|
// If the string is neither an IP address nor a server name, return false
|
|
// If the string is neither an IP address nor a server name, return false
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|