From 557ffa7f106e44a09a99746dcd8e4f369ea4730d Mon Sep 17 00:00:00 2001 From: Abyss777 Date: Mon, 26 Dec 2016 18:06:48 +0500 Subject: Charts implementation --- web/app/Application.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'web/app/Application.js') diff --git a/web/app/Application.js b/web/app/Application.js index daa25b8..82caf1e 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); -- cgit v1.2.3