From c41a704a35f48c218c5a71b70e7e069e70fbcf48 Mon Sep 17 00:00:00 2001 From: Dileesha Rajapakse Date: Mon, 21 Aug 2017 15:04:01 +0530 Subject: [PATCH 1/2] Fixing product-iots#1322 Fixed https://github.com/wso2/product-iots/issues/1322 --- .../public/js/device-view.js | 23 +++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.view/public/js/device-view.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.view/public/js/device-view.js index e57001fe29..39f1f4885d 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.view/public/js/device-view.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.view/public/js/device-view.js @@ -46,6 +46,22 @@ $(document).ready(function() { }); +function getLogStatusIcon(entry) { + switch (entry) { + case 'COMPLETED': + return 'fw-success' + break; + case 'PENDING': + return 'fw-pending' + break; + case 'ERROR': + return 'fw-error' + break; + default: + return 'fw-info' + } +}; + function loadOperationsLog(update) { var operationsLogTable = "#operation-log"; if (update) { @@ -95,7 +111,7 @@ function loadOperationsLog(update) { data: "status", class: "text-right extended-log-data log-record-status", render: function(data, type, full, meta) { - return ' ' + data + ' '; + return ' ' + data + ' '; }, width: "100%" } @@ -171,10 +187,13 @@ function loadOperationsLog(update) { case 'PENDING': return 'fw-pending' break; + case 'ERROR': + return 'fw-error' + break; default: return 'fw-info' } - } + }; } } From d35fa791aab0f8ad6e1f4e0c14688ac50702e551 Mon Sep 17 00:00:00 2001 From: Dileesha Rajapakse Date: Mon, 21 Aug 2017 15:20:56 +0530 Subject: [PATCH 2/2] Refactored the device-view.js script --- .../public/js/device-view.js | 22 +++++++------------ 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.view/public/js/device-view.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.view/public/js/device-view.js index 39f1f4885d..50c6dfa07a 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.view/public/js/device-view.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.view/public/js/device-view.js @@ -49,18 +49,15 @@ $(document).ready(function() { function getLogStatusIcon(entry) { switch (entry) { case 'COMPLETED': - return 'fw-success' - break; + return 'fw-success'; case 'PENDING': - return 'fw-pending' - break; + return 'fw-pending'; case 'ERROR': - return 'fw-error' - break; + return 'fw-error'; default: return 'fw-info' } -}; +} function loadOperationsLog(update) { var operationsLogTable = "#operation-log"; @@ -182,18 +179,15 @@ function loadOperationsLog(update) { function getLogStatusIcon(entry) { switch (entry) { case 'COMPLETED': - return 'fw-success' - break; + return 'fw-success'; case 'PENDING': - return 'fw-pending' - break; + return 'fw-pending'; case 'ERROR': - return 'fw-error' - break; + return 'fw-error'; default: return 'fw-info' } - }; + } } }