aboutsummaryrefslogtreecommitdiff
path: root/web/app/view/dialog
diff options
context:
space:
mode:
Diffstat (limited to 'web/app/view/dialog')
-rw-r--r--web/app/view/dialog/Attribute.js5
-rw-r--r--web/app/view/dialog/Calendar.js5
-rw-r--r--web/app/view/dialog/ComputedAttribute.js9
-rw-r--r--web/app/view/dialog/Device.js13
-rw-r--r--web/app/view/dialog/Driver.js8
-rw-r--r--web/app/view/dialog/Geofence.js7
-rw-r--r--web/app/view/dialog/Group.js5
-rw-r--r--web/app/view/dialog/Maintenance.js5
-rw-r--r--web/app/view/dialog/Notification.js21
-rw-r--r--web/app/view/dialog/NotificationController.js26
-rw-r--r--web/app/view/dialog/SavedCommand.js7
-rw-r--r--web/app/view/dialog/SendCommand.js2
-rw-r--r--web/app/view/dialog/Server.js12
-rw-r--r--web/app/view/dialog/User.js13
14 files changed, 99 insertions, 39 deletions
diff --git a/web/app/view/dialog/Attribute.js b/web/app/view/dialog/Attribute.js
index 2a45897..a85cad0 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 9880d4e..5f00a8b 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 ef6269b..adae7f7 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 50a5e79..60a8f71 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 b67e182..9b1c17b 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 65c32c0..1e22cd7 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 805b422..61ca193 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 5705278..d844d25 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 dc4362d..51af5b8 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 ad65c33..5da669a 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 4759143..b1aeae7 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 9e07cbf..7995473 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 fbfb3c6..b72dbb0 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 86f9167..917f110 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,