@@ -42,6 +42,7 @@ const (
42
42
headlessFlag = "headless"
43
43
ipFlag = "ip"
44
44
uiIPFlag = "ui-ip"
45
+ uiCodecEndpointFlag = "ui-codec-endpoint"
45
46
logFormatFlag = "log-format"
46
47
logLevelFlag = "log-level"
47
48
namespaceFlag = "namespace"
@@ -50,6 +51,14 @@ const (
50
51
dynamicConfigValueFlag = "dynamic-config-value"
51
52
)
52
53
54
+ type uiConfig struct {
55
+ Host string
56
+ Port int
57
+ TemporalGRPCAddress string
58
+ EnableUI bool
59
+ CodecEndpoint string
60
+ }
61
+
53
62
func main () {
54
63
if err := buildCLI ().Run (os .Args ); err != nil {
55
64
goLog .Fatal (err )
@@ -124,6 +133,11 @@ func buildCLI() *cli.App {
124
133
Usage : `IPv4 address to bind the web UI to instead of localhost` ,
125
134
DefaultText : "same as --ip (eg. 127.0.0.1)" ,
126
135
},
136
+ & cli.StringFlag {
137
+ Name : uiCodecEndpointFlag ,
138
+ Usage : `UI Remote data converter HTTP endpoint` ,
139
+ EnvVars : nil ,
140
+ },
127
141
& cli.StringFlag {
128
142
Name : logFormatFlag ,
129
143
Usage : `customize the log formatting (allowed: ["json" "pretty"])` ,
@@ -198,11 +212,12 @@ func buildCLI() *cli.App {
198
212
},
199
213
Action : func (c * cli.Context ) error {
200
214
var (
201
- ip = c .String (ipFlag )
202
- serverPort = c .Int (portFlag )
203
- metricsPort = c .Int (metricsPortFlag )
204
- uiPort = serverPort + 1000
205
- uiIP = ip
215
+ ip = c .String (ipFlag )
216
+ serverPort = c .Int (portFlag )
217
+ metricsPort = c .Int (metricsPortFlag )
218
+ uiPort = serverPort + 1000
219
+ uiIP = ip
220
+ uiCodecEndpoint = ""
206
221
)
207
222
208
223
if c .IsSet (uiPortFlag ) {
@@ -213,6 +228,10 @@ func buildCLI() *cli.App {
213
228
uiIP = c .String (uiIPFlag )
214
229
}
215
230
231
+ if c .IsSet (uiCodecEndpointFlag ) {
232
+ uiCodecEndpoint = c .String (uiCodecEndpointFlag )
233
+ }
234
+
216
235
pragmas , err := getPragmaMap (c .StringSlice (pragmaFlag ))
217
236
if err != nil {
218
237
return err
@@ -257,7 +276,15 @@ func buildCLI() *cli.App {
257
276
}
258
277
if ! c .Bool (headlessFlag ) {
259
278
frontendAddr := fmt .Sprintf ("%s:%d" , ip , serverPort )
260
- opt , err := newUIOption (frontendAddr , uiIP , uiPort , c .String (configFlag ))
279
+ cfg := & uiConfig {
280
+ Host : uiIP ,
281
+ Port : uiPort ,
282
+ TemporalGRPCAddress : frontendAddr ,
283
+ EnableUI : true ,
284
+ CodecEndpoint : uiCodecEndpoint ,
285
+ }
286
+
287
+ opt , err := newUIOption (cfg , c .String (configFlag ))
261
288
if err != nil {
262
289
return err
263
290
}
0 commit comments