1910 lines
89 KiB
JavaScript
1910 lines
89 KiB
JavaScript
// ==UserScript==
|
|
// @name Status.io Selector
|
|
// @namespace https://status.io
|
|
// @description Effort to simplify configuration of incidents/maintenance windows
|
|
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js
|
|
// @require http://ajax.googleapis.com/ajax/libs/jqueryui/1.11.1/jquery-ui.min.js
|
|
// @grant GM_addStyle
|
|
// @grant GM_setClipboard
|
|
// @version 0.0.10
|
|
// ==/UserScript==
|
|
|
|
// draw frame
|
|
var zNode = document.createElement('div');
|
|
zNode.setAttribute('id', 'myContainer');
|
|
document.body.appendChild(zNode);
|
|
|
|
// max region button width 468px
|
|
|
|
var auxHTML = '<center>' +
|
|
'<button id="applyButton" type="button">Apply Selection</button>' +
|
|
'<button id="resetButton" type="button">Reset Form</button>' +
|
|
'<center>';
|
|
|
|
var debugFlag = false;
|
|
var currentMode = "";
|
|
|
|
//azure status page controls
|
|
if (window.location.href.indexOf("5d49ec10226b9e13cb6a422e") > -1) {
|
|
// render initial HTML
|
|
var profilesHTML = '<center>' +
|
|
'<button id="controlplanesButton" type="button">Controlplanes</button>' +
|
|
' ' +
|
|
'<button id="stagesButton" type="button">Stages</button>' +
|
|
' ' +
|
|
'<button id="dataplanesButton" type="button">Dataplanes</button>' +
|
|
' ' +
|
|
'<button id="shrinkButton" type="button">Shrink</button>' +
|
|
' ' +
|
|
'<button id="debugButton" type="button">Debug</button>' +
|
|
'</center>';
|
|
|
|
zNode.innerHTML = profilesHTML;
|
|
if (debugFlag == true) {
|
|
toggleButtonColor(debugButton);
|
|
};
|
|
|
|
document.getElementById("controlplanesButton").addEventListener("click", controlplanesButtonClickAction, false);
|
|
document.getElementById("dataplanesButton").addEventListener("click", dataplanesButtonClickAction, false);
|
|
document.getElementById("stagesButton").addEventListener("click", stagesButtonClickAction, false);
|
|
document.getElementById("shrinkButton").addEventListener("click", shrinkButtonClickAction, false);
|
|
document.getElementById("debugButton").addEventListener("click", debugButtonClickAction, false);
|
|
|
|
// initialize azure component and region variables
|
|
var componentArray = [
|
|
"api",
|
|
"auth",
|
|
"compute",
|
|
"jobs",
|
|
"odbc",
|
|
"sql",
|
|
"webapp",
|
|
"accountConsole"
|
|
];
|
|
|
|
var regionArray = [
|
|
"australiacentral",
|
|
"australiacentral2",
|
|
"australiaeast",
|
|
"australiasoutheast",
|
|
"brazilsouth",
|
|
"canadacentral",
|
|
"canadaeast",
|
|
"centralindia",
|
|
"centralus",
|
|
"chinaeast2",
|
|
"chinanorth2",
|
|
"eastasia",
|
|
"eastus",
|
|
"eastus2",
|
|
"francecentral",
|
|
"germanywestcentral",
|
|
"japaneast",
|
|
"japanwest",
|
|
"koreacentral",
|
|
"northcentralus",
|
|
"northeurope",
|
|
"norwayeast",
|
|
"southafricanorth",
|
|
"southcentralus",
|
|
"southeastasia",
|
|
"southindia",
|
|
"switzerlandnorth",
|
|
"switzerlandwest",
|
|
"uaenorth",
|
|
"uksouth",
|
|
"ukwest",
|
|
"usgovarizona",
|
|
"usgovvirginia",
|
|
"westeurope",
|
|
"westus",
|
|
"westus2",
|
|
"westindia"
|
|
];
|
|
var buttonArray = [];
|
|
|
|
// create tracking maps
|
|
var selectedComponents = new Map();
|
|
var selectedRegions = new Map();
|
|
for (i = 0; i < componentArray.length; i++) {
|
|
selectedComponents.set(componentArray[i], 0);
|
|
};
|
|
for (i = 0; i < regionArray.length; i++) {
|
|
selectedRegions.set(regionArray[i], 0);
|
|
};
|
|
|
|
// init component div groups
|
|
var apiGroup = $("div.form-group").filter(":contains('API Service')");
|
|
var authGroup = $("div.form-group").filter(":contains('Authentication')");
|
|
var computeGroup = $("div.form-group").filter(":contains('Compute Service')");
|
|
var jobsGroup = $("div.form-group").filter(":contains('Jobs Service')");
|
|
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 accountConsoleGroup = $("div.form-group").filter(":contains('Account Console')");
|
|
|
|
|
|
// write component HTML template
|
|
var componentsHTML = '<center>' +
|
|
'<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>' +
|
|
'<button id="accountConsoleButton" type="button">Accounts</button>' +
|
|
'</center></br></br>';
|
|
|
|
// regional functions
|
|
|
|
function canadaeastButtonClickAction(zEvent) {
|
|
var buttonName = "canadaeastButton";
|
|
var buttonRegions = ["canadaeast"];
|
|
toggleRegion(buttonName, buttonRegions);
|
|
};
|
|
function canadacentralButtonClickAction(zEvent) {
|
|
var buttonName = "canadacentralButton";
|
|
var buttonRegions = ["canadacentral"];
|
|
toggleRegion(buttonName, buttonRegions);
|
|
};
|
|
function canadacentralCPButtonClickAction(zEvent) {
|
|
var buttonName = "canadacentralButton";
|
|
var buttonRegions = ["canadacentral", "canadaeast"];
|
|
toggleRegion(buttonName, buttonRegions);
|
|
};
|
|
function centralindiaButtonClickAction(zEvent) {
|
|
var buttonName = "centralindiaButton";
|
|
var buttonRegions = ["centralindia"];
|
|
toggleRegion(buttonName, buttonRegions);
|
|
};
|
|
function centralindiaCPButtonClickAction(zEvent) {
|
|
var buttonName = "centralindiaButton";
|
|
var buttonRegions = ["centralindia", "southindia", "westindia"];
|
|
toggleRegion(buttonName, buttonRegions);
|
|
};
|
|
function southindiaButtonClickAction(zEvent) {
|
|
var buttonName = "southindiaButton";
|
|
var buttonRegions = ["southindia"];
|
|
toggleRegion(buttonName, buttonRegions);
|
|
};
|
|
function westindiaButtonClickAction(zEvent) {
|
|
var buttonName = "westindiaButton";
|
|
var buttonRegions = ["westindia"];
|
|
toggleRegion(buttonName, buttonRegions);
|
|
};
|
|
function switzerlandnorthButtonClickAction(zEvent) {
|
|
var buttonName = "switzerlandnorthButton";
|
|
var buttonRegions = ["switzerlandnorth"];
|
|
toggleRegion(buttonName, buttonRegions);
|
|
};
|
|
function switzerlandwestButtonClickAction(zEvent) {
|
|
var buttonName = "switzerlandwestButton";
|
|
var buttonRegions = ["switzerlandwest"];
|
|
toggleRegion(buttonName, buttonRegions);
|
|
};
|
|
function norwayeastButtonClickAction(zEvent) {
|
|
var buttonName = "norwayeastButton";
|
|
var buttonRegions = ["norwayeast"];
|
|
toggleRegion(buttonName, buttonRegions);
|
|
};
|
|
function germanywestcentralButtonClickAction(zEvent) {
|
|
var buttonName = "germanywestcentralButton";
|
|
var buttonRegions = ["germanywestcentral"];
|
|
toggleRegion(buttonName, buttonRegions);
|
|
};
|
|
function westusButtonClickAction(zEvent) {
|
|
var buttonName = "westusButton";
|
|
var buttonRegions = ["westus"];
|
|
toggleRegion(buttonName, buttonRegions);
|
|
};
|
|
function westusCPButtonClickAction(zEvent) {
|
|
var buttonName = "westusButton";
|
|
var buttonRegions = ["westus", "westus2", "southcentralus"];
|
|
toggleRegion(buttonName, buttonRegions);
|
|
};
|
|
function westus2ButtonClickAction(zEvent) {
|
|
var buttonName = "westus2Button";
|
|
var buttonRegions = ["westus2"];
|
|
toggleRegion(buttonName, buttonRegions);
|
|
};
|
|
function southcentralusButtonClickAction(zEvent) {
|
|
var buttonName = "southcentralusButton";
|
|
var buttonRegions = ["southcentralus"];
|
|
toggleRegion(buttonName, buttonRegions);
|
|
};
|
|
function westeuropeButtonClickAction(zEvent) {
|
|
var buttonName = "westeuropeButton";
|
|
var buttonRegions = ["westeurope"];
|
|
toggleRegion(buttonName, buttonRegions);
|
|
};
|
|
function westeuropeCPButtonClickAction(zEvent) {
|
|
var buttonName = "westeuropeButton";
|
|
var buttonRegions = ["westeurope", "northeurope"];
|
|
toggleRegion(buttonName, buttonRegions);
|
|
}
|
|
function northeuropeButtonClickAction(zEvent) {
|
|
var buttonName = "northeuropeButton";
|
|
var buttonRegions = ["northeurope"];
|
|
toggleRegion(buttonName, buttonRegions);
|
|
};
|
|
function ukwestButtonClickAction(zEvent) {
|
|
var buttonName = "ukwestButton";
|
|
var buttonRegions = ["ukwest"];
|
|
toggleRegion(buttonName, buttonRegions);
|
|
};
|
|
function ukwestCPButtonClickAction(zEvent) {
|
|
var buttonName = "ukwestButton";
|
|
var buttonRegions = ["ukwest", "uksouth"];
|
|
toggleRegion(buttonName, buttonRegions);
|
|
};
|
|
function uksouthButtonClickAction(zEvent) {
|
|
var buttonName = "uksouthButton";
|
|
var buttonRegions = ["uksouth"];
|
|
toggleRegion(buttonName, buttonRegions);
|
|
};
|
|
function southafricanorthButtonClickAction(zEvent) {
|
|
var buttonName = "southafricanorthButton";
|
|
var buttonRegions = ["southafricanorth"];
|
|
toggleRegion(buttonName, buttonRegions);
|
|
};
|
|
function uaenorthButtonClickAction(zEvent) {
|
|
var buttonName = "uaenorthButton";
|
|
var buttonRegions = ["uaenorth"];
|
|
toggleRegion(buttonName, buttonRegions);
|
|
};
|
|
function australiaeastButtonClickAction(zEvent) {
|
|
var buttonName = "australiaeastButton";
|
|
var buttonRegions = ["australiaeast"];
|
|
toggleRegion(buttonName, buttonRegions);
|
|
};
|
|
function australiaeastCPButtonClickAction(zEvent) {
|
|
var buttonName = "australiaeastButton";
|
|
var buttonRegions = ["australiaeast", "australiacentral", "australiacentral2", "australiasoutheast"];
|
|
toggleRegion(buttonName, buttonRegions);
|
|
};
|
|
function australiacentralButtonClickAction(zEvent) {
|
|
var buttonName = "australiacentralButton";
|
|
var buttonRegions = ["australiacentral"];
|
|
toggleRegion(buttonName, buttonRegions);
|
|
};
|
|
function australiacentral2ButtonClickAction(zEvent) {
|
|
var buttonName = "australiacentral2Button";
|
|
var buttonRegions = ["australiacentral2"];
|
|
toggleRegion(buttonName, buttonRegions);
|
|
};
|
|
function australiasoutheastButtonClickAction(zEvent) {
|
|
var buttonName = "australiasoutheastButton";
|
|
var buttonRegions = ["australiasoutheast"];
|
|
toggleRegion(buttonName, buttonRegions);
|
|
};
|
|
function japaneastButtonClickAction(zEvent) {
|
|
var buttonName = "japaneastButton";
|
|
var buttonRegions = ["japaneast"];
|
|
toggleRegion(buttonName, buttonRegions);
|
|
};
|
|
function japaneastCPButtonClickAction(zEvent) {
|
|
var buttonName = "japaneastButton";
|
|
var buttonRegions = ["japaneast", "japanwest"];
|
|
toggleRegion(buttonName, buttonRegions);
|
|
};
|
|
function japanwestButtonClickAction(zEvent) {
|
|
var buttonName = "japanwestButton";
|
|
var buttonRegions = ["japanwest"];
|
|
toggleRegion(buttonName, buttonRegions);
|
|
};
|
|
function koreacentralButtonClickAction(zEvent) {
|
|
var buttonName = "koreacentralButton";
|
|
var buttonRegions = ["koreacentral"];
|
|
toggleRegion(buttonName, buttonRegions);
|
|
};
|
|
function southeastasiaButtonClickAction(zEvent) {
|
|
var buttonName = "southeastasiaButton";
|
|
var buttonRegions = ["southeastasia"];
|
|
toggleRegion(buttonName, buttonRegions);
|
|
};
|
|
function southeastasiaCPButtonClickAction(zEvent) {
|
|
var buttonName = "southeastasiaButton";
|
|
var buttonRegions = ["southeastasia", "eastasia"];
|
|
toggleRegion(buttonName, buttonRegions);
|
|
};
|
|
function eastasiaButtonClickAction(zEvent) {
|
|
var buttonName = "eastasiaButton";
|
|
var buttonRegions = ["eastasia"];
|
|
toggleRegion(buttonName, buttonRegions);
|
|
};
|
|
function brazilsouthButtonClickAction(zEvent) {
|
|
var buttonName = "brazilsouthButton";
|
|
var buttonRegions = ["brazilsouth"];
|
|
toggleRegion(buttonName, buttonRegions);
|
|
};
|
|
function eastus2ButtonClickAction(zEvent) {
|
|
var buttonName = "eastus2Button";
|
|
var buttonRegions = ["eastus2"];
|
|
toggleRegion(buttonName, buttonRegions);
|
|
};
|
|
function eastus2CPButtonClickAction(zEvent) {
|
|
var buttonName = "eastus2Button";
|
|
var buttonRegions = ["eastus2", "eastus", "centralus", "northcentralus"];
|
|
toggleRegion(buttonName, buttonRegions);
|
|
};
|
|
function eastusButtonClickAction(zEvent) {
|
|
var buttonName = "eastusButton";
|
|
var buttonRegions = ["eastus"];
|
|
toggleRegion(buttonName, buttonRegions);
|
|
};
|
|
function centralusButtonClickAction(zEvent) {
|
|
var buttonName = "centralusButton";
|
|
var buttonRegions = ["centralus"];
|
|
toggleRegion(buttonName, buttonRegions);
|
|
};
|
|
function northcentralusButtonClickAction(zEvent) {
|
|
var buttonName = "northcentralusButton";
|
|
var buttonRegions = ["northcentralus"];
|
|
toggleRegion(buttonName, buttonRegions);
|
|
};
|
|
function francecentralButtonClickAction(zEvent) {
|
|
var buttonName = "francecentralButton";
|
|
var buttonRegions = ["francecentral"];
|
|
toggleRegion(buttonName, buttonRegions);
|
|
};
|
|
function chinanorth2ButtonClickAction(zEvent) {
|
|
var buttonName = "chinanorth2Button";
|
|
var buttonRegions = ["chinanorth2"];
|
|
toggleRegion(buttonName, buttonRegions);
|
|
};
|
|
function chinaeast2ButtonClickAction(zEvent) {
|
|
var buttonName = "chinaeast2Button";
|
|
var buttonRegions = ["chinaeast2"];
|
|
toggleRegion(buttonName, buttonRegions);
|
|
};
|
|
function usgovvirginiaButtonClickAction(zEvent) {
|
|
var buttonName = "usgovvirginiaButton";
|
|
var buttonRegions = ["usgovvirginia"];
|
|
toggleRegion(buttonName, buttonRegions);
|
|
};
|
|
function usgovarizonaButtonClickAction(zEvent) {
|
|
var buttonName = "usgovarizonaButton";
|
|
var buttonRegions = ["usgovarizona"];
|
|
toggleRegion(buttonName, buttonRegions);
|
|
};
|
|
function stage1ButtonClickAction(zEvent) {
|
|
var buttonName = "stage1Button";
|
|
var buttonRegions = ["canadacentral", "canadaeast", "centralindia", "southindia", "westindia", "switzerlandnorth", "switzerlandwest", "norwayeast", "germanywestcentral"];
|
|
toggleRegion(buttonName, buttonRegions);
|
|
};
|
|
function stage1point5ButtonClickAction(zEvent) {
|
|
var buttonName = "stage1point5Button";
|
|
var buttonRegions = ["westus", "westus2", "southcentralus"];
|
|
toggleRegion(buttonName, buttonRegions);
|
|
};
|
|
function stage2ButtonClickAction(zEvent) {
|
|
var buttonName = "stage2Button";
|
|
var buttonRegions = ["westeurope", "northeurope", "ukwest", "uksouth", "southafricanorth", "uaenorth"];
|
|
toggleRegion(buttonName, buttonRegions);
|
|
};
|
|
function stage3amButtonClickAction(zEvent) {
|
|
var buttonName = "stage3amButton";
|
|
var buttonRegions = ["australiaeast", "australiacentral", "australiacentral2", "australiasoutheast", "japaneast", "japanwest", "koreacentral", "southeastasia", "eastasia"];
|
|
toggleRegion(buttonName, buttonRegions);
|
|
};
|
|
function stage3pmButtonClickAction(zEvent) {
|
|
var buttonName = "stage3pmButton";
|
|
var buttonRegions = ["brazilsouth", "eastus2", "eastus", "centralus", "northcentralus", "francecentral"];
|
|
toggleRegion(buttonName, buttonRegions);
|
|
};
|
|
function stagegovcloudButtonClickAction(zEvent) {
|
|
var buttonName = "stagegovcloudButton";
|
|
var buttonRegions = ["usgovvirginia", "usgovarizona"];
|
|
toggleRegion(buttonName, buttonRegions);
|
|
};
|
|
function stagemooncakeButtonClickAction(zEvent) {
|
|
var buttonName = "stagemooncakeButton";
|
|
var buttonRegions = ["chinanorth2", "chinaeast2"];
|
|
toggleRegion(buttonName, buttonRegions);
|
|
};
|
|
|
|
// component functions
|
|
function authButtonClickAction(zEvent) {
|
|
toggleComponent("auth");
|
|
toggleButtonColor("authButton");
|
|
};
|
|
function apiButtonClickAction(zEvent) {
|
|
toggleComponent("api");
|
|
toggleButtonColor("apiButton");
|
|
};
|
|
function computeButtonClickAction(zEvent) {
|
|
toggleComponent("compute");
|
|
toggleButtonColor("computeButton");
|
|
};
|
|
function jobsButtonClickAction(zEvent) {
|
|
toggleComponent("jobs");
|
|
toggleButtonColor("jobsButton");
|
|
};
|
|
function odbcButtonClickAction(zEvent) {
|
|
toggleComponent("odbc");
|
|
toggleButtonColor("odbcButton");
|
|
};
|
|
function webappButtonClickAction(zEvent) {
|
|
toggleComponent("webapp");
|
|
toggleButtonColor("webappButton");
|
|
};
|
|
function sqlButtonClickAction(zEvent) {
|
|
toggleComponent("sql");
|
|
toggleButtonColor("sqlButton");
|
|
};
|
|
function accountConsoleButtonClickAction(zEvent) {
|
|
toggleComponent("accountConsole");
|
|
toggleButtonColor("accountConsoleButton");
|
|
};
|
|
|
|
|
|
// profile management functions
|
|
function loadDataplanes() {
|
|
currentMode = "dataplane";
|
|
console.log("Loading Azure dataplanes profile");
|
|
var dataplaneHTML = '<center>' +
|
|
'<button id="canadacentralButton" style="width:234px" type="button">Canada Central</button>' +
|
|
'<button id="canadaeastButton" style="width:234px" type="button">Canada East</button>' +
|
|
'</br>' +
|
|
'<button id="centralindiaButton" style="width:156px" type="button">Central India</button>' +
|
|
'<button id="southindiaButton" style="width:156px" type="button">South India</button>' +
|
|
'<button id="westindiaButton" style="width:156px" type="button">West India</button>' +
|
|
'</br>' +
|
|
'<button id="switzerlandnorthButton" style="width:234px" type="button">Switzerland North</button>' +
|
|
'<button id="switzerlandwestButton" style="width:234px" type="button">Switzerland West</button>' +
|
|
'</br>' +
|
|
'<button id="norwayeastButton" style="width:234px" type="button">Norway East</button>' +
|
|
'<button id="germanywestcentralButton" style="width:234px" type="button">Germany West Central</button>' +
|
|
'</br></br>' +
|
|
'<button id="westusButton" style="width:156px" type="button">West US</button>' +
|
|
'<button id="westus2Button" style="width:156px" type="button">West US 2</button>' +
|
|
'<button id="southcentralusButton" style="width:156px" type="button">South Central US</button>' +
|
|
'</br></br>' +
|
|
'<button id="westeuropeButton" style="width:117px" type="button">West Europe</button>' +
|
|
'<button id="northeuropeButton" style="width:117px" type="button">North Europe</button>' +
|
|
'<button id="ukwestButton" style="width:117px" type="button">UK West</button>' +
|
|
'<button id="uksouthButton" style="width:117px" type="button">UK South</button>' +
|
|
'<br>' +
|
|
'<button id="southafricanorthButton" style="width:234px" type="button">South Africa North</button>' +
|
|
'<button id="uaenorthButton" style="width:234px" type="button">UAE North</button>' +
|
|
'</br></br>' +
|
|
'<button id="australiaeastButton" style="width:156px" type="button">Australia East</button>' +
|
|
'<button id="australiacentralButton" style="width:156px" type="button">Australia Central</button>' +
|
|
'<button id="australiacentral2Button" style="width:156px" type="button">Australia Central 2</button>' +
|
|
'</br>' +
|
|
'<button id="australiasoutheastButton" style="width:138px" type="button">Australia Southeast</button>' +
|
|
'<button id="japaneastButton" style="width:110px" type="button">Japan East</button>' +
|
|
'<button id="japanwestButton" style="width:110px" type="button">Japan West</button>' +
|
|
'<button id="koreacentralButton" style="width:110px" type="button">Korea Central</button>' +
|
|
'</br>' +
|
|
'<button id="southeastasiaButton" style="width:234px" type="button">Southeast Asia</button>' +
|
|
'<button id="eastasiaButton" style="width:234px" type="button">East Asia</button>' +
|
|
'</br></br>' +
|
|
'<button id="brazilsouthButton" style="width:156px" type="button">Brazil South</button>' +
|
|
'<button id="eastus2Button" style="width:156px" type="button">East US 2</button>' +
|
|
'<button id="eastusButton" style="width:156px" type="button">East US</button>' +
|
|
'</br>' +
|
|
'<button id="centralusButton" style="width:156px" type="button">Central US</button>' +
|
|
'<button id="northcentralusButton" style="width:156px" type="button">North Central US</button>' +
|
|
'<button id="francecentralButton" style="width:156px" type="button">France Central</button>' +
|
|
'</br></br>' +
|
|
'<button id="chinanorth2Button" style="width:117px" type="button">China North 2</button>' +
|
|
'<button id="chinaeast2Button" style="width:117px" type="button">China East 2</button>' +
|
|
'<button id="usgovvirginiaButton" style="width:117px" type="button">US Gov Virginia</button>' +
|
|
'<button id="usgovarizonaButton" style="width:117px" type="button">US Gov Arizona</button>' +
|
|
'</center>';
|
|
|
|
zNode.innerHTML = profilesHTML + '<hr class="solid">' + dataplaneHTML + '<hr class="solid">' + componentsHTML +
|
|
auxHTML;
|
|
if (debugFlag == true) {
|
|
toggleButtonColor("debugButton");
|
|
};
|
|
|
|
// array of active buttons
|
|
buttonArray = [
|
|
"australiacentral",
|
|
"australiacentral2",
|
|
"australiaeast",
|
|
"australiasoutheast",
|
|
"brazilsouth",
|
|
"canadacentral",
|
|
"canadaeast",
|
|
"centralindia",
|
|
"centralus",
|
|
"chinaeast2",
|
|
"chinanorth2",
|
|
"eastasia",
|
|
"eastus",
|
|
"eastus2",
|
|
"francecentral",
|
|
"germanywestcentral",
|
|
"japaneast",
|
|
"japanwest",
|
|
"koreacentral",
|
|
"northcentralus",
|
|
"northeurope",
|
|
"norwayeast",
|
|
"southafricanorth",
|
|
"southcentralus",
|
|
"southeastasia",
|
|
"southindia",
|
|
"switzerlandnorth",
|
|
"switzerlandwest",
|
|
"uaenorth",
|
|
"uksouth",
|
|
"ukwest",
|
|
"usgovarizona",
|
|
"usgovvirginia",
|
|
"westindia",
|
|
"westeurope",
|
|
"westus",
|
|
"westus2"
|
|
];
|
|
|
|
reset();
|
|
|
|
// regional listeners
|
|
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("switzerlandwestButton").addEventListener("click", switzerlandwestButtonClickAction, false);
|
|
document.getElementById("norwayeastButton").addEventListener("click", norwayeastButtonClickAction, false);
|
|
document.getElementById("germanywestcentralButton").addEventListener("click", germanywestcentralButtonClickAction, 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("australiaeastButton").addEventListener("click", australiaeastButtonClickAction, false);
|
|
document.getElementById("australiacentralButton").addEventListener("click", australiacentralButtonClickAction, false);
|
|
document.getElementById("australiacentral2Button").addEventListener("click", australiacentral2ButtonClickAction, false);
|
|
document.getElementById("australiasoutheastButton").addEventListener("click", australiasoutheastButtonClickAction, false);
|
|
document.getElementById("japaneastButton").addEventListener("click", japaneastButtonClickAction, false);
|
|
document.getElementById("japanwestButton").addEventListener("click", japanwestButtonClickAction, false);
|
|
document.getElementById("koreacentralButton").addEventListener("click", koreacentralButtonClickAction, false);
|
|
document.getElementById("southeastasiaButton").addEventListener("click", southeastasiaButtonClickAction, false);
|
|
document.getElementById("eastasiaButton").addEventListener("click", eastasiaButtonClickAction, false);
|
|
document.getElementById("brazilsouthButton").addEventListener("click", brazilsouthButtonClickAction, false);
|
|
document.getElementById("eastus2Button").addEventListener("click", eastus2ButtonClickAction, false);
|
|
document.getElementById("eastusButton").addEventListener("click", eastusButtonClickAction, false);
|
|
document.getElementById("centralusButton").addEventListener("click", centralusButtonClickAction, false);
|
|
document.getElementById("northcentralusButton").addEventListener("click", northcentralusButtonClickAction, false);
|
|
document.getElementById("francecentralButton").addEventListener("click", francecentralButtonClickAction, false);
|
|
document.getElementById("chinanorth2Button").addEventListener("click", chinanorth2ButtonClickAction, false);
|
|
document.getElementById("chinaeast2Button").addEventListener("click", chinaeast2ButtonClickAction, false);
|
|
document.getElementById("usgovvirginiaButton").addEventListener("click", usgovvirginiaButtonClickAction, false);
|
|
document.getElementById("usgovarizonaButton").addEventListener("click", usgovarizonaButtonClickAction, false);
|
|
|
|
// profile listeners
|
|
document.getElementById("controlplanesButton").addEventListener("click", controlplanesButtonClickAction, false);
|
|
document.getElementById("dataplanesButton").addEventListener("click", dataplanesButtonClickAction, false);
|
|
document.getElementById("stagesButton").addEventListener("click", stagesButtonClickAction, false);
|
|
document.getElementById("shrinkButton").addEventListener("click", shrinkButtonClickAction, false);
|
|
document.getElementById("debugButton").addEventListener("click", debugButtonClickAction, false);
|
|
|
|
// component listeners
|
|
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("accountConsoleButton").addEventListener("click", accountConsoleButtonClickAction, false);
|
|
document.getElementById("allComponentsButton").addEventListener("click", allComponentsButtonClickAction, false);
|
|
|
|
// aux listeners
|
|
document.getElementById("resetButton").addEventListener("click", resetButtonClickAction, false);
|
|
document.getElementById("applyButton").addEventListener("click", applyButtonClickAction, false);
|
|
};
|
|
function loadControlplanes() {
|
|
currentMode = "controlplane";
|
|
console.log("Loading Azure controlplanes profile");
|
|
var controlplaneHTML = '<center>' +
|
|
'<button id="canadacentralButton" style="width:234px" type="button">Canada Central</button>' +
|
|
'<button id="centralindiaButton" style="width:234px" type="button">Central India</button>' +
|
|
'</br>' +
|
|
'<button id="switzerlandnorthButton" style="width:234px" type="button">Switzerland North</button>' +
|
|
'<button id="switzerlandwestButton" style="width:234px" type="button">Switzerland West</button>' +
|
|
'</br>' +
|
|
'<button id="norwayeastButton" style="width:234px" type="button">Norway East</button>' +
|
|
'<button id="germanywestcentralButton" style="width:234px" type="button">Germany West Central</button>' +
|
|
'</br></br>' +
|
|
'<button id="westusButton" style="width:468px" type="button">West US</button>' +
|
|
'</br></br>' +
|
|
'<button id="westeuropeButton" style="width:234px" type="button">West Europe</button>' +
|
|
'<button id="ukwestButton" style="width:234px" type="button">UK West</button>' +
|
|
'</br>' +
|
|
'<button id="southafricanorthButton" style="width:234px" type="button">South Africa North</button>' +
|
|
'<button id="uaenorthButton" style="width:234px" type="button">UAE North</button>' +
|
|
'</br></br>' +
|
|
'<button id="australiaeastButton" style="width:117px" type="button">Australia East</button>' +
|
|
'<button id="japaneastButton" style="width:117px" type="button">Japan East</button>' +
|
|
'<button id="koreacentralButton" style="width:117px" type="button">Korea Central</button>' +
|
|
'<button id="southeastasiaButton" style="width:117px" type="button">Southeast Asia</button>' +
|
|
'</br></br>' +
|
|
'<button id="brazilsouthButton" style="width:156px" type="button">Brazil South</button>' +
|
|
'<button id="eastus2Button" style="width:156px" type="button">East US 2</button>' +
|
|
'<button id="francecentralButton" style="width:156px" type="button">France Central</button>' +
|
|
'</br></br>' +
|
|
'<button id="chinanorth2Button" style="width:117px" type="button">China North 2</button>' +
|
|
'<button id="chinaeast2Button" style="width:117px" type="button">China East 2</button>' +
|
|
'<button id="usgovvirginiaButton" style="width:117px" type="button">US Gov Virginia</button>' +
|
|
'<button id="usgovarizonaButton" style="width:117px" type="button">US Gov Arizona</button>' +
|
|
'</center>';
|
|
|
|
zNode.innerHTML = profilesHTML + '<hr class="solid">' + controlplaneHTML + '<hr class="solid">' + componentsHTML + auxHTML;
|
|
if (debugFlag == true) {
|
|
toggleButtonColor("debugButton");
|
|
};
|
|
|
|
// array of active buttons
|
|
buttonArray = [
|
|
"australiaeast",
|
|
"brazilsouth",
|
|
"canadacentral",
|
|
"centralindia",
|
|
"chinaeast2",
|
|
"chinanorth2",
|
|
"eastus2",
|
|
"francecentral",
|
|
"germanywestcentral",
|
|
"japaneast",
|
|
"koreacentral",
|
|
"norwayeast",
|
|
"southafricanorth",
|
|
"southeastasia",
|
|
"switzerlandnorth",
|
|
"switzerlandwest",
|
|
"uaenorth",
|
|
"ukwest",
|
|
"usgovarizona",
|
|
"usgovvirginia",
|
|
"westeurope",
|
|
"westus"
|
|
];
|
|
|
|
// clear everything on profile load
|
|
reset();
|
|
|
|
// regional listeners
|
|
document.getElementById("canadacentralButton").addEventListener("click", canadacentralCPButtonClickAction, false);
|
|
document.getElementById("switzerlandnorthButton").addEventListener("click", switzerlandnorthButtonClickAction, false);
|
|
document.getElementById("switzerlandwestButton").addEventListener("click", switzerlandwestButtonClickAction, false);
|
|
document.getElementById("centralindiaButton").addEventListener("click", centralindiaCPButtonClickAction, false);
|
|
document.getElementById("norwayeastButton").addEventListener("click", norwayeastButtonClickAction, false);
|
|
document.getElementById("germanywestcentralButton").addEventListener("click", germanywestcentralButtonClickAction, false);
|
|
document.getElementById("westusButton").addEventListener("click", westusCPButtonClickAction, false);
|
|
document.getElementById("westeuropeButton").addEventListener("click", westeuropeCPButtonClickAction, false);
|
|
document.getElementById("ukwestButton").addEventListener("click", ukwestCPButtonClickAction, false);
|
|
document.getElementById("southafricanorthButton").addEventListener("click", southafricanorthButtonClickAction, false);
|
|
document.getElementById("uaenorthButton").addEventListener("click", uaenorthButtonClickAction, false);
|
|
document.getElementById("australiaeastButton").addEventListener("click", australiaeastCPButtonClickAction, false);
|
|
document.getElementById("japaneastButton").addEventListener("click", japaneastCPButtonClickAction, false);
|
|
document.getElementById("koreacentralButton").addEventListener("click", koreacentralButtonClickAction, false);
|
|
document.getElementById("southeastasiaButton").addEventListener("click", southeastasiaCPButtonClickAction, false);
|
|
document.getElementById("brazilsouthButton").addEventListener("click", brazilsouthButtonClickAction, false);
|
|
document.getElementById("eastus2Button").addEventListener("click", eastus2CPButtonClickAction, false);
|
|
document.getElementById("francecentralButton").addEventListener("click", francecentralButtonClickAction, false);
|
|
document.getElementById("chinanorth2Button").addEventListener("click", chinanorth2ButtonClickAction, false);
|
|
document.getElementById("chinaeast2Button").addEventListener("click", chinaeast2ButtonClickAction, false);
|
|
document.getElementById("usgovvirginiaButton").addEventListener("click", usgovvirginiaButtonClickAction, false);
|
|
document.getElementById("usgovarizonaButton").addEventListener("click", usgovarizonaButtonClickAction, false);
|
|
|
|
// profile listeners
|
|
document.getElementById("controlplanesButton").addEventListener("click", controlplanesButtonClickAction, false);
|
|
document.getElementById("dataplanesButton").addEventListener("click", dataplanesButtonClickAction, false);
|
|
document.getElementById("stagesButton").addEventListener("click", stagesButtonClickAction, false);
|
|
document.getElementById("shrinkButton").addEventListener("click", shrinkButtonClickAction, false);
|
|
document.getElementById("debugButton").addEventListener("click", debugButtonClickAction, false);
|
|
|
|
// component listeners
|
|
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("accountConsoleButton").addEventListener("click", accountConsoleButtonClickAction, false);
|
|
document.getElementById("allComponentsButton").addEventListener("click", allComponentsButtonClickAction, false);
|
|
|
|
// aux listeners
|
|
document.getElementById("resetButton").addEventListener("click", resetButtonClickAction, false);
|
|
document.getElementById("applyButton").addEventListener("click", applyButtonClickAction, false);
|
|
};
|
|
function loadStages() {
|
|
currentMode = "stage";
|
|
console.log("Loading Azure stages profile");
|
|
var stagesHTML = '<center>' +
|
|
'<button id="stage1Button" style="width:94px" type="button">Stage-1</button>' +
|
|
'<button id="stage1point5Button" style="width:94px" type="button">Stage-1.5</button>' +
|
|
'<button id="stage2Button" style="width:92px" type="button">Stage-2</button>' +
|
|
'<button id="stage3amButton" style="width:94px" type="button">Stage-3AM</button>' +
|
|
'<button id="stage3pmButton" style="width:94px" type="button">Stage-3PM</button>' +
|
|
'</br>' +
|
|
'<button id="stagegovcloudButton" style="width:234px" type="button">Govcloud</button>' +
|
|
'<button id="stagemooncakeButton" style="width:234px" type="button">Mooncake</button>' +
|
|
'</center>';
|
|
|
|
zNode.innerHTML = profilesHTML + '<hr class="solid">' + stagesHTML + '<hr class="solid">' + componentsHTML + auxHTML;
|
|
if (debugFlag == true) {
|
|
toggleButtonColor("debugButton");
|
|
};
|
|
|
|
// array of active buttons
|
|
buttonArray = [
|
|
"stage1",
|
|
"stage1point5",
|
|
"stage2",
|
|
"stage3am",
|
|
"stage3pm",
|
|
"stagegovcloud",
|
|
"stagemooncake"
|
|
];
|
|
|
|
reset();
|
|
|
|
// regional listeners
|
|
document.getElementById("stage1Button").addEventListener("click", stage1ButtonClickAction, false);
|
|
document.getElementById("stage1point5Button").addEventListener("click", stage1point5ButtonClickAction, false);
|
|
document.getElementById("stage2Button").addEventListener("click", stage2ButtonClickAction, false);
|
|
document.getElementById("stage3amButton").addEventListener("click", stage3amButtonClickAction, false);
|
|
document.getElementById("stage3pmButton").addEventListener("click", stage3pmButtonClickAction, false);
|
|
document.getElementById("stagegovcloudButton").addEventListener("click", stagegovcloudButtonClickAction, false);
|
|
document.getElementById("stagemooncakeButton").addEventListener("click", stagemooncakeButtonClickAction, false);
|
|
|
|
// profile listeners
|
|
document.getElementById("controlplanesButton").addEventListener("click", controlplanesButtonClickAction, false);
|
|
document.getElementById("dataplanesButton").addEventListener("click", dataplanesButtonClickAction, false);
|
|
document.getElementById("stagesButton").addEventListener("click", stagesButtonClickAction, false);
|
|
document.getElementById("shrinkButton").addEventListener("click", shrinkButtonClickAction, false);
|
|
document.getElementById("debugButton").addEventListener("click", debugButtonClickAction, false);
|
|
|
|
// component listeners
|
|
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("accountConsoleButton").addEventListener("click", accountConsoleButtonClickAction, false);
|
|
document.getElementById("allComponentsButton").addEventListener("click", allComponentsButtonClickAction, false);
|
|
|
|
// aux listeners
|
|
document.getElementById("resetButton").addEventListener("click", resetButtonClickAction, false);
|
|
document.getElementById("applyButton").addEventListener("click", applyButtonClickAction, false);
|
|
};
|
|
function shrink() {
|
|
currentMode = "";
|
|
zNode.innerHTML = profilesHTML
|
|
if (debugFlag == true) {
|
|
toggleButtonColor("debugButton");
|
|
};
|
|
|
|
document.getElementById("controlplanesButton").addEventListener("click", controlplanesButtonClickAction, false);
|
|
document.getElementById("dataplanesButton").addEventListener("click", dataplanesButtonClickAction, false);
|
|
document.getElementById("stagesButton").addEventListener("click", stagesButtonClickAction, false);
|
|
document.getElementById("shrinkButton").addEventListener("click", shrinkButtonClickAction, false);
|
|
document.getElementById("debugButton").addEventListener("click", debugButtonClickAction, false);
|
|
};
|
|
};
|
|
|
|
// aws status page controls
|
|
if (window.location.href.indexOf("5cf02dde58a00904bda41926") > -1) {
|
|
// render initial HTML
|
|
var profilesHTML = '<center>' +
|
|
'<button id="controlplanesButton" type="button">Controlplanes</button>' +
|
|
' ' +
|
|
'<button id="stagesButton" type="button">Stages</button>' +
|
|
' ' +
|
|
'<button id="dataplanesButton" type="button">Dataplanes</button>' +
|
|
' ' +
|
|
'<button id="shrinkButton" type="button">Shrink</button>' +
|
|
' ' +
|
|
'<button id="debugButton" type="button">Debug</button>' +
|
|
'</center>';
|
|
|
|
zNode.innerHTML = profilesHTML;
|
|
if (debugFlag == true) {
|
|
toggleButtonColor("debugButton");
|
|
};
|
|
document.getElementById("controlplanesButton").addEventListener("click", controlplanesButtonClickAction, false);
|
|
document.getElementById("dataplanesButton").addEventListener("click", dataplanesButtonClickAction, false);
|
|
document.getElementById("stagesButton").addEventListener("click", stagesButtonClickAction, false);
|
|
document.getElementById("shrinkButton").addEventListener("click", shrinkButtonClickAction, false);
|
|
document.getElementById("debugButton").addEventListener("click", debugButtonClickAction, false);
|
|
|
|
// initialize aws component and region variables
|
|
var componentArray = [
|
|
"api",
|
|
"auth",
|
|
"compute",
|
|
"jobs",
|
|
"odbc",
|
|
"sql",
|
|
"webapp",
|
|
"accountConsole"
|
|
];
|
|
var regionArray = [
|
|
"ap-northeast-1",
|
|
"ap-northeast-2",
|
|
"ap-south-1",
|
|
"ap-southeast-1",
|
|
"ap-southeast-2",
|
|
"ca-central-1",
|
|
"eu-central-1",
|
|
"eu-west-1",
|
|
"eu-west-2",
|
|
"us-east-1",
|
|
"us-east-2",
|
|
"us-west-1",
|
|
"us-west-2"
|
|
];
|
|
var buttonArray = [];
|
|
var ceFlag = false;
|
|
|
|
// create tracking maps
|
|
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);
|
|
};
|
|
|
|
// init component div groups
|
|
var apiGroup = $("div.form-group").filter(":contains('API Service')");
|
|
var authGroup = $("div.form-group").filter(":contains('Authentication')");
|
|
var computeGroup = $("div.form-group").filter(":contains('Compute Service')");
|
|
var jobsGroup = $("div.form-group").filter(":contains('Jobs Service')");
|
|
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 accountConsoleGroup = $("div.form-group").filter(":contains('Account Console')");
|
|
var ceGroup = $("div.form-group").filter(":contains('Community Edition')");
|
|
|
|
// write component HTML template
|
|
var componentsHTML = '<center>' +
|
|
'<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>' +
|
|
'<button id="accountConsoleButton" type="button">Accounts</button>' +
|
|
'</center></br>';
|
|
|
|
// regional functions
|
|
function cacentral1ButtonClickAction(zEvent) {
|
|
var buttonName = "cacentral1Button";
|
|
var buttonRegions = ["ca-central-1"];
|
|
toggleRegion(buttonName, buttonRegions);
|
|
};
|
|
function eucentral1ButtonClickAction(zEvent) {
|
|
var buttonName = "eucentral1Button";
|
|
var buttonRegions = ["eu-central-1"];
|
|
toggleRegion(buttonName, buttonRegions);
|
|
};
|
|
function euwest2ButtonClickAction(zEvent) {
|
|
var buttonName = "euwest2Button";
|
|
var buttonRegions = ["eu-west-2"];
|
|
toggleRegion(buttonName, buttonRegions);
|
|
};
|
|
function uswest1ButtonClickAction(zEvent) {
|
|
var buttonName = "uswest1Button";
|
|
var buttonRegions = ["us-west-1"];
|
|
toggleRegion(buttonName, buttonRegions);
|
|
};
|
|
function uswest2ButtonClickAction(zEvent) {
|
|
var buttonName = "uswest2Button";
|
|
var buttonRegions = ["us-west-2"];
|
|
toggleRegion(buttonName, buttonRegions);
|
|
};
|
|
function uswest2CPButtonClickAction(zEvent) {
|
|
var buttonName = "uswest2Button";
|
|
var buttonRegions = ["us-west-2", "us-west-1", "us-east-1"];
|
|
toggleRegion(buttonName, buttonRegions);
|
|
};
|
|
function useast1ButtonClickAction(zEvent) {
|
|
var buttonName = "useast1Button";
|
|
var buttonRegions = ["us-east-1"];
|
|
toggleRegion(buttonName, buttonRegions);
|
|
};
|
|
function useast2ButtonClickAction(zEvent) {
|
|
var buttonName = "useast2Button";
|
|
var buttonRegions = ["us-east-2"];
|
|
toggleRegion(buttonName, buttonRegions);
|
|
};
|
|
function apsouth1ButtonClickAction(zEvent) {
|
|
var buttonName = "apsouth1Button";
|
|
var buttonRegions = ["ap-south-1"];
|
|
toggleRegion(buttonName, buttonRegions);
|
|
};
|
|
function apsoutheast1ButtonClickAction(zEvent) {
|
|
var buttonName = "apsoutheast1Button";
|
|
var buttonRegions = ["ap-southeast-1"];
|
|
toggleRegion(buttonName, buttonRegions);
|
|
};
|
|
function apsoutheast2ButtonClickAction(zEvent) {
|
|
var buttonName = "apsoutheast2Button";
|
|
var buttonRegions = ["ap-southeast-2"];
|
|
toggleRegion(buttonName, buttonRegions);
|
|
};
|
|
function apnortheast1ButtonClickAction(zEvent) {
|
|
var buttonName = "apnortheast1Button";
|
|
var buttonRegions = ["ap-northeast-1"];
|
|
toggleRegion(buttonName, buttonRegions);
|
|
};
|
|
function apnortheast2ButtonClickAction(zEvent) {
|
|
var buttonName = "apnortheast2Button";
|
|
var buttonRegions = ["ap-northeast-2"];
|
|
toggleRegion(buttonName, buttonRegions);
|
|
};
|
|
function euwest1ButtonClickAction(zEvent) {
|
|
var buttonName = "euwest1Button";
|
|
var buttonRegions = ["eu-west-1"];
|
|
toggleRegion(buttonName, buttonRegions);
|
|
};
|
|
function ceButtonClickAction(zEvent) {
|
|
toggleButtonColor("ceButton");
|
|
toggleCe();
|
|
};
|
|
function stage1ButtonClickAction(zEvent) {
|
|
var buttonName = "stage1Button";
|
|
var buttonRegions = ["ca-central-1", "eu-central-1", "eu-west-2"];
|
|
toggleRegion(buttonName, buttonRegions);
|
|
toggleCe();
|
|
};
|
|
function stage2ButtonClickAction(zEvent) {
|
|
var buttonName = "stage2Button";
|
|
var buttonRegions = ["us-west-2", "us-west-1", "us-east-1", "us-east-2", "ap-southeast-1"];
|
|
toggleRegion(buttonName, buttonRegions);
|
|
};
|
|
function stage3amButtonClickAction(zEvent) {
|
|
var buttonName = "stage3amButton";
|
|
var buttonRegions = ["ap-south-1", "ap-southeast-2", "ap-northeast-1", "ap-northeast-2"];
|
|
toggleRegion(buttonName, buttonRegions);
|
|
};
|
|
function stage3pmButtonClickAction(zEvent) {
|
|
var buttonName = "stage3pmButton";
|
|
var buttonRegions = ["eu-west-1"];
|
|
toggleRegion(buttonName, buttonRegions);
|
|
};
|
|
|
|
// component functions
|
|
function authButtonClickAction(zEvent) {
|
|
toggleComponent("auth");
|
|
toggleButtonColor("authButton");
|
|
};
|
|
function apiButtonClickAction(zEvent) {
|
|
toggleComponent("api");
|
|
toggleButtonColor("apiButton");
|
|
};
|
|
function computeButtonClickAction(zEvent) {
|
|
toggleComponent("compute");
|
|
toggleButtonColor("computeButton");
|
|
};
|
|
function jobsButtonClickAction(zEvent) {
|
|
toggleComponent("jobs");
|
|
toggleButtonColor("jobsButton");
|
|
};
|
|
function odbcButtonClickAction(zEvent) {
|
|
toggleComponent("odbc");
|
|
toggleButtonColor("odbcButton");
|
|
};
|
|
function webappButtonClickAction(zEvent) {
|
|
toggleComponent("webapp");
|
|
toggleButtonColor("webappButton");
|
|
};
|
|
function sqlButtonClickAction(zEvent) {
|
|
toggleComponent("sql");
|
|
toggleButtonColor("sqlButton");
|
|
};
|
|
function accountConsoleButtonClickAction(zEvent) {
|
|
toggleComponent("accountConsole");
|
|
toggleButtonColor("accountConsoleButton");
|
|
};
|
|
|
|
// profile management functions
|
|
function loadDataplanes() {
|
|
currentMode = "dataplane";
|
|
console.log("Loading AWS dataplanes profile");
|
|
var dataplaneHTML = '<center>' +
|
|
'<button id="ceButton" style="width:117px" type="button">CE</button>' +
|
|
'<button id="cacentral1Button" style="width:117px" type="button">ca-central-1</button>' +
|
|
'<button id="eucentral1Button" style="width:117px" type="button">eu-central-1</button>' +
|
|
'<button id="euwest2Button" style="width:117px" type="button">eu-west-2</button>' +
|
|
'</br></br>' +
|
|
'<button id="uswest2Button" style="width:234px" type="button">us-west-2</button>' +
|
|
'<button id="uswest1Button" style="width:234px" type="button">us-west-1</button>' +
|
|
'</br>' +
|
|
'<button id="useast1Button" style="width:234px" type="button">us-east-1</button>' +
|
|
'<button id="useast2Button" style="width:234px" type="button">us-east-2</button>' +
|
|
'</br>' +
|
|
'<button id="apsoutheast1Button" style="width:468px" type="button">ap-southeast-1</button>' +
|
|
'</br></br>' +
|
|
'<button id="apsouth1Button" style="width:117px" type="button">ap-south-1</button>' +
|
|
'<button id="apsoutheast2Button" style="width:117px" type="button">ap-southeast-2</button>' +
|
|
'<button id="apnortheast1Button" style="width:117px" type="button">ap-northeast-1</button>' +
|
|
'<button id="apnortheast2Button" style="width:117px" type="button">ap-northeast-2</button>' +
|
|
'</br></br>' +
|
|
'<button id="euwest1Button" style="width:468px" type="button">eu-west-1</button>' +
|
|
'</center>';
|
|
|
|
zNode.innerHTML = profilesHTML + '<hr class="solid">' + dataplaneHTML + '<hr class="solid">' + componentsHTML + auxHTML;
|
|
if (debugFlag == true) {
|
|
toggleButtonColor("debugButton");
|
|
};
|
|
|
|
// array of active buttons
|
|
buttonArray = [
|
|
"apnortheast1",
|
|
"apnortheast2",
|
|
"apsouth1",
|
|
"apsoutheast1",
|
|
"apsoutheast2",
|
|
"ce",
|
|
"cacentral1",
|
|
"eucentral1",
|
|
"euwest1",
|
|
"euwest2",
|
|
"useast1",
|
|
"useast2",
|
|
"uswest2",
|
|
"uswest1"
|
|
];
|
|
|
|
// clear everything on profile load
|
|
reset();
|
|
|
|
// regional listeners
|
|
document.getElementById("cacentral1Button").addEventListener("click", cacentral1ButtonClickAction, false);
|
|
document.getElementById("eucentral1Button").addEventListener("click", eucentral1ButtonClickAction, false);
|
|
document.getElementById("euwest2Button").addEventListener("click", euwest2ButtonClickAction, false);
|
|
document.getElementById("uswest1Button").addEventListener("click", uswest1ButtonClickAction, false);
|
|
document.getElementById("uswest2Button").addEventListener("click", uswest2ButtonClickAction, false);
|
|
document.getElementById("useast1Button").addEventListener("click", useast1ButtonClickAction, false);
|
|
document.getElementById("useast2Button").addEventListener("click", useast2ButtonClickAction, false);
|
|
document.getElementById("apsouth1Button").addEventListener("click", apsouth1ButtonClickAction, false);
|
|
document.getElementById("apsoutheast1Button").addEventListener("click", apsoutheast1ButtonClickAction, false);
|
|
document.getElementById("apsoutheast2Button").addEventListener("click", apsoutheast2ButtonClickAction, false);
|
|
document.getElementById("apnortheast1Button").addEventListener("click", apnortheast1ButtonClickAction, false);
|
|
document.getElementById("apnortheast2Button").addEventListener("click", apnortheast2ButtonClickAction, false);
|
|
document.getElementById("euwest1Button").addEventListener("click", euwest1ButtonClickAction, false);
|
|
document.getElementById("ceButton").addEventListener("click", ceButtonClickAction, false);
|
|
|
|
// profile listeners
|
|
document.getElementById("controlplanesButton").addEventListener("click", controlplanesButtonClickAction, false);
|
|
document.getElementById("dataplanesButton").addEventListener("click", dataplanesButtonClickAction, false);
|
|
document.getElementById("stagesButton").addEventListener("click", stagesButtonClickAction, false);
|
|
document.getElementById("shrinkButton").addEventListener("click", shrinkButtonClickAction, false);
|
|
document.getElementById("debugButton").addEventListener("click", debugButtonClickAction, false);
|
|
|
|
// component listeners
|
|
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("accountConsoleButton").addEventListener("click", accountConsoleButtonClickAction, false);
|
|
document.getElementById("allComponentsButton").addEventListener("click", allComponentsButtonClickAction, false);
|
|
|
|
// aux listeners
|
|
document.getElementById("resetButton").addEventListener("click", resetButtonClickAction, false);
|
|
document.getElementById("applyButton").addEventListener("click", applyButtonClickAction, false);
|
|
};
|
|
function loadControlplanes() {
|
|
currentMode = "controlplane";
|
|
console.log("Loading AWS controlplanes profile");
|
|
var controlplaneHTML = '<center>' +
|
|
'<button id="ceButton" style="width:117px" type="button">CE</button>' +
|
|
'<button id="cacentral1Button" style="width:117px" type="button">ca-central-1</button>' +
|
|
'<button id="eucentral1Button" style="width:117px" type="button">eu-central-1</button>' +
|
|
'<button id="euwest2Button" style="width:117px" type="button">eu-west-2</button>' +
|
|
'</br></br>' +
|
|
'<button id="uswest2Button" style="width:117px" type="button">us-west-2</button>' +
|
|
'<button id="useast1Button" style="width:117px" type="button">us-east-1</button>' +
|
|
'<button id="useast2Button" style="width:117px" type="button">us-east-2</button>' +
|
|
'<button id="apsoutheast1Button" style="width:117px" type="button">ap-southeast-1</button>' +
|
|
'</br></br>' +
|
|
'<button id="apsouth1Button" style="width:117px" type="button">ap-south-1</button>' +
|
|
'<button id="apsoutheast2Button" style="width:117px" type="button">ap-southeast-2</button>' +
|
|
'<button id="apnortheast1Button" style="width:117px" type="button">ap-northeast-1</button>' +
|
|
'<button id="apnortheast2Button" style="width:117px" type="button">ap-northeast-2</button>' +
|
|
'</br></br>' +
|
|
'<button id="euwest1Button" style="width:468px" type="button">eu-west-1</button>' +
|
|
'</center>';
|
|
|
|
zNode.innerHTML = profilesHTML + '<hr class="solid">' + controlplaneHTML + '<hr class="solid">' + componentsHTML + auxHTML;
|
|
if (debugFlag == true) {
|
|
toggleButtonColor("debugButton");
|
|
};
|
|
|
|
// array of active buttons
|
|
buttonArray = [
|
|
"apnortheast1",
|
|
"apnortheast2",
|
|
"apsouth1",
|
|
"apsoutheast1",
|
|
"apsoutheast2",
|
|
"cacentral1",
|
|
"ce",
|
|
"eucentral1",
|
|
"euwest1",
|
|
"euwest2",
|
|
"useast2",
|
|
"uswest2",
|
|
"useast1"
|
|
];
|
|
|
|
// clear everything on profile load
|
|
reset();
|
|
|
|
// regional listeners
|
|
document.getElementById("cacentral1Button").addEventListener("click", cacentral1ButtonClickAction, false);
|
|
document.getElementById("eucentral1Button").addEventListener("click", eucentral1ButtonClickAction, false);
|
|
document.getElementById("euwest2Button").addEventListener("click", euwest2ButtonClickAction, false);
|
|
document.getElementById("uswest2Button").addEventListener("click", uswest2CPButtonClickAction, false);
|
|
document.getElementById("useast1Button").addEventListener("click", useast1ButtonClickAction, false);
|
|
document.getElementById("useast2Button").addEventListener("click", useast2ButtonClickAction, false);
|
|
document.getElementById("apsouth1Button").addEventListener("click", apsouth1ButtonClickAction, false);
|
|
document.getElementById("apsoutheast1Button").addEventListener("click", apsoutheast1ButtonClickAction, false);
|
|
document.getElementById("apsoutheast2Button").addEventListener("click", apsoutheast2ButtonClickAction, false);
|
|
document.getElementById("apnortheast1Button").addEventListener("click", apnortheast1ButtonClickAction, false);
|
|
document.getElementById("apnortheast2Button").addEventListener("click", apnortheast2ButtonClickAction, false);
|
|
document.getElementById("euwest1Button").addEventListener("click", euwest1ButtonClickAction, false);
|
|
document.getElementById("ceButton").addEventListener("click", ceButtonClickAction, false);
|
|
|
|
// profile listeners
|
|
document.getElementById("controlplanesButton").addEventListener("click", controlplanesButtonClickAction, false);
|
|
document.getElementById("dataplanesButton").addEventListener("click", dataplanesButtonClickAction, false);
|
|
document.getElementById("stagesButton").addEventListener("click", stagesButtonClickAction, false);
|
|
document.getElementById("shrinkButton").addEventListener("click", shrinkButtonClickAction, false);
|
|
document.getElementById("debugButton").addEventListener("click", debugButtonClickAction, false);
|
|
|
|
// component listeners
|
|
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("accountConsoleButton").addEventListener("click", accountConsoleButtonClickAction, false);
|
|
document.getElementById("allComponentsButton").addEventListener("click", allComponentsButtonClickAction, false);
|
|
|
|
// aux listeners
|
|
document.getElementById("resetButton").addEventListener("click", resetButtonClickAction, false);
|
|
document.getElementById("applyButton").addEventListener("click", applyButtonClickAction, false);
|
|
};
|
|
function loadStages() {
|
|
currentMode = "stage";
|
|
console.log("Loading AWS stages profile");
|
|
var stagesHTML = '<center>' +
|
|
'<button id="stage1Button" style="width:117px" type="button">Stage-1</button>' +
|
|
'<button id="stage2Button" style="width:117px" type="button">Stage-2</button>' +
|
|
'<button id="stage3amButton" style="width:117px" type="button">Stage-3 AM</button>' +
|
|
'<button id="stage3pmButton" style="width:117px" type="button">Stage-3 PM</button>' +
|
|
'</center>';
|
|
|
|
zNode.innerHTML = profilesHTML + '<hr class="solid">' + stagesHTML + '<hr class="solid">' + componentsHTML + auxHTML;
|
|
if (debugFlag == true) {
|
|
toggleButtonColor("debugButton");
|
|
}
|
|
|
|
// array of active buttons
|
|
buttonArray = [
|
|
"stage1",
|
|
"stage2",
|
|
"stage3am",
|
|
"stage3pm"
|
|
];
|
|
|
|
// clear everything on profile load
|
|
reset();
|
|
|
|
// regional listeners
|
|
document.getElementById("stage1Button").addEventListener("click", stage1ButtonClickAction, false);
|
|
document.getElementById("stage2Button").addEventListener("click", stage2ButtonClickAction, false);
|
|
document.getElementById("stage3amButton").addEventListener("click", stage3amButtonClickAction, false);
|
|
document.getElementById("stage3pmButton").addEventListener("click", stage3pmButtonClickAction, false);
|
|
|
|
// profile listeners
|
|
document.getElementById("controlplanesButton").addEventListener("click", controlplanesButtonClickAction, false);
|
|
document.getElementById("dataplanesButton").addEventListener("click", dataplanesButtonClickAction, false);
|
|
document.getElementById("stagesButton").addEventListener("click", stagesButtonClickAction, false);
|
|
document.getElementById("shrinkButton").addEventListener("click", shrinkButtonClickAction, false);
|
|
|
|
// component listeners
|
|
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("accountConsoleButton").addEventListener("click", accountConsoleButtonClickAction, false);
|
|
document.getElementById("allComponentsButton").addEventListener("click", allComponentsButtonClickAction, false);
|
|
|
|
// aux listeners
|
|
document.getElementById("resetButton").addEventListener("click", resetButtonClickAction, false);
|
|
document.getElementById("applyButton").addEventListener("click", applyButtonClickAction, false);
|
|
};
|
|
function shrink() {
|
|
currentMode = "";
|
|
zNode.innerHTML = profilesHTML
|
|
if (debugFlag == true) {
|
|
toggleButtonColor("debugButton");
|
|
};
|
|
|
|
document.getElementById("controlplanesButton").addEventListener("click", controlplanesButtonClickAction, false);
|
|
document.getElementById("dataplanesButton").addEventListener("click", dataplanesButtonClickAction, false);
|
|
document.getElementById("stagesButton").addEventListener("click", stagesButtonClickAction, false);
|
|
document.getElementById("shrinkButton").addEventListener("click", shrinkButtonClickAction, false);
|
|
document.getElementById("debugButton").addEventListener("click", debugButtonClickAction, false);
|
|
};
|
|
};
|
|
|
|
// gcp status page controls
|
|
if (window.location.href.indexOf("60087ab5608daf0535dc8e23") > -1) {
|
|
// render initial HTML
|
|
var profilesHTML = '<center>' +
|
|
'<button id="controlplanesButton" type="button">Controlplanes</button>' +
|
|
' ' +
|
|
'<button id="stagesButton" type="button">Stages</button>' +
|
|
' ' +
|
|
'<button id="shrinkButton" type="button">Shrink</button>' +
|
|
' ' +
|
|
'<button id="debugButton" type="button">Debug</button>' +
|
|
'</center>';
|
|
zNode.innerHTML = profilesHTML;
|
|
if (debugFlag == true) {
|
|
toggleButtonColor("debugButton");
|
|
};
|
|
|
|
document.getElementById("controlplanesButton").addEventListener("click", controlplanesButtonClickAction, false);
|
|
document.getElementById("stagesButton").addEventListener("click", stagesButtonClickAction, false);
|
|
document.getElementById("shrinkButton").addEventListener("click", shrinkButtonClickAction, false);
|
|
document.getElementById("debugButton").addEventListener("click", debugButtonClickAction, false);
|
|
|
|
// initialize gcp component and region variables
|
|
var componentArray =[
|
|
"api",
|
|
"auth",
|
|
"compute",
|
|
"jobs",
|
|
"odbc",
|
|
"sql",
|
|
"webapp",
|
|
"accountConsole"
|
|
];
|
|
var regionArray = [
|
|
"australia-southeast1",
|
|
"asia-southeast1",
|
|
"europe-west1",
|
|
"europe-west2",
|
|
"us-central1",
|
|
"us-east1",
|
|
"us-east4",
|
|
"us-west1",
|
|
"us-west4",
|
|
"europe-west3"
|
|
];
|
|
var buttonArray = [];
|
|
|
|
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);
|
|
};
|
|
|
|
// init component div groups
|
|
var apiGroup = $("div.form-group").filter(":contains('API Service')");
|
|
var authGroup = $("div.form-group").filter(":contains('Authentication')");
|
|
var computeGroup = $("div.form-group").filter(":contains('Compute Service')");
|
|
var jobsGroup = $("div.form-group").filter(":contains('Jobs Service')");
|
|
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 accountConsoleGroup = $("div.form-group").filter(":contains('Account Console')");
|
|
|
|
|
|
// write component HTML template
|
|
var componentsHTML = '<center>' +
|
|
'<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>' +
|
|
'<button id="accountConsoleButton" type="button">Accounts</button>' +
|
|
'</center></br></br>';
|
|
|
|
// regional functions
|
|
function australiasoutheast1ButtonClickAction(zEvent) {
|
|
var buttonName = "australiasoutheast1Button";
|
|
var buttonRegions = ["australia-southeast1"];
|
|
toggleRegion(buttonName, buttonRegions);
|
|
};
|
|
function asiasoutheast1ButtonClickAction(zEvent) {
|
|
var buttonName = "asiasoutheast1Button";
|
|
var buttonRegions = ["asia-southeast1"];
|
|
toggleRegion(buttonName, buttonRegions);
|
|
};
|
|
function europewest1ButtonClickAction(zEvent) {
|
|
var buttonName = "europewest1Button";
|
|
var buttonRegions = ["europe-west1"];
|
|
toggleRegion(buttonName, buttonRegions);
|
|
};
|
|
function europewest2ButtonClickAction(zEvent) {
|
|
var buttonName = "europewest2Button";
|
|
var buttonRegions = ["europe-west2"];
|
|
toggleRegion(buttonName, buttonRegions);
|
|
};
|
|
function uscentral1ButtonClickAction(zEvent) {
|
|
var buttonName = "uscentral1Button";
|
|
var buttonRegions = ["us-central1"];
|
|
toggleRegion(buttonName, buttonRegions);
|
|
};
|
|
function useast1ButtonClickAction(zEvent) {
|
|
var buttonName = "useast1Button";
|
|
var buttonRegions = ["us-east1"];
|
|
toggleRegion(buttonName, buttonRegions);
|
|
};
|
|
function useast4ButtonClickAction(zEvent) {
|
|
var buttonName = "useast4Button";
|
|
var buttonRegions = ["us-east4"];
|
|
toggleRegion(buttonName, buttonRegions);
|
|
};
|
|
function uswest1ButtonClickAction(zEvent) {
|
|
var buttonName = "uswest1Button";
|
|
var buttonRegions = ["us-west1"];
|
|
toggleRegion(buttonName, buttonRegions);
|
|
};
|
|
function uswest4ButtonClickAction(zEvent) {
|
|
var buttonName = "uswest4Button";
|
|
var buttonRegions = ["us-west4"];
|
|
toggleRegion(buttonName, buttonRegions);
|
|
};
|
|
function europewest3ButtonClickAction(zEvent) {
|
|
var buttonName = "europewest3Button";
|
|
var buttonRegions = ["europe-west3"];
|
|
toggleRegion(buttonName, buttonRegions);
|
|
};
|
|
function stage1ButtonClickAction(zEvent) {
|
|
var buttonName = "stage1Button";
|
|
var buttonRegions = ["europe-west1"];
|
|
toggleRegion(buttonName, buttonRegions);
|
|
};
|
|
function stage2ButtonClickAction(zEvent) {
|
|
var buttonName = "stage2Button";
|
|
var buttonRegions = ["europe-west2", "us-central1", "us-east1", "us-east4", "us-west1"];
|
|
toggleRegion(buttonName, buttonRegions);
|
|
};
|
|
function stage3amButtonClickAction(zEvent) {
|
|
var buttonName = "stage3amButton";
|
|
var buttonRegions = ["asia-southeast1", "australia-southeast1"];
|
|
toggleRegion(buttonName, buttonRegions);
|
|
};
|
|
function stage3pmButtonClickAction(zEvent) {
|
|
var buttonName = "stage3pmButton";
|
|
var buttonRegions = ["us-west4", "europe-west3"];
|
|
toggleRegion(buttonName, buttonRegions);
|
|
};
|
|
|
|
// component functions
|
|
function authButtonClickAction(zEvent) {
|
|
toggleComponent("auth");
|
|
toggleButtonColor("authButton");
|
|
};
|
|
function apiButtonClickAction(zEvent) {
|
|
toggleComponent("api");
|
|
toggleButtonColor("apiButton");
|
|
};
|
|
function computeButtonClickAction(zEvent) {
|
|
toggleComponent("compute");
|
|
toggleButtonColor("computeButton");
|
|
};
|
|
function jobsButtonClickAction(zEvent) {
|
|
toggleComponent("jobs");
|
|
toggleButtonColor("jobsButton");
|
|
};
|
|
function odbcButtonClickAction(zEvent) {
|
|
toggleComponent("odbc");
|
|
toggleButtonColor("odbcButton");
|
|
};
|
|
function webappButtonClickAction(zEvent) {
|
|
toggleComponent("webapp");
|
|
toggleButtonColor("webappButton");
|
|
};
|
|
function sqlButtonClickAction(zEvent) {
|
|
toggleComponent("sql");
|
|
toggleButtonColor("sqlButton");
|
|
};
|
|
function sqlButtonClickAction(zEvent) {
|
|
toggleComponent("accountConsole");
|
|
toggleButtonColor("accountConsoleButton");
|
|
};
|
|
|
|
function loadControlplanes() {
|
|
currentMode = "controlplane";
|
|
console.log("Loading GCP controlplanes profile");
|
|
var controlplaneHTML = '<center>' +
|
|
'<button id="europewest1Button" style="width:468px" type="button">Europe-West1</button>' +
|
|
'</br></br>' +
|
|
'<button id="europewest2Button" style="width:234px" type="button">Europe-West2</button>' +
|
|
'<button id="uscentral1Button" style="width:234px" type="button">US-Central1</button>' +
|
|
'</br>' +
|
|
'<button id="useast1Button" style="width:156px" type="button">US-East1</button>' +
|
|
'<button id="useast4Button" style="width:156px" type="button">US-East4</button>' +
|
|
'<button id="uswest1Button" style="width:156px" type="button">US-West1</button>' +
|
|
'</br></br>' +
|
|
'<button id="australiasoutheast1Button" style="width:234px" type="button">Australia-Southeast1</button>' +
|
|
'<button id="asiasoutheast1Button" style="width:234px" type="button">Asia-Southeast1</button>' +
|
|
'</br></br>' +
|
|
'<button id="uswest4Button" style="width:234px" type="button">US-West4</button>' +
|
|
'<button id="europewest3Button" style="width:234px" type="button">EU-West3</button>' +
|
|
'</br></center>'
|
|
;
|
|
zNode.innerHTML = profilesHTML + '<hr class="solid">' + controlplaneHTML + '<hr class="solid">' + componentsHTML + auxHTML;
|
|
if (debugFlag == true) {
|
|
toggleButtonColor("debugButton");
|
|
};
|
|
|
|
// array of active buttons
|
|
buttonArray = [
|
|
"asiasoutheast1",
|
|
"australiasoutheast1",
|
|
"europewest1",
|
|
"europewest2",
|
|
"uscentral1",
|
|
"useast1",
|
|
"useast4",
|
|
"uswest1",
|
|
"uswest4",
|
|
"europewest3"
|
|
];
|
|
if (debugFlag == true) {
|
|
console.log("buttonArray: " + buttonArray);
|
|
}
|
|
|
|
// clear everything on profile load
|
|
reset();
|
|
|
|
// regional listeners
|
|
document.getElementById("australiasoutheast1Button").addEventListener("click", australiasoutheast1ButtonClickAction, false);
|
|
document.getElementById("asiasoutheast1Button").addEventListener("click", asiasoutheast1ButtonClickAction, false);
|
|
document.getElementById("europewest1Button").addEventListener("click", europewest1ButtonClickAction, false);
|
|
document.getElementById("europewest2Button").addEventListener("click", europewest2ButtonClickAction, false);
|
|
document.getElementById("uscentral1Button").addEventListener("click", uscentral1ButtonClickAction, false);
|
|
document.getElementById("useast1Button").addEventListener("click", useast1ButtonClickAction, false);
|
|
document.getElementById("useast4Button").addEventListener("click", useast4ButtonClickAction, false);
|
|
document.getElementById("uswest1Button").addEventListener("click", uswest1ButtonClickAction, false);
|
|
document.getElementById("uswest4Button").addEventListener("click", uswest4ButtonClickAction, false);
|
|
document.getElementById("europewest3Button").addEventListener("click", europewest3ButtonClickAction, false);
|
|
|
|
// profile listeners
|
|
document.getElementById("controlplanesButton").addEventListener("click", controlplanesButtonClickAction, false);
|
|
document.getElementById("stagesButton").addEventListener("click", stagesButtonClickAction, false);
|
|
document.getElementById("shrinkButton").addEventListener("click", shrinkButtonClickAction, false);
|
|
document.getElementById("debugButton").addEventListener("click", debugButtonClickAction, false);
|
|
|
|
// component listeners
|
|
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("accountConsoleButton").addEventListener("click", accountConsoleButtonClickAction, false);
|
|
document.getElementById("allComponentsButton").addEventListener("click", allComponentsButtonClickAction, false);
|
|
|
|
// aux listeners
|
|
document.getElementById("resetButton").addEventListener("click", resetButtonClickAction, false);
|
|
document.getElementById("applyButton").addEventListener("click", applyButtonClickAction, false);
|
|
};
|
|
function loadStages() {
|
|
currentMode = "stage";
|
|
console.log("Loading GCP stages profile");
|
|
var stagesHTML = '<center>' +
|
|
'<button id="stage1Button" style="width:117px" type="button">Stage-1</button>' +
|
|
'<button id="stage2Button" style="width:117px" type="button">Stage-2</button>' +
|
|
'<button id="stage3amButton" style="width:117px" type="button">Stage-3AM</button>' +
|
|
'<button id="stage3pmButton" style="width:117px" type="button">Stage-3PM</button>' +
|
|
'</center>';
|
|
|
|
zNode.innerHTML = profilesHTML + '<hr class="solid">' + stagesHTML + '<hr class="solid">' + componentsHTML + auxHTML;
|
|
if (debugFlag == true) {
|
|
toggleButtonColor("debugButton");
|
|
}
|
|
|
|
// array of active buttons
|
|
buttonArray = [
|
|
"stage1",
|
|
"stage2",
|
|
"stage3am",
|
|
"stage3pm"
|
|
];
|
|
|
|
// clear everything on profile load
|
|
reset();
|
|
|
|
// regional listeners
|
|
document.getElementById("stage1Button").addEventListener("click", stage1ButtonClickAction, false);
|
|
document.getElementById("stage2Button").addEventListener("click", stage2ButtonClickAction, false);
|
|
document.getElementById("stage3amButton").addEventListener("click", stage3amButtonClickAction, false);
|
|
document.getElementById("stage3pmButton").addEventListener("click", stage3pmButtonClickAction, false);
|
|
|
|
// profile listeners
|
|
document.getElementById("controlplanesButton").addEventListener("click", controlplanesButtonClickAction, false);
|
|
document.getElementById("stagesButton").addEventListener("click", stagesButtonClickAction, false);
|
|
document.getElementById("shrinkButton").addEventListener("click", shrinkButtonClickAction, false);
|
|
document.getElementById("debugButton").addEventListener("click", debugButtonClickAction, false);
|
|
|
|
// component listeners
|
|
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("accountConsoleButton").addEventListener("click", accountConsoleButtonClickAction, false);
|
|
document.getElementById("allComponentsButton").addEventListener("click", allComponentsButtonClickAction, false);
|
|
|
|
// aux listeners
|
|
document.getElementById("resetButton").addEventListener("click", resetButtonClickAction, false);
|
|
document.getElementById("applyButton").addEventListener("click", applyButtonClickAction, false);
|
|
};
|
|
function shrink() {
|
|
currentMode = "";
|
|
zNode.innerHTML = profilesHTML
|
|
if (debugFlag == true) {
|
|
toggleButtonColor("debugButton");
|
|
};
|
|
|
|
document.getElementById("controlplanesButton").addEventListener("click", controlplanesButtonClickAction, false);
|
|
document.getElementById("stagesButton").addEventListener("click", stagesButtonClickAction, false);
|
|
document.getElementById("shrinkButton").addEventListener("click", shrinkButtonClickAction, false);
|
|
document.getElementById("debugButton").addEventListener("click", debugButtonClickAction, false);
|
|
};
|
|
|
|
};
|
|
|
|
// profile functions
|
|
function controlplanesButtonClickAction(zEvent) {
|
|
loadControlplanes();
|
|
};
|
|
function dataplanesButtonClickAction(zEvent) {
|
|
loadDataplanes();
|
|
};
|
|
function stagesButtonClickAction(zEvent) {
|
|
loadStages();
|
|
};
|
|
function shrinkButtonClickAction(zEvent) {
|
|
shrink();
|
|
};
|
|
function debugButtonClickAction(zEvent) {
|
|
toggleDebug();
|
|
toggleButtonColor("debugButton");
|
|
};
|
|
|
|
// aux functions
|
|
function applyButtonClickAction(zEvent) {
|
|
apply();
|
|
};
|
|
function allComponentsButtonClickAction(zEvent) {$
|
|
var enabledCount = 0
|
|
for (i = 0; i < componentArray.length; i++) {
|
|
var component = componentArray[i];
|
|
if (checkComponent(component) > 0) {
|
|
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 resetButtonClickAction(zEvent) {
|
|
reset();
|
|
};
|
|
function toggleComponent(component) {
|
|
if (checkComponent(component) < 1) {
|
|
selectComponent(component);
|
|
} else {
|
|
deselectComponent(component);
|
|
}
|
|
};
|
|
function toggleButtonColor(buttonName) {
|
|
var bg = document.getElementById(buttonName).style.background;
|
|
if(bg != '') {
|
|
clearButtonColor(buttonName);
|
|
} else {
|
|
setButtonColor(buttonName);
|
|
}
|
|
};
|
|
function checkComponent(component) {
|
|
var status = selectedComponents.get(component);
|
|
return status;
|
|
};
|
|
function checkRegion(region) {
|
|
var status = selectedRegions.get(region)
|
|
return status;
|
|
};
|
|
function selectComponent(component) {
|
|
var value = checkComponent(component)
|
|
value++
|
|
selectedComponents.set(component, value);
|
|
if (debugFlag == true) {
|
|
console.log(selectedComponents);
|
|
}
|
|
};
|
|
function deselectComponent(component) {
|
|
var value = checkComponent(component)
|
|
value--
|
|
selectedComponents.set(component, value);
|
|
if (debugFlag == true) {
|
|
console.log(selectedComponents);
|
|
};
|
|
};
|
|
function resetComponent(component) {
|
|
selectedComponents.set(component, 0);
|
|
if (debugFlag == true) {
|
|
console.log(selectedComponents);
|
|
};
|
|
};
|
|
function toggleRegion(buttonName, regionArray) {
|
|
if (checkButtonColor(buttonName) != 'rgb(0, 255, 0)') {
|
|
setButtonColor(buttonName);
|
|
for (i=0; i < regionArray.length; i++) {
|
|
selectRegion(regionArray[i])
|
|
}
|
|
} else {
|
|
clearButtonColor(buttonName);
|
|
for (i=0; i < regionArray.length; i++) {
|
|
deselectRegion(regionArray[i])
|
|
}
|
|
}
|
|
};
|
|
function selectRegion(region) {
|
|
var value = checkRegion(region)
|
|
value++
|
|
selectedRegions.set(region, value);
|
|
if (debugFlag == true) {
|
|
console.log(selectedRegions);
|
|
};
|
|
};
|
|
function deselectRegion(region) {
|
|
var value = checkRegion(region)
|
|
value--
|
|
selectedRegions.set(region, value);
|
|
if (debugFlag == true) {
|
|
console.log(selectedRegions);
|
|
};
|
|
};
|
|
function resetRegion(region) {
|
|
selectedRegions.set(region, 0);
|
|
if (debugFlag == true) {
|
|
console.log(selectedRegions);
|
|
};
|
|
};
|
|
function setButtonColor(buttonName) {
|
|
document.getElementById(buttonName).style.background = '#00FF00';
|
|
};
|
|
function clearButtonColor(buttonName) {
|
|
document.getElementById(buttonName).style.background = '';
|
|
};
|
|
function checkButtonColor(buttonName) {
|
|
var color = document.getElementById(buttonName).style.background;
|
|
return color;
|
|
};
|
|
function selectCheckbox(box) {
|
|
box.filter("A")[0].classList.add("checked");
|
|
box.filter("INPUT")[0].checked = true;
|
|
};
|
|
function deselectCheckbox(box) {
|
|
box.filter("A")[0].classList.remove("checked");
|
|
box.filter("INPUT")[0].checked = false;
|
|
};
|
|
function apply() {
|
|
if (debugFlag == true) {
|
|
console.log("Running apply()");
|
|
}
|
|
for (i = 0; i < componentArray.length; i++) {
|
|
var component = componentArray[i];
|
|
if (debugFlag == true) {
|
|
console.log("component: " + 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.checkbox.styled-checkbox").children().children().children().children()`;
|
|
var checkbox = eval(checkboxStr);
|
|
if (debugFlag == true) {
|
|
console.log("region: " + region);
|
|
console.log("groupName: " + groupName);
|
|
console.log("checkboxStr: " + checkboxStr);
|
|
}
|
|
if (checkRegion(region) > 0 && checkComponent(component) > 0) {
|
|
if (debugFlag == true) {
|
|
console.log("selecting checkbox")
|
|
}
|
|
selectCheckbox(checkbox);
|
|
if (debugFlag == true) {
|
|
console.log("checkbox selected")
|
|
}
|
|
} else {
|
|
if (debugFlag == true) {
|
|
console.log("deselecting checkbox")
|
|
}
|
|
deselectCheckbox(checkbox);
|
|
if (debugFlag == true) {
|
|
console.log("checkbox deselected")
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (typeof ceFlag != 'undefined') {
|
|
var checkboxStr = `$("div.form-group").filter(":contains('Community Edition')").children().slice(1).children().children().children().children().children()`;
|
|
var checkbox = eval(checkboxStr);
|
|
if (checkCe() == true) {
|
|
selectCheckbox(checkbox);
|
|
} else {
|
|
deselectCheckbox(checkbox);
|
|
}
|
|
}
|
|
};
|
|
function reset() {
|
|
if (debugFlag == true) {
|
|
console.log("Running reset()");
|
|
}
|
|
|
|
if (debugFlag == true) {
|
|
console.log("Clearing components");
|
|
console.log("componentArray: " + componentArray);
|
|
console.log("buttonArray: " + buttonArray);
|
|
};
|
|
for (i = 0; i < componentArray.length; i++) {
|
|
var component = componentArray[i];
|
|
if(debugFlag == true) {
|
|
console.log("Deselecting " + component);
|
|
}
|
|
resetComponent(component);
|
|
var buttonName = component + 'Button';
|
|
if(debugFlag == true) {
|
|
console.log("Clearing button " + buttonName);
|
|
}
|
|
clearButtonColor(buttonName);
|
|
};
|
|
|
|
if (debugFlag == true) {
|
|
console.log("Clearing regions");
|
|
console.log("regionArray: " + regionArray);
|
|
console.log("buttonArray: " + buttonArray);
|
|
};
|
|
for (i = 0; i < buttonArray.length; i++) {
|
|
var region = buttonArray[i];
|
|
var buttonName = region + 'Button';
|
|
if(debugFlag == true) {
|
|
console.log("region: " + region);
|
|
console.log("buttonName: " + buttonName);
|
|
}
|
|
if(debugFlag == true) {
|
|
console.log("clearButtonColor:" + buttonName);
|
|
}
|
|
clearButtonColor(buttonName);
|
|
if(debugFlag == true) {
|
|
console.log("clearButtonColor complete");
|
|
}
|
|
};
|
|
for (i = 0; i < regionArray.length; i++) {
|
|
var region = regionArray[i];
|
|
if(debugFlag == true) {
|
|
console.log("deselectRegion " + region);
|
|
}
|
|
resetRegion(region);
|
|
if(debugFlag == true) {
|
|
console.log("deselectRegion complete");
|
|
}
|
|
};
|
|
if (debugFlag == true) {
|
|
console.log("Checking for CE");
|
|
}
|
|
if (typeof ceFlag != 'undefined') {
|
|
if (debugFlag == true) {
|
|
console.log("CE found; deselectCe");
|
|
}
|
|
deselectCe();
|
|
if (debugFlag == true) {
|
|
console.log("Clearing ceButton if visible");
|
|
}
|
|
if (currentMode != 'stage') {
|
|
clearButtonColor("ceButton");
|
|
};
|
|
}
|
|
if (debugFlag == true) {
|
|
console.log("CE check complete");
|
|
}
|
|
apply();
|
|
if(debugFlag == true) {
|
|
console.log("reset() complete");
|
|
}
|
|
};
|
|
function checkDebug() {
|
|
var status = debugFlag;
|
|
return status;
|
|
};
|
|
function toggleDebug() {
|
|
if (checkDebug() == false) {
|
|
enableDebug();
|
|
} else {
|
|
disableDebug();
|
|
};
|
|
};
|
|
function enableDebug() {
|
|
debugFlag = true;
|
|
console.log("DEBUG logging enabled");
|
|
};
|
|
function disableDebug() {
|
|
debugFlag = false;
|
|
console.log("DEBUG logging disabled");
|
|
};
|
|
function selectCe() {
|
|
ceFlag = true;
|
|
if (debugFlag == true) {
|
|
console.log("DEBUG: ceFlag = " + ceFlag);
|
|
};
|
|
};
|
|
function deselectCe() {
|
|
ceFlag = false;
|
|
};
|
|
function toggleCe() {
|
|
if (checkCe() == false) {
|
|
selectCe();
|
|
} else {
|
|
deselectCe();
|
|
}
|
|
};
|
|
function checkCe() {
|
|
var status = ceFlag;
|
|
return status;
|
|
};
|