aboutsummaryrefslogtreecommitdiff
path: root/web
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2016-09-27 09:52:42 +0500
committerAbyss777 <abyss@fox5.ru>2016-09-27 09:52:42 +0500
commitac4f0adf3b196b1a9af40be64b3e4e0fac91c1d6 (patch)
tree491df27460d6d3e994614b73d1e39913d9fbc8d5 /web
parent6a1a261466fae6a6718cd3c0cb43b6061ec86fba (diff)
downloadtrackermap-web-ac4f0adf3b196b1a9af40be64b3e4e0fac91c1d6.tar.gz
trackermap-web-ac4f0adf3b196b1a9af40be64b3e4e0fac91c1d6.tar.bz2
trackermap-web-ac4f0adf3b196b1a9af40be64b3e4e0fac91c1d6.zip
Remove second store
Diffstat (limited to 'web')
-rw-r--r--web/app/Application.js1
-rw-r--r--web/app/store/AttributeAliases.js30
-rw-r--r--web/app/view/AttributesAliases.js2
-rw-r--r--web/app/view/AttributesAliasesController.js12
-rw-r--r--web/app/view/StateController.js13
5 files changed, 9 insertions, 49 deletions
diff --git a/web/app/Application.js b/web/app/Application.js
index 8262e2e6..0d6430d9 100644
--- a/web/app/Application.js
+++ b/web/app/Application.js
@@ -61,7 +61,6 @@ Ext.define('Traccar.Application', {
'Notifications',
'AllNotifications',
'GeofenceTypes',
- 'AttributeAliases',
'AllAttributeAliases',
'ReportRoute',
'ReportEvents',
diff --git a/web/app/store/AttributeAliases.js b/web/app/store/AttributeAliases.js
deleted file mode 100644
index ebec8c87..00000000
--- a/web/app/store/AttributeAliases.js
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com)
- * Copyright 2016 Andrey Kunitsyn (abyss@fox5.ru)
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-Ext.define('Traccar.store.AttributeAliases', {
- extend: 'Ext.data.Store',
- model: 'Traccar.model.AttributeAlias',
-
- proxy: {
- type: 'rest',
- url: 'api/attributes/aliases',
- writer: {
- writeAllFields: true
- }
- }
-});
diff --git a/web/app/view/AttributesAliases.js b/web/app/view/AttributesAliases.js
index 717991dd..8fcf10bb 100644
--- a/web/app/view/AttributesAliases.js
+++ b/web/app/view/AttributesAliases.js
@@ -26,7 +26,7 @@ Ext.define('Traccar.view.AttributesAliases', {
],
controller: 'attributesAliases',
- store: 'AttributeAliases',
+ store: 'AllAttributeAliases',
selType: 'rowmodel',
diff --git a/web/app/view/AttributesAliasesController.js b/web/app/view/AttributesAliasesController.js
index cda3e338..8f406c42 100644
--- a/web/app/view/AttributesAliasesController.js
+++ b/web/app/view/AttributesAliasesController.js
@@ -31,7 +31,7 @@ Ext.define('Traccar.view.AttributesAliasesController', {
this.lookupReference('toolbarAddButton').setDisabled(true);
this.lookupReference('toolbarEditButton').setDisabled(true);
this.lookupReference('toolbarRemoveButton').setDisabled(true);
- this.getView().getStore().loadData([], false);
+ this.getView().getStore().filter('deviceId', 0);
},
onAddClick: function () {
@@ -83,12 +83,16 @@ Ext.define('Traccar.view.AttributesAliasesController', {
},
onDeviceChange: function (combobox, newValue, oldValue) {
+ var admin = Traccar.app.getUser().get('admin');
this.onSelectionChange('');
if (newValue !== null) {
- this.getView().getStore().getProxy().setExtraParam('deviceId', newValue);
- this.getView().getStore().load();
+ this.getView().getStore().filter('deviceId', newValue);
+ if (admin && this.getView().getStore().getCount() === 0) {
+ this.getView().getStore().getProxy().setExtraParam('deviceId', newValue);
+ this.getView().getStore().load();
+ }
} else {
- this.getView().getStore().loadData([], false);
+ this.getView().getStore().filter('deviceId', 0);
}
}
});
diff --git a/web/app/view/StateController.js b/web/app/view/StateController.js
index 7462fcc8..c0f5b9a1 100644
--- a/web/app/view/StateController.js
+++ b/web/app/view/StateController.js
@@ -47,10 +47,6 @@ Ext.define('Traccar.view.StateController', {
'#AllAttributeAliases': {
add: 'updateAliases',
update: 'updateAliases'
- },
- '#AttributeAliases': {
- add: 'updateAliasesRemote',
- update: 'updateAliasesRemote'
}
}
}
@@ -183,14 +179,5 @@ Ext.define('Traccar.view.StateController', {
if (this.position !== null) {
this.updatePosition();
}
- },
-
- updateAliasesRemote: function () {
- Ext.getStore('AllAttributeAliases').load({
- scope: this,
- callback: function () {
- this.updateAliases();
- }
- });
}
});