diff options
Diffstat (limited to 'web')
-rw-r--r-- | web/app/controller/Root.js | 20 | ||||
-rw-r--r-- | web/app/view/dialog/Server.js | 4 | ||||
-rw-r--r-- | web/l10n/en.json | 1 |
3 files changed, 24 insertions, 1 deletions
diff --git a/web/app/controller/Root.js b/web/app/controller/Root.js index 935b1f15..bbfa0845 100644 --- a/web/app/controller/Root.js +++ b/web/app/controller/Root.js @@ -66,10 +66,28 @@ Ext.define('Traccar.controller.Root', { }); }, + showAnnouncement: function (announcement) { + var maxWidth = Ext.getBody().getViewSize().width - 2 * Traccar.Style.normalPadding; + if (maxWidth > Traccar.Style.windowWidth) { + maxWidth = Traccar.Style.windowWidth; + } + Ext.Msg.show({ + msg: announcement, + buttons: Ext.Msg.OK, + closable: false, + modal: false, + maxWidth: maxWidth + }).alignTo(Ext.getBody(), "t-t", [0, Traccar.Style.normalPadding]); + }, + onServerReturn: function (options, success, response) { - var token, parameters = {}; + var announcement, token, parameters = {}; if (success) { Traccar.app.setServer(Ext.decode(response.responseText)); + announcement = Traccar.app.getServer().get('announcement'); + if (announcement) { + this.showAnnouncement(announcement); + } token = Ext.Object.fromQueryString(window.location.search).token; if (token) { parameters.token = token; diff --git a/web/app/view/dialog/Server.js b/web/app/view/dialog/Server.js index b72dbb0c..d9e225ec 100644 --- a/web/app/view/dialog/Server.js +++ b/web/app/view/dialog/Server.js @@ -88,6 +88,10 @@ Ext.define('Traccar.view.dialog.Server', { xtype: 'unescapedTextField', name: 'poiLayer', fieldLabel: Strings.mapPoiLayer + }, { + xtype: 'unescapedTextField', + name: 'announcement', + fieldLabel: Strings.serverAnnouncement }] }, { xtype: 'fieldset', diff --git a/web/l10n/en.json b/web/l10n/en.json index 83349be5..eeafe1d6 100644 --- a/web/l10n/en.json +++ b/web/l10n/en.json @@ -231,6 +231,7 @@ "serverRegistration": "Registration", "serverReadonly": "Readonly", "serverForceSettings": "Force Settings", + "serverAnnouncement": "Announcement", "mapTitle": "Map", "mapLayer": "Map Layer", "mapCustom": "Custom (XYZ)", |