|
|
|
@ -21,6 +21,7 @@ var modalPopupContainer = modalPopup + " .modal-content";
|
|
|
|
|
var modalPopupContent = modalPopup + " .modal-content";
|
|
|
|
|
|
|
|
|
|
var backendEndBasePath = "/api/device-mgt/v1.0";
|
|
|
|
|
var notificationsAvailable = false;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* set popup maximum height function.
|
|
|
|
@ -101,12 +102,13 @@ function loadNewNotifications() {
|
|
|
|
|
viewModel.context = context;
|
|
|
|
|
viewModel.notifications = responsePayload.notifications;
|
|
|
|
|
if (responsePayload.count > 0) {
|
|
|
|
|
notificationsAvailable = true;
|
|
|
|
|
$(messageSideBar).html(template(viewModel));
|
|
|
|
|
} else {
|
|
|
|
|
$(messageSideBar).html(
|
|
|
|
|
"<h4 class='text-center'>No New Notifications</h4>" +
|
|
|
|
|
"<h5 class='text-center text-muted'>" +
|
|
|
|
|
"Check this section for error notifications<br>related to device operations" +
|
|
|
|
|
"Check this section for error notifications<br>related to device operations" +
|
|
|
|
|
"</h5>"
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
@ -454,6 +456,10 @@ $(document).ready(function () {
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
if(notificationsAvailable) {
|
|
|
|
|
$("#right-side-pane-notifications-clear").removeClass("hidden");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$("#right-sidebar").on("click", ".btn", function (e) {
|
|
|
|
|
|
|
|
|
|
var clickEvent = $(this).data('click-event');
|
|
|
|
@ -490,59 +496,59 @@ $(document).ready(function () {
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
function statisticLoad(redirectUrl) {
|
|
|
|
|
var contentType = "application/json";
|
|
|
|
|
var defaultStatusClasses = "fw fw-stack-1x";
|
|
|
|
|
var content = $("#statistic-response-template").find(".content");
|
|
|
|
|
var title = content.find("#title");
|
|
|
|
|
var statusIcon = content.find("#status-icon");
|
|
|
|
|
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: redirectUrl,
|
|
|
|
|
type: "GET",
|
|
|
|
|
success: function () {
|
|
|
|
|
window.location.href = redirectUrl;
|
|
|
|
|
},
|
|
|
|
|
error: function() {
|
|
|
|
|
var urix = backendEndBasePath + "/admin/publish-artifact/deploy/device_management";
|
|
|
|
|
var device = {};
|
|
|
|
|
invokerUtil.post(urix, device, function (data) {
|
|
|
|
|
title.html("Deploying statistic artifacts. Please wait...");
|
|
|
|
|
statusIcon.attr("class", defaultStatusClasses + " fw-check");
|
|
|
|
|
$(modalPopupContent).html(content.html());
|
|
|
|
|
showPopup();
|
|
|
|
|
poll(redirectUrl);
|
|
|
|
|
}, function (jqXHR) {
|
|
|
|
|
title.html("Failed to deploy artifacts, Please contact administrator.");
|
|
|
|
|
statusIcon.attr("class", defaultStatusClasses + " fw-error");
|
|
|
|
|
$(modalPopupContent).html(content.html());
|
|
|
|
|
showPopup();
|
|
|
|
|
}, contentType);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
var contentType = "application/json";
|
|
|
|
|
var defaultStatusClasses = "fw fw-stack-1x";
|
|
|
|
|
var content = $("#statistic-response-template").find(".content");
|
|
|
|
|
var title = content.find("#title");
|
|
|
|
|
var statusIcon = content.find("#status-icon");
|
|
|
|
|
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: redirectUrl,
|
|
|
|
|
type: "GET",
|
|
|
|
|
success: function () {
|
|
|
|
|
window.location.href = redirectUrl;
|
|
|
|
|
},
|
|
|
|
|
error: function() {
|
|
|
|
|
var urix = backendEndBasePath + "/admin/publish-artifact/deploy/device_management";
|
|
|
|
|
var device = {};
|
|
|
|
|
invokerUtil.post(urix, device, function (data) {
|
|
|
|
|
title.html("Deploying statistic artifacts. Please wait...");
|
|
|
|
|
statusIcon.attr("class", defaultStatusClasses + " fw-check");
|
|
|
|
|
$(modalPopupContent).html(content.html());
|
|
|
|
|
showPopup();
|
|
|
|
|
poll(redirectUrl);
|
|
|
|
|
}, function (jqXHR) {
|
|
|
|
|
title.html("Failed to deploy artifacts, Please contact administrator.");
|
|
|
|
|
statusIcon.attr("class", defaultStatusClasses + " fw-error");
|
|
|
|
|
$(modalPopupContent).html(content.html());
|
|
|
|
|
showPopup();
|
|
|
|
|
}, contentType);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
var pollingCount = 15;
|
|
|
|
|
function poll(portalUrl) {
|
|
|
|
|
var content = $("#statistic-response-template").find(".content");
|
|
|
|
|
var title = content.find("#title");
|
|
|
|
|
var defaultStatusClasses = "fw fw-stack-1x";
|
|
|
|
|
var statusIcon = content.find("#status-icon");
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: portalUrl,
|
|
|
|
|
type: "GET",
|
|
|
|
|
success: function (data) {
|
|
|
|
|
window.location.href = portalUrl;
|
|
|
|
|
},
|
|
|
|
|
dataType: "json",
|
|
|
|
|
error: setTimeout(function () {
|
|
|
|
|
pollingCount = pollingCount - 1;
|
|
|
|
|
if (pollingCount > 0) {
|
|
|
|
|
poll(portalUrl);
|
|
|
|
|
} else {
|
|
|
|
|
window.location.href = portalUrl;
|
|
|
|
|
}
|
|
|
|
|
}, 5000),
|
|
|
|
|
timeout: 5000
|
|
|
|
|
});
|
|
|
|
|
var content = $("#statistic-response-template").find(".content");
|
|
|
|
|
var title = content.find("#title");
|
|
|
|
|
var defaultStatusClasses = "fw fw-stack-1x";
|
|
|
|
|
var statusIcon = content.find("#status-icon");
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: portalUrl,
|
|
|
|
|
type: "GET",
|
|
|
|
|
success: function (data) {
|
|
|
|
|
window.location.href = portalUrl;
|
|
|
|
|
},
|
|
|
|
|
dataType: "json",
|
|
|
|
|
error: setTimeout(function () {
|
|
|
|
|
pollingCount = pollingCount - 1;
|
|
|
|
|
if (pollingCount > 0) {
|
|
|
|
|
poll(portalUrl);
|
|
|
|
|
} else {
|
|
|
|
|
window.location.href = portalUrl;
|
|
|
|
|
}
|
|
|
|
|
}, 5000),
|
|
|
|
|
timeout: 5000
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|