From b0fee5f46fb498f6f938be738e41686075507cd6 Mon Sep 17 00:00:00 2001 From: Selim Emre Date: Fri, 11 Mar 2022 13:56:47 +0300 Subject: [PATCH 1/2] Add info for trial license expire --- package.json | 3 ++- src/app/app.page/app.definitions.ts | 11 ++++++++++ src/app/app.page/app.page.component.html | 4 +--- src/app/app.page/app.page.component.ts | 21 +++++++++++++++++-- .../dashboard/overview/overview.component.ts | 3 +-- src/app/rest/auth.service.ts | 3 +-- .../server.settings.component.ts | 11 +--------- 7 files changed, 36 insertions(+), 20 deletions(-) diff --git a/package.json b/package.json index ec7af640..a820644a 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "postinstall": "node patch.js", "ng": "ng", "start": "ng serve", - "build": "ng build", + "build": "ng build --prod", "test": "ng test", "lint": "ng lint", "e2e": "ng e2e" @@ -31,6 +31,7 @@ "@angular/platform-browser-dynamic": "^10.0.8", "@angular/platform-server": "^10.0.8", "@angular/router": "^10.0.8", + "@antmedia/webrtc_adaptor": "^2.4.2-SNAPSHOT", "@ngui/map": "0.30.3", "@ngui/ngui": "0.15.2", "@types/googlemaps": "3.39.11", diff --git a/src/app/app.page/app.definitions.ts b/src/app/app.page/app.definitions.ts index c2cc78f3..116f9251 100644 --- a/src/app/app.page/app.definitions.ts +++ b/src/app/app.page/app.definitions.ts @@ -177,6 +177,17 @@ export class ServerSettings { ) {} } + +export declare class Licence { + licenceId: string; + startDate: number; + endDate: number; + type: string; + licenceCount: string; + owner: string; + status: string; +} + export class AppSettings { constructor(public mp4MuxingEnabled: boolean, diff --git a/src/app/app.page/app.page.component.html b/src/app/app.page/app.page.component.html index e5594eec..2f5051be 100644 --- a/src/app/app.page/app.page.component.html +++ b/src/app/app.page/app.page.component.html @@ -4,9 +4,7 @@
-
+
diff --git a/src/app/app.page/app.page.component.ts b/src/app/app.page/app.page.component.ts index 9dd8fe75..b6631d4f 100644 --- a/src/app/app.page/app.page.component.ts +++ b/src/app/app.page/app.page.component.ts @@ -22,7 +22,7 @@ import { MatPaginator, MatPaginatorIntl, PageEvent } from "@angular/material/pag import { MatTableDataSource } from "@angular/material/table" import { MatSort } from "@angular/material/sort" import "rxjs/add/operator/toPromise"; -import { AppSettings, ServerSettings } from "./app.definitions"; +import { AppSettings, ServerSettings, Licence } from "./app.definitions"; import { SelectionModel } from "@angular/cdk/collections"; import { @@ -57,7 +57,6 @@ declare var Chartist: any; declare var swal: any; declare var classie: any; - const ERROR_SOCIAL_ENDPOINT_UNDEFINED_CLIENT_ID = -1; const ERROR_SOCIAL_ENDPOINT_UNDEFINED_ENDPOINT = -2; @@ -188,6 +187,8 @@ export class AppPageComponent implements OnInit, OnDestroy, AfterViewInit { public clusterNodes: ClusterNode[]; public user: User; public currentClusterNode: string; + public currentLicence : Licence; + public licenseText:string; public appSettings: AppSettings; // = new AppSettings(false, true, true, 5, 2, "event", "no clientid", "no fb secret", "no youtube cid", "no youtube secre", "no pers cid", "no pers sec"); @@ -443,6 +444,22 @@ export class AppPageComponent implements OnInit, OnDestroy, AfterViewInit { this.getSettings(); this.restService.isEnterpriseEdition().subscribe(data => { this.isEnterpriseEdition = data["success"]; + if(this.isEnterpriseEdition){ + this.restService.getLastLicenseStatus().subscribe(data => { + this.currentLicence = data; + const currentDate = new Date(); + const licenseDate = new Date(this.currentLicence.endDate); + + const daysDiff:number = Math.floor(Math.abs(Number(licenseDate) - Number(currentDate)) / (1000*60*60*24)); + + if(this.currentLicence.type == "trial" && daysDiff < 7){ + this.licenseText = ""; + } + }, error => { show403Error(error); }); + } + else{ + this.licenseText = "Enterprise Edition for Ultra Low Latency Streaming"; + } }, error => { show403Error(error); }); if (scope == "system") { diff --git a/src/app/dashboard/overview/overview.component.ts b/src/app/dashboard/overview/overview.component.ts index bb2f190f..0fa4504f 100644 --- a/src/app/dashboard/overview/overview.component.ts +++ b/src/app/dashboard/overview/overview.component.ts @@ -4,10 +4,9 @@ import {SupportRestService} from '../../rest/support.service'; import {Router} from '@angular/router'; import 'rxjs/add/operator/map'; import 'rxjs/add/operator/catch'; -import {Licence} from "../../server.settings/server.settings.component"; import {AuthService, show403Error} from "../../rest/auth.service"; import {SupportRequest} from "../../support/support.definitions"; -import {ServerSettings} from "../../app.page/app.definitions"; +import {ServerSettings,Licence} from "../../app.page/app.definitions"; import {Locale} from "../../locale/locale"; declare var $: any; diff --git a/src/app/rest/auth.service.ts b/src/app/rest/auth.service.ts index 000a4d60..5c881e9e 100644 --- a/src/app/rest/auth.service.ts +++ b/src/app/rest/auth.service.ts @@ -2,8 +2,7 @@ import {Injectable} from '@angular/core'; import {Observable} from 'rxjs'; import {CanActivate, Router} from '@angular/router'; import {RestService, User} from './rest.service'; -import {Licence} from "../server.settings/server.settings.component"; -import {ServerSettings} from "../app.page/app.definitions"; +import {ServerSettings,Licence} from "../app.page/app.definitions"; import {DatePipe} from '@angular/common'; import { LOCAL_STORAGE_SCOPE_KEY } from 'app/pages/login/login.component'; diff --git a/src/app/server.settings/server.settings.component.ts b/src/app/server.settings/server.settings.component.ts index 33dbd6fa..c8986272 100644 --- a/src/app/server.settings/server.settings.component.ts +++ b/src/app/server.settings/server.settings.component.ts @@ -7,7 +7,7 @@ import {MatDialog } from '@angular/material/dialog'; import {AfterViewInit, Component, Injectable, OnInit, OnDestroy, ChangeDetectorRef, ViewChild, Input, Output} from '@angular/core'; -import {ServerSettings, UserInfoTable, UserInf} from "../app.page/app.definitions"; +import {ServerSettings, UserInfoTable, UserInf, Licence} from "../app.page/app.definitions"; import {Locale} from "../locale/locale"; import {AuthService, show403Error} from "../rest/auth.service"; import {RestService, User} from "../rest/rest.service"; @@ -27,15 +27,6 @@ import 'rxjs/add/operator/catch'; declare var $:any; declare var swal: any; -export class Licence { - licenceId: string; - startDate: number; - endDate: number; - type: string; - licenceCount: string; - owner: string; - status: string;} - @Component({ moduleId: module.id, selector: 'server.settings', From a41870d675320fe1e2e6576e3328fc8c5f1b97fa Mon Sep 17 00:00:00 2001 From: Selim Emre Date: Fri, 11 Mar 2022 14:03:17 +0300 Subject: [PATCH 2/2] Remove unnecessary npm package --- package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/package.json b/package.json index a820644a..34d584bf 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,6 @@ "@angular/platform-browser-dynamic": "^10.0.8", "@angular/platform-server": "^10.0.8", "@angular/router": "^10.0.8", - "@antmedia/webrtc_adaptor": "^2.4.2-SNAPSHOT", "@ngui/map": "0.30.3", "@ngui/ngui": "0.15.2", "@types/googlemaps": "3.39.11",