license updates

This commit is contained in:
Timo 2021-02-11 09:51:10 +02:00
parent 4c34602f77
commit e01fce424f
6 changed files with 32 additions and 14 deletions

View File

@ -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'));
})
);

View File

@ -52,12 +52,17 @@
<div class="row">
<div translate="license-info-screen.licensed-to"></div>
<div>{{ appConfigService.getConfig('LICENSEE', '-') }}</div>
<div>{{ appConfigService.getConfig('LICENSE_CUSTOMER', '-') }}</div>
</div>
<div class="row">
<div translate="license-info-screen.licensing-period"></div>
<div>{{ appConfigService.getConfig('LICENSING_START', '-') }} / {{ appConfigService.getConfig('LICENSING_END', '-') }}</div>
<div>{{ appConfigService.getConfig('LICENSE_START', '-') }} / {{ appConfigService.getConfig('LICENSE_END', '-') }}</div>
</div>
<div class="row">
<div>{{ 'license-info-screen.licensed-page-count' | translate }}</div>
<div>{{ totalLicensedNumberOfPages }}</div>
</div>
<div class="row">
@ -74,11 +79,7 @@
<div class="row">
<div translate="license-info-screen.current-analyzed"></div>
<div>
{{ currentInfo.numberOfAnalyzedPages }} ({{
(currentInfo.numberOfAnalyzedPages / totalInfo.numberOfAnalyzedPages) * 100 | number: '1.0-2'
}}%)
</div>
<div>{{ currentInfo.numberOfAnalyzedPages }} ({{ analysisPercentageOfLicense | number: '1.0-2' }}%)</div>
</div>
<div class="row" *ngIf="!!unlicensedInfo">

View File

@ -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;
});
}

View File

@ -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
}

View File

@ -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"
},

View File

@ -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"',