2024-02-13 20:52:10 +00:00
|
|
|
package temporal
|
|
|
|
|
|
|
|
import (
|
|
|
|
"code.tjo.space/mentos1386/zdravko/internal"
|
|
|
|
"github.com/temporalio/ui-server/v2/server"
|
|
|
|
"github.com/temporalio/ui-server/v2/server/config"
|
|
|
|
"github.com/temporalio/ui-server/v2/server/server_options"
|
|
|
|
)
|
|
|
|
|
|
|
|
func NewUiConfig(cfg *internal.Config) *config.Config {
|
|
|
|
return &config.Config{
|
2024-02-15 17:43:35 +00:00
|
|
|
Host: cfg.Temporal.ListenAddress,
|
2024-02-13 20:52:10 +00:00
|
|
|
Port: 8223,
|
2024-02-15 17:43:35 +00:00
|
|
|
TemporalGRPCAddress: cfg.Temporal.ServerHost,
|
2024-02-13 20:52:10 +00:00
|
|
|
EnableUI: true,
|
|
|
|
PublicPath: "/temporal",
|
|
|
|
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
|
|
|
|
}
|