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 569c299..b0c39b7 100644 --- a/src/public/home.php +++ b/src/public/home.php @@ -1,6 +1,82 @@ {% extends 'templates/dashboard.j2' %} {% set active_page = 'home' %} {% block main %} -

Home

-

Good afternoon!

+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

+
+ +
+
+
+
+

+

Total Domains

+
+
+ +
+
+
+

Loading...

+

Current Public IP

+ +
+
+ +
+
+
+

+

Last DynDNS Update

+
+
+
+ + {% endblock %} 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