aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2021-02-27 16:13:37 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2021-02-27 16:13:37 +0300
commit59e8c916390a3eb215c8b4be49a919bb3319b014 (patch)
tree26e3c3e9276a350747777a81d851ff69e0cad8bb
parentPython server can now be run as root (diff)
downloadlinux-status-59e8c916390a3eb215c8b4be49a919bb3319b014.tar.gz
linux-status-59e8c916390a3eb215c8b4be49a919bb3319b014.zip
remove obsolete user panels
Diffstat (limited to '')
-rw-r--r--index.html11
1 files changed, 10 insertions, 1 deletions
diff --git a/index.html b/index.html
index 1650330..8c46b82 100644
--- a/index.html
+++ b/index.html
@@ -107,7 +107,7 @@ function add_user(name) {
return;
}
let text = `
-<div class="row">
+<div class="row" id="user_${name}">
<div class="col">
<h2>${name}</h2>
<hr>
@@ -147,6 +147,15 @@ function set_user(name, data) {
}
function set_users(data) {
+ users.forEach(function(name) {
+ if (!(name in data)) {
+ $('#user_' + name).remove();
+ let i = users.indexOf(name);
+ if (i > -1) {
+ users.splice(i, 1);
+ }
+ }
+ });
Object.keys(data).forEach(function(name) {
set_user(name, data[name]);
});