Skip to content

Commit

Permalink
Merge pull request #52 from LuisMayo/feat/add-auto-refresh-admin
Browse files Browse the repository at this point in the history
add auto-refresh in admin dashboard
  • Loading branch information
LuisMayo authored Nov 9, 2023
2 parents 932ca5e + 273d74b commit 3f8509a
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions data/frontend/index.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
<!doctype html>
<html>
<head><title>VHS Alternative Server Admin Dashboard</title></head>
<head>
<title>VHS Alternative Server Admin Dashboard</title>
<script>
function checkElementChanged(id) {
return document.getElementById(id)?.value != null && document.getElementById(id)?.value.trim() != '';
}
setInterval(() => {
if(!checkElementChanged('userId') && !checkElementChanged('userId2') && !checkElementChanged('admin')) {
location.pathname = '/vhs-admin/'
}
}, 10000);
</script>
</head>
<body>
<div>${lastMessage}</div>
<div>
Expand All @@ -16,8 +28,8 @@ <h3>Impersonate user</h3>
<form action="/vhs-admin/impersonate-user" method="post">
<label for="admin">Admin:</label>
<input id="admin" name="admin"/>
<label for="userId">User:</label>
<input id="userId" name="userId"/>
<label for="userId2">User:</label>
<input id="userId2" name="userId"/>
<button type="submit">Submit</button>
</form>
</div>
Expand Down

0 comments on commit 3f8509a

Please sign in to comment.