diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2021-12-25 15:46:30 -0800 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2021-12-25 15:46:30 -0800 |
commit | 034c0e660d90ff6539f14cf622adaf341e0ff970 (patch) | |
tree | 9712f660f9bec422ee366193281ff77ad5572427 /web/app | |
parent | 6c0bcc146bc51d4e75f3d9d50b9e3476c5aaf4fc (diff) | |
download | trackermap-web-034c0e660d90ff6539f14cf622adaf341e0ff970.tar.gz trackermap-web-034c0e660d90ff6539f14cf622adaf341e0ff970.tar.bz2 trackermap-web-034c0e660d90ff6539f14cf622adaf341e0ff970.zip |
Support server change
Diffstat (limited to 'web/app')
-rw-r--r-- | web/app/view/dialog/Login.js | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/web/app/view/dialog/Login.js b/web/app/view/dialog/Login.js index 86917b94..d5658914 100644 --- a/web/app/view/dialog/Login.js +++ b/web/app/view/dialog/Login.js @@ -50,6 +50,47 @@ Ext.define('Traccar.view.dialog.Login', { margin: '10px auto 25px' } }, { + xtype: 'pickerfield', + fieldLabel: Strings.settingsServer, + editable: false, + value: window.location.host, + hidden: !window.appInterface && !(window.webkit && window.webkit.messageHandlers.appInterface), + createPicker: function () { + var self = this, popup = Ext.create({ + xtype: 'window', + closeAction: 'hide', + referenceHolder: true, + minWidth: 204, + layout: 'form', + header: false, + resizable: true, + items: [{ + xtype: 'textfield', + anchor: '100%', + reference: 'serverAddress', + value: window.location.href + }], + fbar: [{ + text: Strings.sharedSet, + handler: function () { + var message = 'server|' + popup.lookupReference('serverAddress').getValue(); + if (window.webkit && window.webkit.messageHandlers.appInterface) { + window.webkit.messageHandlers.appInterface.postMessage(message); + } + if (window.appInterface) { + window.appInterface.postMessage(message); + } + } + }, { + text: Strings.sharedCancel, + handler: function () { + self.collapse(); + } + }] + }); + return popup; + } + }, { xtype: 'combobox', name: 'language', fieldLabel: Strings.loginLanguage, |