minor UI fix, minot data processing improvements

This commit is contained in:
Антон
2026-01-09 21:05:02 +03:00
parent facde3b80e
commit de09326c38
5 changed files with 47 additions and 19 deletions

View File

@@ -147,20 +147,24 @@ const renderChart = () => {
{
label: !isSpeedMode.value ? 'Received (MB)' : 'RX Mbps',
data: dataRx,
borderColor: '#27ae60',
backgroundColor: 'rgba(39, 174, 96, 0.1)',
borderColor: '#3fb950',
backgroundColor: 'rgba(63, 185, 80, 0.15)',
borderWidth: 2,
fill: true,
tension: 0.3
tension: 0.3,
pointRadius: 3,
pointHoverRadius: 4
},
{
label: !isSpeedMode.value ? 'Sent (MB)' : 'TX Mbps',
data: dataTx,
borderColor: '#2980b9',
backgroundColor: 'rgba(41, 128, 185, 0.1)',
borderColor: '#58a6ff',
backgroundColor: 'rgba(88, 166, 255, 0.15)',
borderWidth: 2,
fill: true,
tension: 0.3
tension: 0.3,
pointRadius: 3,
pointHoverRadius: 4
}
]
},

View File

@@ -14,11 +14,25 @@ export function useFormatters() {
function parseServerDate(dateStr) {
if (!dateStr) return null;
let isoStr = dateStr.replace(' ', 'T');
if (!isoStr.endsWith('Z') && !isoStr.includes('+')) {
isoStr += 'Z';
// Handle ISO strings with Z
if (dateStr.endsWith('Z')) return new Date(dateStr);
// Assume format YYYY-MM-DD HH:MM:SS (standard backend output)
const [datePart, timePart] = dateStr.split(' ');
if (!datePart || !timePart) {
// Fallback for other formats
let isoStr = dateStr.replace(' ', 'T');
if (!isoStr.endsWith('Z') && !isoStr.includes('+')) {
isoStr += 'Z';
}
return new Date(isoStr);
}
return new Date(isoStr);
const [y, m, d] = datePart.split('-').map(Number);
const [h, min, s] = timePart.split(':').map(Number);
// Construct Date in UTC
return new Date(Date.UTC(y, m - 1, d, h, min, s !== undefined ? s : 0));
}
return {

View File

@@ -304,7 +304,7 @@ const renderMainChart = () => {
borderWidth: 2,
fill: true,
tension: 0.3,
pointRadius: 0,
pointRadius: 3,
pointHoverRadius: 4
},
{
@@ -315,7 +315,7 @@ const renderMainChart = () => {
borderWidth: 2,
fill: true,
tension: 0.3,
pointRadius: 0,
pointRadius: 3,
pointHoverRadius: 4
}
]