Skip to content

Refactor/server overview - #70

Merged
HublackBE merged 9 commits into
mainfrom
refactor/ServerOverview
Jan 12, 2026
Merged

Refactor/server overview#70
HublackBE merged 9 commits into
mainfrom
refactor/ServerOverview

Conversation

@HublackBE

Copy link
Copy Markdown
Contributor

No description provided.

Changed the "Overview" SelectorBarItem icon from "Clock" to "PreviewLink" in ServerMainPage.xaml for improved visual representation.
Refactor srvOverview to use IAgentClientRegistry for async client retrieval, simplify resource fetching, and manage aTimer with navigation events. Add navigation event overrides and update event handler to async.
Added Page_Unloaded event to srvOverview to stop aTimer when the page is unloaded, preventing resource leaks. Broadened exception handling in resource update logic to catch all exceptions. Changed aTimer from static to instance variable for better lifecycle management.
Added comments above TcpClient.ConnectAsync to document its use of a combined cancellation token and the specific exceptions it may throw on timeout, cancellation, or connection failure. No changes to functionality.
Refactored CreateClientAsync to use async/await for future extensibility. Added a check to prevent client creation for offline endpoints, logging a warning and throwing an exception if attempted.
SelectorBar navigation now occurs only after a successful agent connection. If the agent is offline, a warning dialog is shown and navigation is disabled. UI updates are properly dispatched, and error handling and user feedback are enhanced during initialization.
…n ServicesPage

Added explicit handling for gRPC RpcException during service initialization. Now, cancelled calls are ignored, while other errors clear the service list and display an error message in the UI. Refactored service loading to ensure all UI updates occur on the DispatcherQueue for thread safety and clearer user feedback.
Added a styled, centered TextBlock to the ContentFrame with a clear message when the agent is offline. This provides users with more informative feedback in addition to the existing ContentDialog, clarifying why features are inaccessible.

@nasrlol nasrlol left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good refactor

@HublackBE
HublackBE merged commit be2d1b1 into main Jan 12, 2026
1 check passed
@HublackBE
HublackBE deleted the refactor/ServerOverview branch January 12, 2026 11:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants