Adding version checking
This commit is contained in:
11
index.php
11
index.php
@@ -20,6 +20,9 @@ if ($filter_node) {
|
||||
|
||||
$max_ip_cnt = $t_ips ? max(array_column($t_ips, 'cnt')) : 1;
|
||||
$max_port_cnt = $t_ports ? max(array_column($t_ports, 'cnt')) : 1;
|
||||
|
||||
$upstream_version = fetch_upstream_version();
|
||||
$update_available = $upstream_version && is_newer_version($upstream_version, APP_VERSION);
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
@@ -46,6 +49,14 @@ $max_port_cnt = $t_ports ? max(array_column($t_ports, 'cnt')) : 1;
|
||||
</header>
|
||||
<main>
|
||||
|
||||
<?php if ($update_available): ?>
|
||||
<div class="alert warn">
|
||||
Update available: <strong>v<?= h($upstream_version) ?></strong> —
|
||||
you are running <strong>v<?= h(APP_VERSION) ?></strong>.
|
||||
<a href="https://git.ny.daprogs.com/DAProgs/portspoof_concentrator" target="_blank">View release ↗</a>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<!-- Stat cards -->
|
||||
<div class="stats-row">
|
||||
<div class="stat-card">
|
||||
|
||||
Reference in New Issue
Block a user