From d243caa095ece5c130250d02e4f3ae7632a9db36 Mon Sep 17 00:00:00 2001 From: Abyss777 Date: Tue, 23 May 2017 14:45:18 +0500 Subject: Implement testing computedAttribute --- web/l10n/en.json | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'web/l10n/en.json') diff --git a/web/l10n/en.json b/web/l10n/en.json index 171fddb..6e78e5c 100644 --- a/web/l10n/en.json +++ b/web/l10n/en.json @@ -46,9 +46,11 @@ "sharedAlias": "Alias", "sharedComputedAttribute": "Computed Attribute", "sharedComputedAttributes": "Computed Attributes", + "sharedCheckComputedAttribute": "Check Computed Attribute", "sharedExpression": "Expression", "sharedDeviceDistance": "Device Distance", "sharedDevice": "Device", + "sharedSelectDevice": "Select Device", "sharedTestNotification": "Send Test Notification", "sharedCalendar": "Calendar", "sharedCalendars": "Calendars", @@ -87,6 +89,8 @@ "errorGeneral": "Invalid parameters or constraints violation", "errorConnection": "Connection error", "errorSocket": "Web socket connection error", + "infoTitle": "Info", + "infoGeneral": "Responce", "userEmail": "Email", "userPassword": "Password", "userAdmin": "Admin", -- cgit v1.2.3 From 7f1a29d1f6606cd7d6469f769fd0e303badcd591 Mon Sep 17 00:00:00 2001 From: Abyss777 Date: Tue, 23 May 2017 15:23:07 +0500 Subject: - Revert showError function - Fix strings --- web/app/Application.js | 17 ++++------------- web/app/view/dialog/SelectDevice.js | 2 +- web/app/view/dialog/SelectDeviceController.js | 12 +++++++++++- web/l10n/en.json | 5 ++--- 4 files changed, 18 insertions(+), 18 deletions(-) (limited to 'web/l10n/en.json') diff --git a/web/app/Application.js b/web/app/Application.js index 0125cd0..d73378c 100644 --- a/web/app/Application.js +++ b/web/app/Application.js @@ -164,24 +164,15 @@ Ext.define('Traccar.Application', { } }, - showError: function (error, success) { - var title, general; - if (success) { - title = Strings.infoTitle; - general = Strings.infoGeneral; - } else { - title = Strings.errorTitle; - general = Strings.errorGeneral; - } - + showError: function (error) { if (Ext.isString(error)) { - Ext.Msg.alert(title, error); + Ext.Msg.alert(Strings.errorTitle, error); } else if (error.responseText) { - Ext.Msg.alert(title, general + + Ext.Msg.alert(Strings.errorTitle, Strings.errorGeneral + '

'); } else if (error.statusText) { - Ext.Msg.alert(title, error.statusText); + Ext.Msg.alert(Strings.errorTitle, error.statusText); } else { Ext.Msg.alert(Strings.errorTitle, Strings.errorConnection); } diff --git a/web/app/view/dialog/SelectDevice.js b/web/app/view/dialog/SelectDevice.js index 8037453..5b11c03 100644 --- a/web/app/view/dialog/SelectDevice.js +++ b/web/app/view/dialog/SelectDevice.js @@ -23,7 +23,7 @@ Ext.define('Traccar.view.dialog.SelectDevice', { ], controller: 'selectDevice', - title: Strings.sharedSelectDevice, + title: Strings.sharedDevice, items: { xtype: 'form', diff --git a/web/app/view/dialog/SelectDeviceController.js b/web/app/view/dialog/SelectDeviceController.js index 4336c48..d8cd5d3 100644 --- a/web/app/view/dialog/SelectDeviceController.js +++ b/web/app/view/dialog/SelectDeviceController.js @@ -29,7 +29,17 @@ Ext.define('Traccar.view.dialog.SelectDeviceController', { method: 'POST', jsonData: Ext.util.JSON.encode(record), callback: function (options, success, response) { - Traccar.app.showError(response, success); + if (success) { + if (response.responseText) { + Ext.Msg.alert(Strings.sharedInfoTitle, Strings.sharedInfoGeneral + + '

'); + } else if (response.statusText) { + Ext.Msg.alert(Strings.sharedInfoTitle, response.statusText); + } + } else { + Traccar.app.showError(response); + } } }); button.up('window').close(); diff --git a/web/l10n/en.json b/web/l10n/en.json index 6e78e5c..024f147 100644 --- a/web/l10n/en.json +++ b/web/l10n/en.json @@ -50,7 +50,6 @@ "sharedExpression": "Expression", "sharedDeviceDistance": "Device Distance", "sharedDevice": "Device", - "sharedSelectDevice": "Select Device", "sharedTestNotification": "Send Test Notification", "sharedCalendar": "Calendar", "sharedCalendars": "Calendars", @@ -65,6 +64,8 @@ "sharedTypeNumber": "Number", "sharedTypeBoolean": "Boolean", "sharedTimezone": "Timezone", + "sharedInfoTitle": "Info", + "sharedInfoGeneral": "Responce", "attributeSpeedLimit": "Speed Limit", "attributeReportIgnoreOdometer": "Report: Ignore Odometer", "attributeMaintenanceStart": "Maintenance: Start", @@ -89,8 +90,6 @@ "errorGeneral": "Invalid parameters or constraints violation", "errorConnection": "Connection error", "errorSocket": "Web socket connection error", - "infoTitle": "Info", - "infoGeneral": "Responce", "userEmail": "Email", "userPassword": "Password", "userAdmin": "Admin", -- cgit v1.2.3 From 0b2fa6cd0c1221e559bbe48bffea6ce8ba7e749a Mon Sep 17 00:00:00 2001 From: Abyss777 Date: Tue, 23 May 2017 15:32:10 +0500 Subject: Simple show response --- web/app/view/dialog/SelectDeviceController.js | 4 +--- web/l10n/en.json | 1 - 2 files changed, 1 insertion(+), 4 deletions(-) (limited to 'web/l10n/en.json') diff --git a/web/app/view/dialog/SelectDeviceController.js b/web/app/view/dialog/SelectDeviceController.js index d8cd5d3..7b7277c 100644 --- a/web/app/view/dialog/SelectDeviceController.js +++ b/web/app/view/dialog/SelectDeviceController.js @@ -31,9 +31,7 @@ Ext.define('Traccar.view.dialog.SelectDeviceController', { callback: function (options, success, response) { if (success) { if (response.responseText) { - Ext.Msg.alert(Strings.sharedInfoTitle, Strings.sharedInfoGeneral + - '

'); + Ext.Msg.alert(Strings.sharedInfoTitle, response.responseText); } else if (response.statusText) { Ext.Msg.alert(Strings.sharedInfoTitle, response.statusText); } diff --git a/web/l10n/en.json b/web/l10n/en.json index 024f147..754295e 100644 --- a/web/l10n/en.json +++ b/web/l10n/en.json @@ -65,7 +65,6 @@ "sharedTypeBoolean": "Boolean", "sharedTimezone": "Timezone", "sharedInfoTitle": "Info", - "sharedInfoGeneral": "Responce", "attributeSpeedLimit": "Speed Limit", "attributeReportIgnoreOdometer": "Report: Ignore Odometer", "attributeMaintenanceStart": "Maintenance: Start", -- cgit v1.2.3