From 0cd7cc27302bc50ae7f6854d026f29a22d930e26 Mon Sep 17 00:00:00 2001 From: aceberg <1502200+aceberg@users.noreply.github.com> Date: Mon, 24 Mar 2025 00:28:40 +0700 Subject: [PATCH] Remove old files --- internal/web/public/box.svg | 2 - internal/web/public/css/index.css | 30 --- internal/web/public/js/filter-search.js | 68 ------- internal/web/public/js/hist-html.js | 24 --- internal/web/public/js/history.js | 66 ------- internal/web/public/js/host-scan.js | 54 ------ internal/web/public/js/host.js | 47 ----- internal/web/public/js/index.js | 98 ---------- internal/web/public/js/notify.js | 5 - internal/web/public/js/refresh.js | 26 --- internal/web/public/js/sort.js | 47 ----- internal/web/templates/config.html | 233 ------------------------ internal/web/templates/footer.html | 4 - internal/web/templates/header.html | 57 ------ internal/web/templates/history.html | 40 ---- internal/web/templates/host.html | 120 ------------ internal/web/templates/old_index.html | 73 -------- 17 files changed, 994 deletions(-) delete mode 100644 internal/web/public/box.svg delete mode 100644 internal/web/public/css/index.css delete mode 100644 internal/web/public/js/filter-search.js delete mode 100644 internal/web/public/js/hist-html.js delete mode 100644 internal/web/public/js/history.js delete mode 100644 internal/web/public/js/host-scan.js delete mode 100644 internal/web/public/js/host.js delete mode 100644 internal/web/public/js/index.js delete mode 100644 internal/web/public/js/notify.js delete mode 100644 internal/web/public/js/refresh.js delete mode 100644 internal/web/public/js/sort.js delete mode 100644 internal/web/templates/config.html delete mode 100644 internal/web/templates/footer.html delete mode 100644 internal/web/templates/header.html delete mode 100644 internal/web/templates/history.html delete mode 100644 internal/web/templates/host.html delete mode 100644 internal/web/templates/old_index.html diff --git a/internal/web/public/box.svg b/internal/web/public/box.svg deleted file mode 100644 index a9d9224..0000000 --- a/internal/web/public/box.svg +++ /dev/null @@ -1,2 +0,0 @@ - \ No newline at end of file diff --git a/internal/web/public/css/index.css b/internal/web/public/css/index.css deleted file mode 100644 index 0660a2d..0000000 --- a/internal/web/public/css/index.css +++ /dev/null @@ -1,30 +0,0 @@ -/* Sort button */ -.my-btn { - height: 100%; - background-color: #00000000; - color: var(--bs-primary); - text-align: center; -} -.my-btn:hover { - background-color: #0000001a; -} - -/* History box */ -.my-box-on::before, .my-box-off::before { - content: url(/fs/public/box.svg); - border-left: thin solid black; -} -.my-box-on { - background-color: var(--bs-success); -} -.my-box-off { - background-color: var(--bs-gray-500); -} -.my-box-on:hover, .my-box-off:hover { - background-color: #0000001a; -} - - -.hidden { - display: none; -} \ No newline at end of file diff --git a/internal/web/public/js/filter-search.js b/internal/web/public/js/filter-search.js deleted file mode 100644 index 7287df7..0000000 --- a/internal/web/public/js/filter-search.js +++ /dev/null @@ -1,68 +0,0 @@ -let oldFilter = ''; -let bkpArray; - -function filterFunc(field, value) { - - if (oldFilter == field) { - addrsArray = bkpArray; - } - - switch (field) { - case 'iface': - addrsArray = addrsArray.filter((item) => item.Iface == value); - break; - case 'known': - addrsArray = addrsArray.filter((item) => item.Known == value); - break; - case 'line': - addrsArray = addrsArray.filter((item) => item.Now == value); - break; - default: - console.log("Filter error"); - } - - oldFilter = field; - - displayArrayData(addrsArray); -} - -function resetFilter() { - addrsArray = bkpArray; - displayArrayData(addrsArray); -} - -function searchFunc() { - const s = document.getElementById('search').value; - - if (s != "") { - - const sl = s.toLowerCase(); - - let newArray = []; - - for (let item of addrsArray) { - - if (searchItem(item, sl)) { - newArray.push(item); - } - } - addrsArray = newArray; - } else { - addrsArray = bkpArray; - } - - displayArrayData(addrsArray); -} - -function searchItem(item, sl) { - - const name = item.Name.toLowerCase(); - const hw = item.Hw.toLowerCase(); - const mac = item.Mac.toLowerCase(); - - if ((name.includes(sl)) || (item.Iface.includes(sl)) || (item.IP.includes(sl)) || (mac.includes(sl)) || (hw.includes(sl)) || (item.Date.includes(sl))) { - return true; - } else { - return false; - } -} \ No newline at end of file diff --git a/internal/web/public/js/hist-html.js b/internal/web/public/js/hist-html.js deleted file mode 100644 index c0d7313..0000000 --- a/internal/web/public/js/hist-html.js +++ /dev/null @@ -1,24 +0,0 @@ - -function getHistHTML(hist) { - - let html = '', col, title; - - for (let h of hist) { - if (h.Now != 0) { - col = `my-box-on`; - } else { - col = `my-box-off`; - } - title = `title="Date: ${h.Date}\nIface: ${h.Iface}\nIP: ${h.IP}\nKnown: ${h.Known}"`; - - html = html + ``; - } - return html; -} - -function sortHistByDate(hist) { - - hist.sort((a, b) => (a.Date < b.Date ? 1 : -1)); - - return hist; -} \ No newline at end of file diff --git a/internal/web/public/js/history.js b/internal/web/public/js/history.js deleted file mode 100644 index 8599705..0000000 --- a/internal/web/public/js/history.js +++ /dev/null @@ -1,66 +0,0 @@ -let show = 500; -let addrsArray; - -loadAddrs(); - -async function loadAddrs() { - - const n = localStorage.getItem("histShow"); - if (n != null) { - show = n; - } - - const url = '/api/all'; - addrsArray = await (await fetch(url)).json(); - - loadHistory(); -} - -async function loadHistory() { - - let tr, td, url, hist; - let i = 0; - - document.getElementById('showHist').innerHTML = ''; - - for (let a of addrsArray) { - url = '/api/history/'+a.Mac; - hist = await (await fetch(url)).json(); - - if (hist != null) { - hist = sortHistByDate(hist); - - if (show > 0) { - hist = hist.slice(0, show); - } - - td = getHistHTML(hist); // hist-html.js - } - - i = i + 1; - - tr = ` -
${a.Name}
- - -● After changing Host or Port the app must be restarted
-● Shoutrrr URL provides notifications to Discord, Email, Gotify, Telegram and other services. Link to documentation
-● Interfaces - one or more, space separated
-● Timeout (seconds) - time between scans
-● Args for arp-scan - pass your own arguments to arp-scan. Enable debug log level to see resulting command. (Example: -r 1). See docs for more.
● Arp Strings - can setup scans for vlans, docker0 and etcetera. See docs for more.
● Trim History - remove history after (hours)
-● Store History in DB - if off, the History will be stored only in memory and will be lost on app restart. Though, it will keep the app DB smaller and InfluxDB is recommended for long term History storage
-● PG Connect URL - address to connect to PostgreSQL DB. (Example: postgres://username:password@192.168.0.1:5432/dbname?sslmode=disable). Full list of URL parameters here
● If you find this app useful, please, donate
-● Commission you own app (Golang, HTML/JS, Flutter). Contact here
-