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