Fix preview to use hostname instead of static hostname
parent
48d2b9691e
commit
ec66ce5cc4
|
@ -5,6 +5,7 @@
|
|||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "evilportal",
|
||||
"version": "0.0.0",
|
||||
"dependencies": {
|
||||
"@angular/animations": "~9.1.11",
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue