catch up; southcentralus broken
This commit is contained in:
parent
ec1d7be17d
commit
05ca3892b8
|
|
@ -10,34 +10,173 @@
|
|||
// @version 0.0.1
|
||||
// ==/UserScript==
|
||||
|
||||
|
||||
// draw frame
|
||||
var zNode = document.createElement('div');
|
||||
zNode.innerHTML = 'Loading...';
|
||||
zNode.setAttribute('id', 'myContainer');
|
||||
document.body.appendChild(zNode);
|
||||
|
||||
if (window.location.href.indexOf("5d49ec10226b9e13cb6a422e") > -1) {
|
||||
console.log("azure status page");
|
||||
var componentArray = ["api", "auth", "compute", "jobs", "odbc", "webapp", "sql"];
|
||||
var regionArray = ["canadacentral", "canadaeast", "centralindia", "southindia", "westindia", +
|
||||
"switzerlandnorth", "norwayeast", "westus2", "westus", "southcentralus", +
|
||||
"westeurope", "northeurope", "ukwest", "uksouth", "southafricanorth", +
|
||||
"uaenorth", "australiaeast", "australiacentral", "australiacentral2", +
|
||||
"australiasoutheast", "japaneast", "japanwest", "koreacentral", +
|
||||
"southeastasia", "eastasia", "brazilsouth", "eastus2", "eastus", +
|
||||
"centralus", "northcentralus", "francecentral", "chinanorth2", "chinaeast2", +
|
||||
var regionArray = ["canadacentral", "canadaeast", "centralindia", "southindia", "westindia",
|
||||
"switzerlandnorth", "norwayeast", "westus2", "westus", "southcentralus",
|
||||
"westeurope", "northeurope", "ukwest", "uksouth", "southafricanorth",
|
||||
"uaenorth", "australiaeast", "australiacentral", "australiacentral2",
|
||||
"australiasoutheast", "japaneast", "japanwest", "koreacentral",
|
||||
"southeastasia", "eastasia", "brazilsouth", "eastus2", "eastus",
|
||||
"centralus", "northcentralus", "francecentral", "chinanorth2", "chinaeast2",
|
||||
"usgovvirginia", "usgovarizona"];
|
||||
var selectedComponents = new Map();
|
||||
var selectedRegions = new Map();
|
||||
|
||||
// init maps
|
||||
for (i = 0; i < componentArray.length; i++) {
|
||||
selectedComponents.set(componentArray[i], false);
|
||||
}
|
||||
for (i = 0; i < regionArray.length; i++) {
|
||||
selectedRegions.set(regionArray[i], false)
|
||||
}
|
||||
var profilesHTML = '<center><button id="controlPlanesButton type="button">Controlplanes</button> ' +
|
||||
'<button id="stagesButton type="button">Stages</button> <button id="dataPlanesButton type="button">' +
|
||||
'Dataplanes</button></center>'
|
||||
var dataplanesHTML = '<button id="canadaCentralButton" type="button">canadacentral</button>' +
|
||||
'<button id="canadaEastButton" type="button">canadaeast</button><button id="centralIndiaButton"' +
|
||||
' type="button>centralindia</button><button id="southIndiaButton" type="button">southindia</button>' +
|
||||
'<button id="westIndiaButton" type="button">westindia</button><button id="switzerlandNorthButton"' +
|
||||
' type="button">switzerlandnorth</button><button id="norwayEastButton" type="button">norwayeast</button>'
|
||||
var locationHTML = dataplanesHTML
|
||||
'Dataplanes</button></center>';
|
||||
|
||||
var controlplanesHTML = '<button id="canadaCentralButton" type="button">canadacentral</button><button id="centralIndiaButton" type="button>centralindia</button>' +
|
||||
'<button id="switzerlandNorthButton" type="button">switzerlandnorth</button><button id="norwayEastButton" type="button">norwayeast</button></br></br>' +
|
||||
'<button id="westUsButton" type="button">westus</button></br></br>' +
|
||||
'<button id="westEuropeButton" type="button">westeurope</button><button id="ukWestButton" type="button">ukwest</button>' +
|
||||
'<button id="southAfricaNorthButton" type="button">southafricanorth</button><button id="uaeNorthButton" type="button">uaenorth</button></br></br>' +
|
||||
'<button id="australiaEastButton" type="button">australiaeast</button><button id="japanEastButton" type="button">japaneast</button>' +
|
||||
'<button id="koreaCentralButton" type="button">koreacentral</button><button id="southeastAsiaButton" type="button">southeastasia</button></br></br>' +
|
||||
'<button id="brazilSouthButton" type="button">brazilsouth</button><button id="eastUs2Button" type="button">eastus2</button>' +
|
||||
'<button id="franceCentralButton" type="button">francecentral</button></br></br>' +
|
||||
'<button id="chinaNorth2Button" type="button">chinanorth2</button><button id="chinaEast2Button" type="button">chinaeast2</button>' +
|
||||
'<button id="usGovVirginiaButton" type="button">usgovvirginia</button><button id="usGovArizonaButton" type="button">usgovarizona</button>';
|
||||
var stagesHTML = '<button id="stage1Button" type="button">Stage-1</button><button id="stage1.5Button" type="button">Stage-1.5</button>' +
|
||||
'<button id="stage2Button" type="button">Stage-2</button><button id="stage3AMButton" type="button">Stage-3AM</button>' +
|
||||
'<button id="stage3PMButton" type="button">Stage-3PM</button><button id="govCloudButton" type="button">Govcloud</button>' +
|
||||
'<button id="mooncakeButton" type="button">Mooncake</button>';
|
||||
var componentsHTML = '<button id="allComponentsButton" type="button">AllComponents</button> <button id="apiButton" type="button">API</button>' +
|
||||
'<button id="authButton">Auth</button><button id="computeButton" type="button">Compute</button><button id="jobsButton" type="button">Jobs</button>' +
|
||||
'<button id="odbcButton" type="button">ODBC/JDBC</button><button id="webappButton" type="button">Webapp</button>' +
|
||||
'<button id="sqlButton" type="button">SQL</button></br></br>';
|
||||
function canadaEastButtonClickAction(zEvent) {
|
||||
toggleRegion("canadaeast");
|
||||
toggleButtonColor("canadaEastButton");
|
||||
};
|
||||
function canadaCentralButtonClickAction(zEvent) {
|
||||
toggleRegion("canadacentral");
|
||||
toggleButtonColor("canadaCentralButton");
|
||||
};
|
||||
function centralIndiaButtonClickAction(zEvent) {
|
||||
toggleRegion("centralindia");
|
||||
toggleButtonColor("centralIndiaButton");
|
||||
};
|
||||
function southIndiaButtonClickAction(zEvent) {
|
||||
toggleRegion("southindia");
|
||||
toggleButtonColor("southIndiaButton");
|
||||
};
|
||||
function westIndiaButtonClickAction(zEvent) {
|
||||
toggleRegion("westindia");
|
||||
toggleButtonColor("westIndiaButton");
|
||||
};
|
||||
function switzerlandNorthButtonClickAction(zEvent) {
|
||||
toggleRegion("switzerlandnorth");
|
||||
toggleButtonColor("switzerlandNorthButton");
|
||||
};
|
||||
function norwayEastButtonClickAction(zEvent) {
|
||||
toggleRegion("norwayeast");
|
||||
toggleButtonColor("norwayEastButton");
|
||||
};
|
||||
function westUsButtonClickAction(zEvent) {
|
||||
toggleRegion("westus");
|
||||
toggleButtonColor("westUsButton");
|
||||
};
|
||||
function westUs2ButtonClickAction(zEvent) {
|
||||
toggleRegion("westus2");
|
||||
toggleButtonColor("westUs2Button");
|
||||
};
|
||||
function southCentralUsButtonClickAction(zEvent) {
|
||||
toggleRegion("southcentralus");
|
||||
toggleButtonColor("southCentralUsButton");
|
||||
};
|
||||
function westEuropeButtonClickAction(zEvent) {
|
||||
toggleRegion("westeurope");
|
||||
toggleButtonColor("westEuropeButton");
|
||||
};
|
||||
function northEuropeButtonClickAction(zEvent) {
|
||||
toggleRegion("northeurope");
|
||||
toggleButtonColor("northEuropeButton");
|
||||
};
|
||||
function northEuropeButtonClickAction(zEvent) {
|
||||
toggleRegion("northeurope");
|
||||
toggleButtonColor("northEuropeButton");
|
||||
};
|
||||
function ukWestButtonClickAction(zEvent) {
|
||||
toggleRegion("ukwest");
|
||||
toggleButtonColor("ukWestButton");
|
||||
};
|
||||
function ukSouthButtonClickAction(zEvent) {
|
||||
toggleRegion("uksouth");
|
||||
toggleButtonColor("ukSouthButton");
|
||||
};
|
||||
function southAfricaNorthButtonClickAction(zEvent) {
|
||||
toggleRegion("southafricanorth");
|
||||
toggleButtonColor("southAfricaNorthButton");
|
||||
};
|
||||
function uaeNorthButtonClickAction(zEvent) {
|
||||
toggleRegion("uaenorth");
|
||||
toggleButtonColor("uaeNorthButton");
|
||||
};
|
||||
function loadDataplanes() {
|
||||
var locationHTML = '<button id="canadaCentralButton" type="button">canadacentral</button><button id="canadaEastButton" type="button">canadaeast</button>' +
|
||||
'<button id="centralIndiaButton" type="button">centralindia</button><button id="southIndiaButton" type="button">southindia</button>' +
|
||||
'<button id="westIndiaButton" type="button">westindia</button><button id="switzerlandNorthButton" type="button">switzerlandnorth</button>' +
|
||||
'<button id="norwayEastButton" type="button">norwayeast</button></br></br>' +
|
||||
'<button id="westUsButton" type="button">westus</button><button id="westUs2Button" type="button">westus2</button>' +
|
||||
'<button id="southCentralUsButton" type="button">southcentralus</button></br></br>' +
|
||||
'<button id="westEuropeButton" type="button">westeurope</button><button id="northEuropeButton" type="button">northeurope</button>' +
|
||||
'<button id="ukWestButton" type="button">ukwest</button><button id="ukSouthButton" type="button">uksouth</button>' +
|
||||
'<button id="southAfricaNorthButton" type="button">southafricanorth</button><button id="uaeNorthButton" type="button">uaenorth</button></br></br>' +
|
||||
'<button id="australiaEastButton" type="button">australiaeast</button><button id="australiaCentralButton" type="button">australiacentral</button>' +
|
||||
'<button id="australiaCentral2Button" type="button">australiacentral2</button><button id="australiaSoutheastButton" type="button">australiasoutheast</button>' +
|
||||
'<button id="japanEastButton" type="button">japaneast</button></br><button id="japanWestButton" type="button">japanwest</button>' +
|
||||
'<button id="koreaCentralButton" type="button">koreacentral</button><button id="southeastAsiaButton" type="button">southeastasia</button>' +
|
||||
'<button id="eastAsiaButton" type="button">eastasia</button></br></br>' +
|
||||
'<button id="brazilSouthButton" type="button">brazilsouth</button><button id="eastUs2Button" type="button">eastus2</button>' +
|
||||
'<button id="eastUsButton" type="button">eastus</button><button id="centralUsButton" type="button">centralus</button>' +
|
||||
'<button id="northCentralUsButton" type="button">northcentralus</button><button id="franceCentralButton" type="button">francecentral</button></br></br>' +
|
||||
'<button id="chinaNorth2Button" type="button">chinanorth2</button><button id="chinaEast2Button" type="button">chinaeast2</button>' +
|
||||
'<button id="usGovVirginiaButton" type="button">usgovvirginia</button><button id="usGovArizonaButton" type="button">usgovarizona</button>';
|
||||
|
||||
|
||||
zNode.innerHTML = profilesHTML + '<hr class="solid">' + locationHTML + '<hr class="solid">' + componentsHTML + '<button id="applyButton" type="button">Apply Selection</button>';
|
||||
|
||||
document.getElementById("canadaCentralButton").addEventListener("click", canadaCentralButtonClickAction, false);
|
||||
document.getElementById("canadaEastButton").addEventListener("click", canadaEastButtonClickAction, false);
|
||||
document.getElementById("centralIndiaButton").addEventListener("click", centralIndiaButtonClickAction, false);
|
||||
document.getElementById("southIndiaButton").addEventListener("click", southIndiaButtonClickAction, false);
|
||||
document.getElementById("westIndiaButton").addEventListener("click", westIndiaButtonClickAction, false);
|
||||
document.getElementById("switzerlandNorthButton").addEventListener("click", switzerlandNorthButtonClickAction, false);
|
||||
document.getElementById("norwayEastButton").addEventListener("click", norwayEastButtonClickAction, false);
|
||||
document.getElementById("westUsButton").addEventListener("click", westUsButtonClickAction, false);
|
||||
document.getElementById("westUs2Button").addEventListener("click", westUs2ButtonClickAction, false);
|
||||
document.getElementById("southCentralUsButton").addEventListener("click", southCentralUsButtonClickAction, false);
|
||||
document.getElementById("westEuropeButton").addEventListener("click", westEuropeButtonClickAction, false);
|
||||
document.getElementById("northEuropeButton").addEventListener("click", northEuropeButtonClickAction, false);
|
||||
document.getElementById("ukWestButton").addEventListener("click", ukWestButtonClickAction, false);
|
||||
document.getElementById("ukSouthButton").addEventListener("click", ukSouthButtonClickAction, false);
|
||||
document.getElementById("southAfricaNorthButton").addEventListener("click", southAfricaNorthButtonClickAction, false);
|
||||
document.getElementById("uaeNorthButton").addEventListener("click", uaeNorthButtonClickAction, false);
|
||||
// document.getElementById("Button").addEventListener("click", ButtonClickAction, false);
|
||||
};
|
||||
loadDataplanes();
|
||||
}
|
||||
|
||||
if (window.location.href.indexOf("5cf02dde58a00904bda41926") > -1) {
|
||||
console.log("aws status page");
|
||||
}
|
||||
|
||||
if (window.location.href.indexOf("60087ab5608daf0535dc8e23") > -1) {
|
||||
console.log("gcp status page");
|
||||
}
|
||||
// setup some variables
|
||||
var apiGroup = $("div.form-group").filter(":contains('API Service')");
|
||||
|
|
@ -48,141 +187,52 @@ var odbcGroup = $("div.form-group").filter(":contains('ODBC/JDBC Service')");
|
|||
var webappGroup = $("div.form-group").filter(":contains('User Interface')");
|
||||
var sqlGroup = $("div.form-group").filter(":contains('Databricks SQL')");
|
||||
|
||||
|
||||
var selectedComponents = new Map();
|
||||
var selectedRegions = new Map();
|
||||
for (i = 0; i < componentArray.length; i++) {
|
||||
selectedComponents.set(componentArray[i], false);
|
||||
}
|
||||
|
||||
for (i = 0; i < regionArray.length; i++) {
|
||||
selectedRegions.set(regionArray[i], false)
|
||||
}
|
||||
|
||||
function apply() {
|
||||
for (i = 0; i < componentArray.length; i++) {
|
||||
var component = componentArray[i];
|
||||
console.log(component)
|
||||
for (j = 0; j < regionArray.length; j++) {
|
||||
var region = regionArray[j];
|
||||
var groupName = component + "Group";
|
||||
var group = eval(groupName);
|
||||
var checkboxStr = `group.find('*').filter(\":contains('${region}')\").filter("div.clearfix.prettycheckbox.labelright.blue").children().filter("A")[0]`;
|
||||
var checkbox = eval(checkboxStr);
|
||||
if (checkRegion(region) == true && checkComponent(component) == true) {
|
||||
selectCheckbox(checkbox);
|
||||
} else {
|
||||
deselectCheckbox(checkbox);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// draw frame
|
||||
var zNode = document.createElement('div');
|
||||
zNode.innerHTML = profilesHTML + '</br>' + locationHTML + '</br></br><button id="allComponentsButton" type="button">AllComponents</button> <button id="apiButton" type="button">API</button><button id="authButton">Auth</button>' +
|
||||
'<button id="computeButton" type="button">Compute</button><button id="jobsButton" type="button">Jobs</button><button id="odbcButton" type="button">ODBC/JDBC</button>' +
|
||||
'<button id="webappButton" type="button">Webapp</button><button id="sqlButton" type="button">SQL</button></br></br>'+
|
||||
'<button id="applyButton" type="button">Apply Selection</button>';
|
||||
zNode.setAttribute('id', 'myContainer');
|
||||
document.body.appendChild(zNode);
|
||||
|
||||
// component buttons
|
||||
document.getElementById("apiButton").addEventListener(
|
||||
"click", apiButtonClickAction, false
|
||||
);
|
||||
|
||||
function apiButtonClickAction(zEvent) {
|
||||
toggleComponent("api");
|
||||
toggleButtonColor("apiButton");
|
||||
}
|
||||
document.getElementById("authButton").addEventListener(
|
||||
"click", authButtonClickAction, false
|
||||
);
|
||||
|
||||
function authButtonClickAction(zEvent) {
|
||||
toggleComponent("auth");
|
||||
toggleButtonColor("authButton");
|
||||
}
|
||||
document.getElementById("computeButton").addEventListener(
|
||||
"click", computeButtonClickAction, false
|
||||
);
|
||||
function apiButtonClickAction(zEvent) {
|
||||
toggleComponent("api");
|
||||
toggleButtonColor("apiButton");
|
||||
}
|
||||
function computeButtonClickAction(zEvent) {
|
||||
toggleComponent("compute");
|
||||
toggleButtonColor("computeButton");
|
||||
}
|
||||
|
||||
document.getElementById("jobsButton").addEventListener(
|
||||
"click", jobsButtonClickAction, false
|
||||
);
|
||||
|
||||
function jobsButtonClickAction(zEvent) {
|
||||
toggleComponent("jobs");
|
||||
toggleButtonColor("jobsButton");
|
||||
}
|
||||
document.getElementById("odbcButton").addEventListener(
|
||||
"click", odbcButtonClickAction, false
|
||||
);
|
||||
|
||||
function odbcButtonClickAction(zEvent) {
|
||||
toggleComponent("odbc");
|
||||
toggleButtonColor("odbcButton");
|
||||
}
|
||||
document.getElementById("webappButton").addEventListener(
|
||||
"click", webappButtonClickAction, false
|
||||
);
|
||||
|
||||
function webappButtonClickAction(zEvent) {
|
||||
toggleComponent("webapp");
|
||||
toggleButtonColor("webappButton");
|
||||
}
|
||||
document.getElementById("sqlButton").addEventListener(
|
||||
"click", sqlButtonClickAction, false
|
||||
);
|
||||
|
||||
function sqlButtonClickAction(zEvent) {
|
||||
toggleComponent("sql");
|
||||
toggleButtonColor("sqlButton");
|
||||
}
|
||||
document.getElementById("allComponentsButton").addEventListener(
|
||||
"click", allComponentsButtonClickAction, false
|
||||
);
|
||||
document.getElementById("apiButton").addEventListener("click", apiButtonClickAction, false);
|
||||
document.getElementById("authButton").addEventListener("click", authButtonClickAction, false);
|
||||
document.getElementById("computeButton").addEventListener("click", computeButtonClickAction, false);
|
||||
document.getElementById("jobsButton").addEventListener("click", jobsButtonClickAction, false);
|
||||
document.getElementById("odbcButton").addEventListener("click", odbcButtonClickAction, false);
|
||||
document.getElementById("webappButton").addEventListener("click", webappButtonClickAction, false);
|
||||
document.getElementById("sqlButton").addEventListener("click", sqlButtonClickAction, false);
|
||||
document.getElementById("allComponentsButton").addEventListener("click", allComponentsButtonClickAction, false);
|
||||
|
||||
function allComponentsButtonClickAction(zEvent) {
|
||||
for (i = 0; i < componentArray.length; i++) {
|
||||
var component = componentArray[i];
|
||||
var buttonName = component + "Button";
|
||||
selectComponent(component);
|
||||
setButtonColor(buttonName);
|
||||
}
|
||||
}
|
||||
|
||||
// regional buttons
|
||||
function canadaCentralButtonClickAction(zEvent) {
|
||||
toggleRegion("canadacentral");
|
||||
toggleButtonColor("canadaCentralButton")
|
||||
|
||||
}
|
||||
document.getElementById("canadaCentralButton").addEventListener(
|
||||
"click", canadaCentralButtonClickAction, false
|
||||
);
|
||||
function canadaEastButtonClickAction(zEvent) {
|
||||
toggleRegion("canadaeast");
|
||||
toggleButtonColor("canadaEastButton")
|
||||
}
|
||||
document.getElementById("canadaEastButton").addEventListener(
|
||||
"click", canadaEastButtonClickAction, false
|
||||
);
|
||||
// aux buttons
|
||||
|
||||
document.getElementById("applyButton").addEventListener("click", applyButtonClickAction, false);
|
||||
// aux functions
|
||||
function applyButtonClickAction(zEvent) {
|
||||
apply();
|
||||
}
|
||||
document.getElementById("applyButton").addEventListener(
|
||||
"click", applyButtonClickAction, false
|
||||
)
|
||||
// aux functions
|
||||
function toggleComponent(component) {
|
||||
if (checkComponent(component) == false) {
|
||||
selectComponent(component);
|
||||
|
|
@ -241,7 +291,52 @@ function selectCheckbox(box) {
|
|||
function deselectCheckbox(box) {
|
||||
box.setAttribute("class", "");
|
||||
}
|
||||
|
||||
function apply() {
|
||||
for (i = 0; i < componentArray.length; i++) {
|
||||
var component = componentArray[i];
|
||||
for (j = 0; j < regionArray.length; j++) {
|
||||
var region = regionArray[j];
|
||||
var groupName = component + "Group";
|
||||
var group = eval(groupName);
|
||||
var checkboxStr = `group.find('*').filter(\":contains('${region}')\").filter("div.clearfix.prettycheckbox.labelright.blue").children().filter("A")[0]`;
|
||||
var checkbox = eval(checkboxStr);
|
||||
if (checkRegion(region) == true && checkComponent(component) == true) {
|
||||
console.log(region);
|
||||
console.log(component);
|
||||
console.log(groupName);
|
||||
console.log(group);
|
||||
console.log(checkbox);
|
||||
selectCheckbox(checkbox);
|
||||
} else {
|
||||
deselectCheckbox(checkbox);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
function allComponentsButtonClickAction(zEvent) {
|
||||
var enabledCount = 0
|
||||
for (i = 0; i < componentArray.length; i++) {
|
||||
var component = componentArray[i];
|
||||
if (checkComponent(component) == true) {
|
||||
enabledCount++;
|
||||
}
|
||||
}
|
||||
if (enabledCount == componentArray.length) {
|
||||
for (i = 0; i < componentArray.length; i++) {
|
||||
var component = componentArray[i];
|
||||
var buttonName = component + "Button";
|
||||
deselectComponent(component);
|
||||
clearButtonColor(buttonName);
|
||||
}
|
||||
} else {
|
||||
for (i = 0; i < componentArray.length; i++) {
|
||||
var component = componentArray[i];
|
||||
var buttonName = component + "Button";
|
||||
selectComponent(component);
|
||||
setButtonColor(buttonName);
|
||||
}
|
||||
}
|
||||
}
|
||||
function multilineStr(dummyFunc) {
|
||||
var str = dummyFunc.toString();
|
||||
str = str.replace(/^[^\/]+\/\*!?/, '') // Strip function () { /*!
|
||||
|
|
@ -272,6 +367,9 @@ GM_addStyle(multilineStr(function() {
|
|||
color: red;
|
||||
background: white;
|
||||
}
|
||||
hr.solid {
|
||||
border-top: 3px solid #bbb;
|
||||
}
|
||||
*/
|
||||
}));
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue