major refactor of the dashboard and react-openapi integration #1

Merged
aetos merged 44 commits from period-selection into main 2026-05-07 11:00:54 +00:00
2 changed files with 5 additions and 5 deletions
Showing only changes of commit 38f7416942 - Show all commits

View File

@@ -25,7 +25,7 @@ export default function DashboardView({
}: ViewProps) {
const theme = useTheme();
const themeMode = theme.palette.mode;
const { mode, period, comparison } = state;
const { mode, periodType, comparison } = state;
// Resolve colors with fallbacks
const colors = React.useMemo(() => {
@@ -139,8 +139,8 @@ export default function DashboardView({
title={section.title}
accentColor={colors.primary}
colorScheme={colors}
periodType={period}
onPeriodTypeChange={(p: any) => setState(prev => ({ ...prev, period: p }))}
periodType={periodType}
onPeriodTypeChange={(p: any) => setState(prev => ({ ...prev, periodType: p }))}
comparison={comparison}
setComparison={(c: any) => setState(prev => ({ ...prev, comparison: c }))}
/>

View File

@@ -3,7 +3,7 @@ import { ChartDataPoint, HistoryChartProps, ChartData } from "./HistoryChart.mod
import HistoryChartView from "./HistoryChart.view";
export default function HistoryChart(props: HistoryChartProps) {
const { tabs, data, period, comparison } = props;
const { tabs, data, periodType, comparison } = props;
const [activeTab, setActiveTab] = React.useState<string>(tabs[0] || "");
const [startIndex, setStartIndex] = React.useState(0);
@@ -16,7 +16,7 @@ export default function HistoryChart(props: HistoryChartProps) {
rawData = data.daily || [];
} else {
const section = data[activeDataKey];
rawData = section?.[period] || [];
rawData = section?.[periodType] || [];
}
const currentData = rawData;