added secret key bindings for admins to reload and restart their NodeBBs :shipit:

v1.18.x
Julian Lam 11 years ago
parent 063a4e5628
commit 1f06e4f5a2

@ -576,6 +576,11 @@ var socket,
});
}
});
// Admin keyboard shortcuts
require(['admin'], function(Admin) {
Admin.init();
});
});
};

@ -0,0 +1,19 @@
define('admin', ['mousetrap'], function(Mousetrap) {
var Admin= {};
Admin.init = function() {
if (app.isAdmin) {
Mousetrap.bind('ctrl+shift+a r', function() {
console.log('[admin] Reloading NodeBB...');
socket.emit('admin.reload');
});
Mousetrap.bind('ctrl+shift+a R', function() {
console.log('[admin] Restarting NodeBB...');
socket.emit('admin.restart');
});
}
};
return Admin;
});
Loading…
Cancel
Save