mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-06-26 16:24:54 +00:00
Added support of ui split build (#682)
This commit is contained in:
parent
39f0b74897
commit
d216c64154
@ -54,6 +54,7 @@ WORKDIR /app
|
|||||||
COPY --from=builder ["/app/agent-build/mizuagent", "."]
|
COPY --from=builder ["/app/agent-build/mizuagent", "."]
|
||||||
COPY --from=builder ["/app/agent/build/extensions", "extensions"]
|
COPY --from=builder ["/app/agent/build/extensions", "extensions"]
|
||||||
COPY --from=site-build ["/app/ui-build/build", "site"]
|
COPY --from=site-build ["/app/ui-build/build", "site"]
|
||||||
|
COPY --from=site-build ["/app/ui-build/build-ent", "site-standalone"]
|
||||||
RUN mkdir /app/data/
|
RUN mkdir /app/data/
|
||||||
|
|
||||||
# gin-gonic runs in debug mode without this
|
# gin-gonic runs in debug mode without this
|
||||||
|
@ -247,7 +247,12 @@ func hostApi(socketHarOutputChannel chan<- *tapApi.OutputChannelItem) {
|
|||||||
if err := setUIFlags(); err != nil {
|
if err := setUIFlags(); err != nil {
|
||||||
logger.Log.Errorf("Error setting ui mode, err: %v", err)
|
logger.Log.Errorf("Error setting ui mode, err: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if config.Config.StandaloneMode {
|
||||||
|
app.Use(static.ServeRoot("/", "./site-standalone"))
|
||||||
|
} else {
|
||||||
app.Use(static.ServeRoot("/", "./site"))
|
app.Use(static.ServeRoot("/", "./site"))
|
||||||
|
}
|
||||||
|
|
||||||
app.Use(middlewares.CORSMiddleware()) // This has to be called after the static middleware, does not work if its called before
|
app.Use(middlewares.CORSMiddleware()) // This has to be called after the static middleware, does not work if its called before
|
||||||
|
|
||||||
@ -290,8 +295,7 @@ func setUIFlags() error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
replacedContent := strings.Replace(string(read), "__IS_STANDALONE__", strconv.FormatBool(config.Config.StandaloneMode), 1)
|
replacedContent := strings.Replace(string(read), "__IS_OAS_ENABLED__", strconv.FormatBool(config.Config.OAS), 1)
|
||||||
replacedContent = strings.Replace(replacedContent, "__IS_OAS_ENABLED__", strconv.FormatBool(config.Config.OAS), 1)
|
|
||||||
replacedContent = strings.Replace(replacedContent, "__IS_SERVICE_MAP_ENABLED__", strconv.FormatBool(config.Config.ServiceMap), 1)
|
replacedContent = strings.Replace(replacedContent, "__IS_SERVICE_MAP_ENABLED__", strconv.FormatBool(config.Config.ServiceMap), 1)
|
||||||
|
|
||||||
err = ioutil.WriteFile(uiIndexPath, []byte(replacedContent), 0)
|
err = ioutil.WriteFile(uiIndexPath, []byte(replacedContent), 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user