From 6e12329d9da1b689e50de20f3ac49b3cd4e0ebd9 Mon Sep 17 00:00:00 2001 From: Abdalrahman Date: Wed, 13 May 2026 02:47:09 +0300 Subject: [PATCH] feat(api-docs): enhance in-panel API documentation (#4312) * feat(api-docs): enhance API documentation with missing endpoints, search, collapse, and route sync test - Add 29 undocumented routes across 4 new sections (Settings, Xray Settings, Subscription Server, WebSocket) plus 4 missing Server API endpoints - Fix inaccuracies: history metric keys, node metric keys, VLESS enc description - Add response schemas to 15+ key endpoints - Add search bar and expand/collapse all controls to the docs page - Add collapsible endpoint sections with endpoint count - Add Go test (TestAPIRoutesDocumented) to verify all Go routes are documented * feat(api-docs): add JSON syntax highlighting and top-right copy button to code blocks * fix(api-docs): use distinct colors for JSON syntax highlighting (green strings, amber numbers) * feat(api-docs): add request body examples, error responses, WebSocket message types, and subscription response headers * fix(api-docs): use ClipboardManager.copyText instead of copy to fix API token copy button --- frontend/src/pages/api-docs/ApiDocsPage.vue | 109 +++++- frontend/src/pages/api-docs/CodeBlock.vue | 152 ++++++++ frontend/src/pages/api-docs/EndpointRow.vue | 26 +- .../src/pages/api-docs/EndpointSection.vue | 105 +++++- frontend/src/pages/api-docs/endpoints.js | 335 +++++++++++++++++- web/controller/api_docs_test.go | 160 +++++++++ 6 files changed, 859 insertions(+), 28 deletions(-) create mode 100644 frontend/src/pages/api-docs/CodeBlock.vue create mode 100644 web/controller/api_docs_test.go diff --git a/frontend/src/pages/api-docs/ApiDocsPage.vue b/frontend/src/pages/api-docs/ApiDocsPage.vue index 28fee7b4..9a5f958e 100644 --- a/frontend/src/pages/api-docs/ApiDocsPage.vue +++ b/frontend/src/pages/api-docs/ApiDocsPage.vue @@ -1,5 +1,5 @@ + + + + + + diff --git a/frontend/src/pages/api-docs/EndpointRow.vue b/frontend/src/pages/api-docs/EndpointRow.vue index 0b7fb300..761e4a88 100644 --- a/frontend/src/pages/api-docs/EndpointRow.vue +++ b/frontend/src/pages/api-docs/EndpointRow.vue @@ -1,6 +1,7 @@