From c3c74faa4d2b92da20f5f6b1a2d06026e657415b Mon Sep 17 00:00:00 2001 From: Jose Alberto Hernandez Date: Wed, 17 Apr 2024 08:23:23 -0500 Subject: [PATCH] Masking the server configuration for external services --- .../notification/notification.component.html | 2 +- .../notification/notification.component.ts | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/app/system/external-services/notification/notification.component.html b/src/app/system/external-services/notification/notification.component.html index 3ff7dc5a2..5e5ab93de 100644 --- a/src/app/system/external-services/notification/notification.component.html +++ b/src/app/system/external-services/notification/notification.component.html @@ -16,7 +16,7 @@ {{'labels.inputs.Value' | translate}} - {{ configuration.value }} + {{ getConfigurationValue(configuration) }} diff --git a/src/app/system/external-services/notification/notification.component.ts b/src/app/system/external-services/notification/notification.component.ts index 3f3f1eec7..8b1a21860 100644 --- a/src/app/system/external-services/notification/notification.component.ts +++ b/src/app/system/external-services/notification/notification.component.ts @@ -49,4 +49,12 @@ export class NotificationComponent implements OnInit { this.dataSource.sort = this.sort; } + getConfigurationValue(configuration: any): string { + const value = configuration.value; + if (configuration.name === 'server_key') { + return value.replace(value.substr(1, value.length - 3), value.substr(1, value.length - 3).replace(/./g, '*')); + } + return value; + } + }