|
|
@ -154,8 +154,10 @@ $(document).ready(function () {
|
|
|
|
|
|
|
|
|
|
|
|
$("#appbar-btn-apply-changes").click(function () {
|
|
|
|
$("#appbar-btn-apply-changes").click(function () {
|
|
|
|
var applyPolicyChangesAPI = "/devicemgt_admin/policies/apply-changes";
|
|
|
|
var applyPolicyChangesAPI = "/devicemgt_admin/policies/apply-changes";
|
|
|
|
$(modalPopupContent).html($('#change-policy-modal-content').html());
|
|
|
|
modalDialog.header('Do you really want to apply changes to all policies?');
|
|
|
|
showPopup();
|
|
|
|
modalDialog.footer('<div class="buttons"><a href="#" id="change-policy-yes-link" class="btn-operations">Yes' +
|
|
|
|
|
|
|
|
'</a><a href="#" id="change-policy-cancel-link" class="btn-operations btn-default">No</a></div>');
|
|
|
|
|
|
|
|
modalDialog.show();
|
|
|
|
|
|
|
|
|
|
|
|
$("a#change-policy-yes-link").click(function () {
|
|
|
|
$("a#change-policy-yes-link").click(function () {
|
|
|
|
invokerUtil.put(
|
|
|
|
invokerUtil.put(
|
|
|
@ -163,26 +165,29 @@ $(document).ready(function () {
|
|
|
|
null,
|
|
|
|
null,
|
|
|
|
// on success
|
|
|
|
// on success
|
|
|
|
function () {
|
|
|
|
function () {
|
|
|
|
$(modalPopupContent).html($('#change-policy-success-content').html());
|
|
|
|
modalDialog.header('Done. Changes applied successfully.');
|
|
|
|
showPopup();
|
|
|
|
modalDialog.footer('<div class="buttons"><a href="#" id="change-policy-success-link" ' +
|
|
|
|
|
|
|
|
'class="btn-operations">Ok</a></div>');
|
|
|
|
$("a#change-policy-success-link").click(function () {
|
|
|
|
$("a#change-policy-success-link").click(function () {
|
|
|
|
hidePopup();
|
|
|
|
modalDialog.hide();
|
|
|
|
location.reload();
|
|
|
|
location.reload();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
// on error
|
|
|
|
// on error
|
|
|
|
function () {
|
|
|
|
function () {
|
|
|
|
$(modalPopupContent).html($('#change-policy-error-content').html());
|
|
|
|
modalDialog.header('An unexpected error occurred. Please try again later.');
|
|
|
|
showPopup();
|
|
|
|
modalDialog.footer('<div class="buttons"><a href="#" id="change-policy-error-link" ' +
|
|
|
|
|
|
|
|
'class="btn-operations">Ok</a></div>');
|
|
|
|
|
|
|
|
modalDialog.showAsError();
|
|
|
|
$("a#change-policy-error-link").click(function () {
|
|
|
|
$("a#change-policy-error-link").click(function () {
|
|
|
|
hidePopup();
|
|
|
|
modalDialog.hide();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
);
|
|
|
|
);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
$("a#change-policy-cancel-link").click(function () {
|
|
|
|
$("a#change-policy-cancel-link").click(function () {
|
|
|
|
hidePopup();
|
|
|
|
modalDialog.hide();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
@ -204,19 +209,22 @@ $(document).ready(function () {
|
|
|
|
updatePolicyAPI,
|
|
|
|
updatePolicyAPI,
|
|
|
|
newPolicyPriorityList,
|
|
|
|
newPolicyPriorityList,
|
|
|
|
function () {
|
|
|
|
function () {
|
|
|
|
$(modalPopupContent).html($('#save-policy-priorities-success-content').html());
|
|
|
|
modalDialog.header('Done. New Policy priorities were successfully updated.');
|
|
|
|
showPopup();
|
|
|
|
modalDialog.footer('<a href="#" id="save-policy-priorities-success-link" class="btn-operations">Ok' +
|
|
|
|
|
|
|
|
'</a>');
|
|
|
|
|
|
|
|
modalDialog.show();
|
|
|
|
$("a#save-policy-priorities-success-link").click(function () {
|
|
|
|
$("a#save-policy-priorities-success-link").click(function () {
|
|
|
|
hidePopup();
|
|
|
|
modalDialog.hide();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
function () {
|
|
|
|
function () {
|
|
|
|
$("#save-policy-priorities-error-content").find(".message-from-server").html(
|
|
|
|
modalDialog.header('An unexpected error occurred. Please try again later.');
|
|
|
|
"Message From Server : " + data["statusText"]);
|
|
|
|
modalDialog.content(html("Message From Server : " + data["statusText"]));
|
|
|
|
$(modalPopupContent).html($('#save-policy-priorities-error-content').html());
|
|
|
|
modalDialog.footer('<div class="buttons"><a href="#" id="save-policy-priorities-error-link" ' +
|
|
|
|
showPopup();
|
|
|
|
'class="btn-operations">Ok</a></div>');
|
|
|
|
|
|
|
|
modalDialog.showAsError();
|
|
|
|
$("a#save-policy-priorities-error-link").click(function () {
|
|
|
|
$("a#save-policy-priorities-error-link").click(function () {
|
|
|
|
hidePopup();
|
|
|
|
modalDialog.hide();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
);
|
|
|
|
);
|
|
|
@ -227,16 +235,27 @@ $(document).ready(function () {
|
|
|
|
var policyList = getSelectedPolicies();
|
|
|
|
var policyList = getSelectedPolicies();
|
|
|
|
var statusList = getSelectedPolicyStates();
|
|
|
|
var statusList = getSelectedPolicyStates();
|
|
|
|
if (($.inArray('Inactive/Updated', statusList) > -1) || ($.inArray('Inactive', statusList) > -1)) {
|
|
|
|
if (($.inArray('Inactive/Updated', statusList) > -1) || ($.inArray('Inactive', statusList) > -1)) {
|
|
|
|
$(modalPopupContent).html($("#errorPolicyUnPublishSelection").html());
|
|
|
|
modalDialog.header('Operation cannot be performed !');
|
|
|
|
showPopup();
|
|
|
|
modalDialog.content('You cannot select already inactive policies. Please deselect inactive policies and ' +
|
|
|
|
|
|
|
|
'try again.');
|
|
|
|
|
|
|
|
modalDialog.footer('<div class="buttons"><a href="javascript:modalDialog.hide()" ' +
|
|
|
|
|
|
|
|
'class="btn-operations">Ok</a></div>');
|
|
|
|
|
|
|
|
modalDialog.showAsAWarning();
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
var serviceURL = "/devicemgt_admin/policies/inactivate";
|
|
|
|
var serviceURL = "/devicemgt_admin/policies/inactivate";
|
|
|
|
if (policyList == 0) {
|
|
|
|
if (policyList == 0) {
|
|
|
|
$(modalPopupContent).html($("#errorPolicyUnPublish").html());
|
|
|
|
modalDialog.header('Operation cannot be performed !');
|
|
|
|
|
|
|
|
modalDialog.content('Please select a policy or a list of policies to unpublish.');
|
|
|
|
|
|
|
|
modalDialog.footer('<div class="buttons"><a href="javascript:modalDialog.hide()" ' +
|
|
|
|
|
|
|
|
'class="btn-operations">Ok</a></div>');
|
|
|
|
|
|
|
|
modalDialog.showAsAWarning();
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
$(modalPopupContent).html($('#unpublish-policy-modal-content').html());
|
|
|
|
modalDialog.header('Do you really want to unpublish the selected policy(s)?');
|
|
|
|
|
|
|
|
modalDialog.footer('<div class="buttons"><a href="#" id="unpublish-policy-yes-link" ' +
|
|
|
|
|
|
|
|
'class="btn-operations">Yes</a><a href="#" id="unpublish-policy-cancel-link" ' +
|
|
|
|
|
|
|
|
'class="btn-operations btn-default">No</a></div>');
|
|
|
|
|
|
|
|
modalDialog.show();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
showPopup();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$("a#unpublish-policy-yes-link").click(function () {
|
|
|
|
$("a#unpublish-policy-yes-link").click(function () {
|
|
|
|
invokerUtil.put(
|
|
|
|
invokerUtil.put(
|
|
|
@ -244,24 +263,29 @@ $(document).ready(function () {
|
|
|
|
policyList,
|
|
|
|
policyList,
|
|
|
|
// on success
|
|
|
|
// on success
|
|
|
|
function () {
|
|
|
|
function () {
|
|
|
|
$(modalPopupContent).html($('#unpublish-policy-success-content').html());
|
|
|
|
modalDialog.header('Done. Selected policy was successfully unpublished.');
|
|
|
|
|
|
|
|
modalDialog.footer('<div class="buttons"><a href="#" id="unpublish-policy-success-link" ' +
|
|
|
|
|
|
|
|
'class="btn-operations">Ok</a></div>');
|
|
|
|
$("a#unpublish-policy-success-link").click(function () {
|
|
|
|
$("a#unpublish-policy-success-link").click(function () {
|
|
|
|
hidePopup();
|
|
|
|
modalDialog.hide();
|
|
|
|
location.reload();
|
|
|
|
location.reload();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
// on error
|
|
|
|
// on error
|
|
|
|
function () {
|
|
|
|
function () {
|
|
|
|
$(modalPopupContent).html($('#unpublish-policy-error-content').html());
|
|
|
|
modalDialog.header('An unexpected error occurred. Please try again later.');
|
|
|
|
|
|
|
|
modalDialog.footer('<div class="buttons"><a href="#" id="unpublish-policy-error-link" ' +
|
|
|
|
|
|
|
|
'class="btn-operations">Ok</a></div>');
|
|
|
|
|
|
|
|
modalDialog.showAsError();
|
|
|
|
$("a#unpublish-policy-error-link").click(function () {
|
|
|
|
$("a#unpublish-policy-error-link").click(function () {
|
|
|
|
hidePopup();
|
|
|
|
modalDialog.hide();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
);
|
|
|
|
);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
$("a#unpublish-policy-cancel-link").click(function () {
|
|
|
|
$("a#unpublish-policy-cancel-link").click(function () {
|
|
|
|
hidePopup();
|
|
|
|
modalDialog.hide();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
@ -271,16 +295,27 @@ $(document).ready(function () {
|
|
|
|
var policyList = getSelectedPolicies();
|
|
|
|
var policyList = getSelectedPolicies();
|
|
|
|
var statusList = getSelectedPolicyStates();
|
|
|
|
var statusList = getSelectedPolicyStates();
|
|
|
|
if (($.inArray('Active/Updated', statusList) > -1) || ($.inArray('Active', statusList) > -1)) {
|
|
|
|
if (($.inArray('Active/Updated', statusList) > -1) || ($.inArray('Active', statusList) > -1)) {
|
|
|
|
$(modalPopupContent).html($("#errorPolicyPublishSelection").html());
|
|
|
|
modalDialog.header('Operation cannot be performed !');
|
|
|
|
showPopup();
|
|
|
|
modalDialog.content('You cannot select already active policies. Please deselect active policies and try ' +
|
|
|
|
|
|
|
|
'again.');
|
|
|
|
|
|
|
|
modalDialog.footer('<div class="buttons"><a href="javascript:modalDialog.hide()" class="btn-operations">' +
|
|
|
|
|
|
|
|
'Ok</a></div>');
|
|
|
|
|
|
|
|
modalDialog.showAsAWarning();
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
var serviceURL = "/devicemgt_admin/policies/activate";
|
|
|
|
var serviceURL = "/devicemgt_admin/policies/activate";
|
|
|
|
if (policyList == 0) {
|
|
|
|
if (policyList == 0) {
|
|
|
|
$(modalPopupContent).html($("#errorPolicyPublish").html());
|
|
|
|
modalDialog.header('Operation cannot be performed !');
|
|
|
|
|
|
|
|
modalDialog.content('Please select a policy or a list of policies to publish.');
|
|
|
|
|
|
|
|
modalDialog.footer('<div class="buttons"><a href="javascript:modalDialog.hide()" class="btn-operations">' +
|
|
|
|
|
|
|
|
'Ok</a></div>');
|
|
|
|
|
|
|
|
modalDialog.showAsAWarning();
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
$(modalPopupContent).html($('#publish-policy-modal-content').html());
|
|
|
|
modalDialog.header('Do you really want to publish the selected policy(s)?');
|
|
|
|
|
|
|
|
modalDialog.footer('<div class="buttons"><a href="#" id="publish-policy-yes-link" ' +
|
|
|
|
|
|
|
|
'class="btn-operations">Yes</a><a href="#" id="publish-policy-cancel-link" ' +
|
|
|
|
|
|
|
|
'class="btn-operations btn-default">No</a></div>');
|
|
|
|
|
|
|
|
modalDialog.show();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
showPopup();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$("a#publish-policy-yes-link").click(function () {
|
|
|
|
$("a#publish-policy-yes-link").click(function () {
|
|
|
|
invokerUtil.put(
|
|
|
|
invokerUtil.put(
|
|
|
@ -288,24 +323,29 @@ $(document).ready(function () {
|
|
|
|
policyList,
|
|
|
|
policyList,
|
|
|
|
// on success
|
|
|
|
// on success
|
|
|
|
function () {
|
|
|
|
function () {
|
|
|
|
$(modalPopupContent).html($('#publish-policy-success-content').html());
|
|
|
|
modalDialog.header('Done. Selected policy was successfully published.');
|
|
|
|
|
|
|
|
modalDialog.footer('<div class="buttons"><a href="#" id="publish-policy-success-link" ' +
|
|
|
|
|
|
|
|
'class="btn-operations">Ok</a></div>');
|
|
|
|
$("a#publish-policy-success-link").click(function () {
|
|
|
|
$("a#publish-policy-success-link").click(function () {
|
|
|
|
hidePopup();
|
|
|
|
modalDialog.hide();
|
|
|
|
location.reload();
|
|
|
|
location.reload();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
// on error
|
|
|
|
// on error
|
|
|
|
function () {
|
|
|
|
function () {
|
|
|
|
$(modalPopupContent).html($('#publish-policy-error-content').html());
|
|
|
|
modalDialog.header('An unexpected error occurred. Please try again later.');
|
|
|
|
|
|
|
|
modalDialog.footer('<div class="buttons"><a href="#" id="publish-policy-error-link" ' +
|
|
|
|
|
|
|
|
'class="btn-operations">Ok</a></div>');
|
|
|
|
|
|
|
|
modalDialog.showAsError();
|
|
|
|
$("a#publish-policy-error-link").click(function () {
|
|
|
|
$("a#publish-policy-error-link").click(function () {
|
|
|
|
hidePopup();
|
|
|
|
modalDialog.hide();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
);
|
|
|
|
);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
$("a#publish-policy-cancel-link").click(function () {
|
|
|
|
$("a#publish-policy-cancel-link").click(function () {
|
|
|
|
hidePopup();
|
|
|
|
modalDialog.hide();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
@ -314,11 +354,18 @@ $(document).ready(function () {
|
|
|
|
var policyList = getSelectedPolicies();
|
|
|
|
var policyList = getSelectedPolicies();
|
|
|
|
var deletePolicyAPI = "/devicemgt_admin/policies/bulk-remove";
|
|
|
|
var deletePolicyAPI = "/devicemgt_admin/policies/bulk-remove";
|
|
|
|
if (policyList == 0) {
|
|
|
|
if (policyList == 0) {
|
|
|
|
$(modalPopupContent).html($("#errorPolicy").html());
|
|
|
|
modalDialog.header('Operation cannot be performed !');
|
|
|
|
|
|
|
|
modalDialog.content('Please select a policy or a list of policies to remove.');
|
|
|
|
|
|
|
|
modalDialog.footer('<div class="buttons"><a href="javascript:modalDialog.hide()" class="btn-operations">' +
|
|
|
|
|
|
|
|
'Ok</a></div>');
|
|
|
|
|
|
|
|
modalDialog.showAsAWarning();
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
$(modalPopupContent).html($('#remove-policy-modal-content').html());
|
|
|
|
modalDialog.header('Do you really want to remove the selected policy(s)?');
|
|
|
|
|
|
|
|
modalDialog.footer('<div class="buttons"><a href="#" id="remove-policy-yes-link" class=' +
|
|
|
|
|
|
|
|
'"btn-operations">Remove</a> <a href="#" id="remove-policy-cancel-link" ' +
|
|
|
|
|
|
|
|
'class="btn-operations btn-default">Cancel</a></div>');
|
|
|
|
|
|
|
|
modalDialog.show();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
showPopup();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$("a#remove-policy-yes-link").click(function () {
|
|
|
|
$("a#remove-policy-yes-link").click(function () {
|
|
|
|
invokerUtil.post(
|
|
|
|
invokerUtil.post(
|
|
|
@ -328,30 +375,41 @@ $(document).ready(function () {
|
|
|
|
function (data) {
|
|
|
|
function (data) {
|
|
|
|
data = JSON.parse(data);
|
|
|
|
data = JSON.parse(data);
|
|
|
|
if (data.errorMessage) {
|
|
|
|
if (data.errorMessage) {
|
|
|
|
$(modalPopupContent).html($('#remove-policy-error-devices').html());
|
|
|
|
modalDialog.header('Cannot Remove Policies.');
|
|
|
|
|
|
|
|
modalDialog.footer('<div class="buttons"><a href="#" id="remove-policy-error-devices" ' +
|
|
|
|
|
|
|
|
'class="btn-operations">Ok</a></div>');
|
|
|
|
|
|
|
|
modalDialog.showAsError();
|
|
|
|
$("a#remove-policy-error-devices").click(function () {
|
|
|
|
$("a#remove-policy-error-devices").click(function () {
|
|
|
|
hidePopup();
|
|
|
|
modalDialog.hide();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
$(modalPopupContent).html($('#remove-policy-success-content').html());
|
|
|
|
modalDialog.header('Done. Selected policy was successfully removed.');
|
|
|
|
|
|
|
|
modalDialog.footer('<div class="buttons"><a href="#" id="remove-policy-success-link" ' +
|
|
|
|
|
|
|
|
'class="btn-operations">Ok</a></div>');
|
|
|
|
$("a#remove-policy-success-link").click(function () {
|
|
|
|
$("a#remove-policy-success-link").click(function () {
|
|
|
|
var thisTable = $(".DTTT_selected").closest('.dataTables_wrapper').find('.dataTable').dataTable();
|
|
|
|
var thisTable = $(".DTTT_selected").closest('.dataTables_wrapper').find('.dataTable').dataTable();
|
|
|
|
thisTable.api().rows('.DTTT_selected').remove().draw(false);
|
|
|
|
thisTable.api().rows('.DTTT_selected').remove().draw(false);
|
|
|
|
hidePopup();
|
|
|
|
modalDialog.hide();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
// on error
|
|
|
|
// on error
|
|
|
|
function (data) {
|
|
|
|
function (data) {
|
|
|
|
if (JSON.parse(data.responseText).errorMessage) {
|
|
|
|
if (JSON.parse(data.responseText).errorMessage) {
|
|
|
|
$(modalPopupContent).html($('#remove-policy-error-devices').html());
|
|
|
|
modalDialog.header('Cannot Remove Policies.');
|
|
|
|
|
|
|
|
modalDialog.footer('<div class="buttons"><a href="#" id="remove-policy-error-devices" ' +
|
|
|
|
|
|
|
|
'class="btn-operations">Ok</a></div>');
|
|
|
|
|
|
|
|
modalDialog.showAsError();
|
|
|
|
$("a#remove-policy-error-devices").click(function () {
|
|
|
|
$("a#remove-policy-error-devices").click(function () {
|
|
|
|
hidePopup();
|
|
|
|
modalDialog.hide();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
$(modalPopupContent).html($('#remove-policy-error-content').html());
|
|
|
|
modalDialog.header('An unexpected error occurred. Please try again later.');
|
|
|
|
|
|
|
|
modalDialog.footer('<div class="buttons"><a href="#" id="remove-policy-error-link" ' +
|
|
|
|
|
|
|
|
'class="btn-operations">Ok</a></div>');
|
|
|
|
|
|
|
|
modalDialog.showAsError();
|
|
|
|
$("a#remove-policy-error-link").click(function () {
|
|
|
|
$("a#remove-policy-error-link").click(function () {
|
|
|
|
hidePopup();
|
|
|
|
modalDialog.hide();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -359,7 +417,7 @@ $(document).ready(function () {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
$("a#remove-policy-cancel-link").click(function () {
|
|
|
|
$("a#remove-policy-cancel-link").click(function () {
|
|
|
|
hidePopup();
|
|
|
|
modalDialog.hide();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
$("#loading-content").remove();
|
|
|
|
$("#loading-content").remove();
|
|
|
|