Skip to content
Snippets Groups Projects
Unverified Commit d8a807fa authored by Tony Bonnin's avatar Tony Bonnin
Browse files

Dashboard App for ACF

parent a101f44b
No related branches found
No related tags found
No related merge requests found
......@@ -176,7 +176,7 @@ end
let delay = () =>
{
increment += 1;
// CONVERT JS UPTIME 😂
// CONVERT JS UPTIME
js_uptime = parseInt(increment);
var js_centuries = Math.floor((js_uptime / (3600*24) / 365) / 100);
var js_years = Math.floor((js_uptime / (3600*24) / 365) % 100);
......@@ -265,16 +265,26 @@ end
<p class="dashboard-infos dash-info-cpu-temp">
<span class="data-title">CPU Temp</span>
</p>
<p class="dashboard-infos dash-info-temp">
<p id="cpuTemp" class="dashboard-infos dash-info-temp">
<%
if (tonumber(proc.value.temp.value)) ~= nil then
print (math.floor(tonumber(proc.value.temp.value / 1000)) .. C")
else
print ("N/A")
print ("NaN°C")
end
%>
<script type="application/javascript" defer>
async function load() {
let url = '<%= html.html_escape(page_info.script .. "/alpine-baselayout/health/proc?viewtype=json") %>';
let obj = await (await fetch(url)).json();
document.getElementById("cpuTemp").innerHTML = ((obj.value.temp.value) / 1000) + "°C";
};
setInterval(load, 1000);
</script>
</p>
</div>
</div>
......
......@@ -90,12 +90,32 @@ hr {
justify-content: center;
}
#valid {
font-weight: bold;
display: flex;
clear: both;
padding: 0.5rem 1rem;
margin: 0.5rem auto 0 !important;
width: 100% !important;
border-radius: 4px;
font-size: 12.5px;
line-height: 1.5rem;
flex-direction: row;
flex-wrap: nowrap;
justify-content: flex-start;
align-items: stretch;
color: #ffffff;
background: rgb(116,255,91);
background: linear-gradient(90deg, rgba(116,255,91,1) 0%, rgba(41,219,0,1) 80%);
margin-bottom: 1em;
}
#error {
font-weight: bold;
display: flex;
clear: both;
padding: 0.5rem 1rem;
margin: 0.5rem auto;
margin: 0.5rem auto 0 !important;
width: 100% !important;
border-radius: 4px;
font-size: 12.5px;
......@@ -104,9 +124,9 @@ hr {
flex-wrap: nowrap;
justify-content: flex-start;
align-items: stretch;
border: 2px solid;
color: #c70000;
background: white;
color: #ffffff;
background: rgb(255,91,91);
background: linear-gradient(90deg, rgba(255,91,91,1) 0%, rgb(255 65 89) 80%);
margin-bottom: 1em;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment