diff --git a/internal/http/router.go b/internal/http/router.go index 5d3f951b2b..2b8e0dbc67 100644 --- a/internal/http/router.go +++ b/internal/http/router.go @@ -28,6 +28,9 @@ const EventLogRouterPath = "/eventlog" // ExprPath is path for expression. const ExprPath = "/expr" +// StaticPath is path for the static view. +const StaticPath = "/static/" + const RootPath = "/" // Prometheus restful api path diff --git a/internal/http/server.go b/internal/http/server.go index f37e0ce442..08f6e9ec16 100644 --- a/internal/http/server.go +++ b/internal/http/server.go @@ -87,6 +87,10 @@ func registerDefaults() { w.Write([]byte(fmt.Sprintf(`{"output": "%s"}`, output))) }), }) + Register(&Handler{ + Path: StaticPath, + Handler: GetStaticHandler(), + }) } func RegisterStopComponent(triggerComponentStop func(role string) error) { diff --git a/internal/http/static/index.html b/internal/http/static/index.html new file mode 100644 index 0000000000..0a12f181e6 --- /dev/null +++ b/internal/http/static/index.html @@ -0,0 +1,170 @@ + + +
+ + +Parameter meaning:
+The auth parameter is etcd root path, and the code parameter is expr execution expression.
+Injection object:
+Currently, the objects injected by expr include: param, proxy, rootcoord, querycoord, datacoord, quernode, datanode. You can use this tool to get the running value of the object.
+Usage example:
+1. Get a configuration: param.CommonCfg.GracefulTime.GetValue()
+2. Get a property value in the proxy object: proxy.address
+3. Determine whether a graph exists in the datanode: datanode.flowgraphManager.HasFlowgraph("aaa")
+Limitations:
+1. Variables cannot be modified.
+2. Methods with non-basic type parameters cannot be executed.
+3. Functions with multiple return values cannot be chained.