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

Dashboard App for ACF

parent 24e155ce
No related branches found
No related tags found
No related merge requests found
...@@ -20,7 +20,7 @@ if session.userinfo and session.userinfo.userid and viewlibrary and viewlibrary. ...@@ -20,7 +20,7 @@ if session.userinfo and session.userinfo.userid and viewlibrary and viewlibrary.
end end
-- CHECK SYS RELEASE VERSION -- CHECK SYS RELEASE VERSION
local check_sysver = string.match(sys.value.version.value, "v%d+.%d+.%d+") local check_sysver = string.match(sys.value.version.value, "%d+.%d+.%d+")
local major_sysver = string.match(check_sysver, "%d+") -- Parse Major for Upgrade local major_sysver = string.match(check_sysver, "%d+") -- Parse Major for Upgrade
local minor_sysver = string.gsub(string.match(check_sysver, "%p%d+"), "%D", "") -- Parse Minor for Update local minor_sysver = string.gsub(string.match(check_sysver, "%p%d+"), "%D", "") -- Parse Minor for Update
local patch_sysver = string.gsub(string.match(check_sysver, ".[^.]*$"), "%D", "") -- Parse Patch for Update local patch_sysver = string.gsub(string.match(check_sysver, ".[^.]*$"), "%D", "") -- Parse Patch for Update
...@@ -32,12 +32,12 @@ end ...@@ -32,12 +32,12 @@ end
local minor_distver = string.gsub(string.match(actual_distver, "%p%d+"), "%D", "") -- Parse Minor for Update local minor_distver = string.gsub(string.match(actual_distver, "%p%d+"), "%D", "") -- Parse Minor for Update
local patch_distver = string.gsub(string.match(actual_distver, ".[^.]*$"), "%D", "") -- Parse Patch for Fix local patch_distver = string.gsub(string.match(actual_distver, ".[^.]*$"), "%D", "") -- Parse Patch for Fix
if major_sysver == major_distver and minor_sysver == minor_distver and patch_sysver == patch_distver then if major_sysver == major_distver and minor_sysver == minor_distver and patch_sysver == patch_distver then
chkres = "<a class='version-link version-ok' href='https://www.alpinelinux.org/releases/' title='🟩 Up to Date' target='_blank'><span class='version-check-ok'>Alpine Linux <span class='version-letter'>" .. check_sysver .. "</span></span></a> | up to date " chkres = "<a id='alpine-version-link' class='version-link version-ok' href='https://www.alpinelinux.org/releases/' title='🟩 Up to Date' target='_blank'><span class='version-check-ok'>Alpine Linux | <span class='version-letter'>" .. check_sysver .. "</span></span></a> up to date "
else else
chkres = "<a class='version-link version-update' href='https://www.alpinelinux.org/releases/' title='🟧 Update Needed' target='_blank'><span class='version-check-update'>Alpine Linux <span class='version-letter'>" .. check_sysver .. "</span></span></a> | update needed " chkres = "<a id='alpine-version-link' class='version-link version-update' href='https://www.alpinelinux.org/releases/' title='🟧 Update Needed' target='_blank'><span class='version-check-update'>Alpine Linux | <span class='version-letter'>" .. check_sysver .. "</span></span></a>update needed "
end end
if major_sysver ~= major_distver then if major_sysver ~= major_distver then
chkres = "<a class='version-link version-upgrade' href='https://www.alpinelinux.org/releases/' title='🟥 Upgrade Needed' target='_blank'><span class='version-check-upgrade'>Alpine Linux <span class='version-letter'>" .. check_sysver .. "</span></span></a> | upgrade required " chkres = "<a id='alpine-version-link' class='version-link version-upgrade' href='https://www.alpinelinux.org/releases/' title='🟥 Upgrade Needed' target='_blank'><span class='version-check-upgrade'>Alpine Linux | <span class='version-letter'>" .. check_sysver .. "</span></span></a>upgrade required "
end end
-- GET DIST VERSION CHANGES -- GET DIST VERSION CHANGES
...@@ -53,11 +53,11 @@ end ...@@ -53,11 +53,11 @@ end
local up_seconds = string.format("%02d", math.floor(((up_time % (3600 * 24)) % 3600) % 60)) local up_seconds = string.format("%02d", math.floor(((up_time % (3600 * 24)) % 3600) % 60))
-- REPLACE O.E.M DEFAULT STRING -- REPLACE O.E.M DEFAULT STRING
function oem_parse(str) function oem_parse(str)
return (string.gsub(str, "To be filled by O.E.M." or "Not Specified" , "Standard PC")) return (string.gsub(str, "To be filled by O.E.M." or "Not Specified", "Standard PC"))
end end
function version_parse(str) function version_parse(str)
return (string.gsub(str, "To be filled by O.E.M." or "Not Specified" , "Unknow")) return (string.gsub(str, "To be filled by O.E.M." or "Not Specified", "Unknow"))
end end
-- Table of colors -- Table of colors
...@@ -208,13 +208,23 @@ end ...@@ -208,13 +208,23 @@ end
</span> </span>
<p class="dashboard-infos dash-info-board"> <p class="dashboard-infos dash-info-board">
<span class="data-title">Board : </span> <span class="data-title">Board : </span>
<%= oem_parse(sys.value.boardVendor.value) %> | <%
<%= oem_parse(sys.value.boardName.value) %> | -- EXEMPLE TO PARSE KNOW MOBO MODELS
<%= version_parse(string.gsub(sys.value.boardVersion.value, "^", "ver : ")) %> if string.match(sys.value.boardName.value, "EMB%-H81B") then
print ("<span>" .. string.gsub(sys.value.boardVendor.value, "To be filled by O.E.M." or "Not Specified", "AAEON") .. "</span>")
print (" | <span>" .. sys.value.boardName.value .. "</span> | ")
print ("<span>" .. string.gsub(sys.value.boardVersion.value, "To be filled by O.E.M." or "Not Specified" or "Unknow", "Rev : 2.00") .. "</span>")
-- ELSE REWRITE ALL OTHERS
else
print ("<span>" .. oem_parse(sys.value.boardVendor.value) .. "</span>")
print (" | <span>" .. oem_parse(sys.value.boardName.value) .. "</span> | ")
print ("<span>" .. version_parse(string.gsub(sys.value.boardVersion.value, "^", "Rev : ")) .. "</span>")
end
%>
</p> </p>
<p class="dashboard-infos dash-info-bios"> <p class="dashboard-infos dash-info-bios">
<span class="data-title">BIOS : </span> <span class="data-title">BIOS : </span>
<%= sys.value.biosVersion.value %> | <span id="version">v. </span><%= sys.value.biosVersion.value %> |
<%= sys.value.biosVendor.value %> - <%= sys.value.biosVendor.value %> -
<%= sys.value.biosDate.value %> <%= sys.value.biosDate.value %>
</p> </p>
......
...@@ -71,10 +71,13 @@ end ...@@ -71,10 +71,13 @@ end
<![endif]--> <![endif]-->
<!-- UNPKG JS CDN FOR LATEST CHART.JS --> <!-- UNPKG JS CDN FOR LATEST CHART.JS -->
<script type="application/javascript" src="https://unpkg.com/chart.js@latest/dist/chart.umd.js"></script> <script type="application/javascript" src="https://unpkg.com/chart.js@latest/dist/chart.umd.js"></script>
<script type="application/javascript" src="https://cdn.jsdelivr.net/npm/luxon@latest"></script>
<script type="application/javascript" src="https://cdn.jsdelivr.net/npm/chartjs-adapter-luxon@latest/dist/chartjs-adapter-luxon.umd.min.js"></script>
<script type="application/javascript" src="https://cdn.jsdelivr.net/npm/chartjs-plugin-streaming@latest"></script>
<!-- UNPKG JS CDN FOR LATEST HIGHLIGHT.JS --> <!-- UNPKG JS CDN FOR LATEST HIGHLIGHT.JS -->
<script type="application/javascript" src="https://unpkg.com/@highlightjs/cdn-assets@latest/highlight.min.js"></script> <script type="application/javascript" src="https://unpkg.com/@highlightjs/cdn-assets@latest/highlight.min.js"></script>
<!-- INITIALIZE HIGHLIGHT.JS --> <!-- INITIALIZE HIGHLIGHT.JS -->
<script type="application/javascript" async defer>hljs.highlightAll()</script> <script type="application/javascript" defer>hljs.highlightAll()</script>
<!-- UNPKG JS CDN FOR LATEST JQUERY --> <!-- UNPKG JS CDN FOR LATEST JQUERY -->
<script type="application/javascript" src="https://unpkg.com/jquery"></script> <script type="application/javascript" src="https://unpkg.com/jquery"></script>
<script type="text/javascript" src="<%= html.html_escape(pageinfo.wwwprefix..pageinfo.skin.."/"..posix.basename(pageinfo.skin)..".js") %>"></script> <script type="text/javascript" src="<%= html.html_escape(pageinfo.wwwprefix..pageinfo.skin.."/"..posix.basename(pageinfo.skin)..".js") %>"></script>
......
...@@ -285,6 +285,10 @@ ...@@ -285,6 +285,10 @@
font-size: 0.65rem; font-size: 0.65rem;
} }
#alpine-version-link {
margin: 0 0.25rem 0 0;
}
.check-version a { .check-version a {
font-weight: normal; font-weight: normal;
} }
...@@ -302,7 +306,7 @@ ...@@ -302,7 +306,7 @@
display: inline-block; display: inline-block;
position: relative; position: relative;
top: 0.025rem; top: 0.025rem;
margin: 0 0.25rem 0 0.15rem; margin: 0 0.25rem;
color: inherit; color: inherit;
font-size: 0.7rem; font-size: 0.7rem;
} }
...@@ -319,7 +323,7 @@ ...@@ -319,7 +323,7 @@
display: inline-block; display: inline-block;
position: relative; position: relative;
top: 0.025rem; top: 0.025rem;
margin: 0 0.25rem 0 0.15rem; margin: 0 0.25rem;
color: inherit; color: inherit;
font-size: 0.7rem; font-size: 0.7rem;
} }
...@@ -336,7 +340,7 @@ ...@@ -336,7 +340,7 @@
display: inline-block; display: inline-block;
position: relative; position: relative;
top: 0.025rem; top: 0.025rem;
margin: 0 0.25rem 0 0.15rem; margin: 0 0.25rem;
color: inherit; color: inherit;
font-size: 0.7rem; font-size: 0.7rem;
} }
...@@ -414,6 +418,14 @@ ...@@ -414,6 +418,14 @@
background-image: url(../../img/icons/intel-inside-dash.png); background-image: url(../../img/icons/intel-inside-dash.png);
} }
.dashboard-infos.dash-info-bios {
text-transform: capitalize !important;
}
#version {
text-transform: lowercase !important;
}
/*span.data-title.value-title.value-mem-total { /*span.data-title.value-title.value-mem-total {
color: #16597a; color: #16597a;
} }
......
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