Revision 57481
Added by Konstantinos Triantafyllou over 4 years ago
modules/uoa-monitor-portal/trunk/monitor_dashboard/src/app/utils/entities/stakeholder.ts | ||
---|---|---|
1 |
import {SafeResourceUrl} from "@angular/platform-browser"; |
|
2 |
|
|
1 | 3 |
export class Stakeholder { |
2 | 4 |
id: string; |
3 | 5 |
type: string; |
... | ... | |
336 | 338 |
type: string; // for charts is type of chart {table, bar, column, etc} |
337 | 339 |
source:string;// for numbers is the service {statistics, search, metrics} for charts is the tool {stats-tool,old,metrics, fake} |
338 | 340 |
url: string; |
341 |
safeResourceUrl: SafeResourceUrl; // initialize on front end |
|
339 | 342 |
jsonPath:string[]; |
340 | 343 |
constructor(type: string, source:string, url: string, jsonPath:string[]){ |
341 | 344 |
this.type = type; |
modules/uoa-monitor-portal/trunk/monitor_dashboard/src/app/monitor/monitor.component.html | ||
---|---|---|
1 | 1 |
<!--disable_transitions --> |
2 | 2 |
<div class="sidebar_main_swipe" [class.sidebar_main_active]="open"> |
3 | 3 |
<div id="header_main"> |
4 |
<nav class="uk-navbar">
|
|
4 |
<nav class="uk-light">
|
|
5 | 5 |
<a id="sidebar_main_toggle" (click)="toggleOpen()" class="sSwitch sSwitch_left"> |
6 | 6 |
<span class="sSwitchIcon"></span> |
7 | 7 |
</a> |
... | ... | |
17 | 17 |
</div> |
18 | 18 |
</nav> |
19 | 19 |
</div> |
20 |
<dashboard-sidebar *ngIf="sideBar" [items]="sideBar.items" [name]="stakeholder.index_name" |
|
21 |
class="uk-width-1-5"></dashboard-sidebar> |
|
20 |
<dashboard-sidebar *ngIf="sideBar" [items]="sideBar.items" [name]="stakeholder.index_name"></dashboard-sidebar> |
|
22 | 21 |
<div *ngIf="activeSubCategory" |
23 | 22 |
id="page_content" click-outside-or-esc targetId="page_content" (clickOutside)="toggleOpen($event)"> |
24 | 23 |
<div id="page_content_inner"> |
... | ... | |
34 | 33 |
<div class="md-card-content"> |
35 | 34 |
<span class="uk-text-muted uk-text-small uk-margin-bottom">{{number.name}}</span> |
36 | 35 |
<h2 *ngIf="numberResults.get(i)" class="uk-margin-remove"> |
37 |
<span class="countUpMe">{{numberResults.get(i) | number}}</span>
|
|
36 |
<span>{{numberResults.get(i) | number}}</span> |
|
38 | 37 |
</h2> |
39 | 38 |
</div> |
40 | 39 |
</div> |
... | ... | |
43 | 42 |
</div> |
44 | 43 |
<div class="uk-grid uk-grid-medium uk-margin-bottom" uk-height-match="target: div > div > h5"> |
45 | 44 |
<ng-template ngFor [ngForOf]="activeSubCategory.charts" let-chart let-i="index"> |
46 |
<div *ngIf="chart.isActive && chart.isPublic" |
|
45 |
<div *ngIf="chart.isActive && chart.isPublic && chartsActiveType.get(i)"
|
|
47 | 46 |
[class.uk-width-1-3@m]="chart.width === 'small'" |
48 | 47 |
[class.uk-width-1-2@m]="chart.width === 'medium'" |
49 | 48 |
[class.uk-width-1-1]="chart.width === 'large'"> |
... | ... | |
61 | 60 |
</button> |
62 | 61 |
</div> |
63 | 62 |
<iframe *ngIf="chartsActiveType.get(i).source !== 'fake'" |
64 |
[src]="getUrlByStakeHolder(chartsActiveType.get(i))"
|
|
65 |
class="uk-width-1-1" height="300"></iframe>
|
|
63 |
[src]="chartsActiveType.get(i).safeResourceUrl"
|
|
64 |
class="uk-width-1-1 uk-height-medium"></iframe>
|
|
66 | 65 |
<img *ngIf="chartsActiveType.get(i).source === 'fake'" |
67 |
[src]="getUrlByStakeHolder(chartsActiveType.get(i))"
|
|
68 |
class="uk-width-1-1"> |
|
66 |
[src]="chartsActiveType.get(i).safeResourceUrl"
|
|
67 |
class="uk-width-1-1 uk-height-medium">
|
|
69 | 68 |
</div> |
70 | 69 |
</div> |
71 | 70 |
</div> |
modules/uoa-monitor-portal/trunk/monitor_dashboard/src/app/monitor/monitor.component.ts | ||
---|---|---|
48 | 48 |
private statisticsService: StatisticsService, |
49 | 49 |
private sidebarOpenService: SidebarOpenService, |
50 | 50 |
private seoService: SEOService, |
51 |
private cdr: ChangeDetectorRef, |
|
51 | 52 |
private sanitizer: DomSanitizer) { |
52 | 53 |
this.errorCodes = new ErrorCodes(); |
53 | 54 |
this.errorMessages = new ErrorMessagesComponent(); |
... | ... | |
202 | 203 |
}); |
203 | 204 |
this.activeSubCategory.charts.forEach((chart, index) => { |
204 | 205 |
if (chart.indicatorPaths.length > 0) { |
206 |
chart.indicatorPaths[0].safeResourceUrl = this.getUrlByStakeHolder(chart.indicatorPaths[0]); |
|
205 | 207 |
this.chartsActiveType.set(index, chart.indicatorPaths[0]); |
206 | 208 |
} |
207 | 209 |
}); |
210 |
this.cdr.detectChanges(); |
|
208 | 211 |
} |
209 | 212 |
|
210 | 213 |
public getUrlByStakeHolder(indicatorPath: IndicatorPath) { |
... | ... | |
212 | 215 |
} |
213 | 216 |
|
214 | 217 |
public setActiveChart(index, type: string) { |
215 |
this.chartsActiveType.set(index, this.activeSubCategory.charts[index].indicatorPaths.filter(indicatorPath => indicatorPath.type === type)[0]); |
|
218 |
let activeChart = this.activeSubCategory.charts[index].indicatorPaths.filter(indicatorPath => indicatorPath.type === type)[0]; |
|
219 |
activeChart.safeResourceUrl = this.getUrlByStakeHolder(activeChart); |
|
220 |
this.chartsActiveType.set(index, activeChart); |
|
216 | 221 |
} |
217 | 222 |
|
218 | 223 |
private navigateToError() { |
Also available in: Unified diff
[Monitor Dashboard]: Fix satinizer of iframe