From 0524b24a6928202588c0565c196dc57895f2e792 Mon Sep 17 00:00:00 2001 From: TRC Loop Date: Sun, 19 Oct 2025 20:57:51 +0200 Subject: [PATCH 1/3] Update home page header with icon Replaces the plain Home header with a styled div containing a home icon and the title. Improves visual appearance and consistency with dashboard design. --- src/public/home.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/public/home.php b/src/public/home.php index 569c299..1419205 100644 --- a/src/public/home.php +++ b/src/public/home.php @@ -1,6 +1,7 @@ {% extends 'templates/dashboard.j2' %} {% set active_page = 'home' %} {% block main %} -

Home

-

Good afternoon!

+
+

Home

+
{% endblock %} From 42c0a461e1679a74d7e502b9e02e617eaf7009e5 Mon Sep 17 00:00:00 2001 From: TRC Loop Date: Sun, 19 Oct 2025 21:29:19 +0200 Subject: [PATCH 2/3] Add dashboard stats and last DynDNS update tracking Introduces a stats grid to the home page displaying total domains, current public IP, and last DynDNS update time. Adds new CSS for stat cards and updates dyn_dns_update.php to persist the last run timestamp in settings. --- src/lib/dyn_dns_update.php | 11 +++++ src/public/css/styles.css | 86 ++++++++++++++++++++++++++++++++++++++ src/public/home.php | 77 +++++++++++++++++++++++++++++++++- 3 files changed, 173 insertions(+), 1 deletion(-) diff --git a/src/lib/dyn_dns_update.php b/src/lib/dyn_dns_update.php index 7545769..61b3828 100644 --- a/src/lib/dyn_dns_update.php +++ b/src/lib/dyn_dns_update.php @@ -53,3 +53,14 @@ } $logger->info('DynDNS update completed.'); + +$lastRun = $settingsManager->find(["key" => "lastDynDnsRun"]); + +if (!$lastRun) { + $lastRun = new KeyValue(); + $lastRun->key = "lastDynDnsRun"; +} + +$lastRun->value = date('c'); // ISO8601 timestamp +$settingsManager->save($lastRun); + diff --git a/src/public/css/styles.css b/src/public/css/styles.css index 6531e2c..ba09aff 100644 --- a/src/public/css/styles.css +++ b/src/public/css/styles.css @@ -12,6 +12,10 @@ --link-hover: #4b5563; --error: #ef4444; --error-light: #fee2e2; + --success: #16a34a; + --danger: #dc2626; + --surface-variant: #f6f6f7; + --accent: #3b82f6; } /* ---------- Base ---------- */ @@ -740,3 +744,85 @@ select:focus { .modal-note a:hover { color: var(--primary-hover); } + +.stats-grid { + margin-top: 2rem; + display: grid; + grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); + gap: 1.5rem; + width: 100%; +} + +.stat-card { + display: flex; + align-items: center; + gap: 1.1rem; + background: var(--card); + border: 1px solid var(--border); + border-radius: 12px; + padding: 1.4rem 1.6rem; + box-shadow: 0 3px 10px rgba(0,0,0,0.05); + transition: transform 0.15s ease, box-shadow 0.2s ease; +} + +.stat-card:hover { + transform: translateY(-3px); + box-shadow: 0 6px 18px rgba(0,0,0,0.08); +} + +.stat-icon { + background: rgba(99,102,241,0.1); + color: var(--primary); + border-radius: 10px; + display: flex; + align-items: center; + justify-content: center; + width: 54px; + height: 54px; + font-size: 1.9rem; + flex-shrink: 0; +} + +.stat-info { + display: flex; + flex-direction: column; + justify-content: center; +} + +.stat-info h3 { + margin: 0; + font-size: 1.6rem; + color: var(--text); + font-weight: 600; +} + +.stat-info p { + margin: 0.25rem 0 0; + font-size: 0.95rem; + color: var(--placeholder); +} + +#public-ip-card h3, +#last-dyndns-card h3 { + font-family: monospace; + font-size: 1.15rem; + letter-spacing: 0.4px; + word-break: break-all; +} + +@media (max-width: 600px) { + .stat-card { + flex-direction: row; + padding: 1.1rem 1.25rem; + } + + .stat-info h3 { + font-size: 1.4rem; + } + + .stat-icon { + width: 48px; + height: 48px; + font-size: 1.6rem; + } +} diff --git a/src/public/home.php b/src/public/home.php index 1419205..b0c39b7 100644 --- a/src/public/home.php +++ b/src/public/home.php @@ -1,7 +1,82 @@ {% extends 'templates/dashboard.j2' %} {% set active_page = 'home' %} {% block main %} +getPDO()->query("SELECT COUNT(*) FROM domains")->fetchColumn(); + +$apiKeyObject = $settingsManager->find(["key" => "apiKey"]); +$apiKey = $apiKeyObject->value ?? ''; + +$lastDynDnsRun = $settingsManager->find(["key" => "lastDynDnsRun"]); +$lastDynDnsRunValue = $lastDynDnsRun ? date('Y-m-d H:i:s', strtotime($lastDynDnsRun->value)) : 'Never'; +?> +
-

Home

+ +

Home

+ +
+
+
+
+

+

Total Domains

+
+
+ +
+
+
+

Loading...

+

Current Public IP

+ +
+
+ +
+
+
+

+

Last DynDNS Update

+
+
+
+ + {% endblock %} From 31b66a01c1765268cbb144760d227bc522a09b26 Mon Sep 17 00:00:00 2001 From: TRC Loop Date: Sun, 19 Oct 2025 21:31:30 +0200 Subject: [PATCH 3/3] Display last updater run and domain count in settings Fetches and displays the actual last DynDNS updater run time and total domain count from the database in the settings page, replacing hardcoded values for improved accuracy. --- src/public/settings.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/public/settings.php b/src/public/settings.php index ca3c4fa..92030d6 100644 --- a/src/public/settings.php +++ b/src/public/settings.php @@ -1,9 +1,16 @@ getPDO()->query("SELECT COUNT(*) FROM domains")->fetchColumn(); $apiKeyObject = $settingsManager->find(["key"=>"apiKey"]); $apiKey = $apiKeyObject->value; + +$lastDynDnsRun = $settingsManager->find(["key" => "lastDynDnsRun"]); +$lastDynDnsRunValue = $lastDynDnsRun ? date('Y-m-d H:i:s', strtotime($lastDynDnsRun->value)) : 'Never'; ?> {% extends 'templates/dashboard.j2' %} {% set active_page = 'settings' %} @@ -54,8 +61,8 @@
Database Size
-
Last updater run
5h ago
-
Total Domains
0
+
Last updater run
+
Total Domains