|
|
@ -38,32 +38,40 @@ var displayPolicy = function (policyPayloadObj) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$("#policy-status").html(policyStatus);
|
|
|
|
$("#policy-status").html(policyStatus);
|
|
|
|
console.log(policyPayloadObj);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// if (policyPayloadObj.users.length > 0) {
|
|
|
|
if (policyPayloadObj.users == null) {
|
|
|
|
// $("#policy-users").text(policyPayloadObj.users.toString().split(",").join(", "));
|
|
|
|
$("#policy-users").text("NONE");
|
|
|
|
// } else {
|
|
|
|
}
|
|
|
|
// $("#users-row").addClass("hidden");
|
|
|
|
else if (policyPayloadObj.users.length > 0) {
|
|
|
|
// }
|
|
|
|
$("#policy-users").text(policyPayloadObj.users.toString().split(",").join(", "));
|
|
|
|
// if (policyPayloadObj.deviceGroups.length > 0) {
|
|
|
|
} else {
|
|
|
|
// debugger;
|
|
|
|
$("#users-row").addClass("hidden");
|
|
|
|
// var deviceGroups = policyPayloadObj.deviceGroups;
|
|
|
|
}
|
|
|
|
// var assignedGroups = [];
|
|
|
|
|
|
|
|
// for (var index in deviceGroups) {
|
|
|
|
|
|
|
|
// if (deviceGroups.hasOwnProperty(index)) {
|
|
|
|
|
|
|
|
// assignedGroups.push(deviceGroups[index].name);
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// $("#policy-groups").text(assignedGroups.toString().split(",").join(", "));
|
|
|
|
|
|
|
|
// } else {
|
|
|
|
|
|
|
|
// $("#policy-groups").text("NONE");
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// if (policyPayloadObj.roles.length > 0) {
|
|
|
|
if (policyPayloadObj.deviceGroups == null) {
|
|
|
|
// $("#policy-roles").text(policyPayloadObj.roles.toString().split(",").join(", "));
|
|
|
|
$("#policy-groups").text("NONE");
|
|
|
|
// } else {
|
|
|
|
} else if (policyPayloadObj.deviceGroups.length > 0) {
|
|
|
|
// $("#roles-row").addClass("hidden");
|
|
|
|
debugger;
|
|
|
|
// }
|
|
|
|
var deviceGroups = policyPayloadObj.deviceGroups;
|
|
|
|
|
|
|
|
var assignedGroups = [];
|
|
|
|
|
|
|
|
for (var index in deviceGroups) {
|
|
|
|
|
|
|
|
if (deviceGroups.hasOwnProperty(index)) {
|
|
|
|
|
|
|
|
assignedGroups.push(deviceGroups[index].name);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
$("#policy-groups").text(assignedGroups.toString().split(",").join(", "));
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
$("#policy-groups").text("NONE");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (policyPayloadObj.roles == null) {
|
|
|
|
|
|
|
|
$("#policy-roles").text("NONE");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (policyPayloadObj.roles.length > 0) {
|
|
|
|
|
|
|
|
$("#policy-roles").text(policyPayloadObj.roles.toString().split(",").join(", "));
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
$("#roles-row").addClass("hidden");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var deviceType = policy["platform"];
|
|
|
|
var deviceType = policy["platform"];
|
|
|
|
var policyOperationsTemplateSrc = context + '/public/cdmf.unit.device.type.' + deviceType +
|
|
|
|
var policyOperationsTemplateSrc = context + '/public/cdmf.unit.device.type.' + deviceType +
|
|
|
|