change the password check
This commit is contained in:
20
samy.js
20
samy.js
@@ -223,11 +223,8 @@ document.addEventListener("DOMContentLoaded", () => {
|
|||||||
// =======================================================================
|
// =======================================================================
|
||||||
async function fetchSites() {
|
async function fetchSites() {
|
||||||
const pwdInput = document.getElementById("Password");
|
const pwdInput = document.getElementById("Password");
|
||||||
const pwd = pwdInput?.value;
|
const pwd = (pwdInput?.value ?? ""); // allow empty string
|
||||||
if (!pwd) {
|
|
||||||
alert("Please enter the password.");
|
|
||||||
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>';
|
||||||
@@ -256,7 +253,8 @@ async function fetchSites() {
|
|||||||
console.error(e);
|
console.error(e);
|
||||||
dropdown.innerHTML =
|
dropdown.innerHTML =
|
||||||
'<option disabled selected>Error loading sites</option>';
|
'<option disabled selected>Error loading sites</option>';
|
||||||
alert("Failed to fetch sites. Check password and try again.");
|
alert("Failed to fetch sites. Check password or confirm your public IP is allowlisted.");
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -268,11 +266,8 @@ let allPrinters = [];
|
|||||||
// POST /getprinters with password from Devices tab
|
// POST /getprinters with password from Devices tab
|
||||||
async function fetchPrinters() {
|
async function fetchPrinters() {
|
||||||
const pwdInput = document.getElementById("PrinterPassword");
|
const pwdInput = document.getElementById("PrinterPassword");
|
||||||
const pwd = pwdInput?.value;
|
|
||||||
if (!pwd) {
|
const pwd = (pwdInput?.value ?? ""); // allow blank
|
||||||
alert("Please enter the printer password.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const clientContainer = document.getElementById("printerClientContainer");
|
const clientContainer = document.getElementById("printerClientContainer");
|
||||||
const listContainer = document.getElementById("printerListContainer");
|
const listContainer = document.getElementById("printerListContainer");
|
||||||
@@ -324,7 +319,8 @@ async function fetchPrinters() {
|
|||||||
dropdown.innerHTML =
|
dropdown.innerHTML =
|
||||||
'<option disabled selected>Error loading clients</option>';
|
'<option disabled selected>Error loading clients</option>';
|
||||||
}
|
}
|
||||||
alert("Failed to fetch printers. Check password and try again.");
|
alert("Failed to fetch printers. Check password or confirm your public IP is allowlisted.");
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user