|
|
@ -62,6 +62,8 @@ policyModule = function () {
|
|
|
|
policyObjectToView["priorityId"] = policyObjectFromRestEndpoint["priorityId"];
|
|
|
|
policyObjectToView["priorityId"] = policyObjectFromRestEndpoint["priorityId"];
|
|
|
|
policyObjectToView["name"] = policyObjectFromRestEndpoint["policyName"];
|
|
|
|
policyObjectToView["name"] = policyObjectFromRestEndpoint["policyName"];
|
|
|
|
policyObjectToView["platform"] = policyObjectFromRestEndpoint["profile"]["deviceType"];
|
|
|
|
policyObjectToView["platform"] = policyObjectFromRestEndpoint["profile"]["deviceType"];
|
|
|
|
|
|
|
|
policyObjectFromRestEndpoint["policyType"] = policyListFromRestEndpoint["policyType"];
|
|
|
|
|
|
|
|
policyObjectFromRestEndpoint["correctiveActions"] = policyListFromRestEndpoint["correctiveActions"];
|
|
|
|
if (policyObjectToView["platform"] == "ios") {
|
|
|
|
if (policyObjectToView["platform"] == "ios") {
|
|
|
|
policyObjectToView["deviceTypeIcon"] = "apple";
|
|
|
|
policyObjectToView["deviceTypeIcon"] = "apple";
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
@ -168,6 +170,27 @@ policyModule = function () {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* Retrieve all policies based on policy type
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
publicMethods.getAllPoliciesByType = function (policyType) {
|
|
|
|
|
|
|
|
var carbonUser = session.get(constants["USER_SESSION_KEY"]);
|
|
|
|
|
|
|
|
if (!carbonUser) {
|
|
|
|
|
|
|
|
log.error("User object was not found in the session");
|
|
|
|
|
|
|
|
userModule.logout(function () {
|
|
|
|
|
|
|
|
response.sendRedirect(devicemgtProps["appContext"] + "login");
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
var url = devicemgtProps["httpsURL"] + devicemgtProps["backendRestEndpoints"]["deviceMgt"] +
|
|
|
|
|
|
|
|
"/policies/type/" + policyType + "?offset=0&limit=100";
|
|
|
|
|
|
|
|
return serviceInvokers.XMLHttp.get(url, privateMethods.handleGetAllPoliciesResponse);
|
|
|
|
|
|
|
|
} catch (e) {
|
|
|
|
|
|
|
|
log.error("Error occurred while retrieving policies by policy type " + policyType);
|
|
|
|
|
|
|
|
throw e;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
Get policies count from backend services.
|
|
|
|
Get policies count from backend services.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|