Commit Graph
2 Commits
  • feat(nodes): add distinct purple indicator when panel is online but Xray core failed (#5040)
    * feat(nodes): add distinct purple indicator when panel is online but Xray core failed
    
    Currently nodes only show binary online/offline based on panel API reachability.
    
    This adds a third state:
    - Green: panel reachable + Xray healthy
    - Purple pulsing dot + "Online (Xray Error)": panel API works (management actions still available) but the node Xray process is in error or stopped. Tooltip shows the remote xrayError.
    - Red: unreachable (unchanged)
    
    Backend now captures xray.state + xray.errorMsg from /panel/api/server/status heartbeats and probes.
    New fields on Node + NodeSummary, forwarded for transitive nodes.
    Frontend Zod + NodeList rendering + dedicated .xray-error-dot CSS (color #722ED1) + i18n key.
    
    Color chosen purple per feedback after initial implementation.
    
    Refs: worktree xray-failed-in-nodes
    
    * fix: remove invalid JSON comment causing CI failures
    
    * chore: regenerate OpenAPI schemas and types for xray error indicators
    
    * chore: regenerate examples and schemas for xray error indicators
    
    * chore: regenerate missing openapi.json examples
    
    * fix
    
    ---------
    
    Co-authored-by: Rqzbeh <rqzbeh@users.noreply.github.com>
    Co-authored-by: Sanaei <ho3ein.sanaei@gmail.com>
  • feat(api-docs): generate response examples from Go structs; fix SS2022 PSK regen (#4996)
    Stop hand-writing OpenAPI response examples, which kept drifting from the real payloads (clients/traffic missing fields, inbounds/list exposing userId which is json:"-", the fictional inbound-443 tag instead of the real in-<port>-<transport> form).
    
    tools/openapigen now emits frontend/src/generated/examples.ts: a per-struct example instance built from type defaults, validate oneof/min bounds, and example: struct tags, with nested-ref expansion and a cycle guard. build-openapi.mjs composes the {success,obj} envelope from it for any endpoint annotated with responseSchema (+ responseSchemaArray for lists); the hand-written response is dropped for those. Service DTOs InboundOption/ApiTokenView/ProbeResultUI are added to the walker.
    
    #4996: client password regeneration now produces a valid Shadowsocks 2022 PSK (correct base64 length per cipher) when an SS2022 inbound is attached, in both the single and bulk client forms; backend surfaces ssMethod on /inbounds/options so the UI can pick the right length.
    
    Also: Swagger UI persists the Authorization token across reloads (persistAuthorization).