[release] v0.12.0-unstable36
This commit is contained in:
parent
19d69d6dd2
commit
798505f7a7
|
@ -8,6 +8,7 @@
|
||||||
- Added lazyloading to URL and Servapp pages images
|
- Added lazyloading to URL and Servapp pages images
|
||||||
- Added a dangerous IP detector that stops sending HTTP response to IPs that are abusing various shields features
|
- Added a dangerous IP detector that stops sending HTTP response to IPs that are abusing various shields features
|
||||||
- Added a button in the servapp page to easily download the docker backup
|
- Added a button in the servapp page to easily download the docker backup
|
||||||
|
- Redirect static folder to host if possible
|
||||||
- Improve display or icons [fixes #121]
|
- Improve display or icons [fixes #121]
|
||||||
- Refactored Mongo connection code [fixes #111]
|
- Refactored Mongo connection code [fixes #111]
|
||||||
- Forward simultaneously TCP and UDP [fixes #122]
|
- Forward simultaneously TCP and UDP [fixes #122]
|
||||||
|
|
|
@ -52,14 +52,14 @@ const RouteOverview = ({ routeConfig }) => {
|
||||||
<div><RouteSecurity route={routeConfig} /></div>
|
<div><RouteSecurity route={routeConfig} /></div>
|
||||||
<strong><DashboardOutlined/> Monitoring</strong>
|
<strong><DashboardOutlined/> Monitoring</strong>
|
||||||
<div>
|
<div>
|
||||||
<MiniPlotComponent metrics={[
|
<MiniPlotComponent agglo metrics={[
|
||||||
"cosmos.proxy.route.success." + routeConfig.Name,
|
"cosmos.proxy.route.success." + routeConfig.Name,
|
||||||
"cosmos.proxy.route.error." + routeConfig.Name,
|
"cosmos.proxy.route.error." + routeConfig.Name,
|
||||||
]} labels={{
|
]} labels={{
|
||||||
["cosmos.proxy.route.error." + routeConfig.Name]: "Error",
|
["cosmos.proxy.route.error." + routeConfig.Name]: "Error",
|
||||||
["cosmos.proxy.route.success." + routeConfig.Name]: "Succ."
|
["cosmos.proxy.route.success." + routeConfig.Name]: "Succ."
|
||||||
}}/>
|
}}/>
|
||||||
<MiniPlotComponent metrics={[
|
<MiniPlotComponent agglo metrics={[
|
||||||
"cosmos.proxy.route.bytes." + routeConfig.Name,
|
"cosmos.proxy.route.bytes." + routeConfig.Name,
|
||||||
"cosmos.proxy.route.time." + routeConfig.Name,
|
"cosmos.proxy.route.time." + routeConfig.Name,
|
||||||
]} labels={{
|
]} labels={{
|
||||||
|
|
|
@ -30,7 +30,7 @@ import { FormaterForMetric, formatDate, toUTC } from './utils';
|
||||||
|
|
||||||
import * as API from '../../../api';
|
import * as API from '../../../api';
|
||||||
|
|
||||||
const _MiniPlotComponent = ({metrics, labels, noLabels, noBackground}) => {
|
const _MiniPlotComponent = ({metrics, labels, noLabels, noBackground, agglo}) => {
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
const { primary, secondary } = theme.palette.text;
|
const { primary, secondary } = theme.palette.text;
|
||||||
const [dataMetrics, setDataMetrics] = useState([]);
|
const [dataMetrics, setDataMetrics] = useState([]);
|
||||||
|
@ -168,6 +168,35 @@ const _MiniPlotComponent = ({metrics, labels, noLabels, noBackground}) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const formaters = dataMetrics.map((data) => FormaterForMetric(data));
|
const formaters = dataMetrics.map((data) => FormaterForMetric(data));
|
||||||
|
|
||||||
|
const getShowValue = (agglo, dataMetric, di) => {
|
||||||
|
let showValue;
|
||||||
|
|
||||||
|
if(dataMetric.Values.length) {
|
||||||
|
if(agglo) {
|
||||||
|
let now = new Date();
|
||||||
|
now.setHours(now.getHours());
|
||||||
|
now.setMinutes(0);
|
||||||
|
now.setSeconds(0);
|
||||||
|
let key = "hour_" + toUTC(now, true);
|
||||||
|
|
||||||
|
if(key in dataMetric.ValuesAggl) {
|
||||||
|
showValue = dataMetric.ValuesAggl[key].Value
|
||||||
|
} else {
|
||||||
|
showValue = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
showValue = dataMetric.Values[dataMetric.Values.length - 1].Value
|
||||||
|
}
|
||||||
|
|
||||||
|
return formaters[di](showValue);
|
||||||
|
} else {
|
||||||
|
showValue = formaters[di](0)
|
||||||
|
}
|
||||||
|
|
||||||
|
return showValue;
|
||||||
|
}
|
||||||
|
|
||||||
return <Stack direction='row' spacing={3}
|
return <Stack direction='row' spacing={3}
|
||||||
alignItems='center' sx={{padding: '0px 20px', width: '100%', backgroundColor: noBackground ? '' : 'rgba(0,0,0,0.1)'}}
|
alignItems='center' sx={{padding: '0px 20px', width: '100%', backgroundColor: noBackground ? '' : 'rgba(0,0,0,0.1)'}}
|
||||||
|
@ -177,11 +206,11 @@ const _MiniPlotComponent = ({metrics, labels, noLabels, noBackground}) => {
|
||||||
<Stack direction='column' justifyContent={'center'} alignItems={'center'} spacing={0} style={{
|
<Stack direction='column' justifyContent={'center'} alignItems={'center'} spacing={0} style={{
|
||||||
width: '60px',
|
width: '60px',
|
||||||
}}>
|
}}>
|
||||||
{dataMetric.Values.length ? <div style={{
|
{<div style={{
|
||||||
fontWeight: 'bold',
|
fontWeight: 'bold',
|
||||||
fontSize: '110%',
|
fontSize: '110%',
|
||||||
whiteSpace: 'nowrap',
|
whiteSpace: 'nowrap',
|
||||||
}}>{formaters[di](dataMetric.Values[dataMetric.Values.length - 1].Value)}</div> : formaters[di](0)
|
}}>{getShowValue(agglo, dataMetric, di)}</div>
|
||||||
}
|
}
|
||||||
<div>
|
<div>
|
||||||
<div style={{
|
<div style={{
|
||||||
|
@ -205,8 +234,8 @@ const _MiniPlotComponent = ({metrics, labels, noLabels, noBackground}) => {
|
||||||
</Stack>
|
</Stack>
|
||||||
}
|
}
|
||||||
|
|
||||||
const MiniPlotComponent = ({ metrics, labels, noLabels, noBackground }) => {
|
const MiniPlotComponent = ({ metrics, labels, noLabels, noBackground, agglo }) => {
|
||||||
const memoizedComponent = useMemo(() => <_MiniPlotComponent noBackground={noBackground} noLabels={noLabels} metrics={metrics} labels={labels} />, [metrics]);
|
const memoizedComponent = useMemo(() => <_MiniPlotComponent noBackground={noBackground} agglo={agglo} noLabels={noLabels} metrics={metrics} labels={labels} />, [metrics]);
|
||||||
return memoizedComponent;
|
return memoizedComponent;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -254,7 +254,7 @@ const HomePage = () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const bigNb = {
|
const bigNb = {
|
||||||
fontSize: '24px',
|
fontSize: '23px',
|
||||||
fontWeight: "bold",
|
fontWeight: "bold",
|
||||||
textAlign: "center",
|
textAlign: "center",
|
||||||
color: isDark ? "white" : "black",
|
color: isDark ? "white" : "black",
|
||||||
|
|
|
@ -171,14 +171,14 @@ const ContainerOverview = ({ containerInfo, config, refresh, updatesAvailable, s
|
||||||
</div>
|
</div>
|
||||||
<strong><DashboardOutlined /> Monitoring</strong>
|
<strong><DashboardOutlined /> Monitoring</strong>
|
||||||
<div style={{ width: '96%' }}>
|
<div style={{ width: '96%' }}>
|
||||||
<MiniPlotComponent metrics={[
|
<MiniPlotComponent agglo metrics={[
|
||||||
"cosmos.system.docker.cpu." + Name.replace('/', ''),
|
"cosmos.system.docker.cpu." + Name.replace('/', ''),
|
||||||
"cosmos.system.docker.ram." + Name.replace('/', ''),
|
"cosmos.system.docker.ram." + Name.replace('/', ''),
|
||||||
]} labels={{
|
]} labels={{
|
||||||
["cosmos.system.docker.cpu." + Name.replace('/', '')]: "CPU",
|
["cosmos.system.docker.cpu." + Name.replace('/', '')]: "CPU",
|
||||||
["cosmos.system.docker.ram." + Name.replace('/', '')]: "RAM"
|
["cosmos.system.docker.ram." + Name.replace('/', '')]: "RAM"
|
||||||
}}/>
|
}}/>
|
||||||
<MiniPlotComponent metrics={[
|
<MiniPlotComponent agglo metrics={[
|
||||||
"cosmos.system.docker.netTx." + Name.replace('/', ''),
|
"cosmos.system.docker.netTx." + Name.replace('/', ''),
|
||||||
"cosmos.system.docker.netRx." + Name.replace('/', ''),
|
"cosmos.system.docker.netRx." + Name.replace('/', ''),
|
||||||
]} labels={{
|
]} labels={{
|
||||||
|
|
|
@ -304,7 +304,7 @@ const ServApps = () => {
|
||||||
</Stack>
|
</Stack>
|
||||||
</Stack>
|
</Stack>
|
||||||
<div>
|
<div>
|
||||||
<MiniPlotComponent metrics={[
|
<MiniPlotComponent agglo metrics={[
|
||||||
"cosmos.system.docker.cpu." + app.Names[0].replace('/', ''),
|
"cosmos.system.docker.cpu." + app.Names[0].replace('/', ''),
|
||||||
"cosmos.system.docker.ram." + app.Names[0].replace('/', ''),
|
"cosmos.system.docker.ram." + app.Names[0].replace('/', ''),
|
||||||
]} labels={{
|
]} labels={{
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "cosmos-server",
|
"name": "cosmos-server",
|
||||||
"version": "0.12.0-unstable35",
|
"version": "0.12.0-unstable36",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "test-server.js",
|
"main": "test-server.js",
|
||||||
"bugs": {
|
"bugs": {
|
||||||
|
|
|
@ -184,6 +184,12 @@ func RouteTo(route utils.ProxyRouteConfig) http.Handler {
|
||||||
destination := route.Target
|
destination := route.Target
|
||||||
routeType := route.Mode
|
routeType := route.Mode
|
||||||
|
|
||||||
|
if (routeType == "STATIC" || routeType == "SPA") && os.Getenv("HOSTNAME") != "" {
|
||||||
|
if _, err := os.Stat("/mnt/host"); err == nil {
|
||||||
|
destination = "/mnt/host" + destination
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(routeType == "SERVAPP" || routeType == "PROXY") {
|
if(routeType == "SERVAPP" || routeType == "PROXY") {
|
||||||
proxy, err := NewProxy(destination, route.AcceptInsecureHTTPSTarget, route.VerboseForwardHeader, route.DisableHeaderHardening, route.CORSOrigin, route)
|
proxy, err := NewProxy(destination, route.AcceptInsecureHTTPSTarget, route.VerboseForwardHeader, route.DisableHeaderHardening, route.CORSOrigin, route)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in a new issue