aboutsummaryrefslogtreecommitdiff
path: root/web/app/Application.js
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2016-12-26 18:06:48 +0500
committerAbyss777 <abyss@fox5.ru>2016-12-26 18:06:48 +0500
commit557ffa7f106e44a09a99746dcd8e4f369ea4730d (patch)
treebd58f402c90d0f930d6cb13867c8be4738ebdd69 /web/app/Application.js
parent082f7926b846f876613f27f21779b594e79ea0c7 (diff)
downloadtrackermap-web-557ffa7f106e44a09a99746dcd8e4f369ea4730d.tar.gz
trackermap-web-557ffa7f106e44a09a99746dcd8e4f369ea4730d.tar.bz2
trackermap-web-557ffa7f106e44a09a99746dcd8e4f369ea4730d.zip
Charts implementation
Diffstat (limited to 'web/app/Application.js')
-rw-r--r--web/app/Application.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/web/app/Application.js b/web/app/Application.js
index daa25b85..82caf1e0 100644
--- a/web/app/Application.js
+++ b/web/app/Application.js
@@ -70,6 +70,7 @@ Ext.define('Traccar.Application', {
'ReportSummary',
'ReportTypes',
'ReportEventTypes',
+ 'ReportChartTypes',
'Statistics',
'DeviceImages',
'Calendars',
@@ -134,6 +135,22 @@ Ext.define('Traccar.Application', {
}
},
+ getReportColor: function (deviceId) {
+ var index, reportColor, device = Ext.getStore('Devices').getById(deviceId);
+ if (device) {
+ reportColor = device.get('attributes')['web.reportColor'];
+ }
+ if (reportColor) {
+ return reportColor;
+ } else {
+ index = 0;
+ if (deviceId !== undefined) {
+ index = deviceId % Traccar.Style.mapRouteColor.length;
+ }
+ return Traccar.Style.mapRouteColor[index];
+ }
+ },
+
showError: function (response) {
if (Ext.isString(response)) {
Ext.Msg.alert(Strings.errorTitle, response);