diff --git a/ui-ngx/src/app/core/utils.ts b/ui-ngx/src/app/core/utils.ts index 5363932826..2f4f564325 100644 --- a/ui-ngx/src/app/core/utils.ts +++ b/ui-ngx/src/app/core/utils.ts @@ -185,6 +185,12 @@ export function objToBase64(obj: any): string { })); } +export function base64toString(b64Encoded: string): string { + return decodeURIComponent(atob(b64Encoded).split('').map((c) => { + return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2); + }).join('')); +} + export function objToBase64URI(obj: any): string { return encodeURIComponent(objToBase64(obj)); } diff --git a/ui-ngx/src/app/modules/home/components/event/event-content-dialog.component.ts b/ui-ngx/src/app/modules/home/components/event/event-content-dialog.component.ts index a01c20f4be..8b5d0bc6a6 100644 --- a/ui-ngx/src/app/modules/home/components/event/event-content-dialog.component.ts +++ b/ui-ngx/src/app/modules/home/components/event/event-content-dialog.component.ts @@ -27,6 +27,7 @@ import { getAce } from '@shared/models/ace/ace.models'; import { Observable } from 'rxjs/internal/Observable'; import { beautifyJs } from '@shared/models/beautify.models'; import { of } from 'rxjs'; +import { base64toString, isLiteralObject } from '@core/utils'; export interface EventContentDialogData { content: string; @@ -64,6 +65,14 @@ export class EventContentDialogComponent extends DialogComponent