Tooltip für 'Alle Kennzahlen sind bereits trainiert' hinzugefügt, statischer Text entfernt
parent
5af1d40c08
commit
78e5ce16e2
|
|
@ -8,6 +8,8 @@ import Snackbar from "@mui/material/Snackbar";
|
||||||
import MuiAlert from "@mui/material/Alert";
|
import MuiAlert from "@mui/material/Alert";
|
||||||
import { useState, useEffect } from "react";
|
import { useState, useEffect } from "react";
|
||||||
import CircularProgress from "@mui/material/CircularProgress";
|
import CircularProgress from "@mui/material/CircularProgress";
|
||||||
|
import Tooltip from "@mui/material/Tooltip";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -36,9 +38,7 @@ function ConfigPage() {
|
||||||
try {
|
try {
|
||||||
const res = await fetch(`${API_HOST}/api/kpi/settings`);
|
const res = await fetch(`${API_HOST}/api/kpi/settings`);
|
||||||
const data = await res.json();
|
const data = await res.json();
|
||||||
console.log("🔍 GELADENE KPIs:", data);
|
|
||||||
const untrainedExists = data.some((kpi: any) => {
|
const untrainedExists = data.some((kpi: any) => {
|
||||||
console.log("➡️", kpi.name, "is_trained:", kpi.is_trained);
|
|
||||||
return kpi.is_trained === false;
|
return kpi.is_trained === false;
|
||||||
});
|
});
|
||||||
setHasUntrainedKPIs(untrainedExists);
|
setHasUntrainedKPIs(untrainedExists);
|
||||||
|
|
@ -137,7 +137,7 @@ function ConfigPage() {
|
||||||
setSnackbarOpen(true);
|
setSnackbarOpen(true);
|
||||||
setTrainingRunning(false);
|
setTrainingRunning(false);
|
||||||
|
|
||||||
fetchKPISettings(); // 👉 hier hinzufügen!
|
fetchKPISettings();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -179,10 +179,13 @@ function ConfigPage() {
|
||||||
</Box>
|
</Box>
|
||||||
<Box display="flex" flexDirection="column" alignItems="flex-end" gap={1}>
|
<Box display="flex" flexDirection="column" alignItems="flex-end" gap={1}>
|
||||||
<Box display="flex" gap={2}>
|
<Box display="flex" gap={2}>
|
||||||
|
{trainingRunning || !hasUntrainedKPIs ? (
|
||||||
|
<Tooltip title="Alle Kennzahlen sind bereits trainiert.">
|
||||||
|
<span>
|
||||||
<Button
|
<Button
|
||||||
variant="contained"
|
variant="contained"
|
||||||
onClick={handleTriggerTraining}
|
onClick={handleTriggerTraining}
|
||||||
disabled={trainingRunning || !hasUntrainedKPIs}
|
disabled
|
||||||
sx={{
|
sx={{
|
||||||
backgroundColor: "#383838",
|
backgroundColor: "#383838",
|
||||||
"&:hover": { backgroundColor: "#2e2e2e" },
|
"&:hover": { backgroundColor: "#2e2e2e" },
|
||||||
|
|
@ -197,6 +200,22 @@ function ConfigPage() {
|
||||||
"Neu trainieren"
|
"Neu trainieren"
|
||||||
)}
|
)}
|
||||||
</Button>
|
</Button>
|
||||||
|
</span>
|
||||||
|
</Tooltip>
|
||||||
|
) : (
|
||||||
|
<Button
|
||||||
|
variant="contained"
|
||||||
|
onClick={handleTriggerTraining}
|
||||||
|
sx={{
|
||||||
|
backgroundColor: "#383838",
|
||||||
|
"&:hover": { backgroundColor: "#2e2e2e" },
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Neu trainieren
|
||||||
|
</Button>
|
||||||
|
)}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
variant="contained"
|
variant="contained"
|
||||||
|
|
@ -209,14 +228,7 @@ function ConfigPage() {
|
||||||
Neue Kennzahl hinzufügen
|
Neue Kennzahl hinzufügen
|
||||||
</Button>
|
</Button>
|
||||||
</Box>
|
</Box>
|
||||||
|
|
||||||
{!hasUntrainedKPIs && (
|
|
||||||
<Typography variant="body2" color="text.secondary" mt={1}>
|
|
||||||
Alle Kennzahlen sind bereits trainiert.
|
|
||||||
</Typography>
|
|
||||||
)}
|
|
||||||
</Box>
|
</Box>
|
||||||
|
|
||||||
</Box>
|
</Box>
|
||||||
|
|
||||||
{/* Tabelle */}
|
{/* Tabelle */}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue