diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2016-12-27 20:26:21 +1300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-27 20:26:21 +1300 |
commit | ecdf23611e30707f1bc5f89420f9409acaa56652 (patch) | |
tree | 2bf13878f536d0b63e2b4645b57c264a171fb078 /web/app/Application.js | |
parent | 082f7926b846f876613f27f21779b594e79ea0c7 (diff) | |
parent | 747c16cadc803fdf0e4de0dc331c84e29dd56e9c (diff) | |
download | trackermap-web-ecdf23611e30707f1bc5f89420f9409acaa56652.tar.gz trackermap-web-ecdf23611e30707f1bc5f89420f9409acaa56652.tar.bz2 trackermap-web-ecdf23611e30707f1bc5f89420f9409acaa56652.zip |
Merge pull request #371 from Abyss777/charts
Charts implementation
Diffstat (limited to 'web/app/Application.js')
-rw-r--r-- | web/app/Application.js | 17 |
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); |