new admin panel

new date creation in dashboard.html
This commit is contained in:
2019-12-06 12:24:44 +01:00
parent 87bf1d7291
commit 59d18679ea
11 changed files with 580 additions and 41 deletions

View File

@ -0,0 +1,34 @@
$(document).ready(function () {
console.log("page loaded");
$.post('/senddata/checkloginstate', 'action=getloginstate', function (data) {
console.log(data);
if (data.loggedin == true) {
$("#userlabel").html(" " + data.username);
if (data.permission > 0) {
$("#adminpanel").show();
}
} else {
$("#userlabel").html(" not logged in!!");
}
}, 'json');
$("#btn-shutdown").click(function (event) {
console.log("shutting down server");
$.post('/senddata/admindata', 'action=shutdownserver', function (data) {
console.log(data);
}, 'json');
});
$("#btn-restart").click(function (event) {
console.log("restarting server");
$.post('/senddata/admindata', 'action=restartserver', function (data) {
console.log(data);
}, 'json');
});
});