The Goal
I am trying to build a KPI (Key Performance Indicator) dashboard for our company.
I explored various dashboard softwares like Geckoboard but theres out of box integrations don't serve up a data well. Some tools have great API options but thats would take a large investment from our company which were not ready to commit to.
Approach
My approach will be to use the dashboards from our key softwares tools like Jira, Confluence, Aha!, Google Analytics.
What I plan to do is build single page dashboards that will cycle between each other using a Chrome extensions that cycles through browser tabs.
Each page will need data from various tools, for example, a widget from Jira, Pull request from Github, Live Users from google analytics, google docs etc.
Execution
I have two choices when loading in pieces of data, both require Iframes.
Option 1: Next Iframe in a DIV, style the div with overflow:hidden and use margins on the IFRAME to crop the page.
Option 2: Use JQuery to pull an DIV #ID from a page into an IFrame, see:
Technology
I would like to build these single pages with Angular 2, as I like using the angular-cli tool and its also our companies chosen MVC.
I could use Option 1 but i can't guarantee the data I want cropped will always be in the same spot. I have been working with Option 2 but get....
The Error:
localhost/:1 XMLHttpRequest cannot load URL. Redirect from 'URL' to 'URK' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access.
The Ask
Working with Iframes has been tough and am looking for a good reference for what it is I am trying to do. I work as a designer so don't have a great wealth of programming knowledge, If anyone could provide a good description on how I can add pieces of IFrames into an angular application that will only be served up locally would be very much appreciated
Current Code:
dashboard.component.ts
import { Component, AfterViewInit } from '@angular/core';
declare var $:any;
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss']
})
export class AppComponent implements AfterViewInit {
title = 'Dashboard!';
constructor() {
}
ngOnInit() {
}
ngAfterViewInit() {
$('#daysRemaining').load('URL #gadget-17301');
}
}
DOM
<h1>Title</h1>
<iframe id="daysRemaining"></iframe>
Note: JQuery CDN is loaded in index.html