118 lines
4.2 KiB
HTML
118 lines
4.2 KiB
HTML
<h2 mat-dialog-title>Neuer Job</h2>
|
|
|
|
<mat-dialog-content>
|
|
<form class="create-form" [formGroup]="form">
|
|
<mat-form-field appearance="outline">
|
|
<mat-label>Name</mat-label>
|
|
<input matInput formControlName="name" />
|
|
<mat-icon
|
|
matSuffix
|
|
class="field-info"
|
|
matTooltip="Eindeutiger Anzeigename des Jobs, z.B. „News-Themen-Mapping (Testlauf)“."
|
|
>{{ HELP_ICON }}</mat-icon
|
|
>
|
|
@if (form.controls.name.invalid) {
|
|
<mat-error>Bitte einen Namen eingeben.</mat-error>
|
|
}
|
|
</mat-form-field>
|
|
|
|
<mat-form-field appearance="outline">
|
|
<mat-label>Befehl</mat-label>
|
|
<textarea
|
|
matInput
|
|
class="command-input"
|
|
rows="2"
|
|
formControlName="command"
|
|
placeholder="python sync.py --stats"></textarea>
|
|
<mat-icon
|
|
matSuffix
|
|
class="field-info"
|
|
matTooltip="Wird beim Start direkt im Container ausgeführt — wie in einem Terminal, z.B. „python sync.py --update-keywords --target-index docker-job_test“. Leer = Standard-Befehl des Images."
|
|
>{{ HELP_ICON }}</mat-icon
|
|
>
|
|
</mat-form-field>
|
|
|
|
<mat-form-field appearance="outline">
|
|
<mat-label>Image</mat-label>
|
|
<input
|
|
matInput
|
|
class="image-input"
|
|
formControlName="image"
|
|
[matAutocomplete]="imageAuto" />
|
|
<mat-autocomplete #imageAuto="matAutocomplete">
|
|
@for (image of filteredImages(); track image) {
|
|
<mat-option [value]="image">{{ image }}</mat-option>
|
|
}
|
|
</mat-autocomplete>
|
|
<mat-icon
|
|
matSuffix
|
|
class="field-info"
|
|
matTooltip="Docker-Image für den Job. Tippen filtert die aus Nexus verfügbaren Images; du kannst auch einen eigenen Wert eingeben. Images aus unserer Registry (docker.nes.uni-due.de) erhalten die INSE-Zugangsdaten (Elasticsearch/LLM) automatisch, fremde Images nicht."
|
|
>{{ HELP_ICON }}</mat-icon
|
|
>
|
|
@if (form.controls.image.invalid && form.controls.image.touched) {
|
|
<mat-error>Bitte ein Image auswählen oder eingeben.</mat-error>
|
|
}
|
|
<mat-hint>Aus Nexus wählen oder eigenes Image eingeben.</mat-hint>
|
|
</mat-form-field>
|
|
|
|
<mat-form-field appearance="outline">
|
|
<mat-label>Beschreibung (optional)</mat-label>
|
|
<textarea matInput rows="2" formControlName="description"></textarea>
|
|
<mat-icon
|
|
matSuffix
|
|
class="field-info"
|
|
matTooltip="Freitext für die Job-Tabelle: Was macht der Job, was sollte man vor dem Start wissen?"
|
|
>{{ HELP_ICON }}</mat-icon
|
|
>
|
|
</mat-form-field>
|
|
|
|
<mat-form-field appearance="outline">
|
|
<mat-label>Ziel-Index (optional)</mat-label>
|
|
<input matInput formControlName="targetIndex" />
|
|
<mat-icon
|
|
matSuffix
|
|
class="field-info"
|
|
matTooltip="Reine Anzeige-Info in der Tabelle. In welchen Index der Job wirklich schreibt, bestimmt allein der Befehl (z.B. --target-index / --output-index)."
|
|
>{{ HELP_ICON }}</mat-icon
|
|
>
|
|
</mat-form-field>
|
|
|
|
<mat-form-field appearance="outline">
|
|
<mat-label>Umgebungsvariablen (optional)</mat-label>
|
|
<textarea
|
|
matInput
|
|
rows="3"
|
|
formControlName="env"
|
|
placeholder="KEY=value"></textarea>
|
|
<mat-icon
|
|
matSuffix
|
|
class="field-info"
|
|
matTooltip="Zusätzliche Umgebungsvariablen für den Container, eine pro Zeile im Format KEY=value. Das Standard-Image bekommt die INSE-Zugangsdaten (Elasticsearch/LLM) automatisch — hier ist nur Spezielles nötig."
|
|
>{{ HELP_ICON }}</mat-icon
|
|
>
|
|
<mat-hint>Eine Variable pro Zeile im Format KEY=value.</mat-hint>
|
|
@if (form.controls.env.hasError('invalidEnv')) {
|
|
<mat-error>Ungültige Zeile — Format: KEY=value.</mat-error>
|
|
}
|
|
</mat-form-field>
|
|
</form>
|
|
|
|
@if (serverError()) {
|
|
<p class="server-error">{{ serverError() }}</p>
|
|
}
|
|
</mat-dialog-content>
|
|
|
|
<mat-dialog-actions align="end">
|
|
<button mat-button type="button" (click)="close()">Abbrechen</button>
|
|
<button
|
|
mat-flat-button
|
|
color="primary"
|
|
type="button"
|
|
[disabled]="creating()"
|
|
(click)="submit()">
|
|
<mat-icon>{{ ADD_ICON }}</mat-icon>
|
|
Anlegen
|
|
</button>
|
|
</mat-dialog-actions>
|