use css vars for coloring
Signed-off-by: Arthur Lu <learthurgo@gmail.com>
This commit is contained in:
@@ -325,7 +325,7 @@ async function handleDiskDelete () {
|
||||
document.body.append(dialog);
|
||||
|
||||
dialog.header = `Delete ${this.dataset.disk}`;
|
||||
dialog.formBody = `<p style="color: #FF0000;">Are you sure you want to <strong>delete</strong> disk</p><p style="color: #FF0000;">${this.dataset.disk}</p>`;
|
||||
dialog.formBody = `<p>Are you sure you want to <strong>delete</strong> disk</p><p>${this.dataset.disk}</p>`;
|
||||
|
||||
dialog.callback = async (result, form) => {
|
||||
if (result === "confirm") {
|
||||
|
@@ -16,7 +16,7 @@ async function init (){
|
||||
});
|
||||
formSubmitButton.addEventListener("click", async (e) => {
|
||||
status.innerText = "";
|
||||
status.style.color = "#000000";
|
||||
status.style.color = "var(--content-txt-color)";
|
||||
e.preventDefault();
|
||||
let form = document.querySelector("form");
|
||||
let formData = new FormData(form);
|
||||
@@ -25,21 +25,21 @@ async function init (){
|
||||
let ticket = await requestTicket(formData.get("username"), formData.get("password"), formData.get("realm"));
|
||||
setTicket(ticket.data.ticket, ticket.data.CSRFPreventionToken, formData.get("username"));
|
||||
status.innerText = "Authentication successful!"
|
||||
status.style.color = "#00ff00";
|
||||
status.style.color = "var(--success-color)";
|
||||
goToPage("index.html");
|
||||
}
|
||||
catch (error) {
|
||||
if(error instanceof ResponseError) { // response error is usually 401 auth failed
|
||||
status.innerText = "Authentication failed.";
|
||||
status.style.color = "#ff0000";
|
||||
status.style.color = "var(--fail-color)";
|
||||
}
|
||||
else if (error instanceof NetworkError) {
|
||||
status.innerText = "Encountered a network error.";
|
||||
status.style.color = "#ff0000";
|
||||
status.style.color = "var(--fail-color)";
|
||||
}
|
||||
else {
|
||||
status.innerText = "An error occured.";
|
||||
status.style.color = "#ff0000";
|
||||
status.style.color = "var(--fail-color)";
|
||||
console.error(error);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user