upd
This commit is contained in:
parent
24c2de20b3
commit
a090b00680
@ -1,4 +1,5 @@
|
||||
|
||||
var a, selected_node, deadNode, node2;
|
||||
$(function() {
|
||||
var url = "ws://" + location.host + "/socket";
|
||||
var ws = new WebSocket(url);
|
||||
@ -8,6 +9,29 @@ $(function() {
|
||||
a = JSON.parse(evt.data);
|
||||
displayData(a);
|
||||
};
|
||||
|
||||
$('#mountForm').submit(function(event){
|
||||
event.preventDefault();
|
||||
$.ajax({
|
||||
url:"mount",
|
||||
data:$(this).serialize(),
|
||||
method:'POST',
|
||||
success:function(data){
|
||||
$('#mount').css('display', 'none');
|
||||
$('input[type = "text"]').val('');
|
||||
var res = JSON.parse(data);
|
||||
message = "<h3>" + res["state"] + "</h3> <p>"+ res["message"] +"</p>";
|
||||
$("#rspContainer").css("display", "block");
|
||||
$("#rsp").html(message)
|
||||
if (res["state"] == 'OK'){
|
||||
$("#rspContainer").css("background-color", "#4CAF50" );
|
||||
}
|
||||
else {
|
||||
$("#rspContainer").css("background-color", "#f44336" )
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
$('.tablink').css('display', 'block');
|
||||
|
||||
|
||||
|
@ -95,28 +95,6 @@
|
||||
// };
|
||||
// $('.tablink').css('display', 'block');
|
||||
//
|
||||
var a, selected_node, deadNode, node2;
|
||||
$('#mountForm').submit(function(event){
|
||||
event.preventDefault();
|
||||
$.ajax({
|
||||
url:"mount",
|
||||
data:$(this).serialize(),
|
||||
method:'POST',
|
||||
success:function(data){
|
||||
$('#mount').css('display', 'none');
|
||||
$('input[type = "text"]').val('');
|
||||
var res = JSON.parse(data);
|
||||
message = "<h3>" + res["state"] + "</h3> <p>"+ res["message"] +"</p>";
|
||||
$("#rspContainer").css("display", "block");
|
||||
$("#rsp").html(message)
|
||||
if (res["state"] == 'OK'){
|
||||
$("#rspContainer").css("background-color", "#4CAF50" );
|
||||
}
|
||||
else {
|
||||
$("#rspContainer").css("background-color", "#f44336" )
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
</script>
|
||||
</html>
|
||||
|
Loading…
Reference in New Issue
Block a user