aboutsummaryrefslogtreecommitdiff
path: root/web/app/controller/Root.js
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2017-09-20 19:37:14 +1200
committerGitHub <noreply@github.com>2017-09-20 19:37:14 +1200
commitadf79e9bc86bc485ea3fa02c4d25b11d8fffee1f (patch)
tree5879cb06e5b81dcc7570f35754ef443005200cb7 /web/app/controller/Root.js
parentd078ef703795ed9c1fb0b6111ee7d12e09143f82 (diff)
parentcf1c138bca946cd354e97cea0c841af1ad0f3e4e (diff)
downloadtrackermap-web-adf79e9bc86bc485ea3fa02c4d25b11d8fffee1f.tar.gz
trackermap-web-adf79e9bc86bc485ea3fa02c4d25b11d8fffee1f.tar.bz2
trackermap-web-adf79e9bc86bc485ea3fa02c4d25b11d8fffee1f.zip
Merge pull request #588 from Abyss777/extended_notifications2
Implement Notifications per device
Diffstat (limited to 'web/app/controller/Root.js')
-rw-r--r--web/app/controller/Root.js37
1 files changed, 13 insertions, 24 deletions
diff --git a/web/app/controller/Root.js b/web/app/controller/Root.js
index 64227aa0..75c4531c 100644
--- a/web/app/controller/Root.js
+++ b/web/app/controller/Root.js
@@ -113,7 +113,19 @@ Ext.define('Traccar.controller.Root', {
Ext.getStore('ComputedAttributes').load();
Ext.getStore('AllCommandTypes').load();
Ext.getStore('Commands').load();
- this.initReportEventTypesStore();
+ Ext.getStore('AllNotificationTypes').load({
+ callback: function (records, operation, success) {
+ var store = Ext.getStore('ReportEventTypes');
+ if (success) {
+ store.add({
+ type: Traccar.store.ReportEventTypes.allEvents,
+ name: Strings.eventAll
+ });
+ store.loadData(records, true);
+ }
+ }
+ });
+ Ext.getStore('Notifications').load();
Ext.getStore('ServerAttributes').loadData(Ext.getStore('CommonDeviceAttributes').getData().items, true);
Ext.getStore('ServerAttributes').loadData(Ext.getStore('CommonUserAttributes').getData().items, true);
@@ -285,28 +297,5 @@ Ext.define('Traccar.controller.Root', {
if (lat === 0 && lon === 0 && zoom === 0) {
this.fireEvent('zoomtoalldevices');
}
- },
-
- initReportEventTypesStore: function () {
- var store = Ext.getStore('ReportEventTypes');
- store.add({
- type: Traccar.store.ReportEventTypes.allEvents,
- name: Strings.eventAll
- });
- Ext.create('Traccar.store.AllNotifications').load({
- scope: this,
- callback: function (records, operation, success) {
- var i, value;
- if (success) {
- for (i = 0; i < records.length; i++) {
- value = records[i].get('type');
- store.add({
- type: value,
- name: Traccar.app.getEventString(value)
- });
- }
- }
- }
- });
}
});