fix(jobs): keep last-run details on single lines
LocationBasedServices/smartguide/pipeline/head This commit looks good

This commit is contained in:
2026-07-21 18:25:07 +02:00
parent 16f7e665fe
commit 6cccd6d19f
8 changed files with 1 additions and 24 deletions
@@ -76,9 +76,6 @@ export class JobLogsDialogComponent implements OnInit {
private readonly logsPanel = viewChild<ElementRef<HTMLElement>>('logsPanel');
// Follow the tail (auto-scroll to the newest lines) as long as the user is at
// the bottom. Once they scroll up to read, this turns false and their scroll
// position is left untouched on the next refresh.
private followTail = true;
private readonly followThresholdPx = 24;
@@ -87,7 +84,6 @@ export class JobLogsDialogComponent implements OnInit {
timer(5000, 5000)
.pipe(takeUntilDestroyed(this.destroyRef))
.subscribe(() => this.loadRuns());
// Ticks the live "läuft seit …" duration every second.
timer(1000, 1000)
.pipe(takeUntilDestroyed(this.destroyRef))
.subscribe(() => this.nowMs.set(Date.now()));
@@ -133,7 +129,6 @@ export class JobLogsDialogComponent implements OnInit {
protected onRunSelected(runId: number): void {
const run = this.runs().find((item) => item.id === runId);
if (run) {
// A run the user just picked should open at its newest output.
this.followTail = true;
this.selectRun(run);
}
@@ -148,7 +143,6 @@ export class JobLogsDialogComponent implements OnInit {
}
private scrollToBottom(): void {
// Defer until the new log content has been rendered.
setTimeout(() => {
const panel = this.logsPanel()?.nativeElement;
if (panel) panel.scrollTop = panel.scrollHeight;
@@ -236,6 +236,7 @@ mat-paginator {
align-items: center;
gap: 2px;
font-size: 13px;
white-space: nowrap;
}
.last-run-message {
@@ -128,7 +128,6 @@ export class JobsComponent implements OnInit {
)
.subscribe((tasks) => this.setTasksPreservingPendingStops(tasks));
// Ticks the live "läuft seit …" duration in the last-run column.
timer(1000, 1000)
.pipe(takeUntilDestroyed(this.destroyRef))
.subscribe(() => this.nowMs.set(Date.now()));
@@ -39,8 +39,6 @@ export function formatScheduleCron(schedule: string | null): string {
return schedule ? `Cron: ${schedule}` : 'Nur manuell';
}
// Backend timestamps are naive UTC without a timezone suffix, so add a "Z"
// before parsing to keep them comparable with the (UTC-based) wall clock.
function appendUtcZ(value: string): string {
return /(?:Z|[+-]\d{2}:\d{2})$/.test(value) ? value : `${value}Z`;
}
@@ -61,7 +59,6 @@ export function formatUtcDateAsLocal(value: string | null | undefined): string {
}).format(new Date(appendUtcZ(value)));
}
// Compact clock format: "00:05 min", "02:28 min", and "1:01:30 h" past an hour.
export function formatDurationSeconds(totalSeconds: number): string {
const s = Math.max(0, Math.round(totalSeconds));
const pad = (n: number) => n.toString().padStart(2, '0');
@@ -74,7 +71,6 @@ export function formatDurationSeconds(totalSeconds: number): string {
return `${pad(minutes)}:${pad(seconds)} min`;
}
// Duration of a finished run, or null while it is still running.
export function formatRunDuration(run: JobRun): string | null {
if (!run.started_at || !run.finished_at) return null;
return formatDurationSeconds(
@@ -82,7 +78,6 @@ export function formatRunDuration(run: JobRun): string | null {
);
}
// Live elapsed time since the run started, relative to the given "now" (ms).
export function formatRunElapsed(run: JobRun, nowMs: number): string | null {
if (!run.started_at) return null;
return formatDurationSeconds((nowMs - toUtcMs(run.started_at)) / 1000);
@@ -4,13 +4,9 @@
gap: 12px;
min-width: 400px;
// Give the first field's floating label room so it is not clipped by the
// dialog title above it.
padding-top: 6px;
}
// Long commands / image names should wrap and stay fully readable, and the
// user can drag the field taller.
.command-input,
.image-input {
resize: vertical;
@@ -70,8 +70,6 @@ export class TaskCreateDialogComponent {
const env = this.parseEnv(value.env);
if (env === undefined) return;
// The default image is stored as null so jobs keep following the
// backend-configured image if it ever changes.
const image = value.image.trim();
this.creating.set(true);
@@ -4,13 +4,9 @@
gap: 12px;
min-width: 400px;
// Give the first field's floating label room so it is not clipped by the
// dialog title above it.
padding-top: 6px;
}
// Long commands / image names should wrap and stay fully readable, and the
// user can drag the field taller.
.command-input,
.image-input {
resize: vertical;
@@ -86,8 +86,6 @@ export class TaskEditDialogComponent {
const env = this.parseEnv(value.env);
if (env === undefined) return;
// The default image is stored as null so the job keeps following the
// backend-configured image if it ever changes.
const image = value.image.trim();
this.saving.set(true);