diff options
Diffstat (limited to 'web/app')
-rw-r--r-- | web/app/Application.js | 17 | ||||
-rw-r--r-- | web/app/view/dialog/SelectDevice.js | 2 | ||||
-rw-r--r-- | web/app/view/dialog/SelectDeviceController.js | 12 |
3 files changed, 16 insertions, 15 deletions
diff --git a/web/app/Application.js b/web/app/Application.js index 0125cd0f..d73378c5 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 + '<br><br><textarea readonly rows="5" style="resize: none; width: 100%;">' + error.responseText + '</textarea>'); } 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 8037453e..5b11c03f 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 4336c48b..d8cd5d3a 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 + + '<br><br><textarea readonly rows="5" style="resize: none; width: 100%;">' + + response.responseText + '</textarea>'); + } else if (response.statusText) { + Ext.Msg.alert(Strings.sharedInfoTitle, response.statusText); + } + } else { + Traccar.app.showError(response); + } } }); button.up('window').close(); |