{
}
-const MiniPlotComponent = ({ metrics, labels }) => {
- const memoizedComponent = useMemo(() => <_MiniPlotComponent metrics={metrics} labels={labels} />, [metrics]);
+const MiniPlotComponent = ({ metrics, labels, noLabels, noBackground }) => {
+ const memoizedComponent = useMemo(() => <_MiniPlotComponent noBackground={noBackground} noLabels={noLabels} metrics={metrics} labels={labels} />, [metrics]);
return memoizedComponent;
};
diff --git a/client/src/pages/dashboard/components/plot.jsx b/client/src/pages/dashboard/components/plot.jsx
index 6040f94..ed5068a 100644
--- a/client/src/pages/dashboard/components/plot.jsx
+++ b/client/src/pages/dashboard/components/plot.jsx
@@ -95,6 +95,7 @@ const PlotComponent = ({ title, slot, data, SimpleDesign, withSelector, xAxis, z
theme.palette.primary.main.replace('rgb(', 'rgba('),
theme.palette.secondary.main.replace('rgb(', 'rgba('),
theme.palette.error.main.replace('rgb(', 'rgba('),
+ theme.palette.warning.main.replace('rgb(', 'rgba('),
],
xaxis: {
categories:
@@ -115,7 +116,7 @@ const PlotComponent = ({ title, slot, data, SimpleDesign, withSelector, xAxis, z
max: zoom.xaxis && zoom.xaxis.max,
},
yaxis: toProcess.map((thisdata, ida) => ({
- opposite: ida === 0,
+ opposite: ida % 2 === 1,
labels: {
style: {
colors: [secondary],
diff --git a/client/src/pages/dashboard/components/table.jsx b/client/src/pages/dashboard/components/table.jsx
index 3399010..14d1922 100644
--- a/client/src/pages/dashboard/components/table.jsx
+++ b/client/src/pages/dashboard/components/table.jsx
@@ -56,10 +56,18 @@ function formatDate(now, time) {
}
function descendingComparator(a, b, orderBy) {
- if (parseFloat(b[orderBy]) < parseFloat(a[orderBy])) {
+ let a1 = a[orderBy];
+ let b1 = b[orderBy];
+
+ if(orderBy != 'name') {
+ a1 = parseFloat(a["__" + orderBy]);
+ b1 = parseFloat(b["__" + orderBy]);
+ }
+
+ if (b1 < a1) {
return -1;
}
- if (parseFloat(b[orderBy]) > parseFloat(a[orderBy])) {
+ if (b1 > a1) {
return 1;
}
return 0;
@@ -162,7 +170,8 @@ const TableComponent = ({ title, data, displayMax, render, xAxis, slot, zoom}) =
return 0;
}
} else {
- return item.Values[date] ? item.Values[date].Value : 0;
+ let realIndex = item.Values.length - 1 - date
+ return item.Values[realIndex] ? item.Values[realIndex].Value : 0;
}
})
.reduce((a, b) => {
@@ -304,7 +313,7 @@ const TableComponent = ({ title, data, displayMax, render, xAxis, slot, zoom}) =
>
- {stableSort(rows, getComparator(order, "__" + orderBy)).map((row, index) => {
+ {stableSort(rows, getComparator(order, orderBy)).map((row, index) => {
const isItemSelected = false // isSelected(row.trackingNo);
const labelId = `enhanced-table-checkbox-${index}`;
diff --git a/client/src/pages/dashboard/components/utils.jsx b/client/src/pages/dashboard/components/utils.jsx
index ad3662c..ebd4f27 100644
--- a/client/src/pages/dashboard/components/utils.jsx
+++ b/client/src/pages/dashboard/components/utils.jsx
@@ -1,5 +1,5 @@
export const simplifyNumber = (num, unit) => {
- if(!num) return 0;
+ if(typeof num == 'undefined' || num === null) return 0;
num = Math.round(num * 100) / 100;
diff --git a/client/src/pages/dashboard/proxyDashboard.jsx b/client/src/pages/dashboard/proxyDashboard.jsx
index 81be379..7e35cf1 100644
--- a/client/src/pages/dashboard/proxyDashboard.jsx
+++ b/client/src/pages/dashboard/proxyDashboard.jsx
@@ -1,10 +1,12 @@
import {
Grid,
LinearProgress,
+ Tooltip,
} from '@mui/material';
import PlotComponent from './components/plot';
import TableComponent from './components/table';
+import { InfoCircleOutlined } from '@ant-design/icons';
const ProxyDashboard = ({ xAxis, zoom, setZoom, slot, metrics }) => {
console.log(metrics)
@@ -25,7 +27,6 @@ const ProxyDashboard = ({ xAxis, zoom, setZoom, slot, metrics }) => {
]} />
-
key.startsWith("cosmos.proxy.route.")).map((key) => metrics[key])
} />
@@ -37,7 +38,17 @@ const ProxyDashboard = ({ xAxis, zoom, setZoom, slot, metrics }) => {
-
+ Reasons For Blocked Requests
+ bots: Bots
+ geo: By Geolocation (blocked countries)
+ referer: By Referer
+ hostname: By Hostname (usually IP scanning threat)
+ ip-whitelists: By IP Whitelists (Including restricted to Constellation)
+ smart-shield: Smart Shield (various abuse metrics such as time, size, brute-force, concurrent requests, etc...). It does not include blocking for banned IP to save resources in case of potential attacks
+
+ } data={
Object.keys(metrics).filter((key) => key.startsWith("cosmos.proxy.blocked.")).map((key) => metrics[key])
} />
diff --git a/client/src/pages/dashboard/resourceDashboard.jsx b/client/src/pages/dashboard/resourceDashboard.jsx
index 11fc6cb..7fbb857 100644
--- a/client/src/pages/dashboard/resourceDashboard.jsx
+++ b/client/src/pages/dashboard/resourceDashboard.jsx
@@ -14,7 +14,7 @@ const ResourceDashboard = ({ xAxis, zoom, setZoom, slot, metrics }) => {