mirror of https://github.com/raftario/filite.git
Prevent overwrites from web UI (closes #12)
This commit is contained in:
parent
7dcf7c3746
commit
35ba76a28d
|
@ -318,13 +318,14 @@
|
|||
(x) => x.id === parseInt(urlInput.value, 36)
|
||||
)
|
||||
) {
|
||||
urlInput.classList.add("conflict");
|
||||
urlInput.setCustomValidity("ID already in use");
|
||||
} else {
|
||||
urlInput.classList.remove("conflict");
|
||||
urlInput.setCustomValidity("");
|
||||
}
|
||||
submitButton.disabled = inputs[group].some(
|
||||
(input) =>
|
||||
input.validity != undefined && !input.validity.valid
|
||||
input.validity !== undefined &&
|
||||
!input.validity.valid
|
||||
);
|
||||
};
|
||||
checkValidity();
|
||||
|
@ -394,6 +395,7 @@
|
|||
fetch(url, {
|
||||
method: "PUT",
|
||||
body: JSON.stringify({ forward }),
|
||||
headers: { "Content-Type": "application/json" },
|
||||
})
|
||||
.then((response) => {
|
||||
status = response.status;
|
||||
|
@ -421,6 +423,7 @@
|
|||
fetch(url, {
|
||||
method: "PUT",
|
||||
body: JSON.stringify({ contents, highlight }),
|
||||
headers: { "Content-Type": "application/json" },
|
||||
})
|
||||
.then((response) => {
|
||||
status = response.status;
|
||||
|
|
|
@ -277,7 +277,7 @@ pub fn init(init: bool) -> Config {
|
|||
}
|
||||
|
||||
let keep_empty = Confirmation::new()
|
||||
.with_text("Are you sure you want to leave an empty password? This will disable authentication")
|
||||
.with_text("Are you sure you want to leave an empty password? This will disable authentication.")
|
||||
.default(false)
|
||||
.interact()
|
||||
.unwrap_or_else(|e| {
|
||||
|
|
Loading…
Reference in New Issue