diff --git a/static/rbmd/script.js b/static/rbmd/script.js index 21dafef..e66c4f5 100644 --- a/static/rbmd/script.js +++ b/static/rbmd/script.js @@ -55,12 +55,8 @@ function displayData(a){ $("#status").html("

"+a.health+"

"); if (a.health == 'deadly.') { deadNode = a.deadlyreason["node"]; - //$('#showDeadlyDetails').click(event, openNode(event, dead_node)) $('#showDeadlyDetails').css("display","block"); -console.log('hui'); -console.log(a.deadlyreason["node"]); $('#resolve').css("display","block"); - $("#mountFormTrigger").addClass("w3-disabled") } else { $('#showDeadlyDetails').css("display","none"); @@ -110,39 +106,39 @@ console.log(a.deadlyreason["node"]); $("#mon").html(""); } } - if (selected_node =='dead') { - var t, up_formatted; - if (a.deadlyreason["updated"] != 0) { - t = new Date(a.deadlyreason["updated"] * 1000) - up_formatted = t.getFullYear() + "/" - + (t.getMonth() + 1) + "/" - + t.getDate() + " " - + t.getHours() + ":" - + t.getMinutes() + ":" - + t.getSeconds(); - } else { - up_formatted=0; - } - deadNode = a.deadlyreason["node"]; - $("#name").html(a.deadlyreason["node"]); - $("#ipv4").html(a.deadlyreason["ip"]["v4"].join("
")); - $("#ipv6").html(a.deadlyreason["ip"]["v6"].join("
")); - $("#updated").html(up_formatted); - if (a.deadlyreason["mounts"] != null) { - var mnt_block = ""; - for (i in a.deadlyreason.mounts) { - var mnt = a.deadlyreason.mounts[i]; - mnt_block += mnt.mountpoint + "
" - + mnt.mountopts + "
" - + mnt.fstype + "
" - + mnt.pool + "
" - + mnt.image + "

"; - } - $("#mon").html(mnt_block); - } else { - $("#mon").html(""); - } - } + // if (selected_node =='dead') { + // var t, up_formatted; + // if (a.deadlyreason["updated"] != 0) { + // t = new Date(a.deadlyreason["updated"] * 1000) + // up_formatted = t.getFullYear() + "/" + // + (t.getMonth() + 1) + "/" + // + t.getDate() + " " + // + t.getHours() + ":" + // + t.getMinutes() + ":" + // + t.getSeconds(); + // } else { + // up_formatted=0; + // } + // deadNode = a.deadlyreason["node"]; + // $("#name").html(a.deadlyreason["node"]); + // $("#ipv4").html(a.deadlyreason["ip"]["v4"].join("
")); + // $("#ipv6").html(a.deadlyreason["ip"]["v6"].join("
")); + // $("#updated").html(up_formatted); + // if (a.deadlyreason["mounts"] != null) { + // var mnt_block = ""; + // for (i in a.deadlyreason.mounts) { + // var mnt = a.deadlyreason.mounts[i]; + // mnt_block += mnt.mountpoint + "
" + // + mnt.mountopts + "
" + // + mnt.fstype + "
" + // + mnt.pool + "
" + // + mnt.image + "

"; + // } + // $("#mon").html(mnt_block); + // } else { + // $("#mon").html(""); + // } + // } $("#leader").html(a.leader); } @@ -152,19 +148,19 @@ console.log(nodeName); selected_node = nodeName; x = document.getElementsByClassName("node"); tablinks = document.getElementsByClassName("tablink"); - if (selected_node == 'dead') { - // if (selected_node == deadNode) { - $('#details').css("border", "2px solid #f44336"); - if ($('#showDeadlyDetails').html() == "Show details") { - $('#details').css("display", "block"); - $('#showDeadlyDetails').text('Hide details'); - } else { - $('#details').css("display", "none"); - $('#showDeadlyDetails').text('Show details'); - } - // displayData(a); - } else { + // if (selected_node == 'dead') { + // // if (selected_node == deadNode) { + // $('#details').css("border", "2px solid #f44336"); + // if ($('#showDeadlyDetails').html() == "Show details") { + // $('#details').css("display", "block"); + // $('#showDeadlyDetails').text('Hide details'); + // } else { + // $('#details').css("display", "none"); + // $('#showDeadlyDetails').text('Show details'); + // } + // // displayData(a); + // } else { $('#showDeadlyDetails').text('Show details'); $('#details').css("border", "").css("display", "block"); displayData(a); - } + // } }