Created
January 3, 2014 05:39
-
-
Save codemoran/8233388 to your computer and use it in GitHub Desktop.
Add Graphdat to Azure
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 Azure | |
// @description Inserts a Graphdat embedded dashboard into the Azure dashboard | |
// @namespace http://userscripts.org/users/codemoran | |
// @version 0.1 | |
// @include https://manage.windowsazure.com/*Workspaces/VirtualMachineExtension/VirtualMachine* | |
// @run-at document-end | |
// @grant none | |
// ==/UserScript== | |
(function () { | |
setTimeout(function() { | |
// get the container hosting the rows | |
var container = document.getElementById('vmMonitorTab'); | |
if (!container) | |
return; | |
var chartContainer = document.getElementById('vmMonitorTabChart'); | |
if (!chartContainer) | |
return; | |
// create the graphdat iframe | |
var graphdat_iframe = document.createElement('iframe'); | |
graphdat_iframe.setAttribute('src', 'https://dashboard.graphdat.com/embed/084af98303?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', '235px'); | |
graphdat_iframe.setAttribute('width', chartContainer.offsetWidth); | |
graphdat_iframe.setAttribute('style', 'border:0px;'); | |
// add in the iframe | |
while (chartContainer.hasChildNodes()) { chartContainer.removeChild(chartContainer.lastChild); } | |
chartContainer.appendChild(graphdat_iframe); | |
}, 2000); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment