]> git.giorgioravera.it Git - network-manager.git/commitdiff
Fixed after CI check
authorGiorgio Ravera <giorgio.ravera@gmail.com>
Mon, 26 Jan 2026 20:44:58 +0000 (21:44 +0100)
committerGiorgio Ravera <giorgio.ravera@gmail.com>
Mon, 26 Jan 2026 20:44:58 +0000 (21:44 +0100)
Dockerfile
README.md
backend/routes/about.py
backend/routes/login.py
backend/security.py
frontend/hosts.html
frontend/js/hosts.js

index 2cbe9ff11be1c444521ca2c13b8204513c35e121..c46c04ca4c9a45913c25d545c8150e378a78c1ec 100644 (file)
@@ -45,7 +45,7 @@ COPY --from=builder /app/entrypoint.py entrypoint.py
 COPY --from=builder /app/log log
 COPY --from=builder /app/settings settings
 
-# Ensure Python sees the installed packages 
+# Ensure Python sees the installed packages
 ENV PYTHONPATH="/usr/local/lib/python3.12/site-packages"
 
 ENTRYPOINT ["/app/entrypoint.py"]
index 87cdba21db720cf0d108908e4ee2c088e2763cda..ac1c5bebdf377ff8176de29b1776b97e96e2cd21 100644 (file)
--- a/README.md
+++ b/README.md
@@ -217,7 +217,7 @@ docker compose up --build -d --force-recreate
 - Use a reverse proxy with TLS
 - Do not put passwords in the repository
 
