From 00cb18eceafdf06ab91312b622c3260b515a765d Mon Sep 17 00:00:00 2001
From: stopyz <stopyz@gmail.com>
Date: Sun, 25 Jun 2023 22:01:59 +0200
Subject: [PATCH] Dashboard App for ACF

---
 README.md                       |  2 +-
 app/acf-util/welcome-html.lsp   |  6 +++---
 css/dashboard-pages/welcome.css | 11 +++++++++++
 3 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/README.md b/README.md
index 36026f1..e6e735a 100644
--- a/README.md
+++ b/README.md
@@ -23,7 +23,7 @@
 
 Light-weight App (Less than 2 MB) installed
 
-> ⚠️ `Serve by` field check version of both `lighttpd` and `mini_httpd`. If lighttpd is install on system, command return `lighttpd` as prefered ACF server. However, it's the best choice to switch to `lighttpd` for `ACF`
+> ⚠️ `Serve by` field check version of both `lighttpd` and `mini_httpd`. If `lighttpd` is install on system, command return `lighttpd` as prefered ACF server. However, it's the best choice to switch to `lighttpd` for `ACF`
 
 Install essential packages :
 
diff --git a/app/acf-util/welcome-html.lsp b/app/acf-util/welcome-html.lsp
index cbbe5cf..20cb1a9 100644
--- a/app/acf-util/welcome-html.lsp
+++ b/app/acf-util/welcome-html.lsp
@@ -41,7 +41,7 @@ end
 	end
 	
 -- GET DIST VERSION CHANGES
-	local check_verchanges = string.match(sys.value.alpineposts.value, "((("..actual_distver..").+%$)-released.html)")
+	local check_verchanges = string.gsub(string.match(string.match(sys.value.alpineposts.value, "(href=\"Alpine-.+("..actual_distver.."))(.+\")"), "\".+\""), "\"", "")
 	
 -- FORMAT UPTIME	
 	local up_time = math.floor(string.match(sys.value.uptime.value, "[%d]+"))
@@ -145,9 +145,9 @@ end
 					<span class="data-title">OS : </span>
 					<%= chkres %>
 					<span class="check-version">
-					 &nbsp; - &nbsp;<!--<a class="version-link" href="https://www.alpinelinux.org/posts/Alpine-<%= actual_distver %>-released.html" target="_blank">-->
+					 &nbsp; - &nbsp;<a class="version-link version-external-link" href="https://www.alpinelinux.org/posts/<%= check_verchanges %>" target="_blank">
 					Last Release : <%= actual_distver %>
-					</span><!--</a>--><br>
+					</span></a><br>
 					<span class="data-title">ACF Version : </span><%= sys.value.luaver.value %> 
 					<% if sys.value.ACFlightServer.value ~= "" then %>
 					<span class="data-title"> | Serve by : </span><%= sys.value.ACFlightServer.value %>
diff --git a/css/dashboard-pages/welcome.css b/css/dashboard-pages/welcome.css
index b43349b..2c1467a 100644
--- a/css/dashboard-pages/welcome.css
+++ b/css/dashboard-pages/welcome.css
@@ -354,6 +354,17 @@
     color: #b9b9b9;
 }
 
+.version-external-link::after {
+    font-family: "Font Awesome 6 Free";
+    font-weight: bold;
+    content: '\F35D' !important;
+    display: inline-block;
+    position: relative;
+    margin: 0 0.25rem 0 0.15rem;
+    color: inherit;
+    font-size: 0.45rem;
+}
+
 .welcome .data-system-up-time::before {
     font-family: "Font Awesome 6 Free";
     font-weight: bold;
-- 
GitLab