Commit 9c4b4e8a by Csók Tamás

vm-details.js: disable or enable the button based on instance state

parent d88a749d
...@@ -388,8 +388,10 @@ function checkNewActivity(runs) { ...@@ -388,8 +388,10 @@ function checkNewActivity(runs) {
} }
$("#vm-details-state span").html(data['human_readable_status'].toUpperCase()); $("#vm-details-state span").html(data['human_readable_status'].toUpperCase());
if(data['status'] == "RUNNING") { if(data['status'] == "RUNNING") {
$("#dashboard-vm-details-connect-button").prop("disabled", false);
$("[data-target=#_console]").attr("data-toggle", "pill").attr("href", "#console").parent("li").removeClass("disabled"); $("[data-target=#_console]").attr("data-toggle", "pill").attr("href", "#console").parent("li").removeClass("disabled");
} else { } else {
$("#dashboard-vm-details-connect-button").prop("disabled", true);
$("[data-target=#_console]").attr("data-toggle", "_pill").attr("href", "#").parent("li").addClass("disabled"); $("[data-target=#_console]").attr("data-toggle", "_pill").attr("href", "#").parent("li").addClass("disabled");
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment