From 9a1eb534c41b26326e0a17801bace95884b4ef00 Mon Sep 17 00:00:00 2001 From: Ylian Saint-Hilaire Date: Mon, 4 Jan 2021 19:14:06 -0800 Subject: [PATCH] Added notification support to mobile application. --- meshcentral.js | 1 + views/default-mobile.handlebars | 293 +++++++++++++++++++++++++++++++- views/default.handlebars | 19 ++- views/messenger.handlebars | 3 +- 4 files changed, 303 insertions(+), 13 deletions(-) diff --git a/meshcentral.js b/meshcentral.js index 44f3d3f3..89250d63 100644 --- a/meshcentral.js +++ b/meshcentral.js @@ -159,6 +159,7 @@ function CreateMeshCentralServer(config, args) { console.log(' --redirport [number] Creates an additional HTTP server to redirect users to the HTTPS server.'); console.log(' --exactports Server must run with correct ports or exit.'); console.log(' --noagentupdate Server will not update mesh agent native binaries.'); + console.log(' --nedbtodb Transfer all NeDB records into current database.'); console.log(' --listuserids Show a list of a user identifiers in the database.'); console.log(' --cert [name], (country), (org) Create a web server certificate with [name] server name.'); console.log(' country and organization can optionally be set.'); diff --git a/views/default-mobile.handlebars b/views/default-mobile.handlebars index a3c60388..a2ac14ec 100644 --- a/views/default-mobile.handlebars +++ b/views/default-mobile.handlebars @@ -417,10 +417,65 @@ margin:10px; z-index:1000; } + + #notificationCount { + min-width: 28px; + font-size: 20px; + background-color: orange; + text-align: center; + cursor: pointer; + color: black; + } + + .notifiyBox { + font-size: 16px; + position: absolute; + z-index: 1000; + top: 60px; + right: 76px; + width: 300px; + text-align: left; + background-color: #F0ECCD; + border: 4px solid #666; + -webkit-border-radius: 10px; + -moz-border-radius: 10px; + border-radius: 10px; + -webkit-box-shadow: 2px 2px 4px #888; + -moz-box-shadow: 2px 2px 4px #888; + box-shadow: 2px 2px 4px #888; + max-height: 200px; + } + + .night .notifiyBox { + color: black; + } + + .notifiyBox:before { + content: ' '; + position: absolute; + width: 0; + height: 0; + right: 5px; + top: -30px; + border: 15px solid; + border-color: transparent #666 #666 transparent; + } + + .notifiyBox:after { + content: ' '; + position: absolute; + width: 0; + height: 0; + right: 7px; + top: -24px; + border: 12px solid; + border-color: transparent #F0ECCD #F0ECCD transparent; + }
+
@@ -431,7 +486,8 @@ {{{title2}}}
- + +
@@ -879,6 +935,7 @@
My Account
+ diff --git a/views/default.handlebars b/views/default.handlebars index 5ec25e48..8651c080 100644 --- a/views/default.handlebars +++ b/views/default.handlebars @@ -12425,8 +12425,8 @@ var emailLink = ''; if (user.email) { emailLink = ' '; } if (((user.siteadmin != 0xFFFFFFFF) || (userinfo.siteadmin == 0xFFFFFFFF))) { // If we are not site admin, we can't change a admin email or real name - x += addDeviceAttribute("Email", everify + email + emailLink + ' '); - x += addDeviceAttribute("Real Name", realname + ' '); + x += addDeviceAttribute("Email", everify + email + emailLink + ' '); + x += addDeviceAttribute("Real Name", realname + ' '); } else { x += addDeviceAttribute("Email", everify + email + emailLink); x += addDeviceAttribute("Real Name", realname); @@ -12436,7 +12436,7 @@ x += addDeviceAttribute("Phone Number", (user.phone?user.phone:('' + "None" + '')) + ' '); } - x += addDeviceAttribute("Server Rights", premsg + msg.join(', ') + ' '); + x += addDeviceAttribute("Server Rights", premsg + msg.join(', ') + ' '); if (user.quota) x += addDeviceAttribute("Server Quota", EscapeHtml(parseInt(user.quota) / 1024) + ' k'); x += addDeviceAttribute("Creation", printDateTime(new Date(user.creation * 1000))); if (user.login) x += addDeviceAttribute("Last Login", printDateTime(new Date(user.login * 1000))); @@ -12455,7 +12455,7 @@ if ((userinfo.siteadmin == 0xFFFFFFFF) || (userinfo.siteadmin & 2)) { var xuserGroups = '' + "None" + ''; if (user.groups) { xuserGroups = ''; for (var i in user.groups) { xuserGroups += '' + EscapeHtml(user.groups[i]) + ''; } } - x += addDeviceAttribute("Admin Realms", addLinkConditional(xuserGroups, 'showUserGroupDialog(event,"' + userid + '")', (userinfo.siteadmin == 0xFFFFFFFF) || ((userinfo.groups == null) && (userinfo._id != user._id) && (user.siteadmin != 0xFFFFFFFF)))); + x += addDeviceAttribute("Admin Realms", addLinkConditional(xuserGroups, 'showUserGroupDialog(event,"' + encodeURIComponentEx(user._id) + '")', (userinfo.siteadmin == 0xFFFFFFFF) || ((userinfo.groups == null) && (userinfo._id != user._id) && (user.siteadmin != 0xFFFFFFFF)))); } // Display device user consent @@ -12488,10 +12488,13 @@ x += '

'; // Add action buttons - x += ''; - if (user.phone && (features & 0x02000000)) { x += ''; } - if ((typeof user.email == 'string') && (user.emailVerified === true) && (features & 0x00000040)) { x += ''; } - if (!self && (activeSessions > 0)) { x += ''; } + x += ''; + if (user.phone && (features & 0x02000000)) { x += ''; } + if ((typeof user.email == 'string') && (user.emailVerified === true) && (features & 0x00000040)) { x += ''; } + if (!self && (activeSessions > 0)) { + x += ''; + x += ''; + } // Setup the panel QH('p30html', x); diff --git a/views/messenger.handlebars b/views/messenger.handlebars index 4f183191..f6410dc0 100644 --- a/views/messenger.handlebars +++ b/views/messenger.handlebars @@ -4,6 +4,7 @@ {{{title}}} - Messenger + @@ -24,7 +25,7 @@
MeshMessenger
-
+