Skip to content

Fix bugs + Hide Terminal from Access Menu#47

Merged
jinnaWan merged 5 commits into
mainfrom
CB-fix-bug-1
May 2, 2025
Merged

Fix bugs + Hide Terminal from Access Menu#47
jinnaWan merged 5 commits into
mainfrom
CB-fix-bug-1

Conversation

@jinnaWan
Copy link
Copy Markdown
Collaborator

@jinnaWan jinnaWan commented May 1, 2025

Summary

  • Correctly show error details
  • Fix duplicate instance setting hook problem
  • Hide terminal from instance setting access menu

@jinnaWan jinnaWan requested review from Copilot and nut1414 May 1, 2025 11:50
@jinnaWan
Copy link
Copy Markdown
Collaborator Author

jinnaWan commented May 1, 2025

@nut1414 pls help review

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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
Copy link

Copilot AI May 1, 2025

Choose a reason for hiding this comment

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

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

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Owner

@nut1414 nut1414 left a comment

Choose a reason for hiding this comment

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

LGTM, nice job!

@jinnaWan jinnaWan merged commit 0ac1b5f into main May 2, 2025
1 check passed
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.

3 participants