Fix bugs + Hide Terminal from Access Menu#47
Merged
Merged
Conversation
Collaborator
Author
|
@nut1414 pls help review |
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR improves error handling across hooks by integrating a shared utility (getErrorMessage) and updates the instance settings page to hide the terminal access in favor of a console-only interface.
- Consolidated error message handling in multiple hooks and components.
- Enhanced props and loading state management in instance setting components.
- Removed terminal access from the AccessMenu while preserving existing console functionality.
Reviewed Changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| frontend/src/utils/errorHandling.ts | New utility to extract and format error messages. |
| frontend/src/pages/Instance/InstanceSettingPage.tsx | Updated to pass additional props to InstanceSettingContent. |
| Multiple hooks (useUserBilling, useAuth, useInstanceSetting, etc.) | Updated error handling with getErrorMessage. |
| Components in Instance Setting (PowerMenu, DestroyMenu, AccessMenu, etc.) | Updated props interfaces and loading state handling; terminal hidden. |
| frontend/src/contexts/baseContext.tsx | Minor dependency array adjustment in useEffect. |
| success: false, | ||
| data: null, | ||
| error: errorMessage | ||
| error: errorMessage as unknown as null // Type assertion to fix the error |
There was a problem hiding this comment.
Consider updating the error type in the payload to accept a string instead of force casting errorMessage to null; this change would improve type consistency and avoid reliance on type assertions.
Suggested change
| error: errorMessage as unknown as null // Type assertion to fix the error | |
| error: errorMessage |
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.
Summary