Skip to content

Commit

Permalink
Fix: Diagnostic status message in index.html
Browse files Browse the repository at this point in the history
  • Loading branch information
hoh committed Nov 21, 2023
1 parent 2365568 commit c0d8ceb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions src/aleph/vm/orchestrator/views/static/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ async function fetchApiStatus () {
details: []
}
if(q.ok){
res.status = "working properly ✅";
res.status = " is working properly ✅";
}
else {
switch(Number(q.status)){
case 503:
res.status = "not working properly ❌";
res.status = " is not working properly ❌";
res.details = await q.json();
case 500:
res.status = "❌ Failed";
res.status = " ❌ Failed";
default:
res.status = q.status;
}
Expand Down Expand Up @@ -67,7 +67,7 @@ async function* fetchLatestMetrics (hostname, fromDate) {

if(!countRes?.posts[0]?.content?.metrics?.crn?.find(node => node.url === hostname))
throw new Error('Hostname not found in metrics');


const totalPages = Math.ceil(totalDataPoints / qp.pagination);
let currentPage = 0;
Expand All @@ -92,4 +92,4 @@ async function* fetchLatestMetrics (hostname, fromDate) {
retries++;
}
}
}
}
10 changes: 5 additions & 5 deletions src/aleph/vm/orchestrator/views/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ <h2>Multiaddr</h2>
<h2>Diagnostic</h2>

<p class="virtualization-wrapper">
Virtualization is
Virtualization&nbsp;
<span class="virtualization-wrapper" id="check">
...&nbsp;
<span class="loader-container">
Expand Down Expand Up @@ -116,7 +116,7 @@ <h2>Version</h2>

<script src="/static/helpers.js"></script>
<script>
const NODE_HOSTNAME = '$public_url';
const NODE_HOSTNAME = '$public_url';
const NODE_VERSION = '$version';

(async () => {
Expand Down Expand Up @@ -209,7 +209,7 @@ <h2>Version</h2>
console.error(err);
document.getElementById('chart-wrapper').innerHTML = err;
}

// Creates checkboxes to disable/enable metrics
Object.keys(displayedMetrics).map(field => {
const wrapperDiv = document.createElement('div')
Expand All @@ -223,7 +223,7 @@ <h2>Version</h2>
wrapperDiv.appendChild(cb)
wrapperDiv.appendChild(label)
document.getElementById('checkboxes-wrapper').appendChild(wrapperDiv)

cb.addEventListener('change', e => {
chart.remove()
displayedMetrics[field] = e.target.checked
Expand Down Expand Up @@ -258,4 +258,4 @@ <h2>Version</h2>

</script>
</body>
</html>
</html>

0 comments on commit c0d8ceb

Please sign in to comment.