@ -1,8 +1,8 @@
import { Component , OnInit } from '@angular/core' ;
import { Component , OnInit } from '@angular/core' ;
import { SettingsService } from '../services/settings.service' ;
import { SettingsService } from '../services/settings.service' ;
import { RequestService } from '../services/request .service';
import { LandingPageService } from '../services/landingpage .service';
import { ILandingPageSettings , ICustomizationSettings } from '../interfaces/ISettings' ;
import { ILandingPageSettings , ICustomizationSettings } from '../interfaces/ISettings' ;
import { I RequestCountModel } from '../interfaces/IRequestModel ';
import { I MediaServerStatus } from '../interfaces/IMediaServerStatus ';
import { DomSanitizer } from '@angular/platform-browser' ;
import { DomSanitizer } from '@angular/platform-browser' ;
import { ImageService } from '../services/image.service' ;
import { ImageService } from '../services/image.service' ;
@ -14,24 +14,23 @@ import { ImageService } from '../services/image.service';
} )
} )
export class LandingPageComponent implements OnInit {
export class LandingPageComponent implements OnInit {
constructor ( private settingsService : SettingsService , private requestService : RequestService ,
constructor ( private settingsService : SettingsService ,
private images : ImageService , private sanitizer : DomSanitizer ) { }
private images : ImageService , private sanitizer : DomSanitizer , private landingPageService : LandingPageService ) { }
customizationSettings : ICustomizationSettings ;
customizationSettings : ICustomizationSettings ;
landingPageSettings : ILandingPageSettings ;
landingPageSettings : ILandingPageSettings ;
requestCount : IRequestCountModel ;
background : any ;
background : any ;
mediaServerStatus : boolean ;
mediaServerStatus : IMediaServerStatus ;
ngOnInit ( ) : void {
ngOnInit ( ) : void {
this . settingsService . getCustomization ( ) . subscribe ( x = > this . customizationSettings = x ) ;
this . settingsService . getCustomization ( ) . subscribe ( x = > this . customizationSettings = x ) ;
this . settingsService . getLandingPage ( ) . subscribe ( x = > this . landingPageSettings = x ) ;
this . settingsService . getLandingPage ( ) . subscribe ( x = > this . landingPageSettings = x ) ;
this . requestService . getRequestsCount ( ) . subscribe ( x = > this . requestCount = x ) ;
this . images . getRandomBackground ( ) . subscribe ( x = > {
this . images . getRandomBackground ( ) . subscribe ( x = > {
this . background = this . sanitizer . bypassSecurityTrustStyle ( 'linear-gradient(-10deg, transparent 20%, rgba(0,0,0,0.7) 20.0%, rgba(0,0,0,0.7) 80.0%, transparent 80%), url(' + x . url + ')' ) ;
this . background = this . sanitizer . bypassSecurityTrustStyle ( 'linear-gradient(-10deg, transparent 20%, rgba(0,0,0,0.7) 20.0%, rgba(0,0,0,0.7) 80.0%, transparent 80%), url(' + x . url + ')' ) ;
} ) ;
} ) ;
this . mediaServerStatus = true ;
this . landingPageService . getServerStatus ( ) . subscribe ( x = > this . mediaServerStatus = x ) ;
}
}
}
}