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 \
PYTHONUNBUFFERED=1 \
APP_HOST=0.0.0.0 \
APP_PORT=8000 \
APP_PORT=8080 \
LOG_LEVEL=info
WORKDIR /app
@ -36,6 +36,6 @@ COPY --from=frontend-build /app/webapp/frontend/dist ./webapp/frontend/dist
RUN mkdir -p /app/var/jobs
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}"]

View File

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

View File

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