Skip to content

Commit

Permalink
PMM-739 show succeeded popup after update
Browse files Browse the repository at this point in the history
  • Loading branch information
delgod committed Jun 30, 2017
1 parent 6ac446f commit 93e8afd
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions landing-page/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ <h4 class="modal-title">Container Errors</h4>
var checkUpdate = $.get("/configurator/v1/check-update", null, null, "json");

checkUpdate.done(function(data, status, xhr) {
if (data.title === "in-progress") {
if (data.title === "running" || data.title === "succeeded" || data.title === "failed") {
updateLocation = xhr.getResponseHeader('Location');
window.setTimeout(update, 1);
} else {
Expand Down Expand Up @@ -186,7 +186,7 @@ <h4 class="modal-title">Container Errors</h4>
var runUpdate = $.post("/configurator/v1/updates", null, null, "json");

runUpdate.done(function(data, status, xhr) {
if (data.title === "in-progress" || data.title === "finished") {
if (data.title === "running" || data.title === "succeeded" || data.title === "failed") {
updateLocation = xhr.getResponseHeader('Location');
window.setTimeout(update, 1);
} else {
Expand Down Expand Up @@ -214,10 +214,18 @@ <h4 class="modal-title">Container Errors</h4>

fetchLog.done(function(data) {
$("#updateOutput").text(data.detail);
if (data.title === "in-progress") {
if (data.title === "running") {
window.setTimeout(update, 1000);
} else if (data.title === "succeeded") {
$("#checkLoader").hide();
$("#updateOutput").hide();
$("#updateDialog").removeClass("modal-lg").addClass("modal-sm");
$("#updateText").text("PMM Server update was completed.")
$("#updateText").show();
} else {
$("#checkLoader").hide();
$("#updateText").text("An unknown error occurred during the update, please try again later.")
$("#updateText").show();
}
});

Expand Down

0 comments on commit 93e8afd

Please sign in to comment.