nazev u sluzby + kontrola u formulare nove

This commit is contained in:
JiriUhlir
2026-07-16 12:05:02 +02:00
parent 3dc0c5b146
commit ec9a643291
2 changed files with 65 additions and 2 deletions
+14
View File
@@ -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();