Fix preview to use hostname instead of static hostname

pull/57/head
KoalaV2 2022-10-04 19:42:13 +02:00
parent 48d2b9691e
commit ec66ce5cc4
No known key found for this signature in database
3 changed files with 8 additions and 2 deletions

View File

@ -5,6 +5,7 @@
"requires": true,
"packages": {
"": {
"name": "evilportal",
"version": "0.0.0",
"dependencies": {
"@angular/animations": "~9.1.11",

View File

@ -12,7 +12,6 @@
<br/>
<div class="previewContainer">
<iframe class="previewWindow" src="http://172.16.42.1"></iframe>
<iframe id="preview" class="previewWindow"></iframe>
</div>
</div>

View File

@ -8,6 +8,9 @@ import {MAT_DIALOG_DATA, MatDialogRef} from "@angular/material/dialog";
})
export class PreviewDialogComponent implements OnInit {
hostname = '';
hostnamediv = '';
constructor(public dialogRef: MatDialogRef<PreviewDialogComponent>,
@Inject(MAT_DIALOG_DATA) public data: any) {}
@ -16,6 +19,9 @@ export class PreviewDialogComponent implements OnInit {
}
ngOnInit(): void {
this.hostname = 'http://'+window.location.hostname;
let hostnamediv = document.getElementById('preview');
hostnamediv.setAttribute('src', this.hostname);
}
}