Created
January 3, 2014 05:38
-
-
Save codemoran/8233378 to your computer and use it in GitHub Desktop.
Add Graphdat to commando.io
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Add Graphdat to commando.io | |
// @description Inserts a Graphdat embedded dashboard into the commando.io dashboard | |
// @namespace http://userscripts.org/users/codemoran | |
// @version 0.1 | |
// @include https://*.commando.io/dashboard | |
// @include https://*.commando.io/execute | |
// @run-at document-end | |
// @grant none | |
// ==/UserScript== | |
(function () { | |
// get the container hosting the rows | |
var container = document.getElementsByClassName('container')[1]; | |
if (!container) | |
return; | |
// get the headers, we'll insert the iframe just before the second header | |
var header = container.getElementsByClassName('header')[1]; | |
if (!header) | |
return; | |
// create the graphdat iframe | |
var graphdat_iframe=document.createElement('iframe'); | |
graphdat_iframe.setAttribute('src', 'https://dashboard.graphdat.com/embed/d10131ee28?d-w=1&d-h=1&d-pad=10&d-header=1&d-slider=0&d-light=1&d-bg=none&d-sg-cpu=0-0-1-1'); | |
graphdat_iframe.setAttribute('allowtransparency', 'true'); | |
graphdat_iframe.setAttribute('height', '400px'); | |
graphdat_iframe.setAttribute('width', header.offsetWidth); | |
graphdat_iframe.setAttribute('style', 'border:0px;'); | |
// add in the iframe | |
container.insertBefore(graphdat_iframe, header); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment