Removed unwanted analytics graphs and added redirect to portal app.

revert-dabc3590
Menaka Jayawardena 8 years ago
parent 8a759db8da
commit 8ad1b0a891

@ -17,26 +17,9 @@
*/
function onRequest(context) {
var devices = context.unit.params.devices;
var deviceType = context.uriParams.deviceType;
var user = context.user;
var deviceId = request.getParameter("deviceId");
if (devices) {
return {
"devices": stringify(devices),
"backendApiUri": "/android_sense/stats/"
};
} else if (deviceType != null && deviceType != undefined && deviceId != null && deviceId != undefined) {
var deviceModule = require("/app/modules/business-controllers/device.js")["deviceModule"];
var device = deviceModule.viewDevice(deviceType, deviceId);
if (device && device.status != "error") {
return {
"device": device.content,
"backendApiUrl": "/android_sense/stats/" + deviceId + "/sensors/"
};
} else {
response.sendError(404, "Device Id " + deviceId + " of type " + deviceType + " cannot be found!");
exit();
}
}
//Redirects to the portal app as we do not use the old analytics view.
response.sendRedirect(context.app.conf["portalURL"] + "/portal/dashboards/android-iot/real-time?owner=" + user.username + "&deviceId=" + deviceId);
}

@ -41,8 +41,6 @@
data-toggle="tab" aria-controls="device_statistics">Device
Statistics</a>
</li>
<li><a class="list-group-item" href="#device_location" role="tab" data-toggle="tab"
aria-controls="device_location">Device Location</a></li>
<li><a class="list-group-item" href="#event_log" role="tab" data-toggle="tab"
aria-controls="event_log">Operations Log</a></li>
{{/zone}}
@ -53,15 +51,6 @@
<div class="panel-heading">Device Statistics</div>
{{unit "cdmf.unit.device.type.android_sense.realtime.analytics-view" device=device}}
</div>
<div class="panel panel-default tab-pane" id="device_location" role="tabpanel"
aria-labelledby="device_location">
<div class="panel-heading">Device Location</div>
<div class="panel-body">
<div id="map" style="height: 400px;">
</div>
<br class="c-both"/>
</div>
</div>
<div class="panel panel-default tab-pane" id="event_log" role="tabpanel"
aria-labelledby="event_log">
<div class="panel-heading">Operations Log <span><a href="#"
@ -85,9 +74,3 @@
</div>
</div>
{{/zone}}
{{#zone "bottomJs"}}
<script async defer
src="https://maps.googleapis.com/maps/api/js?v=3.exp&signed_in=true&callback=initMap">
</script>
{{/zone}}

@ -19,98 +19,7 @@
<div id="chartWrapper">
</div>
<div id="div-chart" data-websocketurl="{{websocketEndpoint}}">
<div id="chartWrapper-battery" class="chartWrapper">
<div id="y_axis-battery" class="custom_y_axis" style="margin-top: -20px;">Battery</div>
<div class="legend_container-battery">
<div id="smoother-battery" title="Smoothing"></div>
<div id="legend-battery"></div>
</div>
<div id="chart-battery" class="custom_rickshaw_graph"></div>
<div class="custom_x_axis">Time</div>
</div>
<div id="chartWrapper-light" class="chartWrapper">
<div id="y_axis-light" class="custom_y_axis" style="margin-top: -20px;">Light</div>
<div class="legend_container-light">
<div id="smoother-light" title="Smoothing"></div>
<div id="legend-light"></div>
</div>
<div id="chart-light" class="custom_rickshaw_graph"></div>
<div class="custom_x_axis">Time</div>
</div>
<div id="chartWrapper-pressure" class="chartWrapper">
<div id="y_axis-pressure" class="custom_y_axis" style="margin-top: -20px;">Pressure</div>
<div class="legend_container-pressure">
<div id="smoother-pressure" title="Smoothing"></div>
<div id="legend-pressure"></div>
</div>
<div id="chart-pressure" class="custom_rickshaw_graph"></div>
<div class="custom_x_axis">Time</div>
</div>
<div id="chartWrapper-proximity" class="chartWrapper">
<div id="y_axis-proximity" class="custom_y_axis" style="margin-top: -20px;">Proximity</div>
<div class="legend_container-proximity">
<div id="smoother-proximity" title="Smoothing"></div>
<div id="legend-proximity"></div>
</div>
<div id="chart-proximity" class="custom_rickshaw_graph"></div>
<div class="custom_x_axis">Time</div>
</div>
<div id="chartWrapper-accelerometer" class="chartWrapper">
<div id="y_axis-accelerometer" class="custom_y_axis" style="margin-top: -20px;">Accelerometer</div>
<div class="legend_container-accelerometer">
<div id="smoother-accelerometer" title="Smoothing"></div>
<div id="legend-accelerometer"></div>
</div>
<div id="chart-accelerometer" class="custom_rickshaw_graph"></div>
<div class="custom_x_axis">Time</div>
</div>
<div id="chartWrapper-magnetic" class="chartWrapper">
<div id="y_axis-magnetic" class="custom_y_axis" style="margin-top: -20px;">Magnetic</div>
<div class="legend_container-magnetic">
<div id="smoother-magnetic" title="Smoothing"></div>
<div id="legend-magnetic"></div>
</div>
<div id="chart-magnetic" class="custom_rickshaw_graph"></div>
<div class="custom_x_axis">Time</div>
</div>
<div id="chartWrapper-rotation" class="chartWrapper">
<div id="y_axis-rotation" class="custom_y_axis" style="margin-top: -20px;">Rotation</div>
<div class="legend_container-rotation">
<div id="smoother-rotation" title="Smoothing"></div>
<div id="legend-rotation"></div>
</div>
<div id="chart-rotation" class="custom_rickshaw_graph"></div>
<div class="custom_x_axis">Time</div>
</div>
<div id="chartWrapper-gyroscope" class="chartWrapper">
<div id="y_axis-gyroscope" class="custom_y_axis" style="margin-top: -20px;">Gyroscope</div>
<div class="legend_container-gyroscope">
<div id="smoother-gyroscope" title="Smoothing"></div>
<div id="legend-gyroscope"></div>
</div>
<div id="chart-gyroscope" class="custom_rickshaw_graph"></div>
<div class="custom_x_axis">Time</div>
</div>
<div id="chartWrapper-gravity" class="chartWrapper">
<div id="y_axis-gravity" class="custom_y_axis" style="margin-top: -20px;">Gravity</div>
<div class="legend_container-gravity">
<div id="smoother-gravity" title="Smoothing"></div>
<div id="legend-gravity"></div>
</div>
<div id="chart-gravity" class="custom_rickshaw_graph"></div>
<div class="custom_x_axis">Time</div>
</div>
</div>
<a class="padding-left"
href="{{@app.context}}/device/{{device.type}}/analytics?deviceId={{device.deviceIdentifier}}&deviceName={{device.name}}">
<span class="fw-stack">

Loading…
Cancel
Save