mirror of
https://github.com/dkmstr/openuds-gui.git
synced 2025-01-03 05:17:36 +03:00
Merge remote-tracking branch 'origin/v3.5'
This commit is contained in:
commit
fc7535288d
@ -12,7 +12,9 @@
|
||||
<h1 class="title">
|
||||
<uds-translate>An error has occurred</uds-translate>
|
||||
</h1>
|
||||
<p class="description" [innerHTML]="this.error | safeHtml">
|
||||
|
||||
<p class="description">
|
||||
<span *ngFor="let error of this.error" [innerHTML]="error"></span>
|
||||
</p>
|
||||
|
||||
<a mat-raised-button color="warn" routerLink="/"><uds-translate>Return</uds-translate></a>
|
||||
|
@ -7,10 +7,10 @@ declare const udsData: any;
|
||||
@Component({
|
||||
selector: 'uds-error',
|
||||
templateUrl: './error.component.html',
|
||||
styleUrls: ['./error.component.css']
|
||||
styleUrls: ['./error.component.css'],
|
||||
})
|
||||
export class ErrorComponent implements OnInit {
|
||||
error = '';
|
||||
error: string[] = [''];
|
||||
|
||||
constructor(private route: ActivatedRoute) {}
|
||||
|
||||
@ -21,13 +21,19 @@ export class ErrorComponent implements OnInit {
|
||||
getError(): void {
|
||||
const id = this.route.snapshot.paramMap.get('id');
|
||||
try {
|
||||
this.error = new TextDecoder().decode(Uint8Array.from(window.atob(id), c => (c as any).charCodeAt(c))).replace('\n', '<br/>');
|
||||
const errText = new TextDecoder()
|
||||
.decode(
|
||||
Uint8Array.from(window.atob(id), (c) => (c as any).charCodeAt(c))
|
||||
)
|
||||
.replace('<', '<')
|
||||
.replace('>', '>');
|
||||
// Split error text in lines
|
||||
this.error = errText.split('\n');
|
||||
console.log(this.error);
|
||||
udsData.error = this.error;
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
this.error = django.gettext('Invalid error string');
|
||||
this.error = [django.gettext('Invalid error string')];
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user