';
@@ -2892,6 +2922,9 @@
// Reset the desktop tools
QV('DeskTools', false);
showDeskToolsProcesses();
+
+ // Ask for device events
+ refreshDeviceEvents();
}
setupDesktop(); // Always refresh the desktop, even if we are on the same device, we need to do some canvas switching.
if (!panel) panel = 10;
@@ -4115,6 +4148,61 @@
}
}
+ //
+ // DEVICE EVENTS
+ //
+
+ var currentDeviceEvents = null;
+ function devevents_update() {
+ var x = '', dateHeader = null;
+ for (var i in currentDeviceEvents) {
+ var event = currentDeviceEvents[i];
+ var time = new Date(event.time);
+ if (time.toLocaleDateString() != dateHeader) {
+ if (dateHeader != null) x += '
";
+ QH('p16events', x);
+ }
+
+ /*
+ function showDeleteAllEventsDialog() {
+ if (xxdialogMode) return;
+ var x = "Delete all events in the server event log?
";
+ x += "Confirm";
+ setDialogMode(2, "Delete All Events", 3, showDeleteAllEventsDialogEx, x);
+ validateDeleteAllEventsDialog();
+ }
+
+ function validateDeleteAllEventsDialog() {
+ QE('idx_dlgOkButton', Q('p3check').checked);
+ }
+
+ function showDeleteAllEventsDialogEx(buttons, tag) {
+ meshserver.send({ action: 'clearevents' });
+ }
+ */
+
+ function refreshDeviceEvents() {
+ //currentDeviceEvents = null;
+ //QH('p16events', '');
+ meshserver.send({ action: 'events', nodeid: currentNode._id, limit: parseInt(p16limitdropdown.value) });
+ }
+
//
// CONSOLE
//
@@ -4292,7 +4380,7 @@
Q('dp2email').focus();
}
- function account_validateEmail(e) {
+ function account_validateEmail(e, email) {
var x = Q('dp2email').value.split('@');
x = (x.length == 2) && (x[0].length > 0) && (x[1].split('.').length > 1) && (x[1].length > 2) && (Q('dp2email').value.length < 1024) && (Q('dp2email').value != userinfo.email);
QE('idx_dlgOkButton', x);
@@ -5061,11 +5149,13 @@
// Show user attributes
var x = '
';
- if (user.email) x += addDeviceAttribute('Email', '' + EscapeHtml(user.email) + '');
- x += addDeviceAttribute('Creation', new Date(user.creation).toLocaleString());
- if (user.login) x += addDeviceAttribute('Last Login', new Date(user.login).toLocaleString());
+ var email = user.email?EscapeHtml(user.email):'Not set', everify = '';
+ if (serverinfo.emailcheck) { everify = ((user.emailVerified == true)?'':', Unverified'); }
+ x += addDeviceAttribute('Email', "" + email + everify + '');
x += addDeviceAttribute('Server Rights', "" + msg + "");
if (user.quota) x += addDeviceAttribute('Server Quota', EscapeHtml(parseInt(user.quota) / 1024) + ' k');
+ x += addDeviceAttribute('Creation', new Date(user.creation).toLocaleString());
+ if (user.login) x += addDeviceAttribute('Last Login', new Date(user.login).toLocaleString());
x += '
';
@@ -5104,6 +5194,34 @@
refreshUsersEvents();
}
+ // Display the user's email change dialog box
+ function p30showUserEmailChangeDialog(event) {
+ if (xxdialogMode) return;
+ var x = '';
+ x += addHtmlValue('Email', '');
+ if (serverinfo.emailcheck) { x += addHtmlValue('Status', ''); }
+ setDialogMode(2, "Change Email for " + EscapeHtml(currentUser.name), 3, p30showUserEmailChangeDialogEx, x);
+ Q('dp30email').focus();
+ Q('dp30email').value = currentUser.email;
+ if (serverinfo.emailcheck) { Q('dp30verified').value = currentUser.emailVerified?1:0; }
+ p30validateEmail();
+ }
+
+ // Perform validation on the user's email change dialog box
+ function p30validateEmail() {
+ var v = Q('dp30email').value, x = v.split('@');
+ x = (x.length == 2) && (x[0].length > 0) && (x[1].split('.').length > 1) && (x[1].length > 2) && (v.length < 1024) && ((v != userinfo.email) || ((serverinfo.emailcheck == true) && (Q('dp30verified').value != (userinfo.emailVerified?1:0))));
+ QE('idx_dlgOkButton', x);
+ }
+
+ // Send to the server the new user's email address and validation status
+ function p30showUserEmailChangeDialogEx() {
+ var x = { action: 'edituser', name: currentUser.name, email: Q('dp30email').value };
+ if (serverinfo.emailcheck) { x.emailVerified = (Q('dp30verified').value == 1); }
+ meshserver.send(x);
+ }
+
+ // Display the user's password change dialog box
function p30showUserChangePassDialog() {
if (xxdialogMode) return;
var x = '';
@@ -5464,6 +5582,7 @@
QS('MainDevDesktop').backgroundColor = ((x == 11) ? "#003366" : "#808080");
QS('MainDevTerminal').backgroundColor = ((x == 12) ? "#003366" : "#808080");
QS('MainDevFiles').backgroundColor = ((x == 13) ? "#003366" : "#808080");
+ QS('MainDevEvents').backgroundColor = ((x == 16) ? "#003366" : "#808080");
QS('MainDevAmt').backgroundColor = ((x == 14) ? "#003366" : "#808080");
QS('MainDevConsole').backgroundColor = ((x == 15) ? "#003366" : "#808080");
QV('MeshSubMenuSpan', x >= 20 && x < 30);