blob: 169cad04112bef9aa534881062b78cd147a67627 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
import {Component, OnInit, Input} from "@angular/core";
import { URLSearchParams } from '@angular/http';
import {Plugin} from "app/models";
@Component({
selector: 'plugin-frame',
templateUrl: './plugin-frame.component.html',
styleUrls:['plugin-frame.component.less']
})
export class PluginFrameComponent implements OnInit {
@Input() plugin: Plugin;
@Input() queryParams: Object;
pluginUrl: string;
private urlSearchParams: URLSearchParams;
constructor() {
this.urlSearchParams = new URLSearchParams();
}
ngOnInit(): void {
this.pluginUrl = this.plugin.pluginProtocol + "://" +
this.plugin.pluginHost + ":" +
this.plugin.pluginPort +
this.plugin.pluginPath;
if (this.queryParams && !_.isEmpty(this.queryParams)) {
_.forOwn(this.queryParams, (value, key) => {
this.urlSearchParams.set(key, value);
});
this.pluginUrl += '?';
this.pluginUrl += this.urlSearchParams.toString();
}
}
}
|