diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2016-08-24 14:55:06 +1200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-08-24 14:55:06 +1200 |
commit | ea0bdea88003f46fd6f6164d5c45e33d53f47c81 (patch) | |
tree | d8e51a10e56f7e916cc2bf7486d75c90feb5696e /web/app | |
parent | a645eb8e2338f11e2c807045b1787a47cd1f1464 (diff) | |
parent | f6484e9808f50aa997f028f9421b05aad6aed8bd (diff) | |
download | traccar-server-ea0bdea88003f46fd6f6164d5c45e33d53f47c81.tar.gz traccar-server-ea0bdea88003f46fd6f6164d5c45e33d53f47c81.tar.bz2 traccar-server-ea0bdea88003f46fd6f6164d5c45e33d53f47c81.zip |
Merge pull request #2242 from Abyss777/users_cache
Implement users cache
Diffstat (limited to 'web/app')
-rw-r--r-- | web/app/view/DevicesController.js | 5 | ||||
-rw-r--r-- | web/app/view/SettingsMenu.js | 12 | ||||
-rw-r--r-- | web/app/view/SettingsMenuController.js | 10 |
3 files changed, 20 insertions, 7 deletions
diff --git a/web/app/view/DevicesController.js b/web/app/view/DevicesController.js index 85aa5fcd4..8058db376 100644 --- a/web/app/view/DevicesController.js +++ b/web/app/view/DevicesController.js @@ -45,6 +45,7 @@ Ext.define('Traccar.view.DevicesController', { this.lookupReference('toolbarAddButton').setVisible(!readonly); this.lookupReference('toolbarEditButton').setVisible(!readonly); this.lookupReference('toolbarRemoveButton').setVisible(!readonly); + this.lookupReference('toolbarGeofencesButton').setVisible(!readonly); }, onAddClick: function () { @@ -86,9 +87,7 @@ Ext.define('Traccar.view.DevicesController', { }, onGeofencesClick: function () { - var admin, device; - admin = Traccar.app.getUser().get('admin'); - device = this.getView().getSelectionModel().getSelection()[0]; + var device = this.getView().getSelectionModel().getSelection()[0]; Ext.create('Traccar.view.BaseWindow', { title: Strings.sharedGeofences, items: { diff --git a/web/app/view/SettingsMenu.js b/web/app/view/SettingsMenu.js index 8c230f36f..bf184424c 100644 --- a/web/app/view/SettingsMenu.js +++ b/web/app/view/SettingsMenu.js @@ -32,11 +32,15 @@ Ext.define('Traccar.view.SettingsMenu', { text: Strings.settingsUser, handler: 'onUserClick' }, { + hidden: true, text: Strings.settingsGroups, - handler: 'onGroupsClick' + handler: 'onGroupsClick', + reference: 'settingsGroupsButton' }, { + hidden: true, text: Strings.sharedGeofences, - handler: 'onGeofencesClick' + handler: 'onGeofencesClick', + reference: 'settingsGeofencesButton' }, { text: Strings.settingsServer, hidden: true, @@ -48,8 +52,10 @@ Ext.define('Traccar.view.SettingsMenu', { handler: 'onUsersClick', reference: 'settingsUsersButton' }, { + hidden: true, text: Strings.sharedNotifications, - handler: 'onNotificationsClick' + handler: 'onNotificationsClick', + reference: 'settingsNotificationsButton' }, { text: Strings.loginLogout, handler: 'onLogoutClick' diff --git a/web/app/view/SettingsMenuController.js b/web/app/view/SettingsMenuController.js index 45b159ccb..ebaa7007d 100644 --- a/web/app/view/SettingsMenuController.js +++ b/web/app/view/SettingsMenuController.js @@ -30,10 +30,18 @@ Ext.define('Traccar.view.SettingsMenuController', { ], init: function () { - if (Traccar.app.getUser().get('admin')) { + var admin, readonly; + admin = Traccar.app.getUser().get('admin'); + readonly = Traccar.app.getServer().get('readonly'); + if (admin) { this.lookupReference('settingsServerButton').setHidden(false); this.lookupReference('settingsUsersButton').setHidden(false); } + if (admin || !readonly) { + this.lookupReference('settingsGroupsButton').setHidden(false); + this.lookupReference('settingsGeofencesButton').setHidden(false); + this.lookupReference('settingsNotificationsButton').setHidden(false); + } }, onUserClick: function () { |