Add asynchronous page content request
This commit is contained in:
1 parent
ed4e749901
commit
244edf90ac
2 files changed
+26
No files matched your search
@@ -144,6 +144,19 @@
|
||||
<h1><span><%= hostname %></span> status - MALP</h1>
|
||||
</header>
|
||||
|
||||
<% if authenticated %>
|
||||
<div id="content"></div>
|
||||
<script>
|
||||
fetch("?content", { credentials: "same-origin" })
|
||||
.then(function(response) {
|
||||
if (response.ok) return response.text();
|
||||
})
|
||||
.then(function(html) {
|
||||
if (html) document.getElementById("content").innerHTML = html;
|
||||
});
|
||||
</script>
|
||||
<% end %>
|
||||
|
||||
<% unless authenticated %>
|
||||
<div class="card">
|
||||
<div class="card-title">Sign In</div>
|
||||
|
||||
Reference in new issue
Block a user