Repository navigation
fix(instance): distinguish deleted and unknown states - #727
Open
cloudbase-ai wants to merge 1 commit into
Open
cloudbase-ai wants to merge 1 commit into
cloudbase-ai wants to merge 1 commit into
Conversation
Signed-off-by: cloudbase-ai <[email protected]>
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
1 open issue
What changed in this PR
Fixes the Instance table’s state rendering to align UI semantics with Admin/chart data by treating backend state 0 as Deleted (not Unknown) and ensuring null/unrecognized values render Unknown rather than an empty cell.
Changes:
- Map state
0to the localized Deleted/已删除 label; keep1Online and2Offline. - Add a default renderer branch to display Unknown for null/unrecognized values.
- Add unit tests covering the state-column renderer and locale labels for Deleted vs Unknown.
| File | Description |
|---|---|
| src/routes/System/Instance/index.js | Updates state renderer mapping and adds fallback Unknown rendering for unrecognized values. |
| src/routes/System/Instance/state.test.js | Adds direct tests for renderer output and validates locale label separation for Deleted vs Unknown. |
| src/locales/en-US.json | Fixes casing for “Unknown” and adds “Deleted” translation. |
| src/locales/zh-CN.json | Adds “已删除” translation for Deleted. |
Review effort: Lite
Comment on lines
+32
to
+39
| const instance = new Instance({}); | ||
| instance.setState = (update) => { | ||
| instance.state = { ...instance.state, ...update }; | ||
| }; | ||
| instance.initInstanceColumns(); | ||
| renderState = instance.state.columns.find( | ||
| (column) => column.dataIndex === "instanceState", | ||
| ).render; |
Copilot stopped reviewing on behalf of
dengliming due to an error
October 21, 2026 15:07
This branch has not been deployed
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.

Part of apache/shenyu#7694.
The instance table labels backend state
0as unknown, while Admin and chart data define it asDELETED. It also renders nothing for null or unrecognized state values.Map
0to the localized Deleted/已删除 label, retain1as Online and2as Offline, and render the existing Unknown label for unrecognized values. Add direct tests of the actual state-column renderer and both locale labels. No numeric API values or dependencies change.Validation:
npm test— 58 suites, 340 tests passed../node_modules/.bin/eslint src/routes/System/Instance/index.js src/routes/System/Instance/state.test.js— passed after formatting.npm run build— passed.Main-repository companion: apache/shenyu#7889. It includes backend unknown-value handling, documented state semantics, corrected schema comments, and the generated Admin static bundle from dashboard commit
f239397e67c970c25a769f3b41ad3aaa7aca7a72. Merge the dashboard source before its bundled-resource companion.