-
Notifications
You must be signed in to change notification settings - Fork 78
Expand file tree
/
Copy pathserver.go
More file actions
41 lines (32 loc) · 1002 Bytes
/
server.go
File metadata and controls
41 lines (32 loc) · 1002 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package dashboard
import (
"context"
"net/http"
appserver "github.com/mudrii/openclaw-dashboard/internal/appserver"
)
type Server struct {
inner *appserver.Server
systemSvc *SystemService
}
func NewServer(dir, version string, cfg Config, gatewayToken string, indexHTML []byte, serverCtx context.Context) *Server {
inner := appserver.NewServer(dir, version, cfg, gatewayToken, indexHTML, serverCtx, refreshCollectorFunc)
return &Server{
inner: inner,
systemSvc: inner.SystemService(),
}
}
func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
s.inner.ServeHTTP(w, r)
}
func (s *Server) PreWarm() {
s.inner.PreWarm()
}
func (s *Server) getDataCached() (map[string]any, error) {
return s.inner.GetDataCached()
}
func (s *Server) getDataRawCached() ([]byte, error) {
return s.inner.GetDataRawCached()
}
func (s *Server) handleStaticFile(w http.ResponseWriter, r *http.Request, path, contentType string) {
s.inner.HandleStaticFile(w, r, path, contentType)
}