nazev u sluzby + kontrola u formulare nove
This commit is contained in:
@@ -149,6 +149,20 @@ document.addEventListener("DOMContentLoaded", () => {
|
||||
const status = document.getElementById("new-app-status");
|
||||
const result = document.getElementById("new-app-result");
|
||||
|
||||
// ID služby musí být vždy lowercase (Docker image/container, Gitea repo, URL).
|
||||
// Přepisujeme rovnou při psaní, ať uživatel vidí skutečnou hodnotu, která se odešle.
|
||||
const appIdInput = form.querySelector('input[name="app_id"]');
|
||||
if (appIdInput) {
|
||||
appIdInput.addEventListener("input", () => {
|
||||
const lowered = appIdInput.value.toLowerCase();
|
||||
if (appIdInput.value !== lowered) {
|
||||
const cursor = appIdInput.selectionStart;
|
||||
appIdInput.value = lowered;
|
||||
appIdInput.setSelectionRange(cursor, cursor);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
form.addEventListener("submit", async (event) => {
|
||||
event.preventDefault();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user