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

View File

@@ -409,10 +409,7 @@ ion-title {
left: 4%; /* 5% * 0.8 */ left: 4%; /* 5% * 0.8 */
} }
.problem,
.passport {
width: 100%;
}
/* Benutzerdefinierte Segmente anpassen */ /* Benutzerdefinierte Segmente anpassen */
.custom-segment { .custom-segment {
@@ -449,4 +446,12 @@ ion-title {
.legendecontainer { .legendecontainer {
margin-left: 8%; /* 10% * 0.8 */ 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 dateSubscription: Subscription = new Subscription();
private durationSubscription: Subscription = new Subscription(); private durationSubscription: Subscription = new Subscription();
private pageRotationSubscription: Subscription | null = null;
standort = ''; standort = '';
standortID = 0; standortID = 0;
@@ -603,23 +604,33 @@ export class AvisoPage implements OnInit, OnDestroy, AfterViewInit {
this.currentPageIndex = 0; this.currentPageIndex = 0;
} }
this.updateAvisoStatesAndCycles(); this.updateAvisoStatesAndCycles();
} }
private startPageRotation(): void { private startPageRotation(): void {
// Prüfen, ob wir überhaupt mehrere Seiten haben
if (!this.avisoTvSettings || this.avisoTvSettings.length === 0) { if (!this.avisoTvSettings || this.avisoTvSettings.length === 0) {
console.warn('avisoTvSettings ist nicht verfügbar oder leer'); console.warn('avisoTvSettings ist nicht verfügbar oder leer');
return; return;
} }
if (this.pages.length <= 1) { if (this.pages.length <= 1) {
// Nur eine Seite // Nur eine Seite => keine Rotation
return; return;
} }
const seitenwechselInSek = this.avisoTvSettings[0].seitenwechselInSek; const seitenwechselInSek = this.avisoTvSettings[0].seitenwechselInSek;
if (typeof seitenwechselInSek === 'number' && seitenwechselInSek > 0) { if (typeof seitenwechselInSek === 'number' && seitenwechselInSek > 0) {
const intervalMs = seitenwechselInSek * 1000; const intervalMs = seitenwechselInSek * 1000;
// Progress-Bar einmalig starten
this.startProgressBar(seitenwechselInSek); 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$)) .pipe(takeUntil(this.destroy$))
.subscribe(() => { .subscribe(() => {
// Neue Arrivals erst beim Seitenwechsel übernehmen // Neue Arrivals erst beim Seitenwechsel übernehmen
@@ -633,6 +644,8 @@ export class AvisoPage implements OnInit, OnDestroy, AfterViewInit {
if (this.pages.length > 1) { if (this.pages.length > 1) {
this.currentPageIndex = (this.currentPageIndex + 1) % this.pages.length; this.currentPageIndex = (this.currentPageIndex + 1) % this.pages.length;
this.cdr.detectChanges(); this.cdr.detectChanges();
// Progress-Bar für nächste Runde (Seitenwechsel) erneut starten
this.startProgressBar(seitenwechselInSek); this.startProgressBar(seitenwechselInSek);
} else { } else {
console.warn('Keine ausreichende Anzahl von Seiten zum Wechseln'); console.warn('Keine ausreichende Anzahl von Seiten zum Wechseln');
@@ -641,8 +654,29 @@ export class AvisoPage implements OnInit, OnDestroy, AfterViewInit {
} else { } else {
console.warn('seitenwechselInSek ist ungültig:', seitenwechselInSek); 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') @HostListener('window:resize')
onResizeHostListener(): void { onResizeHostListener(): void {
this.paginateArrivals(); this.paginateArrivals();

View File

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