2024-02-13 20:52:10 +00:00
|
|
|
package temporal
|
|
|
|
|
|
|
|
import (
|
2024-02-15 22:47:56 +00:00
|
|
|
internal "code.tjo.space/mentos1386/zdravko/internal/config"
|
2024-02-13 20:52:10 +00:00
|
|
|
"github.com/temporalio/ui-server/v2/server"
|
|
|
|
"github.com/temporalio/ui-server/v2/server/config"
|
|
|
|
"github.com/temporalio/ui-server/v2/server/server_options"
|
|
|
|
)
|
|
|
|
|
2024-02-19 09:09:30 +00:00
|
|
|
func NewUiConfig(cfg *internal.TemporalConfig) *config.Config {
|
2024-02-13 20:52:10 +00:00
|
|
|
return &config.Config{
|
2024-02-19 09:09:30 +00:00
|
|
|
Host: cfg.ListenAddress,
|
2024-02-13 20:52:10 +00:00
|
|
|
Port: 8223,
|
2024-02-19 09:09:30 +00:00
|
|
|
TemporalGRPCAddress: "localhost:7233",
|
2024-02-13 20:52:10 +00:00
|
|
|
EnableUI: true,
|
|
|
|
PublicPath: "/temporal",
|
2024-02-19 09:09:30 +00:00
|
|
|
ForwardHeaders: []string{"Authorization"},
|
2024-02-13 20:52:10 +00:00
|
|
|
Codec: config.Codec{
|
|
|
|
Endpoint: "",
|
|
|
|
},
|
|
|
|
CORS: config.CORS{
|
|
|
|
CookieInsecure: true,
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func NewUiServer(cfg *config.Config) (*server.Server, error) {
|
|
|
|
s := server.NewServer(server_options.WithConfigProvider(cfg))
|
|
|
|
return s, nil
|
|
|
|
}
|