----  
+---
 ## ðŸ“„ License
 [MIT](http://opensource.org/licenses/MIT) â€“ see the local [LICENSE](LICENSE) file Â© Giorgio Ravera
 
index 096a7c334e183561403e36ed087afa78f8cc3b97..4a154aacec1894a747ee56c705c60a1bfb3e3710 100644 (file)
@@ -15,11 +15,11 @@ router = APIRouter()
 def about():
     return {
         "app": {
-            "version": settings.APP_VERSION
+            "version": settings.APP_VERSION,
         },
         "baseimg": {
-            "name": settings.BASEIMG_NAME, 
-            "version": settings.BASEIMG_VERSION
+            "name": settings.BASEIMG_NAME,
+            "version": settings.BASEIMG_VERSION,
         },
         "domain": settings.DOMAIN,
         "admin_hash_loaded": settings.ADMIN_PASSWORD_HASH is not None,
index 2b7a2246aa135db6426f1df8f4bd6a98baa3b4a9..e7521654571c81418e20a12900e50f2995931685 100644 (file)
@@ -13,7 +13,7 @@ from settings.settings import settings
 # Create Router
 router = APIRouter()
 
-# IP -> lista timestamp tentativi 
+# IP -> lista timestamp tentativi
 login_attempts = {}
 
 def check_rate_limit(ip: str):
@@ -59,7 +59,7 @@ def api_login(request: Request, data: dict, response: Response):
     pwd = data.get("password")
 
     if verify_login(user, pwd):
-        # reset tentativi su IP 
+        # reset tentativi su IP
         login_attempts.pop(ip, None)
 
         apply_session(response, username=user)
index f0792d5fde21ad368f39c1f9b9812cd6bae05d20..5974114cab30df4bfb0c2a9881244c6e0e3bb7cb 100644 (file)
@@ -82,7 +82,7 @@ def is_logged_in(request: Request) -> bool:
 # -----------------------------
 def close_session(response):
     logger = get_logger(__name__)
-    
+
     response.delete_cookie(
         key="session",
         path="/"
index ca8ff9a95ae3cdf9f89d2a3159b55b9010ea9728..88b7fce0bfb3542b40a6be4237993fff31c9d227 100644 (file)
                             data-bs-toggle="modal" data-bs-target="#addHostModal">
                         <i class="bi bi-plus-lg"></i><span class="label"> Add Host</span>
                     </button>
-                    <button class="btn btn-primary" title="Reload DNS (BIND)" aria-label="Reload DNS" 
+                    <button class="btn btn-primary" title="Reload DNS (BIND)" aria-label="Reload DNS"
                             data-action="reloadDns">
                         <i class="bi bi-arrow-repeat"></i><span class="label"> Reload DNS</span>
                     </button>
-                    <button class="btn btn-primary" title="Reload DHCP (Kea)" aria-label="Reload DHCP" 
+                    <button class="btn btn-primary" title="Reload DHCP (Kea)" aria-label="Reload DHCP"
                             data-action="reloadDhcp">
                         <i class="bi bi-arrow-repeat"></i><span class="label"> Reload DHCP</span>
                     </button>
index 193a0409630f86ab451c1713451e59029763f2b3..df9096ffe0295ae3206e39625ad0a47bbbb0e2be 100644 (file)
@@ -130,7 +130,7 @@ async function loadHosts() {
                     data-host-id="${id}">
                 <i class="bi bi-pencil-fill icon icon-action" aria-hidden="true"></i>
             </span>
-            <span class="action-icon" 
+            <span class="action-icon"
                     role="button" tabindex="0"
                     title="Delete host" aria-label="Delete host"
                     aria-label="Delete host"
@@ -156,7 +156,7 @@ async function loadHosts() {
 async function editHost(id) {
     // Clear form first
     clearAddHostForm();
-    
+
     try {
         const res = await fetch(`/api/hosts/${id}`);
         if (!res.ok) throw new Error(`Fetch failed for host ${id}: ${res.status}`);
@@ -202,7 +202,7 @@ async function saveHost(hostData) {
     if (!isValidMAC(hostData.mac)) {
         showToast("Invalid MAC format", false);
         return false;
-    } 
+    }
 
     try {
         if (editingHostId !== null) {
@@ -212,7 +212,7 @@ async function saveHost(hostData) {
                 headers: { "Content-Type": "application/json" },
                 body: JSON.stringify(hostData)
             });
-            if (res.ok) { 
+            if (res.ok) {
                 showToast("Host updated successfully");
             } else {
                 throw new Error(`Update failed: ${res.status}`);
@@ -656,7 +656,7 @@ const actionHandlers = {
   async delete(e, el) { handleDeleteHost(e, el); },
 
   // edit is handled by bootstrap modal show event
-  edit(e, el) { 
+  edit(e, el) {
     // no-op o log
   },
 
@@ -704,7 +704,7 @@ document.addEventListener("DOMContentLoaded", async () => {
     document.addEventListener("keydown", (e) => {
         // Ignore if focus is in a typing field
         const tag = (e.target.tagName || "").toLowerCase();
-        const isTypingField = 
+        const isTypingField =
             tag === "input" || tag === "textarea" || tag === "select" || e.target.isContentEditable;
 
         if (e.key === "Escape" && !isTypingField) {
@@ -733,8 +733,8 @@ document.addEventListener("DOMContentLoaded", async () => {
             // check Add or Edit mode
             const idAttr = lastTriggerEl?.getAttribute?.('data-host-id');
             const id = idAttr ? Number(idAttr) : null;
-            
-            if (Number.isFinite(id)) {  
+
+            if (Number.isFinite(id)) {
                 // Edit Mode
                 console.log("Modal in EDIT mode for host ID:", id);
                 try {
@@ -789,7 +789,7 @@ document.addEventListener("DOMContentLoaded", async () => {
         document.addEventListener('click', async (e) => {
             const el = e.target.closest('[data-action]');
             if (!el) return;
-          
+
             const action = el.dataset.action;
             const handler = actionHandlers[action];
             if (!handler) return;
@@ -808,12 +808,12 @@ document.addEventListener("DOMContentLoaded", async () => {
             const isEnter = e.key === 'Enter';
             const isSpace = e.key === ' ' || e.key === 'Spacebar';
             if (!isEnter && !isSpace) return;
-            
+
             const el = e.target.closest('[data-action]');
             if (!el) return;
 
             // Trigger click event
-            el.click(); 
+            el.click();
         });
     }
 });