fix28: полный production-фикс графиков, machine-auth, i18n и peer import/export
This commit is contained in:
@@ -160,11 +160,16 @@ const loadDashboard = async () => {
|
||||
}
|
||||
};
|
||||
|
||||
const xAxisLabels = computed(() => {
|
||||
const trafficXAxisLabels = computed(() => {
|
||||
const allTs = new Set<number>();
|
||||
for (const item of timeseries.value.traffic || []) {
|
||||
allTs.add(item.ts);
|
||||
}
|
||||
return Array.from(allTs).sort((a, b) => a - b);
|
||||
});
|
||||
|
||||
const systemXAxisLabels = computed(() => {
|
||||
const allTs = new Set<number>();
|
||||
for (const item of timeseries.value.system || []) {
|
||||
allTs.add(item.ts);
|
||||
}
|
||||
@@ -199,7 +204,7 @@ const trafficChartOption = computed(() => ({
|
||||
xAxis: {
|
||||
type: "category",
|
||||
boundaryGap: false,
|
||||
data: xAxisLabels.value.map((ts) => timestampToDateTime(ts)),
|
||||
data: trafficXAxisLabels.value.map((ts) => timestampToDateTime(ts)),
|
||||
},
|
||||
yAxis: {
|
||||
type: "value",
|
||||
@@ -213,14 +218,14 @@ const trafficChartOption = computed(() => ({
|
||||
type: "line",
|
||||
smooth: true,
|
||||
showSymbol: false,
|
||||
data: xAxisLabels.value.map((ts) => trafficMap.value.get(ts)?.download || 0),
|
||||
data: trafficXAxisLabels.value.map((ts) => trafficMap.value.get(ts)?.download || 0),
|
||||
},
|
||||
{
|
||||
name: t("dashboard.upload"),
|
||||
type: "line",
|
||||
smooth: true,
|
||||
showSymbol: false,
|
||||
data: xAxisLabels.value.map((ts) => trafficMap.value.get(ts)?.upload || 0),
|
||||
data: trafficXAxisLabels.value.map((ts) => trafficMap.value.get(ts)?.upload || 0),
|
||||
},
|
||||
],
|
||||
}));
|
||||
@@ -237,7 +242,7 @@ const systemChartOption = computed(() => ({
|
||||
xAxis: {
|
||||
type: "category",
|
||||
boundaryGap: false,
|
||||
data: xAxisLabels.value.map((ts) => timestampToDateTime(ts)),
|
||||
data: systemXAxisLabels.value.map((ts) => timestampToDateTime(ts)),
|
||||
},
|
||||
yAxis: {
|
||||
type: "value",
|
||||
@@ -251,14 +256,14 @@ const systemChartOption = computed(() => ({
|
||||
type: "line",
|
||||
smooth: true,
|
||||
showSymbol: false,
|
||||
data: xAxisLabels.value.map((ts) => systemMap.value.get(ts)?.cpu || 0),
|
||||
data: systemXAxisLabels.value.map((ts) => systemMap.value.get(ts)?.cpu || 0),
|
||||
},
|
||||
{
|
||||
name: t("dashboard.ram"),
|
||||
type: "line",
|
||||
smooth: true,
|
||||
showSymbol: false,
|
||||
data: xAxisLabels.value.map((ts) => systemMap.value.get(ts)?.mem || 0),
|
||||
data: systemXAxisLabels.value.map((ts) => systemMap.value.get(ts)?.mem || 0),
|
||||
},
|
||||
],
|
||||
}));
|
||||
|
||||
Reference in New Issue
Block a user