-
Device associations updated.
+ Successfully added the device/s to the group!
@@ -374,7 +374,7 @@
';
+ return logStream;
+
+ function getLogStatusIcon(entry) {
+ switch (entry) {
+ case 'COMPLETED':
+ return 'fw-success'
+ break;
+ case 'PENDING':
+ return 'fw-pending'
+ break;
+ default:
+ return 'fw-info'
+ }
+ }
+ }
+}
+
+function loadOperationsLog2(update) {
+ var operationsLogTable = "#operations-log-table";
+
+ if (update) {
+ operationTable = $(operationsLogTable).DataTable();
+ $("#operations-spinner").removeClass("hidden");
+ operationTable.ajax.reload(function(json) {
+ $("#operations-spinner").addClass("hidden");
+ }, false);
+ return;
+ }
+ operationTable = $(operationsLogTable).datatables_extended({
+ serverSide: true,
+ processing: false,
+ searching: false,
+ ordering: false,
+ pageLength: 10,
+ order: [],
+ ajax: {
+ url: "/devicemgt/api/operation/paginate",
+ data: {
+ deviceId: deviceIdentifier,
+ deviceType: deviceType,
+ owner: deviceOwner
+ },
+ dataSrc: function(json) {
+ $("#operations-spinner").addClass("hidden");
+ $("#operations-log-container").empty();
+ return json.data;
+ }
+ },
+ columnDefs: [{
+ targets: 0,
+ data: "code"
+ },
+ {
+ targets: 1,
+ data: "status",
+ render: function(status) {
+ var html;
+ switch (status) {
+ case "COMPLETED":
+ html = "
Completed";
+ break;
+ case "PENDING":
+ html = "
Pending";
+ break;
+ case "ERROR":
+ html = "
Error";
+ break;
+ case "IN_PROGRESS":
+ html = "
In Progress";
+ break;
+ case "REPEATED":
+ html = "
Repeated";
+ break;
}
+ return html;
+ }
+ },
+ {
+ targets: 2,
+ data: "createdTimeStamp",
+ render: function(date) {
+ var value = String(date);
+ return value.slice(0, 16);
}
- ],
- "createdRow": function(row, data) {
-
- $(row).attr("data-type", "selectable");
- $(row).attr("data-id", data["id"]);
- $.each($("td", row),
- function(colIndex) {
- switch(colIndex) {
- case 1:
- $(this).attr("data-grid-label", "Code");
- $(this).attr("data-display", data["code"]);
- break;
- case 2:
- $(this).attr("data-grid-label", "Status");
- $(this).attr("data-display", data["status"]);
- break;
- case 3:
- $(this).attr("data-grid-label", "Created Timestamp");
- $(this).attr("data-display", data["createdTimeStamp"]);
- break;
- }
- }
- );
}
- });
- }
+ ],
+ "createdRow": function(row, data) {
+
+ $(row).attr("data-type", "selectable");
+ $(row).attr("data-id", data["id"]);
+ $.each($("td", row),
+ function(colIndex) {
+ switch (colIndex) {
+ case 1:
+ $(this).attr("data-grid-label", "Code");
+ $(this).attr("data-display", data["code"]);
+ break;
+ case 2:
+ $(this).attr("data-grid-label", "Status");
+ $(this).attr("data-display", data["status"]);
+ break;
+ case 3:
+ $(this).attr("data-grid-label", "Created Timestamp");
+ $(this).attr("data-display", data["createdTimeStamp"]);
+ break;
+ }
+ }
+ );
+ }
+ });
+}
+
+function loadPolicyCompliance() {
+ var policyCompliance = $("#policy-view");
+ var policyComplianceTemplate = policyCompliance.attr("src");
+ var deviceId = policyCompliance.data("device-id");
+ var deviceType = policyCompliance.data("device-type");
+ var activePolicy = null;
- function loadPolicyCompliance() {
- var policyCompliance = $("#policy-view");
- var policyComplianceTemplate = policyCompliance.attr("src");
- var deviceId = policyCompliance.data("device-id");
- var deviceType = policyCompliance.data("device-type");
- var activePolicy = null;
-
- $.template(
- "policy-view",
- policyComplianceTemplate,
- function (template) {
- var getEffectivePolicyURL = "/api/device-mgt/v1.0/devices/" + deviceType + "/" + deviceId + "/effective-policy";
- var getDeviceComplianceURL = "/api/device-mgt/v1.0/devices/" + deviceType + "/" + deviceId + "/compliance-data";
- invokerUtil.get(
- getEffectivePolicyURL,
- // success-callback
- function (data, textStatus, jqXHR) {
- if (jqXHR.status == 200) {
- $("#policy-spinner").addClass("hidden");
- if(data){
- data = JSON.parse(data);
- if (data["active"] == true) {
- activePolicy = data;
- invokerUtil.get(
- getDeviceComplianceURL,
- // success-callback
- function (data, textStatus, jqXHR) {
- if (jqXHR.status == 200 && data) {
- var viewModel = {};
- viewModel["policy"] = activePolicy;
- viewModel["deviceType"] = deviceType;
- viewModel["deviceId"] = deviceId;
- viewModel["appContext"] = context;
- data = JSON.parse(data);
- var content;
- if (data["complianceData"]) {
- if (data["complianceData"]["complianceFeatures"] &&
- data["complianceData"]["complianceFeatures"].length > 0) {
- viewModel["compliance"] = "NON-COMPLIANT";
- viewModel["complianceFeatures"] = data["complianceData"]["complianceFeatures"];
- content = template(viewModel);
- $("#policy-list-container").html(content);
- } else {
- viewModel["compliance"] = "COMPLIANT";
- content = template(viewModel);
- $("#policy-list-container").html(content);
- $("#policy-compliance-table").addClass("hidden");
- }
+ $.template(
+ "policy-view",
+ policyComplianceTemplate,
+ function(template) {
+ var getEffectivePolicyURL = "/api/device-mgt/v1.0/devices/" + deviceType + "/" + deviceId + "/effective-policy";
+ var getDeviceComplianceURL = "/api/device-mgt/v1.0/devices/" + deviceType + "/" + deviceId + "/compliance-data";
+ invokerUtil.get(
+ getEffectivePolicyURL,
+ // success-callback
+ function(data, textStatus, jqXHR) {
+ if (jqXHR.status == 200) {
+ $("#policy-spinner").addClass("hidden");
+ if (data) {
+ data = JSON.parse(data);
+ if (data["active"] == true) {
+ activePolicy = data;
+ invokerUtil.get(
+ getDeviceComplianceURL,
+ // success-callback
+ function(data, textStatus, jqXHR) {
+ if (jqXHR.status == 200 && data) {
+ var viewModel = {};
+ viewModel["policy"] = activePolicy;
+ viewModel["deviceType"] = deviceType;
+ viewModel["deviceId"] = deviceId;
+ viewModel["appContext"] = context;
+ data = JSON.parse(data);
+ var content;
+ if (data["complianceData"]) {
+ if (data["complianceData"]["complianceFeatures"] &&
+ data["complianceData"]["complianceFeatures"].length > 0) {
+ viewModel["compliance"] = "NON-COMPLIANT";
+ viewModel["complianceFeatures"] = data["complianceData"]["complianceFeatures"];
+ content = template(viewModel);
+ $("#policy-list-container").html(content);
} else {
- $("#policy-list-container").
- html("
This device " +
- "has no policy applied.
");
+ viewModel["compliance"] = "COMPLIANT";
+ content = template(viewModel);
+ $("#policy-list-container").html(content);
+ $("#policy-compliance-table").addClass("hidden");
}
+ } else {
+ $("#policy-list-container").
+ html("
This device " +
+ "has no policy applied.
");
}
- },
- // error-callback
- function () {
- $("#policy-list-container").
- html("
Loading policy compliance related data " +
- "was not successful. please try refreshing data in a while.
");
}
- );
- }
+ },
+ // error-callback
+ function() {
+ $("#policy-list-container").
+ html("
Loading policy compliance related data " +
+ "was not successful. please try refreshing data in a while.
");
+ }
+ );
}
}
- },
- // error-callback
- function () {
- $("#policy-list-container").
- html("
Loading policy compliance related data " +
- "was not successful. please try refreshing data in a while.
");
}
- );
- }
- );
- }
+ },
+ // error-callback
+ function() {
+ $("#policy-list-container").
+ html("
Loading policy compliance related data " +
+ "was not successful. please try refreshing data in a while.
");
+ }
+ );
+ }
+ );
+}
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.view/view.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.view/view.hbs
index 8a58f285ab3..e9b704cd7a1 100644
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.view/view.hbs
+++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.view/view.hbs
@@ -15,156 +15,114 @@
specific language governing permissions and limitations
under the License.
}}
+{{#zone "topCss"}}
+ {{css "css/main.css"}}
+{{/zone}}
{{unit "cdmf.unit.lib.editable"}}
{{#zone "content"}}
{{#if deviceFound}}
{{#if isAuthorized}}
-
- {{#defineZone "device-details-header"}}
-
- Device {{device.name}}
- {{#if device.viewModel.model}}
-
- ( {{device.viewModel.vendor}} {{device.viewModel.model}} )
-
- {{/if}}
-
- {{/defineZone}}
-