1 import {Component, OnInit, Input} from "@angular/core";
2 import { URLSearchParams } from '@angular/http';
3 import {Plugin} from "app/models";
6 selector: 'plugin-frame',
7 templateUrl: './plugin-frame.component.html',
8 styleUrls:['plugin-frame.component.less']
11 export class PluginFrameComponent implements OnInit {
13 @Input() plugin: Plugin;
14 @Input() queryParams: Object;
16 private urlSearchParams: URLSearchParams;
19 this.urlSearchParams = new URLSearchParams();
24 this.pluginUrl = this.plugin.pluginProtocol + "://" +
25 this.plugin.pluginHost + ":" +
26 this.plugin.pluginPort +
27 this.plugin.pluginPath;
29 if (this.queryParams && !_.isEmpty(this.queryParams)) {
30 _.forOwn(this.queryParams, (value, key) => {
31 this.urlSearchParams.set(key, value);
34 this.pluginUrl += '?';
35 this.pluginUrl += this.urlSearchParams.toString();