|
@ -12,7 +12,12 @@ import { |
|
|
PROPERTY_SYSTEM_MESSAGE, |
|
|
PROPERTY_SYSTEM_MESSAGE, |
|
|
ghostfolioPrefix |
|
|
ghostfolioPrefix |
|
|
} from '@ghostfolio/common/config'; |
|
|
} from '@ghostfolio/common/config'; |
|
|
import { Coupon, InfoItem, User } from '@ghostfolio/common/interfaces'; |
|
|
import { |
|
|
|
|
|
Coupon, |
|
|
|
|
|
InfoItem, |
|
|
|
|
|
SystemMessage, |
|
|
|
|
|
User |
|
|
|
|
|
} from '@ghostfolio/common/interfaces'; |
|
|
import { hasPermission, permissions } from '@ghostfolio/common/permissions'; |
|
|
import { hasPermission, permissions } from '@ghostfolio/common/permissions'; |
|
|
import { |
|
|
import { |
|
|
differenceInSeconds, |
|
|
differenceInSeconds, |
|
@ -39,6 +44,7 @@ export class AdminOverviewComponent implements OnDestroy, OnInit { |
|
|
public hasPermissionToToggleReadOnlyMode: boolean; |
|
|
public hasPermissionToToggleReadOnlyMode: boolean; |
|
|
public info: InfoItem; |
|
|
public info: InfoItem; |
|
|
public permissions = permissions; |
|
|
public permissions = permissions; |
|
|
|
|
|
public systemMessage: SystemMessage; |
|
|
public transactionCount: number; |
|
|
public transactionCount: number; |
|
|
public userCount: number; |
|
|
public userCount: number; |
|
|
public user: User; |
|
|
public user: User; |
|
@ -149,8 +155,14 @@ export class AdminOverviewComponent implements OnDestroy, OnInit { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public onDeleteSystemMessage() { |
|
|
public onDeleteSystemMessage() { |
|
|
|
|
|
const confirmation = confirm( |
|
|
|
|
|
$localize`Do you really want to delete this system message?` |
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
if (confirmation === true) { |
|
|
this.putAdminSetting({ key: PROPERTY_SYSTEM_MESSAGE, value: undefined }); |
|
|
this.putAdminSetting({ key: PROPERTY_SYSTEM_MESSAGE, value: undefined }); |
|
|
} |
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
public onFlushCache() { |
|
|
public onFlushCache() { |
|
|
const confirmation = confirm( |
|
|
const confirmation = confirm( |
|
@ -184,12 +196,21 @@ export class AdminOverviewComponent implements OnDestroy, OnInit { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public onSetSystemMessage() { |
|
|
public onSetSystemMessage() { |
|
|
const systemMessage = prompt($localize`Please set your system message:`); |
|
|
const systemMessage = prompt( |
|
|
|
|
|
$localize`Please set your system message:`, |
|
|
|
|
|
JSON.stringify( |
|
|
|
|
|
this.systemMessage ?? |
|
|
|
|
|
<SystemMessage>{ |
|
|
|
|
|
message: '⚒️ Scheduled maintenance in progress...', |
|
|
|
|
|
targetGroups: ['Basic', 'Premium'] |
|
|
|
|
|
} |
|
|
|
|
|
) |
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
if (systemMessage) { |
|
|
if (systemMessage) { |
|
|
this.putAdminSetting({ |
|
|
this.putAdminSetting({ |
|
|
key: PROPERTY_SYSTEM_MESSAGE, |
|
|
key: PROPERTY_SYSTEM_MESSAGE, |
|
|
value: systemMessage |
|
|
value: JSON.parse(systemMessage) |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -208,6 +229,9 @@ export class AdminOverviewComponent implements OnDestroy, OnInit { |
|
|
this.coupons = (settings[PROPERTY_COUPONS] as Coupon[]) ?? []; |
|
|
this.coupons = (settings[PROPERTY_COUPONS] as Coupon[]) ?? []; |
|
|
this.customCurrencies = settings[PROPERTY_CURRENCIES] as string[]; |
|
|
this.customCurrencies = settings[PROPERTY_CURRENCIES] as string[]; |
|
|
this.exchangeRates = exchangeRates; |
|
|
this.exchangeRates = exchangeRates; |
|
|
|
|
|
this.systemMessage = settings[ |
|
|
|
|
|
PROPERTY_SYSTEM_MESSAGE |
|
|
|
|
|
] as SystemMessage; |
|
|
this.transactionCount = transactionCount; |
|
|
this.transactionCount = transactionCount; |
|
|
this.userCount = userCount; |
|
|
this.userCount = userCount; |
|
|
this.version = version; |
|
|
this.version = version; |
|
|