-
Notifications
You must be signed in to change notification settings - Fork 3.2k
fix: fix bug with mcp-server status error #8349
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,6 +13,7 @@ const ( | |
| RuntimeStopped = "stopped" | ||
| RuntimeUnhealthy = "unhealthy" | ||
| RuntimeCreating = "creating" | ||
| RuntimeReStarting = "restarting" | ||
|
|
||
| RuntimePHP = "php" | ||
| RuntimeNode = "node" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The code snippet you provided is an update to the Irregularities:There are no major irregularities in the code but there's a redundant space after each comma. This doesn’t impact functionality but it can be cleaned up for better readability. Potential Issues:
Optimization Suggestions:
Peculiar Note:The addition of Overall, the update appears clean syntactically, maintains correctness without functional defects, and provides basic guidance for future enhancements. |
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -58,7 +58,9 @@ | |
| @click="openLog(row)" | ||
| link | ||
| type="primary" | ||
| :disabled="row.status !== 'running' && row.status !== 'error'" | ||
| :disabled=" | ||
| row.status !== 'running' && row.status !== 'error' && row.status !== 'restarting' | ||
| " | ||
| > | ||
| {{ $t('website.check') }} | ||
| </el-button> | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The code snippet provided has a small correction to address an oversight. Currently, when the button is disabled for rows where This might lead to incorrect behavior in scenarios where you expect the button to show differently based on all three states (or any other combination). To resolve this, make sure that only one of these specific status conditions is checked: @@ -58,7 +58,9 @@
@click="openLog(row)"
link
type="primary"
- :disabled="row.status !== 'running' && row.status !== 'error'"
+ :disabled="
+ row.status === 'done' || // Add 'done' as another condition if applicable
+ row.status === 'failed' || // Or add 'failed' if applicable
+ row.status === 'aborted' // Adjust to match all relevant statuses
+ "
>
{{ $t('website.check') }}
</el-button>Make sure to adjust the list with valid statuses ( If you plan for more detailed control over which statuses can activate certain functionality, consider using logical operators appropriately within the |
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The provided code has several improvements and corrections:
Variable Naming Consistency: Use consistent naming conventions for variables (
data,total) even though they differ slightly in case but refer to the same concept.Type Declarations: Ensure that structs such as
response.McpServersRespandrequest.Environmentare properly declared to avoid any type errors.Error Handling: Add more detailed error handling where appropriate, especially in cases like failed database queries or other critical operations.
Optimization: For the
_ = syncMcpServerContainerStatus(&item)line, consider using context cancellation if necessary to handle resource management efficiently.Documentation: Include comments explaining each function's purpose, parameters, and return values to improve readability and maintainability.
Here's an updated version with some of these suggestions:
Justification: