Skip to content
This repository has been archived by the owner on Sep 30, 2024. It is now read-only.

Commit

Permalink
Add global recoveries button
Browse files Browse the repository at this point in the history
  • Loading branch information
mateusduboli committed Oct 11, 2018
1 parent 9b55a34 commit cde611b
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
35 changes: 35 additions & 0 deletions resources/public/js/orchestrator.js
Original file line number Diff line number Diff line change
Expand Up @@ -967,6 +967,35 @@ function getParameterByName(name) {
}


function renderGlobalRecoveriesButton(isGlobalRecoveriesEnabled) {
var iconContainer = $("#global-recoveries-icon > span");
if (isGlobalRecoveriesEnabled) {
iconContainer
.prop("title", "Global Recoveries Enabled")
.addClass("glyphicon-heart")
.removeClass("hidden")
.click(function(event) {
bootbox.confirm("<h3>Global Recoveries</h3>Are you sure you want to <strong>disable</strong> global recoveries?", function(confirm) {
if (confirm) {
apiCommand("/api/disable-global-recoveries");
}
})
});
} else {
iconContainer
.prop("title", "Global Recoveries Disabled")
.addClass("glyphicon-heart-empty")
.removeClass("hidden")
.click(function(event) {
bootbox.confirm("<h3>Global Recoveries</h3>Are you sure you want to enable global recoveries?", function(confirm) {
if (confirm) {
apiCommand("/api/enable-global-recoveries");
}
})
});
}
}

$(document).ready(function() {
visualizeBrand();

Expand Down Expand Up @@ -995,6 +1024,12 @@ $(document).ready(function() {
func(clusters);
});
}, "json");

$.get(appUrl("/api/check-global-recoveries"), function(response) {
var isEnabled = (response.Details == "enabled")
renderGlobalRecoveriesButton(isEnabled);
}, "json");

$(".ajaxLoader").click(function() {
return false;
});
Expand Down
4 changes: 4 additions & 0 deletions resources/templates/layout.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@
</a>
<ul class="dropdown-menu" id="dropdown-context">
</ul>
<li data-nav-page="global-recoveries">
<a id="global-recoveries-icon" name="global-recoveries">
<span class="glyphicon hidden"></span>
</a>
</li>
<li data-nav-page="read-only" style="display: none;">
<a name="read-only" title="read only mode"><span class="glyphicon glyphicon-eye-open"></span></a>
Expand Down

0 comments on commit cde611b

Please sign in to comment.