feat(jobs): show Nexus registry reachability next to the Docker daemon
This commit is contained in:
@@ -18,37 +18,86 @@
|
||||
</button>
|
||||
</header>
|
||||
|
||||
<mat-card appearance="outlined" class="docker-health-card">
|
||||
<mat-card-content class="docker-health-content">
|
||||
<div class="docker-health-info">
|
||||
<span
|
||||
class="docker-state-dot"
|
||||
[class.docker-state-dot--ok]="dockerHealth()?.reachable"
|
||||
[class.docker-state-dot--error]="
|
||||
dockerHealth() && !dockerHealth()?.reachable
|
||||
">
|
||||
</span>
|
||||
<div>
|
||||
<strong>Docker-Daemon</strong>
|
||||
<div class="docker-health-detail">
|
||||
{{ dockerHealth()?.reachable ? 'Erreichbar' : 'Nicht erreichbar' }}
|
||||
@if (dockerHealth()?.detail) {
|
||||
<span> · {{ dockerHealth()?.detail }}</span>
|
||||
}
|
||||
<div class="health-cards">
|
||||
<mat-card appearance="outlined" class="health-card">
|
||||
<mat-card-content class="health-content">
|
||||
<div class="health-info">
|
||||
<span
|
||||
class="state-dot"
|
||||
[class.state-dot--ok]="dockerHealth()?.reachable"
|
||||
[class.state-dot--error]="
|
||||
dockerHealth() && !dockerHealth()?.reachable
|
||||
">
|
||||
</span>
|
||||
<div class="health-text">
|
||||
<strong>Docker-Daemon</strong>
|
||||
<div class="health-detail">
|
||||
{{
|
||||
dockerHealth()?.reachable ? 'Erreichbar' : 'Nicht erreichbar'
|
||||
}}
|
||||
@if (dockerHealth()?.detail) {
|
||||
<span> · {{ dockerHealth()?.detail }}</span>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<button
|
||||
mat-icon-button
|
||||
type="button"
|
||||
aria-label="Docker-Status aktualisieren"
|
||||
matTooltip="Docker-Status aktualisieren"
|
||||
[disabled]="dockerHealthLoading()"
|
||||
(click)="refreshDockerHealth()">
|
||||
<mat-icon>refresh</mat-icon>
|
||||
</button>
|
||||
</mat-card-content>
|
||||
</mat-card>
|
||||
<button
|
||||
mat-icon-button
|
||||
type="button"
|
||||
aria-label="Docker-Status aktualisieren"
|
||||
matTooltip="Docker-Status aktualisieren"
|
||||
[disabled]="dockerHealthLoading()"
|
||||
(click)="refreshDockerHealth()">
|
||||
<mat-icon>refresh</mat-icon>
|
||||
</button>
|
||||
</mat-card-content>
|
||||
</mat-card>
|
||||
|
||||
<mat-card appearance="outlined" class="health-card">
|
||||
<mat-card-content class="health-content">
|
||||
<div class="health-info">
|
||||
<span
|
||||
class="state-dot"
|
||||
[class.state-dot--ok]="registryHealth()?.reachable"
|
||||
[class.state-dot--error]="
|
||||
registryHealth() && !registryHealth()?.reachable
|
||||
">
|
||||
</span>
|
||||
<div class="health-text">
|
||||
<div class="health-title">
|
||||
<strong>Nexus-Registry</strong>
|
||||
@if (registryHealth()?.host) {
|
||||
<code class="health-host">{{ registryHealth()?.host }}</code>
|
||||
}
|
||||
</div>
|
||||
<div class="health-detail">
|
||||
@if (registryHealthLoading() && !registryHealth()) {
|
||||
<span>Wird geprüft …</span>
|
||||
} @else {
|
||||
{{
|
||||
registryHealth()?.reachable
|
||||
? 'Erreichbar'
|
||||
: 'Nicht erreichbar'
|
||||
}}
|
||||
@if (registryHealth()?.detail) {
|
||||
<span> · {{ registryHealth()?.detail }}</span>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<button
|
||||
mat-icon-button
|
||||
type="button"
|
||||
aria-label="Nexus-Status aktualisieren"
|
||||
matTooltip="Nexus-Status aktualisieren"
|
||||
[disabled]="registryHealthLoading()"
|
||||
(click)="refreshRegistryHealth()">
|
||||
<mat-icon>refresh</mat-icon>
|
||||
</button>
|
||||
</mat-card-content>
|
||||
</mat-card>
|
||||
</div>
|
||||
|
||||
<mat-card appearance="outlined">
|
||||
<mat-card-content>
|
||||
|
||||
@@ -37,20 +37,35 @@ mat-paginator {
|
||||
background-color: var(--sg-background);
|
||||
}
|
||||
|
||||
.docker-health-content {
|
||||
.health-cards {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 16px;
|
||||
}
|
||||
|
||||
.docker-health-info {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.docker-state-dot {
|
||||
.health-card {
|
||||
flex: 1 1 0;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.health-content {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.health-info {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
gap: 12px;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.health-text {
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.state-dot {
|
||||
margin-top: 6px;
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
@@ -67,11 +82,24 @@ mat-paginator {
|
||||
}
|
||||
}
|
||||
|
||||
.docker-health-detail {
|
||||
.health-detail {
|
||||
font-size: 12px;
|
||||
color: #64748b;
|
||||
}
|
||||
|
||||
.health-title {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
gap: 8px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.health-host {
|
||||
font-size: 11px;
|
||||
color: #64748b;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
:host ::ng-deep .mat-mdc-row {
|
||||
height: 96px;
|
||||
}
|
||||
@@ -283,8 +311,7 @@ mat-paginator {
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.docker-health-content {
|
||||
.health-cards {
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@ import {
|
||||
BackgroundJobsService,
|
||||
BackgroundJobTask,
|
||||
DockerHealth,
|
||||
RegistryHealth,
|
||||
} from '../../api';
|
||||
import {
|
||||
DataTableComponent,
|
||||
@@ -89,6 +90,8 @@ export class JobsComponent implements OnInit {
|
||||
protected readonly tasks = signal<BackgroundJobTask[]>([]);
|
||||
protected readonly dockerHealth = signal<DockerHealth | null>(null);
|
||||
protected readonly dockerHealthLoading = signal(false);
|
||||
protected readonly registryHealth = signal<RegistryHealth | null>(null);
|
||||
protected readonly registryHealthLoading = signal(false);
|
||||
protected readonly deletingTaskIds = signal<ReadonlySet<number>>(new Set());
|
||||
protected readonly nowMs = signal(Date.now());
|
||||
|
||||
@@ -123,6 +126,7 @@ export class JobsComponent implements OnInit {
|
||||
ngOnInit(): void {
|
||||
this.tasks.set(this.tasksInput());
|
||||
this.dockerHealth.set(this.dockerHealthInput());
|
||||
this.refreshRegistryHealth();
|
||||
|
||||
merge(this.pollNow, this.taskRefreshTrigger)
|
||||
.pipe(
|
||||
@@ -249,6 +253,39 @@ export class JobsComponent implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
protected refreshRegistryHealth(): void {
|
||||
this.registryHealthLoading.set(true);
|
||||
this.backgroundJobsService
|
||||
.getBackgroundJobsRegistryHealth()
|
||||
.pipe(takeUntilDestroyed(this.destroyRef))
|
||||
.subscribe({
|
||||
next: (health) => {
|
||||
this.registryHealth.set(health);
|
||||
this.registryHealthLoading.set(false);
|
||||
},
|
||||
error: () => {
|
||||
this.registryHealthLoading.set(false);
|
||||
this.showError('Nexus-Status konnte nicht abgerufen werden.');
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
private notifyIfRegistryDown(): void {
|
||||
this.backgroundJobsService
|
||||
.getBackgroundJobsRegistryHealth()
|
||||
.pipe(takeUntilDestroyed(this.destroyRef))
|
||||
.subscribe({
|
||||
next: (health) => {
|
||||
this.registryHealth.set(health);
|
||||
if (!health.reachable) {
|
||||
this.showError(
|
||||
`Nexus-Registry nicht erreichbar: ${health.detail}. Die Image-Auswahl bleibt leer.`,
|
||||
);
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
protected runNow(task: BackgroundJobTask): void {
|
||||
if (['running', 'stopping'].includes(task.status)) return;
|
||||
|
||||
@@ -334,6 +371,8 @@ export class JobsComponent implements OnInit {
|
||||
}
|
||||
|
||||
protected openCreateDialog(): void {
|
||||
this.notifyIfRegistryDown();
|
||||
|
||||
const dialogRef = this.dialog.open<
|
||||
TaskCreateDialogComponent,
|
||||
void,
|
||||
@@ -359,6 +398,8 @@ export class JobsComponent implements OnInit {
|
||||
protected openEditDialog(task: BackgroundJobTask): void {
|
||||
if (['running', 'stopping'].includes(task.status)) return;
|
||||
|
||||
this.notifyIfRegistryDown();
|
||||
|
||||
const dialogRef = this.dialog.open<
|
||||
TaskEditDialogComponent,
|
||||
TaskEditDialogData,
|
||||
|
||||
Reference in New Issue
Block a user