Fix format on snmp browser error messages

This commit is contained in:
Calvo 2021-07-07 16:44:19 +02:00
parent 967f7ac239
commit 06d18985e0
1 changed files with 17 additions and 7 deletions

View File

@ -66,16 +66,26 @@ function snmpBrowse() {
}, },
error: function(XMLHttpRequest, textStatus, errorThrown) { error: function(XMLHttpRequest, textStatus, errorThrown) {
$("#spinner").css("display", "none"); $("#spinner").css("display", "none");
$("#snmp_browser").html( var htmlError = "";
"<p>Status: " +
if (XMLHttpRequest.responseText) {
htmlError =
"<p><b>Status:</b> " +
textStatus + textStatus +
"</p><p>" + "</p><p>" +
"Error: " +
errorThrown +
"</p><p>" +
XMLHttpRequest.responseText + XMLHttpRequest.responseText +
"</p>" "</p>";
); } else {
htmlError =
"<p><b>Status:</b> " +
textStatus +
"</p><p>" +
"<b>Error:</b> " +
errorThrown +
"</p>";
}
$("#snmp_browser").html(htmlError);
} }
}); });
} }