This commit is contained in:
2025-10-23 14:24:09 +02:00
parent 29a016dbf0
commit b0fb449f2d
4 changed files with 51 additions and 12 deletions

View File

@@ -109,8 +109,8 @@
</div>
<!-- Zusätzliche IM/EX-Icons (Standort 'WAI') -->
<div *ngIf="standort === 'WAI'">
<div class="bottom-right-icon-im" *ngIf="aviso.imEx === 'IMPORT'">
<div *ngIf="standort === 'WAI' || standort === 'SBG'">
<div class="bottom-right-icon-im" *ngIf="aviso.imEx === 'IMPORT' || aviso.imEx === ''">
<img src="assets/icon/import_icon.png"
style="width: 0.7em; aspect-ratio: 10 / 12" />
</div>
@@ -139,8 +139,8 @@
</div>
<!-- IM/EX-Icons bei Hinweisen (nur Standort 'WAI') -->
<div *ngIf="standort === 'WAI'">
<div class="bottom-right-icon" *ngIf="aviso.imEx === 'IMPORT'">
<div *ngIf="standort === 'WAI' || standort === 'SBG'">
<div class="bottom-right-icon" *ngIf="aviso.imEx === 'IMPORT' || aviso.imEx === '' ">
<ion-icon name="download-outline"></ion-icon>
</div>
<div class="bottom-right-icon" *ngIf="aviso.imEx === 'EXPORT'">
@@ -185,7 +185,7 @@
<img [src]="'assets/Logos/' + avisoTvSettings[0].logo" class="logo" />
<!-- Legende für WAI (Import / Export) -->
<div *ngIf="standort === 'WAI'" class="title legendecontainer">
<div *ngIf="standort === 'WAI' || standort === 'SBG'" class="title legendecontainer">
<div class="div-import">
<img src="assets/icon/import_icon.png"
style="width: 0.8em; aspect-ratio: 10 / 12" /> = IMPORT

View File

@@ -409,10 +409,7 @@ ion-title {
left: 4%; /* 5% * 0.8 */
}
.problem,
.passport {
width: 100%;
}
/* Benutzerdefinierte Segmente anpassen */
.custom-segment {
@@ -449,4 +446,12 @@ ion-title {
.legendecontainer {
margin-left: 8%; /* 10% * 0.8 */
}
.problem {
width: 22%;
}
.passport {
width: 32%;
}
}

View File

@@ -91,6 +91,7 @@ export class AvisoPage implements OnInit, OnDestroy, AfterViewInit {
private dateSubscription: Subscription = new Subscription();
private durationSubscription: Subscription = new Subscription();
private pageRotationSubscription: Subscription | null = null;
standort = '';
standortID = 0;
@@ -603,23 +604,33 @@ export class AvisoPage implements OnInit, OnDestroy, AfterViewInit {
this.currentPageIndex = 0;
}
this.updateAvisoStatesAndCycles();
}
private startPageRotation(): void {
// Prüfen, ob wir überhaupt mehrere Seiten haben
if (!this.avisoTvSettings || this.avisoTvSettings.length === 0) {
console.warn('avisoTvSettings ist nicht verfügbar oder leer');
return;
}
if (this.pages.length <= 1) {
// Nur eine Seite
// Nur eine Seite => keine Rotation
return;
}
const seitenwechselInSek = this.avisoTvSettings[0].seitenwechselInSek;
if (typeof seitenwechselInSek === 'number' && seitenwechselInSek > 0) {
const intervalMs = seitenwechselInSek * 1000;
// Progress-Bar einmalig starten
this.startProgressBar(seitenwechselInSek);
interval(intervalMs)
// Falls noch eine alte Subscription läuft, vorher beenden
this.stopPageRotationIfRunning();
// Jetzt neue Subscription anlegen
this.pageRotationSubscription = interval(intervalMs)
.pipe(takeUntil(this.destroy$))
.subscribe(() => {
// Neue Arrivals erst beim Seitenwechsel übernehmen
@@ -633,6 +644,8 @@ export class AvisoPage implements OnInit, OnDestroy, AfterViewInit {
if (this.pages.length > 1) {
this.currentPageIndex = (this.currentPageIndex + 1) % this.pages.length;
this.cdr.detectChanges();
// Progress-Bar für nächste Runde (Seitenwechsel) erneut starten
this.startProgressBar(seitenwechselInSek);
} else {
console.warn('Keine ausreichende Anzahl von Seiten zum Wechseln');
@@ -641,8 +654,29 @@ export class AvisoPage implements OnInit, OnDestroy, AfterViewInit {
} else {
console.warn('seitenwechselInSek ist ungültig:', seitenwechselInSek);
}
if (this.pages.length > 1) {
this.restartPageRotationIfNeeded();
} else {
this.stopPageRotationIfRunning();
}
}
private stopPageRotationIfRunning(): void {
if (this.pageRotationSubscription && !this.pageRotationSubscription.closed) {
this.pageRotationSubscription.unsubscribe();
this.pageRotationSubscription = null;
}
}
private restartPageRotationIfNeeded(): void {
if (!this.pageRotationSubscription || this.pageRotationSubscription.closed) {
this.startPageRotation();
}
}
@HostListener('window:resize')
onResizeHostListener(): void {
this.paginateArrivals();

View File

@@ -1,4 +1,4 @@
export const environment = {
production: true,
baseUrl: 'https://avisotv.server.app.verag.ag/api'
baseUrl: 'https://webapp.server.app.verag.ag/api'
};