frontend fix

This commit is contained in:
Nicolai 2026-03-17 16:46:28 +01:00
parent a803687ed6
commit 3c425d288c
3 changed files with 17 additions and 8 deletions

View File

@ -14,7 +14,7 @@ FROM python:3.13-slim AS runtime
ENV PYTHONDONTWRITEBYTECODE=1 \ ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \ PYTHONUNBUFFERED=1 \
APP_HOST=0.0.0.0 \ APP_HOST=0.0.0.0 \
APP_PORT=8000 \ APP_PORT=8080 \
LOG_LEVEL=info LOG_LEVEL=info
WORKDIR /app WORKDIR /app
@ -36,6 +36,6 @@ COPY --from=frontend-build /app/webapp/frontend/dist ./webapp/frontend/dist
RUN mkdir -p /app/var/jobs RUN mkdir -p /app/var/jobs
VOLUME ["/app/var"] VOLUME ["/app/var"]
EXPOSE 8000 EXPOSE 8080
CMD ["sh", "-c", "uvicorn webapp.backend.main:app --host ${APP_HOST} --port ${APP_PORT} --log-level ${LOG_LEVEL}"] CMD ["sh", "-c", "uvicorn webapp.backend.main:app --host ${APP_HOST} --port ${APP_PORT} --log-level ${LOG_LEVEL}"]

View File

@ -5,10 +5,10 @@ services:
dockerfile: Dockerfile dockerfile: Dockerfile
image: leag-coallog:latest image: leag-coallog:latest
ports: ports:
- "8000:8000" - "8080:8080"
environment: environment:
APP_HOST: 0.0.0.0 APP_HOST: 0.0.0.0
APP_PORT: "8000" APP_PORT: "8080"
LOG_LEVEL: info LOG_LEVEL: info
volumes: volumes:
- ./var:/app/var - ./var:/app/var

View File

@ -174,7 +174,7 @@ export default function App() {
const [solver, setSolver] = useState("highs"); const [solver, setSolver] = useState("highs");
const [stepSizeTonnes, setStepSizeTonnes] = useState("1000"); const [stepSizeTonnes, setStepSizeTonnes] = useState("1000");
const [mipGapPct, setMipGapPct] = useState("5"); const [mipGapPct, setMipGapPct] = useState("5");
const [maxRuntimeMinutes, setMaxRuntimeMinutes] = useState("10"); const [maxRuntimeMinutes, setMaxRuntimeMinutes] = useState("10.0");
const [availableSolvers, setAvailableSolvers] = useState({ const [availableSolvers, setAvailableSolvers] = useState({
highs: true, highs: true,
gurobi: false, gurobi: false,
@ -189,6 +189,13 @@ export default function App() {
const [timerRunning, setTimerRunning] = useState(false); const [timerRunning, setTimerRunning] = useState(false);
const [cancelPending, setCancelPending] = useState(false); const [cancelPending, setCancelPending] = useState(false);
const formatDecimalWithDot = (value, digits = 1) => {
const normalized = String(value ?? "").replace(",", ".");
const num = Number(normalized);
if (Number.isFinite(num)) return num.toFixed(digits);
return normalized;
};
const handleSubmit = async (event) => { const handleSubmit = async (event) => {
event.preventDefault(); event.preventDefault();
if (!file) { if (!file) {
@ -777,10 +784,12 @@ export default function App() {
type="number" type="number"
min="0.1" min="0.1"
max="1440" max="1440"
step="1" step="0.1"
value={maxRuntimeMinutes} value={maxRuntimeMinutes}
disabled={jobInProgress} disabled={jobInProgress}
onChange={(event) => setMaxRuntimeMinutes(event.target.value)} onChange={(event) =>
setMaxRuntimeMinutes(event.target.value.replace(",", "."))
}
/> />
</label> </label>
@ -814,7 +823,7 @@ export default function App() {
<p className="muted">Schrittweite: {jobStepSizeTonnes || stepSizeTonnes} t</p> <p className="muted">Schrittweite: {jobStepSizeTonnes || stepSizeTonnes} t</p>
<p className="muted">MIP Gap: {jobMipGapPct || mipGapPct}%</p> <p className="muted">MIP Gap: {jobMipGapPct || mipGapPct}%</p>
<p className="muted"> <p className="muted">
Max Laufzeit: {jobMaxRuntimeMinutes || maxRuntimeMinutes} min Max Laufzeit: {formatDecimalWithDot(jobMaxRuntimeMinutes || maxRuntimeMinutes)} min
</p> </p>
{(jobId || logText) && ( {(jobId || logText) && (
<div className="progress-panel"> <div className="progress-panel">