ソースを参照

show cert time for active connections

DmitrievRoman 6 日 前
コミット
f7e0359a16
1 ファイル変更23 行追加0 行削除
  1. 23 0
      html/admin/get_server_data.php

+ 23 - 0
html/admin/get_server_data.php

@@ -61,6 +61,7 @@ ob_start();
                 <th>Connected</th>
                 <th>Cipher</th>
                 <th>Status</th>
+                <th>Cert</th>
                 <th>Actions</th>
             </tr>
         </thead>
@@ -82,6 +83,28 @@ ob_start();
                         <?= $client['banned'] ? 'BANNED' : 'Active' ?>
                     </span>
                 </td>
+                <td>
+                    <?php if (isset($account['cert_date']) && $account['cert_date'] !== '-'): ?>
+                            <div class="cert-info">
+                                <span class="cert-date 
+                                    <?= $account['expired'] ? 'expired' : ($account['days_left'] < 7 ? 'expiring-soon' : 'valid') ?>">
+                                    <?= htmlspecialchars($account['cert_date']) ?>
+                                </span>
+                                <?php if ($account['days_left'] !== null): ?>
+                                    <span class="cert-days 
+                                        <?= $account['expired'] ? 'expired' : ($account['days_left'] < 7 ? 'urgent' : ($account['days_left'] < 30 ? 'warning' : '')) ?>">
+                                        <?php if ($account['expired']): ?>
+                                            (expired <?= $account['days_left'] ?>d ago)
+                                        <?php else: ?>
+                                            (<?= $account['days_left'] ?>d left)
+                                        <?php endif; ?>
+                                    </span>
+                                <?php endif; ?>
+                            </div>
+                        <?php else: ?>
+                            <span class="cert-date error">No certificate</span>
+                        <?php endif; ?>
+                </td>
                 <td class="actions">
                     <?php if ($client['banned']): ?>
                         <button onclick="handleAction('<?= $server_name ?>', 'unban', '<?= htmlspecialchars($client['name']) ?>')"