Update FStackMonkey.ps1
This commit is contained in:
@@ -857,7 +857,7 @@ function Invoke-ScriptMonkey {
|
|||||||
# 1) Inline your full original CSS here
|
# 1) Inline your full original CSS here
|
||||||
#
|
#
|
||||||
$style = @'
|
$style = @'
|
||||||
<style>
|
<style>
|
||||||
:root {
|
:root {
|
||||||
/* Cool Palette */
|
/* Cool Palette */
|
||||||
--background-color: rgba(18, 18, 18, 1);
|
--background-color: rgba(18, 18, 18, 1);
|
||||||
@@ -1012,17 +1012,17 @@ $style = @'
|
|||||||
.container { flex-direction:column; }
|
.container { flex-direction:column; }
|
||||||
.sidebar { width:100%; }
|
.sidebar { width:100%; }
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
'@
|
'@
|
||||||
|
|
||||||
$script = @'
|
$script = @'
|
||||||
<script>
|
<script>
|
||||||
// =======================================================================
|
// =======================================================================
|
||||||
// Tab Navigation
|
// Tab Navigation
|
||||||
// =======================================================================
|
// =======================================================================
|
||||||
const tabButtons = document.querySelectorAll(".tab-button");
|
const tabButtons = document.querySelectorAll(".tab-button");
|
||||||
const tabContents = document.querySelectorAll(".tab-content");
|
const tabContents = document.querySelectorAll(".tab-content");
|
||||||
tabButtons.forEach(btn => {
|
tabButtons.forEach(btn => {
|
||||||
btn.addEventListener("click", () => {
|
btn.addEventListener("click", () => {
|
||||||
// clear active state
|
// clear active state
|
||||||
tabButtons.forEach(b => b.classList.remove("active"));
|
tabButtons.forEach(b => b.classList.remove("active"));
|
||||||
@@ -1031,22 +1031,22 @@ $script = @'
|
|||||||
btn.classList.add("active");
|
btn.classList.add("active");
|
||||||
document.getElementById(btn.dataset.tab).classList.add("active");
|
document.getElementById(btn.dataset.tab).classList.add("active");
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
// initialize default tab on load
|
// initialize default tab on load
|
||||||
document.querySelector(".tab-button[data-tab='{{defaultPage}}Tab']").classList.add("active");
|
document.querySelector(".tab-button[data-tab='{{defaultPage}}Tab']").classList.add("active");
|
||||||
document.getElementById("{{defaultPage}}Tab").classList.add("active");
|
document.getElementById("{{defaultPage}}Tab").classList.add("active");
|
||||||
|
|
||||||
// =======================================================================
|
// =======================================================================
|
||||||
// Task Trigger
|
// Task Trigger
|
||||||
// =======================================================================
|
// =======================================================================
|
||||||
const tasks = [
|
const tasks = [
|
||||||
{{tasksJsAll}}
|
{{tasksJsAll}}
|
||||||
];
|
];
|
||||||
|
|
||||||
// =======================================================================
|
// =======================================================================
|
||||||
// Column “Select All” toggling for On-Boarding
|
// Column “Select All” toggling for On-Boarding
|
||||||
// =======================================================================
|
// =======================================================================
|
||||||
function toggleColumn(col) {
|
function toggleColumn(col) {
|
||||||
const master = document.getElementById(`selectAll${col[0].toUpperCase() + col.slice(1)}Checkbox`);
|
const master = document.getElementById(`selectAll${col[0].toUpperCase() + col.slice(1)}Checkbox`);
|
||||||
const children = document.querySelectorAll(`#onboardTab input[type=checkbox][data-column=${col}]`);
|
const children = document.querySelectorAll(`#onboardTab input[type=checkbox][data-column=${col}]`);
|
||||||
|
|
||||||
@@ -1060,7 +1060,7 @@ $script = @'
|
|||||||
cb.dispatchEvent(new Event('change'));
|
cb.dispatchEvent(new Event('change'));
|
||||||
});
|
});
|
||||||
}, 0);
|
}, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// =======================================================================
|
// =======================================================================
|
||||||
@@ -1104,16 +1104,16 @@ $script = @'
|
|||||||
// Fetch Sites Handler
|
// Fetch Sites Handler
|
||||||
// =======================================================================
|
// =======================================================================
|
||||||
async function fetchSites() {
|
async function fetchSites() {
|
||||||
const pwd = document.getElementById("Password").value;
|
const pwd = document.getElementById("Password").value;
|
||||||
if (!pwd) {
|
if (!pwd) {
|
||||||
alert("Please enter the password.");
|
alert("Please enter the password.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const dropdown = document.getElementById("dattoDropdown");
|
const dropdown = document.getElementById("dattoDropdown");
|
||||||
dropdown.innerHTML = '<option disabled selected>Loading sites...</option>';
|
dropdown.innerHTML = '<option disabled selected>Loading sites...</option>';
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const resp = await fetch("/getpw", {
|
const resp = await fetch("/getpw", {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
headers: { "Content-Type": "application/json" },
|
headers: { "Content-Type": "application/json" },
|
||||||
@@ -1133,12 +1133,12 @@ async function fetchSites() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
document.getElementById("dattoRmmContainer").style.display = "block";
|
document.getElementById("dattoRmmContainer").style.display = "block";
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
dropdown.innerHTML = '<option disabled selected>Error loading sites</option>';
|
dropdown.innerHTML = '<option disabled selected>Error loading sites</option>';
|
||||||
alert("Failed to fetch sites. Check password and try again.");
|
alert("Failed to fetch sites. Check password and try again.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1146,7 +1146,7 @@ async function fetchSites() {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
async function triggerInstall() {
|
async function triggerInstall() {
|
||||||
// disable the button so you can't double-click while work is in flight
|
// disable the button so you can't double-click while work is in flight
|
||||||
const runBtn = document.querySelector('.run-button');
|
const runBtn = document.querySelector('.run-button');
|
||||||
runBtn.disabled = true;
|
runBtn.disabled = true;
|
||||||
@@ -1183,25 +1183,25 @@ async function fetchSites() {
|
|||||||
// always re-enable, even if an error occurred
|
// always re-enable, even if an error occurred
|
||||||
runBtn.disabled = false;
|
runBtn.disabled = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// =======================================================================
|
// =======================================================================
|
||||||
// Shutdown Handler
|
// Shutdown Handler
|
||||||
// =======================================================================
|
// =======================================================================
|
||||||
function endSession() {
|
function endSession() {
|
||||||
fetch("/quit", { method: "GET" })
|
fetch("/quit", { method: "GET" })
|
||||||
.finally(() => window.close());
|
.finally(() => window.close());
|
||||||
}
|
}
|
||||||
|
|
||||||
// =======================================================================
|
// =======================================================================
|
||||||
// Sub-Options Auto-Toggle for Tasks
|
// Sub-Options Auto-Toggle for Tasks
|
||||||
// =======================================================================
|
// =======================================================================
|
||||||
|
|
||||||
|
|
||||||
document.addEventListener('DOMContentLoaded', function () {
|
document.addEventListener('DOMContentLoaded', function () {
|
||||||
// Auto-handle visibility and checking for tasks with sub-options
|
// Auto-handle visibility and checking for tasks with sub-options
|
||||||
const tasksWithSubOptions = document.querySelectorAll('[id$="OptionsContainer"]');
|
const tasksWithSubOptions = document.querySelectorAll('[id$="OptionsContainer"]');
|
||||||
|
|
||||||
@@ -1228,14 +1228,14 @@ async function fetchSites() {
|
|||||||
masterCheckbox.addEventListener('change', updateVisibility);
|
masterCheckbox.addEventListener('change', updateVisibility);
|
||||||
updateVisibility(); // call once on load
|
updateVisibility(); // call once on load
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// ===========================================
|
// ===========================================
|
||||||
// ─ rotating tagline ───────────────────────────────
|
// ─ rotating tagline ───────────────────────────────
|
||||||
// ===========================================
|
// ===========================================
|
||||||
|
|
||||||
document.addEventListener('DOMContentLoaded', () => {
|
document.addEventListener('DOMContentLoaded', () => {
|
||||||
const taglines = [
|
const taglines = [
|
||||||
"Fast deployments, no monkey business.",
|
"Fast deployments, no monkey business.",
|
||||||
"Bananas for better builds.",
|
"Bananas for better builds.",
|
||||||
"Deploy without flinging code.",
|
"Deploy without flinging code.",
|
||||||
@@ -1248,22 +1248,22 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||||||
"Why throw code when the monkey's got it?",
|
"Why throw code when the monkey's got it?",
|
||||||
"Deployments so easy, a monkey could do it. Ours does.",
|
"Deployments so easy, a monkey could do it. Ours does.",
|
||||||
"Monkey in the stack, not on your back."
|
"Monkey in the stack, not on your back."
|
||||||
];
|
];
|
||||||
|
|
||||||
const el = document.getElementById("tagline");
|
const el = document.getElementById("tagline");
|
||||||
let idx = Math.floor(Math.random() * taglines.length);
|
let idx = Math.floor(Math.random() * taglines.length);
|
||||||
el.textContent = taglines[idx];
|
el.textContent = taglines[idx];
|
||||||
|
|
||||||
setInterval(() => {
|
setInterval(() => {
|
||||||
idx = (idx + 1) % taglines.length;
|
idx = (idx + 1) % taglines.length;
|
||||||
el.textContent = taglines[idx];
|
el.textContent = taglines[idx];
|
||||||
}, 10_000);
|
}, 10_000);
|
||||||
});
|
});
|
||||||
|
|
||||||
// when the browser window is closed (X), notify the server to quit
|
// when the browser window is closed (X), notify the server to quit
|
||||||
window.addEventListener('beforeunload', () => {
|
window.addEventListener('beforeunload', () => {
|
||||||
// keepalive: true ensures the request is sent even as the page unloads
|
// keepalive: true ensures the request is sent even as the page unloads
|
||||||
fetch('/quit', { method: 'GET', keepalive: true });
|
fetch('/quit', { method: 'GET', keepalive: true });
|
||||||
});
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
Reference in New Issue
Block a user