diff --git a/apps/red-ui/src/app/app-config/app-config.service.ts b/apps/red-ui/src/app/app-config/app-config.service.ts index 2cbf0630e..1fdb913e6 100644 --- a/apps/red-ui/src/app/app-config/app-config.service.ts +++ b/apps/red-ui/src/app/app-config/app-config.service.ts @@ -19,9 +19,10 @@ export enum AppConfigKey { BACKEND_APP_VERSION = 'BACKEND_APP_VERSION', FRONTEND_APP_VERSION = 'FRONTEND_APP_VERSION', EULA_URL = 'EULA_URL', - LICENSEE = 'LICENSEE', - LICENSING_START = 'LICENSING_START', - LICENSING_END = 'LICENSING_END' + LICENSE_CUSTOMER = 'LICENSE_CUSTOMER', + LICENSE_START = 'LICENSING_START', + LICENSE_END = 'LICENSING_END', + LICENSE_PAGE_COUNT = 'LICENSE_PAGE_COUNT' } @Injectable({ @@ -37,7 +38,7 @@ export class AppConfigService { tap((config) => { console.log('[REDACTION] Started with config: ', config); this._config = config; - this._config["FRONTEND_APP_VERSION"] = version; + this._config['FRONTEND_APP_VERSION'] = version; this._titleService.setTitle(this.getConfig(AppConfigKey.APP_NAME, 'DDA-R')); }) ); diff --git a/apps/red-ui/src/app/screens/admin/license-information-screen/license-information-screen.component.html b/apps/red-ui/src/app/screens/admin/license-information-screen/license-information-screen.component.html index 4ee4d0e94..a49964d60 100644 --- a/apps/red-ui/src/app/screens/admin/license-information-screen/license-information-screen.component.html +++ b/apps/red-ui/src/app/screens/admin/license-information-screen/license-information-screen.component.html @@ -52,12 +52,17 @@
-
{{ appConfigService.getConfig('LICENSEE', '-') }}
+
{{ appConfigService.getConfig('LICENSE_CUSTOMER', '-') }}
-
{{ appConfigService.getConfig('LICENSING_START', '-') }} / {{ appConfigService.getConfig('LICENSING_END', '-') }}
+
{{ appConfigService.getConfig('LICENSE_START', '-') }} / {{ appConfigService.getConfig('LICENSE_END', '-') }}
+
+ +
+
{{ 'license-info-screen.licensed-page-count' | translate }}
+
{{ totalLicensedNumberOfPages }}
@@ -74,11 +79,7 @@
-
- {{ currentInfo.numberOfAnalyzedPages }} ({{ - (currentInfo.numberOfAnalyzedPages / totalInfo.numberOfAnalyzedPages) * 100 | number: '1.0-2' - }}%) -
+
{{ currentInfo.numberOfAnalyzedPages }} ({{ analysisPercentageOfLicense | number: '1.0-2' }}%)
diff --git a/apps/red-ui/src/app/screens/admin/license-information-screen/license-information-screen.component.ts b/apps/red-ui/src/app/screens/admin/license-information-screen/license-information-screen.component.ts index 6d5ecb7aa..83837222f 100644 --- a/apps/red-ui/src/app/screens/admin/license-information-screen/license-information-screen.component.ts +++ b/apps/red-ui/src/app/screens/admin/license-information-screen/license-information-screen.component.ts @@ -13,6 +13,8 @@ export class LicenseInformationScreenComponent { public currentInfo: LicenseReport = {}; public totalInfo: LicenseReport = {}; public unlicensedInfo: LicenseReport = {}; + public totalLicensedNumberOfPages: number = 0; + public analysisPercentageOfLicense: number = 100; public viewReady = false; constructor( @@ -20,6 +22,7 @@ export class LicenseInformationScreenComponent { private readonly _licenseReportController: LicenseReportControllerService, public readonly appConfigService: AppConfigService ) { + this.totalLicensedNumberOfPages = this.appConfigService.getConfig('LICENSE_PAGE_COUNT', 0); const startDate = moment(this.appConfigService.getConfig('LICENSING_START'), 'DD-MM-YYYY'); const endDate = moment(this.appConfigService.getConfig('LICENSING_END'), 'DD-MM-YYYY'); const currentConfig = { @@ -38,6 +41,8 @@ export class LicenseInformationScreenComponent { Promise.all(promises).then((reports) => { [this.currentInfo, this.totalInfo, this.unlicensedInfo] = reports; this.viewReady = true; + this.analysisPercentageOfLicense = + this.totalLicensedNumberOfPages > 0 ? (this.currentInfo.numberOfAnalyzedPages / this.totalLicensedNumberOfPages) * 100 : 100; }); } diff --git a/apps/red-ui/src/assets/config/config.json b/apps/red-ui/src/assets/config/config.json index 63ae17c1c..066302614 100644 --- a/apps/red-ui/src/assets/config/config.json +++ b/apps/red-ui/src/assets/config/config.json @@ -5,7 +5,8 @@ "BACKEND_APP_VERSION": "4.4.40", "FRONTEND_APP_VERSION": "1.0", "EULA_URL": "EULA_URL", - "LICENSEE": "Redaction License", - "LICENSING_START": "01-01-2021", - "LICENSING_END": "31-12-2021" + "LICENSE_CUSTOMER": "Development License", + "LICENSE_START": "01-01-2021", + "LICENSE_END": "31-12-2021", + "LICENSE_PAGE_COUNT": 1000000 } diff --git a/apps/red-ui/src/assets/i18n/en.json b/apps/red-ui/src/assets/i18n/en.json index 5d73855a9..3660dfd7e 100644 --- a/apps/red-ui/src/assets/i18n/en.json +++ b/apps/red-ui/src/assets/i18n/en.json @@ -757,6 +757,7 @@ "analyzed-pages": "Analyzed Pages", "usage-details": "Usage Details", "total-analyzed": "Total Analyzed Pages Since {{date}}", + "licensed-page-count": "Number of licensed pages", "current-analyzed": "Analyzed Pages in Current Licensing Period", "unlicensed-analyzed": "Unlicensed Analyzed Pages" }, diff --git a/docker/red-ui/docker-entrypoint.sh b/docker/red-ui/docker-entrypoint.sh index 509f65f4a..8ac70257f 100755 --- a/docker/red-ui/docker-entrypoint.sh +++ b/docker/red-ui/docker-entrypoint.sh @@ -9,12 +9,21 @@ ADMIN_CONTACT_URL="${ADMIN_CONTACT_URL:-}" AUTO_READ_TIME="${AUTO_READ_TIME:-1.5}" MAX_FILE_SIZE_MB="${MAX_FILE_SIZE_MB:-50}" +LICENSING_START="${LICENSING_START:-01-01-2021}" +LICENSING_END="${LICENSING_END:-31-12-2021}" +LICENSE_PAGE_COUNT="${LICENSE_PAGE_COUNT:-1000000}" +LICENSE_CUSTOMER="${LICENSE_CUSTOMER:-Developement License}" + echo '{ "OAUTH_CLIENT_ID":"'"$OAUTH_CLIENT_ID"'", "OAUTH_URL":"'"$OAUTH_URL"'", "ADMIN_CONTACT_NAME":"'"$ADMIN_CONTACT_NAME"'", "ADMIN_CONTACT_URL":"'"$ADMIN_CONTACT_URL"'", + "LICENSING_START":"'"$LICENSING_START"'", + "LICENSING_END":"'"$LICENSING_END"'", + "LICENSE_PAGE_COUNT":'"$LICENSE_PAGE_COUNT"', + "LICENSE_CUSTOMER":"'"$LICENSE_CUSTOMER"'", "APP_NAME":"'"$APP_NAME"'", "AUTO_READ_TIME":'"$AUTO_READ_TIME"', "MAX_FILE_SIZE_MB":'"$MAX_FILE_SIZE_MB"',