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
@@ -781,7 +781,12 @@
</dialog>
</div>
<div id="status-indicator" class="fixed top-4 right-4 px-4 py-2 bg-blue-500 text-white rounded-lg shadow-md"></div>
<div class="fixed top-4 right-4 flex items-center gap-2">
<div id="status-indicator" class="px-4 py-2 bg-blue-500 text-white rounded-lg shadow-md"></div>
<button id="refresh-button" onclick="handleRefresh()" class="px-3 py-2 bg-blue-500 hover:bg-blue-600 text-white rounded-lg shadow-md transition-colors" title="Gracefully stop the process">
<i class="fas fa-redo"></i>
</button>
</div>
<div id="notifications" class="fixed bottom-4 right-4 flex flex-col-reverse space-y-2" style="z-index: 99999;"></div>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/lib/xterm.js"></script>