[Monitor Dashboard]: Fix satinizer of iframe
git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-monitor-portal/trunk/monitor_dashboard@57481 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
parent
b12200fd12
commit
f5fce31d9f
|
@ -1,7 +1,7 @@
|
|||
<!--disable_transitions -->
|
||||
<div class="sidebar_main_swipe" [class.sidebar_main_active]="open">
|
||||
<div id="header_main">
|
||||
<nav class="uk-navbar">
|
||||
<nav class="uk-light">
|
||||
<a id="sidebar_main_toggle" (click)="toggleOpen()" class="sSwitch sSwitch_left">
|
||||
<span class="sSwitchIcon"></span>
|
||||
</a>
|
||||
|
@ -17,8 +17,7 @@
|
|||
</div>
|
||||
</nav>
|
||||
</div>
|
||||
<dashboard-sidebar *ngIf="sideBar" [items]="sideBar.items" [name]="stakeholder.index_name"
|
||||
class="uk-width-1-5"></dashboard-sidebar>
|
||||
<dashboard-sidebar *ngIf="sideBar" [items]="sideBar.items" [name]="stakeholder.index_name"></dashboard-sidebar>
|
||||
<div *ngIf="activeSubCategory"
|
||||
id="page_content" click-outside-or-esc targetId="page_content" (clickOutside)="toggleOpen($event)">
|
||||
<div id="page_content_inner">
|
||||
|
@ -34,7 +33,7 @@
|
|||
<div class="md-card-content">
|
||||
<span class="uk-text-muted uk-text-small uk-margin-bottom">{{number.name}}</span>
|
||||
<h2 *ngIf="numberResults.get(i)" class="uk-margin-remove">
|
||||
<span class="countUpMe">{{numberResults.get(i) | number}}</span>
|
||||
<span>{{numberResults.get(i) | number}}</span>
|
||||
</h2>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -43,7 +42,7 @@
|
|||
</div>
|
||||
<div class="uk-grid uk-grid-medium uk-margin-bottom" uk-height-match="target: div > div > h5">
|
||||
<ng-template ngFor [ngForOf]="activeSubCategory.charts" let-chart let-i="index">
|
||||
<div *ngIf="chart.isActive && chart.isPublic"
|
||||
<div *ngIf="chart.isActive && chart.isPublic && chartsActiveType.get(i)"
|
||||
[class.uk-width-1-3@m]="chart.width === 'small'"
|
||||
[class.uk-width-1-2@m]="chart.width === 'medium'"
|
||||
[class.uk-width-1-1]="chart.width === 'large'">
|
||||
|
@ -61,11 +60,11 @@
|
|||
</button>
|
||||
</div>
|
||||
<iframe *ngIf="chartsActiveType.get(i).source !== 'fake'"
|
||||
[src]="getUrlByStakeHolder(chartsActiveType.get(i))"
|
||||
class="uk-width-1-1" height="300"></iframe>
|
||||
[src]="chartsActiveType.get(i).safeResourceUrl"
|
||||
class="uk-width-1-1 uk-height-medium"></iframe>
|
||||
<img *ngIf="chartsActiveType.get(i).source === 'fake'"
|
||||
[src]="getUrlByStakeHolder(chartsActiveType.get(i))"
|
||||
class="uk-width-1-1">
|
||||
[src]="chartsActiveType.get(i).safeResourceUrl"
|
||||
class="uk-width-1-1 uk-height-medium">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -48,6 +48,7 @@ export class MonitorComponent implements OnInit, OnDestroy {
|
|||
private statisticsService: StatisticsService,
|
||||
private sidebarOpenService: SidebarOpenService,
|
||||
private seoService: SEOService,
|
||||
private cdr: ChangeDetectorRef,
|
||||
private sanitizer: DomSanitizer) {
|
||||
this.errorCodes = new ErrorCodes();
|
||||
this.errorMessages = new ErrorMessagesComponent();
|
||||
|
@ -202,9 +203,11 @@ export class MonitorComponent implements OnInit, OnDestroy {
|
|||
});
|
||||
this.activeSubCategory.charts.forEach((chart, index) => {
|
||||
if (chart.indicatorPaths.length > 0) {
|
||||
chart.indicatorPaths[0].safeResourceUrl = this.getUrlByStakeHolder(chart.indicatorPaths[0]);
|
||||
this.chartsActiveType.set(index, chart.indicatorPaths[0]);
|
||||
}
|
||||
});
|
||||
this.cdr.detectChanges();
|
||||
}
|
||||
|
||||
public getUrlByStakeHolder(indicatorPath: IndicatorPath) {
|
||||
|
@ -212,7 +215,9 @@ export class MonitorComponent implements OnInit, OnDestroy {
|
|||
}
|
||||
|
||||
public setActiveChart(index, type: string) {
|
||||
this.chartsActiveType.set(index, this.activeSubCategory.charts[index].indicatorPaths.filter(indicatorPath => indicatorPath.type === type)[0]);
|
||||
let activeChart = this.activeSubCategory.charts[index].indicatorPaths.filter(indicatorPath => indicatorPath.type === type)[0];
|
||||
activeChart.safeResourceUrl = this.getUrlByStakeHolder(activeChart);
|
||||
this.chartsActiveType.set(index, activeChart);
|
||||
}
|
||||
|
||||
private navigateToError() {
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import {SafeResourceUrl} from "@angular/platform-browser";
|
||||
|
||||
export class Stakeholder {
|
||||
id: string;
|
||||
type: string;
|
||||
|
@ -336,6 +338,7 @@ export class IndicatorPath {
|
|||
type: string; // for charts is type of chart {table, bar, column, etc}
|
||||
source:string;// for numbers is the service {statistics, search, metrics} for charts is the tool {stats-tool,old,metrics, fake}
|
||||
url: string;
|
||||
safeResourceUrl: SafeResourceUrl; // initialize on front end
|
||||
jsonPath:string[];
|
||||
constructor(type: string, source:string, url: string, jsonPath:string[]){
|
||||
this.type = type;
|
||||
|
|
Loading…
Reference in New Issue