feat(web): Add session management UI for viewing and disconnecting active streams. continues from #4582#5137
Open
numselli wants to merge 6 commits into
Open
feat(web): Add session management UI for viewing and disconnecting active streams. continues from #4582#5137numselli wants to merge 6 commits into
numselli wants to merge 6 commits into
Conversation
- Add /sessions page with table showing client name, IP address, and duration - Add /api/sessions endpoint to list active streaming sessions - Add /api/sessions/disconnect endpoint to terminate sessions - Include auto-refresh (5s) and manual refresh options - Add confirmation dialog before disconnecting - Add Sessions link to navigation bar Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The disconnect confirmation modal was failing with "bootstrap is not defined" because the Modal class wasn't being imported. Now imports Modal from bootstrap/dist/js/bootstrap, matching the pattern used in apps.html. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…lookup Previously, add_authorized_client() generated a random UUID for each paired client, while the Moonlight client sends its own uniqueid during launch. This caused the session management UI to show random UUIDs instead of friendly device names, since the lookup would never match. Now stores the client's actual uniqueID when pairing completes, so session lookups can properly match and display the friendly name from the paired clients database. Note: Existing paired clients will need to re-pair to get correct name mapping. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Adjust inline comment spacing to conform to project's clang-format configuration. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add comprehensive documentation comments to get_all_sessions() and disconnect() functions explaining their purpose, parameters, and return values. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Previously, if a temporary error occurred during session fetch (e.g., during the brief transition after disconnecting a client), the error message would persist even after subsequent successful fetches because the success path never cleared the errorMessage state. Now clears errorMessage when fetch succeeds, so transient errors don't persist on the UI. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.




Changes from original PR:
Description
This PR adds a new Sessions page to the Sunshine web UI that allows administrators to view and manage active streaming sessions.
Features:
Implementation Details:
Backend (C++):
session::get_all_sessions()function instream.cppto enumerate active sessions thread-safelysession::disconnect()function to terminate sessions by IDGET /api/sessionsendpoint to retrieve session list as JSONPOST /api/sessions/disconnectendpoint to terminate a sessionFrontend (Vue.js):
sessions.htmlpage following existing UI patternsFiles Changed:
src/stream.h- Addedsession_info_tstruct and function declarationssrc/stream.cpp- Implemented session enumeration and disconnect functionssrc/confighttp.cpp- Added API endpoints and page routesrc/nvhttp.cpp- Fixed to store client's uniqueID during pairingsrc_assets/common/assets/web/sessions.html- New sessions pagesrc_assets/common/assets/web/Navbar.vue- Added Sessions link to navigationsrc_assets/common/assets/web/public/assets/locale/en.json- Added translationsvite.config.js- Added sessions.html to build inputsScreenshot
Empty state (no active sessions):
[Screenshot: Sessions page showing "No active streaming sessions" message]
With active session:

[Screenshot: Sessions page showing client "yoga" connected from 10.0.0.2 with Disconnect button]
Issues Fixed or Closed
Roadmap Issues
Type of Change
Checklist
AI Usage
Notes:
sync_util::sync_tpatternsMy changes:
Rebased from #4582 onto current main.