auto read time

This commit is contained in:
Timo Bejan 2020-11-16 12:33:23 +02:00
parent 2c19a113d4
commit 900232f8f5
3 changed files with 13 additions and 3 deletions

View File

@ -8,7 +8,8 @@ export enum AppConfigKey {
OAUTH_CLIENT_ID = 'OAUTH_CLIENT_ID',
API_URL = 'API_URL',
ADMIN_CONTACT_NAME = 'ADMIN_CONTACT_NAME',
ADMIN_CONTACT_URL = 'ADMIN_CONTACT_URL'
ADMIN_CONTACT_URL = 'ADMIN_CONTACT_URL',
AUTO_READ_TIME = 'AUTO_READ_TIME'
}
@Injectable({

View File

@ -1,7 +1,8 @@
import { Component, EventEmitter, HostListener, Input, OnChanges, OnInit, Output, SimpleChanges } from '@angular/core';
import { Component, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges } from '@angular/core';
import { ViewedPages, ViewedPagesControllerService } from '@redaction/red-ui-http';
import { AppStateService } from '../../../state/app-state.service';
import { PermissionsService } from '../../../common/service/permissions.service';
import { AppConfigKey, AppConfigService } from '../../../app-config/app-config.service';
@Component({
selector: 'redaction-page-indicator',
@ -21,6 +22,7 @@ export class PageIndicatorComponent implements OnChanges, OnInit {
constructor(
private readonly _viewedPagesControllerService: ViewedPagesControllerService,
private readonly _appStateService: AppStateService,
private readonly _appConfigService: AppConfigService,
private readonly _permissionService: PermissionsService
) {}
@ -48,7 +50,7 @@ export class PageIndicatorComponent implements OnChanges, OnInit {
if (this.active && !this.read) {
this._markPageRead();
}
}, 3 * 1000); // 3 seconds
}, this._appConfigService.getConfig(AppConfigKey.AUTO_READ_TIME, 1.5) * 1000);
}
}
}

View File

@ -3,10 +3,17 @@
OAUTH_CLIENT_ID="${OAUTH_CLIENT_ID:-gin-client}"
OAUTH_URL="${OAUTH_URL:-https://keycloak-dev.iqser.cloud/auth/realms/dev}"
API_URL="${API_URL:-}"
ADMIN_CONTACT_NAME="${ADMIN_CONTACT_NAME:-}"
ADMIN_CONTACT_URL="${ADMIN_CONTACT_URL:-}"
AUTO_READ_TIME="${AUTO_READ_TIME:-1.5}"
echo '{
"OAUTH_CLIENT_ID":"'"$OAUTH_CLIENT_ID"'",
"OAUTH_URL":"'"$OAUTH_URL"'",
"ADMIN_CONTACT_NAME":"'"$ADMIN_CONTACT_NAME"'",
"ADMIN_CONTACT_URL":"'"$ADMIN_CONTACT_URL"'",
"AUTO_READ_TIME":'"$AUTO_READ_TIME"',
"API_URL":"'"$API_URL"'"
}' > /usr/share/nginx/html/assets/config/config.json