aboutsummaryrefslogtreecommitdiff
path: root/web
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-10-15 15:12:46 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2015-10-15 15:12:46 +1300
commitd3ca7de349f1d8ab0d02bf783a2c7627af44c6fd (patch)
tree73684ec6f484001d25bb9c1c417d4f5c7aba2e1d /web
parent7925028c138228f369180adbd857f4cd986a6346 (diff)
downloadtraccar-server-d3ca7de349f1d8ab0d02bf783a2c7627af44c6fd.tar.gz
traccar-server-d3ca7de349f1d8ab0d02bf783a2c7627af44c6fd.tar.bz2
traccar-server-d3ca7de349f1d8ab0d02bf783a2c7627af44c6fd.zip
Change user devices window
Diffstat (limited to 'web')
-rw-r--r--web/app/view/BaseWindow.js24
-rw-r--r--web/app/view/SettingsMenuController.js10
-rw-r--r--web/app/view/UserDevices.js35
-rw-r--r--web/app/view/UserDevicesController.js31
-rw-r--r--web/app/view/UsersController.js12
5 files changed, 79 insertions, 33 deletions
diff --git a/web/app/view/BaseWindow.js b/web/app/view/BaseWindow.js
new file mode 100644
index 000000000..b6c777d1d
--- /dev/null
+++ b/web/app/view/BaseWindow.js
@@ -0,0 +1,24 @@
+/*
+ * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com)
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+Ext.define('Traccar.view.BaseWindow', {
+ extend: 'Ext.window.Window',
+
+ width: Traccar.Style.windowWidth,
+ height: Traccar.Style.windowHeight,
+ layout: 'fit',
+ modal: true
+});
diff --git a/web/app/view/SettingsMenuController.js b/web/app/view/SettingsMenuController.js
index 920356010..c52f0a75e 100644
--- a/web/app/view/SettingsMenuController.js
+++ b/web/app/view/SettingsMenuController.js
@@ -22,7 +22,8 @@ Ext.define('Traccar.view.SettingsMenuController', {
'Traccar.view.LoginController',
'Traccar.view.UserDialog',
'Traccar.view.ServerDialog',
- 'Traccar.view.Users'
+ 'Traccar.view.Users',
+ 'Traccar.view.BaseWindow'
],
init: function () {
@@ -45,12 +46,9 @@ Ext.define('Traccar.view.SettingsMenuController', {
},
onUsersClick: function () {
- Ext.create('Ext.window.Window', {
+ Ext.create('Traccar.view.BaseWindow', {
title: Strings.settingsUsers,
- width: Traccar.Style.windowWidth,
- height: Traccar.Style.windowHeight,
- layout: 'fit',
- modal: true,
+ modal: false,
items: {
xtype: 'usersView'
}
diff --git a/web/app/view/UserDevices.js b/web/app/view/UserDevices.js
index 5eeaac39b..256168946 100644
--- a/web/app/view/UserDevices.js
+++ b/web/app/view/UserDevices.js
@@ -19,23 +19,16 @@ Ext.define('Traccar.view.UserDevices', {
xtype: 'userDevicesView',
requires: [
- 'Traccar.view.UsersController',
- 'Traccar.view.EditToolbar'
+ 'Traccar.view.UserDevicesController'
],
- controller: 'users',
- store: 'Users',
+ controller: 'userDevices',
+ store: 'Devices',
- selType: 'rowmodel',
-
- tbar: {
- xtype: 'editToolbar',
- items: [{
- text: Strings.deviceTitle,
- disabled: true,
- handler: 'onDevicesClick',
- reference: 'userDevicesButton'
- }]
+ selModel: {
+ selType: 'checkboxmodel',
+ checkOnly: true,
+ showHeaderCheckbox: false
},
listeners: {
@@ -43,16 +36,10 @@ Ext.define('Traccar.view.UserDevices', {
},
columns: [{
- text: Strings.userName,
- dataIndex: 'name',
- flex: 1
- }, {
- text: Strings.userEmail,
- dataIndex: 'email',
- flex: 1
+ text: Strings.deviceName,
+ dataIndex: 'name', flex: 1
}, {
- text: Strings.userAdmin,
- dataIndex: 'admin',
- flex: 1
+ text: Strings.deviceIdentifier,
+ dataIndex: 'uniqueId', flex: 1
}]
});
diff --git a/web/app/view/UserDevicesController.js b/web/app/view/UserDevicesController.js
new file mode 100644
index 000000000..ec40fec02
--- /dev/null
+++ b/web/app/view/UserDevicesController.js
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com)
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+Ext.define('Traccar.view.UserDevicesController', {
+ extend: 'Ext.app.ViewController',
+ alias: 'controller.userDevices',
+
+ init: function () {
+ //Ext.getStore('Users').load();
+ },
+
+ onSelectionChange: function (selected) {
+ /*var disabled = selected.length > 0;
+ this.lookupReference('toolbarEditButton').setDisabled(disabled);
+ this.lookupReference('toolbarRemoveButton').setDisabled(disabled);
+ this.lookupReference('userDevicesButton').setDisabled(disabled);*/
+ }
+});
diff --git a/web/app/view/UsersController.js b/web/app/view/UsersController.js
index c8fd137ed..cfcf17fe1 100644
--- a/web/app/view/UsersController.js
+++ b/web/app/view/UsersController.js
@@ -19,7 +19,9 @@ Ext.define('Traccar.view.UsersController', {
alias: 'controller.users',
requires: [
- 'Traccar.view.UserDialog'
+ 'Traccar.view.UserDialog',
+ 'Traccar.view.UserDevices',
+ 'Traccar.view.BaseWindow'
],
init: function () {
@@ -63,8 +65,12 @@ Ext.define('Traccar.view.UsersController', {
},
onDevicesClick: function () {
- //var dialog = Ext.create('Traccar.view.UserDeviceDialog');
- //dialog.show();
+ Ext.create('Traccar.view.BaseWindow', {
+ title: Strings.deviceTitle,
+ items: {
+ xtype: 'userDevicesView'
+ }
+ }).show();
},
onSelectionChange: function (selected) {