Add graceful shutdown button and improve shutdown status display

- Add refresh/shutdown button next to status indicator that gracefully
  stops the process without cleaning my-storage
- Create /api/shutdown endpoint that triggers graceful shutdown via SIGTERM
- Update status indicator to show "Gracefully Cleaning...." when system
  is shutting down (instead of "Searching for peers...")
- Include isShuttingDown flag in /api/status endpoint response
- Use built-in ConfirmationModal for shutdown confirmation with warning styling

The shutdown button appears in the top-right corner next to the status
indicator and uses the existing confirmation modal system for user
confirmation before initiating shutdown.
This commit is contained in:
Raven Scott
2025-12-26 22:03:23 -05:00
parent 1888289067
commit 3466d17eda
6 changed files with 188 additions and 6 deletions
+6 -1
View File
@@ -32,7 +32,12 @@
<div class="container mx-auto max-w-7xl">
<div class="flex justify-between items-center mb-8 flex-wrap gap-4">
<h1 class="text-4xl font-extrabold" style="background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;">P2NS Admin Panel</h1>
<div id="status-indicator" class="px-4 py-2 rounded-lg"></div>
<div class="flex items-center gap-2">
<div id="status-indicator" class="px-4 py-2 rounded-lg"></div>
<button id="refresh-button" onclick="handleRefresh()" class="px-3 py-2 bg-primary hover:bg-primary-hover text-white rounded-lg transition-colors" title="Gracefully stop the process">
<i class="fas fa-redo"></i>
</button>
</div>
</div>
<nav class="flex justify-center mb-8 space-x-4 flex-wrap">