From ce66e10115273c5cb9d65d0a41fb39098ce18df6 Mon Sep 17 00:00:00 2001 From: Anna Date: Mon, 26 Mar 2018 23:13:14 +0300 Subject: [PATCH] UPD --- static/rbmd/script.js | 48 +++++++++++++++++++-------------------- templates/rbmd/index.html | 44 +++++++++++++++++------------------ 2 files changed, 46 insertions(+), 46 deletions(-) diff --git a/static/rbmd/script.js b/static/rbmd/script.js index 80becb8..6c6d79f 100644 --- a/static/rbmd/script.js +++ b/static/rbmd/script.js @@ -40,30 +40,30 @@ $(function() { // displayData(cluster); // }; - $('#mountForm').submit(function(event){ - - event.preventDefault(); - $.ajax({ - url:"mount", - data:$(this).serialize(), - method:'POST', - success:function(data){ - console.log(data); - $('#mount').css('display', 'none'); - $('input[type = "text"]').val(''); - var res = JSON.parse(data); - message = "

" + res["state"] + "

"+ res["message"] +"

"; - $("#rspContainer").css("display", "block"); - $("#rsp").html(message) - if (res["state"] == 'OK'){ - $("#rspContainer").css("background-color", "#4CAF50" ); - } - else { - $("#rspContainer").css("background-color", "#f44336" ) - } - } - }) - }) + // $('#mountForm').submit(function(event){ + // + // event.preventDefault(); + // $.ajax({ + // url:"mount", + // data:$(this).serialize(), + // method:'POST', + // success:function(data){ + // console.log(data); + // $('#mount').css('display', 'none'); + // $('input[type = "text"]').val(''); + // var res = JSON.parse(data); + // message = "

" + res["state"] + "

"+ res["message"] +"

"; + // $("#rspContainer").css("display", "block"); + // $("#rsp").html(message) + // if (res["state"] == 'OK'){ + // $("#rspContainer").css("background-color", "#4CAF50" ); + // } + // else { + // $("#rspContainer").css("background-color", "#f44336" ) + // } + // } + // }) + // }) }); diff --git a/templates/rbmd/index.html b/templates/rbmd/index.html index c745b1e..b749b99 100644 --- a/templates/rbmd/index.html +++ b/templates/rbmd/index.html @@ -95,27 +95,27 @@ // }; // $('.tablink').css('display', 'block'); // - // $('#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 = "

" + res["state"] + "

"+ res["message"] +"

"; - // $("#rspContainer").css("display", "block"); - // $("#rsp").html(message) - // if (res["state"] == 'OK'){ - // $("#rspContainer").css("background-color", "#4CAF50" ); - // } - // else { - // $("#rspContainer").css("background-color", "#f44336" ) - // } - // } - // }) - // }) + $('#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 = "

" + res["state"] + "

"+ res["message"] +"

"; + $("#rspContainer").css("display", "block"); + $("#rsp").html(message) + if (res["state"] == 'OK'){ + $("#rspContainer").css("background-color", "#4CAF50" ); + } + else { + $("#rspContainer").css("background-color", "#f44336" ) + } + } + }) + })