aboutsummaryrefslogtreecommitdiff
path: root/web
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2020-07-04 23:18:37 -0700
committerAnton Tananaev <anton.tananaev@gmail.com>2020-07-04 23:18:37 -0700
commit8e3d7b88d4c05fa6c5a75907b850b897a0da9991 (patch)
treeeb8ada1ada614cf99cf81e8483347a808274bbd9 /web
parentbece93bc00e97d1fe2fb50ff4dedb1d68c06bea4 (diff)
downloadetbsa-traccar-web-8e3d7b88d4c05fa6c5a75907b850b897a0da9991.tar.gz
etbsa-traccar-web-8e3d7b88d4c05fa6c5a75907b850b897a0da9991.tar.bz2
etbsa-traccar-web-8e3d7b88d4c05fa6c5a75907b850b897a0da9991.zip
Add link for modern app
Diffstat (limited to 'web')
-rw-r--r--web/app.css6
-rw-r--r--web/app/view/dialog/Login.js5
-rw-r--r--web/app/view/dialog/LoginController.js12
3 files changed, 23 insertions, 0 deletions
diff --git a/web/app.css b/web/app.css
index b15dec3..c006931 100644
--- a/web/app.css
+++ b/web/app.css
@@ -24,6 +24,12 @@ body.x-border-layout-ct, div.x-border-layout-ct {
overflow: visible !important; /* workaround for Safari issue */
}
+#update {
+ margin: 20px;
+ font-weight: bold;
+ text-align: center;
+}
+
#attribution {
position: absolute;
bottom: 10px;
diff --git a/web/app/view/dialog/Login.js b/web/app/view/dialog/Login.js
index 3a2c247..461ec35 100644
--- a/web/app/view/dialog/Login.js
+++ b/web/app/view/dialog/Login.js
@@ -28,6 +28,11 @@ Ext.define('Traccar.view.dialog.Login', {
header: false,
closable: false,
+ listeners: {
+ afterrender: 'handleAdded',
+ beforedestroy: 'handleRemoved'
+ },
+
items: {
xtype: 'form',
reference: 'form',
diff --git a/web/app/view/dialog/LoginController.js b/web/app/view/dialog/LoginController.js
index c25d9a8..3b1adbd 100644
--- a/web/app/view/dialog/LoginController.js
+++ b/web/app/view/dialog/LoginController.js
@@ -29,6 +29,18 @@ Ext.define('Traccar.view.dialog.LoginController', {
this.lookupReference('languageField').setValue(Locale.language);
},
+ handleAdded: function () {
+ var element = document.createElement('div');
+ element.id = 'update';
+ element.innerHTML = 'Switch to <a href="/modern/">modern interface</a>';
+ document.getElementsByTagName("body")[0].appendChild(element);
+ },
+
+ handleRemoved: function () {
+ var element = document.getElementById('update');
+ document.getElementsByTagName("body")[0].removeChild(element);
+ },
+
login: function () {
var form = this.lookupReference('form');
if (form.isValid()) {