diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/business-controllers/device.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/business-controllers/device.js index b970b04cf9d..6c7dbcc1742 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/business-controllers/device.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/business-controllers/device.js @@ -298,20 +298,20 @@ deviceModule = function () { var url; if (uiPermissions.LIST_DEVICES) { url = devicemgtProps["httpsURL"] + - devicemgtProps["backendRestEndpoints"]["deviceMgt"] + "/devices/count"; + devicemgtProps["backendRestEndpoints"]["deviceMgt"] + "/devices?offset=0&limit=1"; } else if (uiPermissions.LIST_OWN_DEVICES) { url = devicemgtProps["httpsURL"] + devicemgtProps["backendRestEndpoints"]["deviceMgt"] + - "/devices/user/" + carbonUser.username + "/count"; + "/devices?offset=0&limit=1&user=" + carbonUser.username; } else { log.error("Access denied for user: " + carbonUser.username); return -1; } return serviceInvokers.XMLHttp.get( url, function (responsePayload) { - return responsePayload; + return parse(responsePayload["responseText"])["count"]; }, function (responsePayload) { - log.error(responsePayload); + log.error(responsePayload["responseText"]); return -1; } ); diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.dashboard/dashboard.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.dashboard/dashboard.js index 06ac10ba3ab..7fcd099e189 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.dashboard/dashboard.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.dashboard/dashboard.js @@ -36,10 +36,12 @@ function onRequest() { page.permissions = permissions; page.enrollmentURL = devicemgtProps.enrollmentURL; page.device_count = deviceModule.getDevicesCount(); - page.group_count = groupModule.getGroupCount(); + //TODO: Enable Group Management Service API on CDMF + //page.group_count = groupModule.getGroupCount(); + page.group_count = -1; page.user_count = userModule.getUsers()["content"].length; page.policy_count = policyModule.getAllPolicies()["content"].length; page.role_count = userModule.getRoles()["content"].length; return page; -} +} \ No newline at end of file