Compare commits
3 Commits
fc743cbb46
...
c0927601b9
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c0927601b9 | ||
|
|
ef45cf6539 | ||
|
|
23bea5f74e |
@@ -1,3 +0,0 @@
|
||||
function sendNodeHeartbeat(nodeId) {
|
||||
console.log(nodeId);
|
||||
}
|
||||
@@ -44,7 +44,7 @@ function createToast(notificationMessage){
|
||||
toastTitle.appendChild(document.createTextNode("Server Notification"));
|
||||
|
||||
const toastTime = document.createElement('small');
|
||||
toastTime.appendChild(document.createTextNode(Date.now().toLocaleString()));
|
||||
toastTime.appendChild(document.createTextNode(new Date(Date.now()).toLocaleString()));
|
||||
|
||||
const toastClose = document.createElement('button');
|
||||
toastClose.type = 'button';
|
||||
@@ -80,13 +80,13 @@ function createToast(notificationMessage){
|
||||
$('.toast').toast('show');
|
||||
}
|
||||
|
||||
function checkInByNodeId(nodeId){
|
||||
function sendNodeHeartbeat(nodeId){
|
||||
const Http = new XMLHttpRequest();
|
||||
const url='/nodes/'+nodeId;
|
||||
Http.open("GET", url);
|
||||
Http.send();
|
||||
|
||||
Http.onreadystatechange = (e) => {
|
||||
Http.onloadend = (e) => {
|
||||
console.log(Http.responseText)
|
||||
createToast(Http.responseText);
|
||||
}
|
||||
|
||||
@@ -7,5 +7,5 @@
|
||||
</div>
|
||||
</div>
|
||||
<%- include('partials/bodyEnd.ejs') %>
|
||||
<script src="/res/js/controller.js"></script>
|
||||
<script src="/res/js/node.js"></script>
|
||||
<%- include('partials/htmlFooter.ejs') %>
|
||||
@@ -30,7 +30,7 @@
|
||||
<!-- Leave Server button -->
|
||||
<a type="button" class="btn btn-danger <% if(!node.online) { %>disabled<% } %>" href="#" onclick="leaveServer()">Leave Server</a>
|
||||
<!-- Checkin with client button -->
|
||||
<a type="button" class="btn btn-secondary" href="#" onclick="checkInByNodeId('<%=node.id%>')">Check-in with Node</a>
|
||||
<a type="button" class="btn btn-secondary" href="#" onclick="sendNodeHeartbeat('<%=node.id%>')">Check-in with Node</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user