diff options
Diffstat (limited to 'web/app/view/dialog')
-rw-r--r-- | web/app/view/dialog/Attribute.js | 5 | ||||
-rw-r--r-- | web/app/view/dialog/Calendar.js | 5 | ||||
-rw-r--r-- | web/app/view/dialog/ComputedAttribute.js | 9 | ||||
-rw-r--r-- | web/app/view/dialog/Device.js | 13 | ||||
-rw-r--r-- | web/app/view/dialog/Driver.js | 8 | ||||
-rw-r--r-- | web/app/view/dialog/Geofence.js | 7 | ||||
-rw-r--r-- | web/app/view/dialog/Group.js | 5 | ||||
-rw-r--r-- | web/app/view/dialog/Maintenance.js | 5 | ||||
-rw-r--r-- | web/app/view/dialog/Notification.js | 21 | ||||
-rw-r--r-- | web/app/view/dialog/NotificationController.js | 26 | ||||
-rw-r--r-- | web/app/view/dialog/SavedCommand.js | 7 | ||||
-rw-r--r-- | web/app/view/dialog/SendCommand.js | 2 | ||||
-rw-r--r-- | web/app/view/dialog/Server.js | 12 | ||||
-rw-r--r-- | web/app/view/dialog/User.js | 13 |
14 files changed, 99 insertions, 39 deletions
diff --git a/web/app/view/dialog/Attribute.js b/web/app/view/dialog/Attribute.js index 2a458977..a85cad05 100644 --- a/web/app/view/dialog/Attribute.js +++ b/web/app/view/dialog/Attribute.js @@ -21,7 +21,8 @@ Ext.define('Traccar.view.dialog.Attribute', { requires: [ 'Traccar.view.dialog.AttributeController', 'Traccar.view.ColorPicker', - 'Traccar.view.CustomNumberField' + 'Traccar.view.CustomNumberField', + 'Traccar.view.UnescapedTextField' ], controller: 'attribute', @@ -33,7 +34,7 @@ Ext.define('Traccar.view.dialog.Attribute', { validitychange: 'onValidityChange' }, items: [{ - xtype: 'textfield', + xtype: 'unescapedTextField', reference: 'nameTextField', name: 'name', allowBlank: false, diff --git a/web/app/view/dialog/Calendar.js b/web/app/view/dialog/Calendar.js index 9880d4e6..5f00a8be 100644 --- a/web/app/view/dialog/Calendar.js +++ b/web/app/view/dialog/Calendar.js @@ -20,7 +20,8 @@ Ext.define('Traccar.view.dialog.Calendar', { extend: 'Traccar.view.dialog.BaseEdit', requires: [ - 'Traccar.view.dialog.CalendarController' + 'Traccar.view.dialog.CalendarController', + 'Traccar.view.UnescapedTextField' ], controller: 'calendar', @@ -32,7 +33,7 @@ Ext.define('Traccar.view.dialog.Calendar', { xtype: 'fieldset', title: Strings.sharedRequired, items: [{ - xtype: 'textfield', + xtype: 'unescapedTextField', name: 'name', fieldLabel: Strings.sharedName, allowBlank: false diff --git a/web/app/view/dialog/ComputedAttribute.js b/web/app/view/dialog/ComputedAttribute.js index ef6269be..adae7f7b 100644 --- a/web/app/view/dialog/ComputedAttribute.js +++ b/web/app/view/dialog/ComputedAttribute.js @@ -20,7 +20,9 @@ Ext.define('Traccar.view.dialog.ComputedAttribute', { extend: 'Traccar.view.dialog.BaseEdit', requires: [ - 'Traccar.view.dialog.ComputedAttributeController' + 'Traccar.view.dialog.ComputedAttributeController', + 'Traccar.view.UnescapedTextField', + 'Traccar.view.UnescapedTextAreaField' ], controller: 'computedAttribute', @@ -29,7 +31,7 @@ Ext.define('Traccar.view.dialog.ComputedAttribute', { items: { xtype: 'form', items: [{ - xtype: 'textfield', + xtype: 'unescapedTextField', name: 'description', fieldLabel: Strings.sharedDescription }, { @@ -43,7 +45,8 @@ Ext.define('Traccar.view.dialog.ComputedAttribute', { change: 'onAttributeChange' } }, { - xtype: 'textareafield', + xtype: 'unescapedTextAreaField', + reference: 'expressionField', name: 'expression', fieldLabel: Strings.sharedExpression, allowBlank: false diff --git a/web/app/view/dialog/Device.js b/web/app/view/dialog/Device.js index 50a5e79c..60a8f716 100644 --- a/web/app/view/dialog/Device.js +++ b/web/app/view/dialog/Device.js @@ -20,7 +20,8 @@ Ext.define('Traccar.view.dialog.Device', { requires: [ 'Traccar.view.ClearableComboBox', - 'Traccar.view.dialog.DeviceController' + 'Traccar.view.dialog.DeviceController', + 'Traccar.view.UnescapedTextField' ], controller: 'device', @@ -32,12 +33,12 @@ Ext.define('Traccar.view.dialog.Device', { xtype: 'fieldset', title: Strings.sharedRequired, items: [{ - xtype: 'textfield', + xtype: 'unescapedTextField', name: 'name', fieldLabel: Strings.sharedName, allowBlank: false }, { - xtype: 'textfield', + xtype: 'unescapedTextField', name: 'uniqueId', fieldLabel: Strings.deviceIdentifier, allowBlank: false @@ -56,15 +57,15 @@ Ext.define('Traccar.view.dialog.Device', { displayField: 'name', valueField: 'id' }, { - xtype: 'textfield', + xtype: 'unescapedTextField', name: 'phone', fieldLabel: Strings.sharedPhone }, { - xtype: 'textfield', + xtype: 'unescapedTextField', name: 'model', fieldLabel: Strings.deviceModel }, { - xtype: 'textfield', + xtype: 'unescapedTextField', name: 'contact', fieldLabel: Strings.deviceContact }, { diff --git a/web/app/view/dialog/Driver.js b/web/app/view/dialog/Driver.js index b67e182d..9b1c17b5 100644 --- a/web/app/view/dialog/Driver.js +++ b/web/app/view/dialog/Driver.js @@ -19,6 +19,10 @@ Ext.define('Traccar.view.dialog.Driver', { extend: 'Traccar.view.dialog.BaseEdit', + requires: [ + 'Traccar.view.UnescapedTextField' + ], + title: Strings.sharedDriver, items: { @@ -27,12 +31,12 @@ Ext.define('Traccar.view.dialog.Driver', { xtype: 'fieldset', title: Strings.sharedRequired, items: [{ - xtype: 'textfield', + xtype: 'unescapedTextField', name: 'name', fieldLabel: Strings.sharedName, allowBlank: false }, { - xtype: 'textfield', + xtype: 'unescapedTextField', name: 'uniqueId', fieldLabel: Strings.deviceIdentifier, allowBlank: false diff --git a/web/app/view/dialog/Geofence.js b/web/app/view/dialog/Geofence.js index 65c32c04..1e22cd7b 100644 --- a/web/app/view/dialog/Geofence.js +++ b/web/app/view/dialog/Geofence.js @@ -20,7 +20,8 @@ Ext.define('Traccar.view.dialog.Geofence', { requires: [ 'Traccar.view.ClearableComboBox', - 'Traccar.view.dialog.GeofenceController' + 'Traccar.view.dialog.GeofenceController', + 'Traccar.view.UnescapedTextField' ], controller: 'geofence', @@ -32,7 +33,7 @@ Ext.define('Traccar.view.dialog.Geofence', { xtype: 'fieldset', title: Strings.sharedRequired, items: [{ - xtype: 'textfield', + xtype: 'unescapedTextField', name: 'name', fieldLabel: Strings.sharedName }] @@ -42,7 +43,7 @@ Ext.define('Traccar.view.dialog.Geofence', { collapsible: true, collapsed: true, items: [{ - xtype: 'textfield', + xtype: 'unescapedTextField', name: 'description', fieldLabel: Strings.sharedDescription }, { diff --git a/web/app/view/dialog/Group.js b/web/app/view/dialog/Group.js index 805b422c..61ca193d 100644 --- a/web/app/view/dialog/Group.js +++ b/web/app/view/dialog/Group.js @@ -19,7 +19,8 @@ Ext.define('Traccar.view.dialog.Group', { extend: 'Traccar.view.dialog.BaseEdit', requires: [ - 'Traccar.view.ClearableComboBox' + 'Traccar.view.ClearableComboBox', + 'Traccar.view.UnescapedTextField' ], title: Strings.groupDialog, @@ -30,7 +31,7 @@ Ext.define('Traccar.view.dialog.Group', { xtype: 'fieldset', title: Strings.sharedRequired, items: [{ - xtype: 'textfield', + xtype: 'unescapedTextField', name: 'name', fieldLabel: Strings.sharedName, allowBlank: false diff --git a/web/app/view/dialog/Maintenance.js b/web/app/view/dialog/Maintenance.js index 5705278f..d844d259 100644 --- a/web/app/view/dialog/Maintenance.js +++ b/web/app/view/dialog/Maintenance.js @@ -21,7 +21,8 @@ Ext.define('Traccar.view.dialog.Maintenance', { requires: [ 'Traccar.view.dialog.MaintenanceController', - 'Traccar.view.CustomNumberField' + 'Traccar.view.CustomNumberField', + 'Traccar.view.UnescapedTextField' ], controller: 'maintenance', @@ -37,7 +38,7 @@ Ext.define('Traccar.view.dialog.Maintenance', { xtype: 'fieldset', title: Strings.sharedRequired, items: [{ - xtype: 'textfield', + xtype: 'unescapedTextField', name: 'name', fieldLabel: Strings.sharedName, allowBlank: false diff --git a/web/app/view/dialog/Notification.js b/web/app/view/dialog/Notification.js index dc4362d9..51af5b8e 100644 --- a/web/app/view/dialog/Notification.js +++ b/web/app/view/dialog/Notification.js @@ -41,7 +41,10 @@ Ext.define('Traccar.view.dialog.Notification', { displayField: 'name', valueField: 'type', editable: false, - allowBlank: false + allowBlank: false, + listeners: { + change: 'onTypeChange' + } }, { xtype: 'checkboxfield', inputValue: true, @@ -49,8 +52,22 @@ Ext.define('Traccar.view.dialog.Notification', { name: 'always', fieldLabel: Strings.notificationAlways }, { - fieldLabel: Strings.notificationNotificators, xtype: 'tagfield', + reference: 'alarmsField', + fieldLabel: Strings.sharedAlarms, + maxWidth: Traccar.Style.formFieldWidth, + store: 'AlarmTypes', + valueField: 'key', + displayField: 'name', + queryMode: 'local', + hidden: true, + listeners: { + beforerender: 'onAlarmsLoad', + change: 'onAlarmsChange' + } + }, { + xtype: 'tagfield', + fieldLabel: Strings.notificationNotificators, name: 'notificators', maxWidth: Traccar.Style.formFieldWidth, store: 'AllNotificators', diff --git a/web/app/view/dialog/NotificationController.js b/web/app/view/dialog/NotificationController.js index ad65c333..5da669a4 100644 --- a/web/app/view/dialog/NotificationController.js +++ b/web/app/view/dialog/NotificationController.js @@ -23,5 +23,31 @@ Ext.define('Traccar.view.dialog.NotificationController', { init: function () { this.lookupReference('calendarCombo').setHidden( Traccar.app.getBooleanAttributePreference('ui.disableCalendars')); + }, + + onTypeChange: function (view, value) { + this.lookupReference('alarmsField').setHidden(value !== 'alarm'); + }, + + onAlarmsLoad: function (view) { + var attributes, record = view.up('form').getRecord(); + attributes = record.get('attributes') || {}; + if (attributes['alarms']) { + view.suspendEvents(false); + view.setValue(attributes['alarms'].split(',')); + view.resumeEvents(); + } + }, + + onAlarmsChange: function (view, value) { + var attributes, record = view.up('window').down('form').getRecord(); + attributes = record.get('attributes') || {}; + + value = value.join(); + if (attributes['alarms'] !== value) { + attributes['alarms'] = value; + record.set('attributes', attributes); + record.dirty = true; + } } }); diff --git a/web/app/view/dialog/SavedCommand.js b/web/app/view/dialog/SavedCommand.js index 4759143a..b1aeae73 100644 --- a/web/app/view/dialog/SavedCommand.js +++ b/web/app/view/dialog/SavedCommand.js @@ -19,7 +19,8 @@ Ext.define('Traccar.view.dialog.SavedCommand', { extend: 'Traccar.view.dialog.BaseEdit', requires: [ - 'Traccar.view.dialog.SavedCommandController' + 'Traccar.view.dialog.SavedCommandController', + 'Traccar.view.UnescapedTextField' ], controller: 'savedCommand', @@ -34,7 +35,7 @@ Ext.define('Traccar.view.dialog.SavedCommand', { xtype: 'fieldset', title: Strings.sharedRequired, items: [{ - xtype: 'textfield', + xtype: 'unescapedTextField', name: 'description', fieldLabel: Strings.sharedDescription }, { @@ -42,7 +43,7 @@ Ext.define('Traccar.view.dialog.SavedCommand', { name: 'textChannel', inputValue: true, uncheckedValue: false, - fieldLabel: Strings.notificationSms + fieldLabel: Strings.commandSendSms }, { xtype: 'combobox', name: 'type', diff --git a/web/app/view/dialog/SendCommand.js b/web/app/view/dialog/SendCommand.js index 9e07cbf3..79954739 100644 --- a/web/app/view/dialog/SendCommand.js +++ b/web/app/view/dialog/SendCommand.js @@ -54,7 +54,7 @@ Ext.define('Traccar.view.dialog.SendCommand', { reference: 'textChannelCheckBox', inputValue: true, uncheckedValue: false, - fieldLabel: Strings.notificationSms, + fieldLabel: Strings.commandSendSms, listeners: { change: 'onTextChannelChange' } diff --git a/web/app/view/dialog/Server.js b/web/app/view/dialog/Server.js index fbfb3c6a..b72dbb0c 100644 --- a/web/app/view/dialog/Server.js +++ b/web/app/view/dialog/Server.js @@ -20,7 +20,8 @@ Ext.define('Traccar.view.dialog.Server', { requires: [ 'Traccar.view.ClearableComboBox', - 'Traccar.view.dialog.MapPickerController' + 'Traccar.view.dialog.MapPickerController', + 'Traccar.view.UnescapedTextField' ], controller: 'mapPicker', @@ -39,13 +40,14 @@ Ext.define('Traccar.view.dialog.Server', { displayField: 'name', valueField: 'key' }, { - xtype: 'textfield', + xtype: 'unescapedTextField', name: 'bingKey', fieldLabel: Strings.mapBingKey }, { - xtype: 'textfield', + xtype: 'unescapedTextField', + reference: 'mapUrlField', name: 'mapUrl', - fieldLabel: Strings.mapCustom + fieldLabel: Strings.mapCustomLabel }, { xtype: 'numberfield', reference: 'latitude', @@ -83,7 +85,7 @@ Ext.define('Traccar.view.dialog.Server', { displayField: 'name', valueField: 'key' }, { - xtype: 'textfield', + xtype: 'unescapedTextField', name: 'poiLayer', fieldLabel: Strings.mapPoiLayer }] diff --git a/web/app/view/dialog/User.js b/web/app/view/dialog/User.js index 86f91672..917f110c 100644 --- a/web/app/view/dialog/User.js +++ b/web/app/view/dialog/User.js @@ -20,7 +20,8 @@ Ext.define('Traccar.view.dialog.User', { requires: [ 'Traccar.view.ClearableComboBox', - 'Traccar.view.dialog.UserController' + 'Traccar.view.dialog.UserController', + 'Traccar.view.UnescapedTextField' ], controller: 'user', @@ -32,11 +33,11 @@ Ext.define('Traccar.view.dialog.User', { xtype: 'fieldset', title: Strings.sharedRequired, items: [{ - xtype: 'textfield', + xtype: 'unescapedTextField', name: 'name', fieldLabel: Strings.sharedName }, { - xtype: 'textfield', + xtype: 'unescapedTextField', name: 'email', fieldLabel: Strings.userEmail, allowBlank: false @@ -53,7 +54,7 @@ Ext.define('Traccar.view.dialog.User', { collapsible: true, collapsed: true, items: [{ - xtype: 'textfield', + xtype: 'unescapedTextField', name: 'phone', fieldLabel: Strings.sharedPhone }, { @@ -94,7 +95,7 @@ Ext.define('Traccar.view.dialog.User', { displayField: 'name', valueField: 'key' }, { - xtype: 'textfield', + xtype: 'unescapedTextField', name: 'poiLayer', fieldLabel: Strings.mapPoiLayer }] @@ -164,7 +165,7 @@ Ext.define('Traccar.view.dialog.User', { disabled: true, reference: 'userLimitField' }, { - xtype: 'textfield', + xtype: 'unescapedTextField', name: 'token', reference: 'tokenField', fieldLabel: Strings.userToken, |