forked from community/device-mgt-core
parent
2a9e2a47e8
commit
7ff993a7b7
@ -0,0 +1,52 @@
|
||||
{{#zone "topCss"}}
|
||||
{{css "css/analytics.css"}}
|
||||
{{/zone}}
|
||||
|
||||
{{unit "cdmf.unit.ui.title" pageTitle="Analytics"}}
|
||||
{{unit "cdmf.unit.ui.content.title" pageHeader=title}}
|
||||
{{unit "cdmf.unit.lib.service-invoker-utility"}}
|
||||
{{unit "cdmf.unit.lib.handlebars"}}
|
||||
{{unit "cdmf.unit.lib.rickshaw-graph"}}
|
||||
|
||||
{{#zone "breadcrumbs"}}
|
||||
<li>
|
||||
<a href="{{@app.context}}/">
|
||||
<i class="icon fw fw-home"></i>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{@app.context}}/groups">
|
||||
Groups
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{@app.context}}/devices?groupOwner={{groupOwner}}&groupName={{groupName}}">
|
||||
{{groupName}}
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#">
|
||||
Analytics
|
||||
</a>
|
||||
</li>
|
||||
{{/zone}}
|
||||
|
||||
{{#zone "content"}}
|
||||
<div class="container container-bg white-bg">
|
||||
<div class=" margin-top-double">
|
||||
<div class="row padding-top-double padding-bottom-double margin-bottom-double">
|
||||
<div class="col-lg-3 margin-top-double">
|
||||
<h1 class="grey ">{{groupName}} Analytics</h1>
|
||||
</div>
|
||||
{{unit "cdmf.unit.analytics.date-range-picker" deviceTypes=deviceTypes}}
|
||||
</div>
|
||||
<hr>
|
||||
<div class="clear"></div>
|
||||
<div id="div-chart">
|
||||
{{#each deviceTypes}}
|
||||
{{unit deviceAnalyticsViewUnitName devices=devices}}
|
||||
{{/each}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{/zone}}
|
@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||
*
|
||||
* WSO2 Inc. licenses this file to you under the Apache License,
|
||||
* Version 2.0 (the "License"); you may not use this file except
|
||||
* in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
function onRequest(context) {
|
||||
var utility = require("/app/modules/utility.js").utility;
|
||||
var groupModule = require("/app/modules/group.js").groupModule;
|
||||
var groupName = context.uriParams.name;
|
||||
var groupOwner = context.uriParams.owner;
|
||||
var deviceTypes = [];
|
||||
var devices = groupModule.getGroupDevices(groupName, groupOwner).data;
|
||||
|
||||
for (var i = 0; i < devices.length; i++) {
|
||||
var hasDeviceType = false;
|
||||
for (var j = 0; j < deviceTypes.length; j++) {
|
||||
if (deviceTypes[j].type === devices[i].type) {
|
||||
deviceTypes[j].devices.push(devices[i]);
|
||||
hasDeviceType = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!hasDeviceType) {
|
||||
var deviceType = {};
|
||||
deviceType.type = devices[i].type;
|
||||
deviceType.devices = [];
|
||||
deviceType.devices.push(devices[i]);
|
||||
deviceType.deviceAnalyticsViewUnitName = utility.getTenantedDeviceUnitName(deviceType.type, "analytics-view");
|
||||
deviceTypes.push(deviceType);
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
"groupName": groupName,
|
||||
"groupOwner": groupOwner,
|
||||
"deviceTypes": deviceTypes
|
||||
};
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
{
|
||||
"version": "1.0.0",
|
||||
"uri": "/group/{owner}/{name}/analytics",
|
||||
"layout": "cdmf.layout.default"
|
||||
}
|
@ -0,0 +1,63 @@
|
||||
/*
|
||||
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||
*
|
||||
* WSO2 Inc. licenses this file to you under the Apache License,
|
||||
* Version 2.0 (the "License"); you may not use this file except
|
||||
* in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
#rangeSliderWrapper {
|
||||
margin-top: 25px;
|
||||
}
|
||||
|
||||
#chart {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
#legend {
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
left: 8px;
|
||||
}
|
||||
|
||||
#legend_container {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
bottom: 26px;
|
||||
width: 0;
|
||||
}
|
||||
|
||||
#chart_container {
|
||||
float: left;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.ast-container {
|
||||
padding-bottom: 30px;
|
||||
}
|
||||
|
||||
.container {
|
||||
width: auto;
|
||||
}
|
||||
|
||||
.shrink {
|
||||
margin-right: 20px;
|
||||
margin-left: 20px;
|
||||
}
|
||||
.date-range{
|
||||
border: 1px solid #ccc;
|
||||
}
|
||||
|
||||
#dateRangePickerContainer button.active{
|
||||
background-color: #e6e6e6 !important;
|
||||
}
|
@ -1,62 +0,0 @@
|
||||
{{#each groups}}
|
||||
<tr data-type="selectable" data-group-name="{{name}}" data-group-owner="{{owner}}">
|
||||
<td class="remove-padding icon-only content-fill">
|
||||
<div class="thumbnail icon">
|
||||
<img class="square-element text fw "
|
||||
src="public/cdmf.page.groups/images/group-icon.png"/>
|
||||
</div>
|
||||
</td>
|
||||
<td class="fade-edge">
|
||||
<h4>{{name}}</h4>
|
||||
</td>
|
||||
<td class="fade-edge remove-padding-top" data-search="{{owner}}"
|
||||
data-display="{{owner}}"
|
||||
data-grid-label="Owner">{{owner}}</td>
|
||||
<td class="text-right content-fill text-left-on-grid-view no-wrap">
|
||||
<a href="devices?groupName={{name}}&groupOwner={{owner}}"
|
||||
data-click-event="remove-form" class="btn padding-reduce-on-grid-view">
|
||||
<span class="fw-stack">
|
||||
<i class="fw fw-ring fw-stack-2x"></i>
|
||||
<i class="fw fw-view fw-stack-1x"></i>
|
||||
</span>
|
||||
<span class="hidden-xs hidden-on-grid-view">View Devices</span>
|
||||
</a>
|
||||
<a href="analytics?groupName={{name}}&groupOwner={{owner}}"
|
||||
data-click-event="remove-form" class="btn padding-reduce-on-grid-view">
|
||||
<span class="fw-stack">
|
||||
<i class="fw fw-ring fw-stack-2x"></i>
|
||||
<i class="fw fw-statistics fw-stack-1x"></i>
|
||||
</span>
|
||||
<span class="hidden-xs hidden-on-grid-view">Analytics</span>
|
||||
</a>
|
||||
<a href="#" data-click-event="remove-form"
|
||||
class="btn padding-reduce-on-grid-view share-group-link"
|
||||
data-group-name="{{name}}" data-group-owner="{{owner}}">
|
||||
<span class="fw-stack">
|
||||
<i class="fw fw-ring fw-stack-2x"></i>
|
||||
<i class="fw fw-share fw-stack-1x"></i>
|
||||
</span>
|
||||
<span class="hidden-xs hidden-on-grid-view">Share</span>
|
||||
</a>
|
||||
<a href="#" data-click-event="remove-form"
|
||||
class="btn padding-reduce-on-grid-view edit-group-link"
|
||||
data-group-name="{{name}}" data-group-owner="{{owner}}"
|
||||
data-group-description="{{description}}">
|
||||
<span class="fw-stack">
|
||||
<i class="fw fw-ring fw-stack-2x"></i>
|
||||
<i class="fw fw-edit fw-stack-1x"></i>
|
||||
</span>
|
||||
<span class="hidden-xs hidden-on-grid-view">Edit</span>
|
||||
</a>
|
||||
<a href="#" data-click-event="remove-form"
|
||||
class="btn padding-reduce-on-grid-view remove-group-link"
|
||||
data-group-name="{{name}}" data-group-owner="{{owner}}">
|
||||
<span class="fw-stack">
|
||||
<i class="fw fw-ring fw-stack-2x"></i>
|
||||
<i class="fw fw-delete fw-stack-1x"></i>
|
||||
</span>
|
||||
<span class="hidden-xs hidden-on-grid-view">Delete</span>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
{{/each}}
|
@ -0,0 +1,31 @@
|
||||
{{#zone "topCss"}}
|
||||
{{css "css/daterangepicker.css"}}
|
||||
{{/zone}}
|
||||
<span id="device-type-details" data-devicetypes="{{deviceTypes}}"></span>
|
||||
<div id="rangeSliderWrapper" class="pull-right col-lg-9">
|
||||
<div id="dateRangePickerContainer">
|
||||
<div class="btn-group" role="group">
|
||||
<button id="hour-btn" type="button"
|
||||
class="btn btn-default date-range">Hour
|
||||
</button>
|
||||
<button id="h12-btn" type="button"
|
||||
class="btn btn-default date-range">12 Hours
|
||||
</button>
|
||||
<button id="h24-btn" type="button"
|
||||
class="btn btn-default date-range">24 Hours
|
||||
</button>
|
||||
<button id="h48-btn" type="button"
|
||||
class="btn btn-default date-range">48 Hours
|
||||
</button>
|
||||
<button id="date-range" type="button"
|
||||
class="btn btn-default date-range last-child"
|
||||
data-toggle="popup"
|
||||
title="Click to set custom date range"></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{#zone "bottomJs"}}
|
||||
{{js "js/moment.js"}}
|
||||
{{js "js/jquery.daterangepicker.js"}}
|
||||
{{js "js/date-picker.js"}}
|
||||
{{/zone}}
|
@ -0,0 +1,32 @@
|
||||
/*
|
||||
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||
*
|
||||
* WSO2 Inc. licenses this file to you under the Apache License,
|
||||
* Version 2.0 (the "License"); you may not use this file except
|
||||
* in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
function onRequest(context) {
|
||||
var deviceTypes = context.unit.params.deviceTypes;
|
||||
var deviceType = context.uriParams.deviceType;
|
||||
|
||||
var deviceTypesList = [];
|
||||
if (deviceTypes) {
|
||||
for (var i = 0; i < deviceTypes.length; i++) {
|
||||
deviceTypesList.push(deviceTypes[i].type);
|
||||
}
|
||||
} else if (deviceType) {
|
||||
deviceTypesList.push(deviceType);
|
||||
}
|
||||
return {"deviceTypes": stringify(deviceTypesList)};
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
{
|
||||
"version": "1.0.0"
|
||||
}
|
15
components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.device.analytics/public/css/daterangepicker.css → components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.analytics.date-range-picker/public/css/daterangepicker.css
15
components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.device.analytics/public/css/daterangepicker.css → components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.analytics.date-range-picker/public/css/daterangepicker.css
28
components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.device.analytics/public/js/graph_util.js → components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.analytics.date-range-picker/public/js/date-picker.js
28
components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.device.analytics/public/js/graph_util.js → components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.analytics.date-range-picker/public/js/date-picker.js
17
components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.device.analytics/public/js/jquery-ui-timepicker-addon.js → components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.analytics.date-range-picker/public/js/jquery-ui-timepicker-addon.js
vendored
17
components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.device.analytics/public/js/jquery-ui-timepicker-addon.js → components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.analytics.date-range-picker/public/js/jquery-ui-timepicker-addon.js
vendored
@ -1,20 +1,3 @@
|
||||
/*
|
||||
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||
*
|
||||
* WSO2 Inc. licenses this file to you under the Apache License,
|
||||
* Version 2.0 (the "License"); you may not use this file except
|
||||
* in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
(function ($) {
|
||||
|
||||
/*
|
18
components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.device.analytics/public/js/jquery.daterangepicker.js → components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.analytics.date-range-picker/public/js/jquery.daterangepicker.js
18
components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.device.analytics/public/js/jquery.daterangepicker.js → components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.analytics.date-range-picker/public/js/jquery.daterangepicker.js
@ -1,21 +1,3 @@
|
||||
/*
|
||||
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||
*
|
||||
* WSO2 Inc. licenses this file to you under the Apache License,
|
||||
* Version 2.0 (the "License"); you may not use this file except
|
||||
* in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
// daterangepicker.js
|
||||
// version : 0.0.5
|
||||
// author : Chunlong Liu
|
File diff suppressed because it is too large
Load Diff
7
components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.device.analytics/public/css/graph.css → components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.lib.rickshaw-graph/public/css/graph.css
7
components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.device.analytics/public/css/graph.css → components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.lib.rickshaw-graph/public/css/graph.css
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@ -0,0 +1,8 @@
|
||||
{{#zone "topCss"}}
|
||||
{{css "css/graph.css"}}
|
||||
{{/zone}}
|
||||
|
||||
{{#zone "bottomJs"}}
|
||||
{{js "js/d3.min.js"}}
|
||||
{{js "js/rickshaw.min.js"}}
|
||||
{{/zone}}
|
@ -0,0 +1,4 @@
|
||||
{
|
||||
"version": "1.0.0",
|
||||
"index": 30
|
||||
}
|
Loading…
Reference in new issue