mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-07-17 09:51:56 +00:00
Merge branch 'develop' into feature/multiarch_build
This commit is contained in:
commit
724c86bd3b
@ -2,7 +2,6 @@
|
||||
.dockerignore
|
||||
.editorconfig
|
||||
.gitignore
|
||||
**/.env*
|
||||
Dockerfile
|
||||
Makefile
|
||||
LICENSE
|
||||
|
@ -91,6 +91,7 @@ WORKDIR /app
|
||||
COPY --from=builder ["/app/agent-build/mizuagent", "."]
|
||||
COPY --from=builder ["/app/agent/build/extensions", "extensions"]
|
||||
COPY --from=front-end ["/app/ui-build/build", "site"]
|
||||
COPY --from=front-end ["/app/ui-build/build-ent", "site-standalone"]
|
||||
|
||||
# gin-gonic runs in debug mode without this
|
||||
ENV GIN_MODE=release
|
||||
|
@ -247,7 +247,12 @@ func hostApi(socketHarOutputChannel chan<- *tapApi.OutputChannelItem) {
|
||||
if err := setUIFlags(); err != nil {
|
||||
logger.Log.Errorf("Error setting ui mode, err: %v", err)
|
||||
}
|
||||
app.Use(static.ServeRoot("/", "./site"))
|
||||
|
||||
if config.Config.StandaloneMode {
|
||||
app.Use(static.ServeRoot("/", "./site-standalone"))
|
||||
} else {
|
||||
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
|
||||
|
||||
@ -290,8 +295,7 @@ func setUIFlags() error {
|
||||
return err
|
||||
}
|
||||
|
||||
replacedContent := strings.Replace(string(read), "__IS_STANDALONE__", strconv.FormatBool(config.Config.StandaloneMode), 1)
|
||||
replacedContent = strings.Replace(replacedContent, "__IS_OAS_ENABLED__", strconv.FormatBool(config.Config.OAS), 1)
|
||||
replacedContent := strings.Replace(string(read), "__IS_OAS_ENABLED__", strconv.FormatBool(config.Config.OAS), 1)
|
||||
replacedContent = strings.Replace(replacedContent, "__IS_SERVICE_MAP_ENABLED__", strconv.FormatBool(config.Config.ServiceMap), 1)
|
||||
|
||||
err = ioutil.WriteFile(uiIndexPath, []byte(replacedContent), 0)
|
||||
|
2
ui/.env.basic
Normal file
2
ui/.env.basic
Normal file
@ -0,0 +1,2 @@
|
||||
REACT_APP_OVERRIDE_WS_URL="ws://localhost:8899/ws"
|
||||
REACT_APP_OVERRIDE_API_URL="http://localhost:8899/"
|
3
ui/.env.enterprise
Normal file
3
ui/.env.enterprise
Normal file
@ -0,0 +1,3 @@
|
||||
REACT_APP_OVERRIDE_WS_URL="ws://localhost:8899/ws"
|
||||
REACT_APP_OVERRIDE_API_URL="http://localhost:8899/"
|
||||
REACT_APP_OVERRIDE_IS_ENTERPRISE="true"
|
1
ui/.gitignore
vendored
1
ui/.gitignore
vendored
@ -16,6 +16,7 @@
|
||||
|
||||
# production
|
||||
/build
|
||||
/build-ent
|
||||
|
||||
# misc
|
||||
.DS_Store
|
||||
|
15
ui/craco.config.js
Normal file
15
ui/craco.config.js
Normal file
@ -0,0 +1,15 @@
|
||||
// this workaround fix a warning of mini-css-extract-plugin throws "Conflicting order" during build
|
||||
// https://github.com/facebook/create-react-app/issues/5372
|
||||
module.exports = {
|
||||
webpack: {
|
||||
configure: (webpackConfig) => {
|
||||
const instanceOfMiniCssExtractPlugin = webpackConfig.plugins.find(
|
||||
(plugin) => plugin.options && plugin.options.ignoreOrder != null,
|
||||
);
|
||||
if(instanceOfMiniCssExtractPlugin)
|
||||
instanceOfMiniCssExtractPlugin.options.ignoreOrder = true;
|
||||
|
||||
return webpackConfig;
|
||||
},
|
||||
}
|
||||
}
|
5547
ui/package-lock.json
generated
5547
ui/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -3,6 +3,7 @@
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@craco/craco": "^6.4.3",
|
||||
"@material-ui/core": "^4.11.3",
|
||||
"@material-ui/icons": "^4.11.2",
|
||||
"@material-ui/lab": "^4.0.0-alpha.60",
|
||||
@ -32,7 +33,6 @@
|
||||
"react-dom": "^17.0.2",
|
||||
"react-graph-vis": "^1.0.7",
|
||||
"react-lowlight": "^3.0.0",
|
||||
"react-scripts": "4.0.3",
|
||||
"react-scrollable-feed-virtualized": "^1.4.9",
|
||||
"react-syntax-highlighter": "^15.4.3",
|
||||
"react-toastify": "^8.0.3",
|
||||
@ -43,11 +43,15 @@
|
||||
"web-vitals": "^1.1.1",
|
||||
"xml-formatter": "^2.6.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"env-cmd": "^10.0.1"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "react-scripts start",
|
||||
"build": "react-scripts build",
|
||||
"test": "react-scripts test",
|
||||
"eject": "react-scripts eject"
|
||||
"start": "craco start",
|
||||
"start-ent": "./node_modules/.bin/env-cmd -f .env.enterprise craco start",
|
||||
"build": "./node_modules/.bin/env-cmd -f .env.basic craco build & BUILD_PATH='./build-ent' ./node_modules/.bin/env-cmd -f .env.enterprise craco build",
|
||||
"test": "craco test",
|
||||
"eject": "craco eject"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"extends": [
|
||||
|
@ -28,7 +28,6 @@
|
||||
<script>
|
||||
try {
|
||||
// Injected from server
|
||||
window.isEnt = __IS_STANDALONE__
|
||||
window.isOasEnabled = __IS_OAS_ENABLED__
|
||||
window.isServiceMapEnabled = __IS_SERVICE_MAP_ENABLED__
|
||||
}
|
||||
|
18
ui/src/AppChooser.tsx
Normal file
18
ui/src/AppChooser.tsx
Normal file
@ -0,0 +1,18 @@
|
||||
import React, {Suspense} from 'react';
|
||||
import LoadingOverlay from "./components/LoadingOverlay";
|
||||
|
||||
const AppChooser = () => {
|
||||
|
||||
let MainComponent;
|
||||
if (process.env.REACT_APP_OVERRIDE_IS_ENTERPRISE === "true") {
|
||||
MainComponent = React.lazy(() => import('./EntApp'));
|
||||
} else {
|
||||
MainComponent = React.lazy(() => import('./App'));
|
||||
}
|
||||
|
||||
return <Suspense fallback={<LoadingOverlay/>}>
|
||||
<MainComponent/>
|
||||
</Suspense>;
|
||||
}
|
||||
|
||||
export default AppChooser;
|
@ -1,30 +1,28 @@
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import './index.sass';
|
||||
import App from './App';
|
||||
import EntApp from "./EntApp";
|
||||
import {ToastContainer} from "react-toastify";
|
||||
import 'react-toastify/dist/ReactToastify.css';
|
||||
import {RecoilRoot} from "recoil";
|
||||
import AppChooser from "./AppChooser";
|
||||
|
||||
ReactDOM.render(
|
||||
<React.StrictMode>
|
||||
<RecoilRoot>
|
||||
<React.StrictMode>
|
||||
<>
|
||||
{window["isEnt"] ? <EntApp/> : <App/>}
|
||||
<ToastContainer
|
||||
position="bottom-right"
|
||||
autoClose={5000}
|
||||
hideProgressBar={false}
|
||||
newestOnTop={false}
|
||||
closeOnClick
|
||||
rtl={false}
|
||||
pauseOnFocusLoss
|
||||
draggable
|
||||
pauseOnHover
|
||||
/>
|
||||
<RecoilRoot>
|
||||
<AppChooser/>
|
||||
<ToastContainer
|
||||
position="bottom-right"
|
||||
autoClose={5000}
|
||||
hideProgressBar={false}
|
||||
newestOnTop={false}
|
||||
closeOnClick
|
||||
rtl={false}
|
||||
pauseOnFocusLoss
|
||||
draggable
|
||||
pauseOnHover
|
||||
/>
|
||||
</RecoilRoot>
|
||||
</>
|
||||
</RecoilRoot>
|
||||
</React.StrictMode>,
|
||||
document.getElementById('root')
|
||||
);
|
||||
</React.StrictMode>,
|
||||
document.getElementById('root'));
|
||||
|
Loading…
Reference in New Issue
Block a user