From 545eac368e8ea3df8d0e38f8e360da05428d4845 Mon Sep 17 00:00:00 2001 From: aceberg <1502200+aceberg@users.noreply.github.com> Date: Fri, 21 Mar 2025 15:34:49 +0700 Subject: [PATCH] Header --- frontend/index.html | 3 - frontend/src/App.tsx | 4 + .../{BodyCardHead.tsx => Body/CardHead.tsx} | 10 +-- .../src/components/{ => Body}/TableHead.tsx | 4 +- .../src/components/{ => Body}/TableRow.tsx | 4 +- frontend/src/components/Header.tsx | 73 +++++++++++++++++++ .../HostCard.tsx} | 8 +- .../{HostPagePing.tsx => HostPage/Ping.tsx} | 8 +- frontend/src/functions/exports.ts | 2 + frontend/src/pages/Body.tsx | 8 +- frontend/src/pages/HostPage.tsx | 15 ++-- internal/web/api.go | 1 + internal/web/host.go | 22 ------ internal/web/index.go | 2 - ...tPage-BkN2pMDv.js => HostPage-CDE6gnSf.js} | 2 +- internal/web/public/assets/index.js | 2 +- internal/web/templates/index.html | 17 ++++- 17 files changed, 124 insertions(+), 61 deletions(-) rename frontend/src/components/{BodyCardHead.tsx => Body/CardHead.tsx} (76%) rename frontend/src/components/{ => Body}/TableHead.tsx (90%) rename frontend/src/components/{ => Body}/TableRow.tsx (94%) create mode 100644 frontend/src/components/Header.tsx rename frontend/src/components/{HostPageHost.tsx => HostPage/HostCard.tsx} (93%) rename frontend/src/components/{HostPagePing.tsx => HostPage/Ping.tsx} (93%) delete mode 100644 internal/web/host.go rename internal/web/public/assets/{HostPage-BkN2pMDv.js => HostPage-CDE6gnSf.js} (84%) diff --git a/frontend/index.html b/frontend/index.html index a6b893d..a786211 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -5,9 +5,6 @@ WatchYourLAN - - -
diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 10ce092..77b3d93 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -4,6 +4,7 @@ import './App.css'; import { runAtStart } from './functions/atstart'; import Body from './pages/Body'; +import Header from './components/Header'; function App() { @@ -14,6 +15,8 @@ function App() { const HostPage = lazy(() => import("./pages/HostPage")); return ( + <> +
@@ -24,6 +27,7 @@ function App() {
+ ) } diff --git a/frontend/src/components/BodyCardHead.tsx b/frontend/src/components/Body/CardHead.tsx similarity index 76% rename from frontend/src/components/BodyCardHead.tsx rename to frontend/src/components/Body/CardHead.tsx index 7a6523b..ebf8c02 100644 --- a/frontend/src/components/BodyCardHead.tsx +++ b/frontend/src/components/Body/CardHead.tsx @@ -1,9 +1,9 @@ import { Show } from "solid-js"; -import { editNames, setEditNames } from "../functions/exports"; -import Filter from "./Filter"; -import Search from "./Search"; +import { editNames, setEditNames } from "../../functions/exports"; +import Filter from "../Filter"; +import Search from "../Search"; -function BodyCardHead() { +function CardHead() { return (
@@ -25,4 +25,4 @@ function BodyCardHead() { ) } -export default BodyCardHead +export default CardHead diff --git a/frontend/src/components/TableHead.tsx b/frontend/src/components/Body/TableHead.tsx similarity index 90% rename from frontend/src/components/TableHead.tsx rename to frontend/src/components/Body/TableHead.tsx index f769b1a..4b91d44 100644 --- a/frontend/src/components/TableHead.tsx +++ b/frontend/src/components/Body/TableHead.tsx @@ -1,5 +1,5 @@ -import { Host } from "../functions/exports"; -import { sortByAnyField } from "../functions/sort"; +import { Host } from "../../functions/exports"; +import { sortByAnyField } from "../../functions/sort"; function TableHead() { diff --git a/frontend/src/components/TableRow.tsx b/frontend/src/components/Body/TableRow.tsx similarity index 94% rename from frontend/src/components/TableRow.tsx rename to frontend/src/components/Body/TableRow.tsx index 070ad10..2959734 100644 --- a/frontend/src/components/TableRow.tsx +++ b/frontend/src/components/Body/TableRow.tsx @@ -1,6 +1,6 @@ import { createSignal, Show } from "solid-js"; -import { editNames } from "../functions/exports"; -import { apiEditHost } from "../functions/api"; +import { editNames } from "../../functions/exports"; +import { apiEditHost } from "../../functions/api"; function TableRow(_props: any) { diff --git a/frontend/src/components/Header.tsx b/frontend/src/components/Header.tsx new file mode 100644 index 0000000..164df66 --- /dev/null +++ b/frontend/src/components/Header.tsx @@ -0,0 +1,73 @@ +import { createSignal } from "solid-js"; +import { Conf } from "../functions/exports"; + +function Header() { + + const [themePath, setThemePath] = createSignal(''); + const [iconsPath, setIconsPath] = createSignal(''); + + const setCurrentTheme = (appConfig:Conf) => { + const theme = appConfig.Theme?appConfig.Theme:"sand"; + const color = appConfig.Color?appConfig.Color:"dark"; + + if (appConfig.NodePath == '') { + setThemePath("https://cdn.jsdelivr.net/npm/aceberg-bootswatch-fork@v5.3.3-2/dist/"+theme+"/bootstrap.min.css"); + setIconsPath("https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.css"); + } else { + setThemePath(appConfig.NodePath+"/node_modules/bootswatch/dist/"+theme+"/bootstrap.min.css"); + setIconsPath(appConfig.NodePath+"/node_modules/bootstrap-icons/font/bootstrap-icons.css"); + } + + document.documentElement.setAttribute("data-bs-theme", color); + color === "dark" + ? document.documentElement.style.setProperty('--transparent-light', '#ffffff15') + : document.documentElement.style.setProperty('--transparent-light', '#00000015'); + } + setCurrentTheme({ + Theme: "sand", + Color: "dark", + Timeout: 120, + NodePath: "", + }); + + return ( + <> + {/* icons */} + {/* theme */} + + + ) +}; + +export default Header diff --git a/frontend/src/components/HostPageHost.tsx b/frontend/src/components/HostPage/HostCard.tsx similarity index 93% rename from frontend/src/components/HostPageHost.tsx rename to frontend/src/components/HostPage/HostCard.tsx index 4ba0fa5..47b1e42 100644 --- a/frontend/src/components/HostPageHost.tsx +++ b/frontend/src/components/HostPage/HostCard.tsx @@ -1,7 +1,7 @@ -import { apiDelHost, apiEditHost } from "../functions/api"; -import { currentHost } from "../functions/exports"; +import { apiDelHost, apiEditHost } from "../../functions/api"; +import { currentHost } from "../../functions/exports"; -function HostPageHost() { +function HostCard() { let name:string = ""; @@ -98,4 +98,4 @@ function HostPageHost() { ) } -export default HostPageHost \ No newline at end of file +export default HostCard \ No newline at end of file diff --git a/frontend/src/components/HostPagePing.tsx b/frontend/src/components/HostPage/Ping.tsx similarity index 93% rename from frontend/src/components/HostPagePing.tsx rename to frontend/src/components/HostPage/Ping.tsx index 0be37fd..6799892 100644 --- a/frontend/src/components/HostPagePing.tsx +++ b/frontend/src/components/HostPage/Ping.tsx @@ -1,9 +1,9 @@ import { createSignal, For } from "solid-js"; -import { apiPortScan } from "../functions/api"; -import { currentHost } from "../functions/exports"; +import { apiPortScan } from "../../functions/api"; +import { currentHost } from "../../functions/exports"; -function HostPagePing() { +function Ping() { let stop = false; @@ -75,4 +75,4 @@ function HostPagePing() { ) } -export default HostPagePing \ No newline at end of file +export default Ping \ No newline at end of file diff --git a/frontend/src/functions/exports.ts b/frontend/src/functions/exports.ts index 46f7d4a..82d2079 100644 --- a/frontend/src/functions/exports.ts +++ b/frontend/src/functions/exports.ts @@ -27,8 +27,10 @@ export const emptyHost:Host = { }; export interface Conf { + Theme: string; Color: string; Timeout: number; + NodePath: string; }; diff --git a/frontend/src/pages/Body.tsx b/frontend/src/pages/Body.tsx index e7e6305..3cc2912 100644 --- a/frontend/src/pages/Body.tsx +++ b/frontend/src/pages/Body.tsx @@ -2,16 +2,16 @@ import { For } from "solid-js"; import { allHosts } from "../functions/exports"; -import TableRow from "../components/TableRow"; -import TableHead from "../components/TableHead"; -import BodyCardHead from "../components/BodyCardHead"; +import TableRow from "../components/Body/TableRow"; +import TableHead from "../components/Body/TableHead"; +import CardHead from "../components/Body/CardHead"; function Body() { return (
- +
diff --git a/frontend/src/pages/HostPage.tsx b/frontend/src/pages/HostPage.tsx index 6ad2627..c27aedd 100644 --- a/frontend/src/pages/HostPage.tsx +++ b/frontend/src/pages/HostPage.tsx @@ -1,10 +1,11 @@ import { useParams } from "@solidjs/router"; -import { apiGetHost } from "../functions/api"; - -import HostPageHost from "../components/HostPageHost"; -import { setCurrentHost } from "../functions/exports"; import { onMount } from "solid-js"; -import HostPagePing from "../components/HostPagePing"; + +import { apiGetHost } from "../functions/api"; +import { setCurrentHost } from "../functions/exports"; + +import HostCard from "../components/HostPage/HostCard"; +import Ping from "../components/HostPage/Ping"; function HostPage() { @@ -18,10 +19,10 @@ function HostPage() { return (
- +
- +
) diff --git a/internal/web/api.go b/internal/web/api.go index bd88f00..4eb998e 100644 --- a/internal/web/api.go +++ b/internal/web/api.go @@ -43,6 +43,7 @@ func apiHost(c *gin.Context) { idStr := c.Param("id") host := getHostByID(idStr, allHosts) // functions.go + _, host.DNS = updateDNS(host) c.IndentedJSON(http.StatusOK, host) } diff --git a/internal/web/host.go b/internal/web/host.go deleted file mode 100644 index bc22bf5..0000000 --- a/internal/web/host.go +++ /dev/null @@ -1,22 +0,0 @@ -package web - -import ( - "net/http" - - "github.com/gin-gonic/gin" - - "github.com/aceberg/WatchYourLAN/internal/models" -) - -func hostHandler(c *gin.Context) { - var guiData models.GuiData - guiData.Config = appConfig - - idStr := c.Param("id") - host := getHostByID(idStr, allHosts) - _, host.DNS = updateDNS(host) - guiData.Host = host - - c.HTML(http.StatusOK, "header.html", guiData) - c.HTML(http.StatusOK, "host.html", guiData) -} diff --git a/internal/web/index.go b/internal/web/index.go index 473bed1..4c1bc5a 100644 --- a/internal/web/index.go +++ b/internal/web/index.go @@ -13,7 +13,6 @@ func indexHandler(c *gin.Context) { guiData.Config = appConfig guiData.Themes = getAllIfaces(allHosts) - c.HTML(http.StatusOK, "header.html", guiData) c.HTML(http.StatusOK, "index.html", guiData) } @@ -21,6 +20,5 @@ func historyHandler(c *gin.Context) { var guiData models.GuiData guiData.Config = appConfig - c.HTML(http.StatusOK, "header.html", guiData) c.HTML(http.StatusOK, "history.html", guiData) } diff --git a/internal/web/public/assets/HostPage-BkN2pMDv.js b/internal/web/public/assets/HostPage-CDE6gnSf.js similarity index 84% rename from internal/web/public/assets/HostPage-BkN2pMDv.js rename to internal/web/public/assets/HostPage-CDE6gnSf.js index 041c8e6..1fa3e95 100644 --- a/internal/web/public/assets/HostPage-BkN2pMDv.js +++ b/internal/web/public/assets/HostPage-CDE6gnSf.js @@ -1 +1 @@ -import{t as o,i as l,c as t,a as K,b as x,s as O,d as A,e as et,f as B,g as v,h as I,F as lt,j as it,o as nt,u as rt,k as at,l as st}from"./index.js";var dt=o('
Host
ID
Name
DNS name
Iface
IP
MAC
Hardware
Date
Known
Online
'),_t=o('
Scanning port: '),ut=o("");function ft(){let e=!1;const[s,$]=v(""),[C,b]=v(""),[_,y]=v(""),[u,w]=v([]),f=async()=>{e=!1;let n=Number(s());(Number.isNaN(n)||n<1||n>65535)&&(n=1);let r=Number(C());(Number.isNaN(r)||r<1||r>65535)&&(r=65535);let c;for(let a=n;a<=r&&!e;a++)y(a.toString()),c=await it(t().IP,a),c&&w([...u(),a])},P=()=>{e?($(_()),f()):e=!0};return(()=>{var n=bt(),r=n.firstChild,c=r.nextSibling,a=c.firstChild,g=a.firstChild,h=g.nextSibling,k=h.nextSibling,S=a.nextSibling;return g.$$input=i=>$(i.target.value),h.$$input=i=>b(i.target.value),k.$$click=f,l(c,(()=>{var i=K(()=>_()!="");return()=>i()?(()=>{var d=_t(),m=d.firstChild,p=m.nextSibling;return p.firstChild,m.$$click=P,l(p,_,null),d})():[]})(),S),l(S,I(lt,{get each(){return u()},children:i=>(()=>{var d=ut();return l(d,i),x(()=>O(d,"href","http://"+t().IP+":"+i)),d})()})),n})()}B(["input","click"]);var gt=o("
");function pt(){return nt(async()=>{const e=rt(),s=await at(e.id);st(s)}),(()=>{var e=gt(),s=e.firstChild,$=s.nextSibling;return l(s,I($t,{})),l($,I(ft,{})),e})()}export{pt as default}; +import{t as o,i as l,c as t,a as K,b as x,s as O,d as A,e as et,f as B,g as v,h as I,F as lt,j as it,o as nt,u as rt,k as at,l as st}from"./index.js";var dt=o('
Host
ID
Name
DNS name
Iface
IP
MAC
Hardware
Date
Known
Online
'),_t=o('
Scanning port: '),ut=o("");function ft(){let e=!1;const[s,$]=v(""),[C,b]=v(""),[_,y]=v(""),[u,w]=v([]),f=async()=>{e=!1;let n=Number(s());(Number.isNaN(n)||n<1||n>65535)&&(n=1);let r=Number(C());(Number.isNaN(r)||r<1||r>65535)&&(r=65535);let c;for(let a=n;a<=r&&!e;a++)y(a.toString()),c=await it(t().IP,a),c&&w([...u(),a])},k=()=>{e?($(_()),f()):e=!0};return(()=>{var n=bt(),r=n.firstChild,c=r.nextSibling,a=c.firstChild,g=a.firstChild,h=g.nextSibling,N=h.nextSibling,S=a.nextSibling;return g.$$input=i=>$(i.target.value),h.$$input=i=>b(i.target.value),N.$$click=f,l(c,(()=>{var i=K(()=>_()!="");return()=>i()?(()=>{var d=_t(),m=d.firstChild,p=m.nextSibling;return p.firstChild,m.$$click=k,l(p,_,null),d})():[]})(),S),l(S,I(lt,{get each(){return u()},children:i=>(()=>{var d=ut();return l(d,i),x(()=>O(d,"href","http://"+t().IP+":"+i)),d})()})),n})()}B(["input","click"]);var gt=o("
");function pt(){return nt(async()=>{const e=rt(),s=await at(e.id);st(s)}),(()=>{var e=gt(),s=e.firstChild,$=s.nextSibling;return l(s,I($t,{})),l($,I(ft,{})),e})()}export{pt as default}; diff --git a/internal/web/public/assets/index.js b/internal/web/public/assets/index.js index a117471..aa9486a 100644 --- a/internal/web/public/assets/index.js +++ b/internal/web/public/assets/index.js @@ -1 +1 @@ -(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const i of o.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(s){if(s.ep)return;s.ep=!0;const o=n(s);fetch(s.href,o)}})();const w={context:void 0,registry:void 0,effects:void 0,done:!1,getContextId(){return He(this.context.count)},getNextContextId(){return He(this.context.count++)}};function He(e){const t=String(e),n=t.length-1;return w.context.id+(n?String.fromCharCode(96+n):"")+t}function te(e){w.context=e}const Ze=!1,xt=(e,t)=>e===t,Ce=Symbol("solid-proxy"),_t=typeof Proxy=="function",At=Symbol("solid-track"),ue={equals:xt};let ze=lt;const V=1,fe=2,et={owned:null,cleanups:null,context:null,owner:null},$e={};var $=null;let ve=null,Ct=null,v=null,N=null,q=null,pe=0;function ne(e,t){const n=v,r=$,s=e.length===0,o=t===void 0?r:t,i=s?et:{owned:null,cleanups:null,context:o?o.context:null,owner:o},l=s?e:()=>e(()=>T(()=>se(i)));$=i,v=null;try{return K(l,!0)}finally{v=n,$=r}}function R(e,t){t=t?Object.assign({},ue,t):ue;const n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},r=s=>(typeof s=="function"&&(s=s(n.value)),it(n,s));return[ot.bind(n),r]}function Pt(e,t,n){const r=me(e,t,!0,V);Z(r)}function Q(e,t,n){const r=me(e,t,!1,V);Z(r)}function kt(e,t,n){ze=Ft;const r=me(e,t,!1,V);r.user=!0,q?q.push(r):Z(r)}function L(e,t,n){n=n?Object.assign({},ue,n):ue;const r=me(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,Z(r),ot.bind(r)}function Et(e){return e&&typeof e=="object"&&"then"in e}function It(e,t,n){let r,s,o;r=!0,s=e,o={};let i=null,l=$e,a=null,c=!1,f="initialValue"in o,u=typeof r=="function"&&L(r);const g=new Set,[h,b]=(o.storage||R)(o.initialValue),[d,p]=R(void 0),[y,m]=R(void 0,{equals:!1}),[S,x]=R(f?"ready":"unresolved");w.context&&(a=w.getNextContextId(),o.ssrLoadFrom==="initial"?l=o.initialValue:w.load&&w.has(a)&&(l=w.load(a)));function _(k,C,E,W){return i===k&&(i=null,W!==void 0&&(f=!0),(k===l||C===l)&&o.onHydrated&&queueMicrotask(()=>o.onHydrated(W,{value:C})),l=$e,D(C,E)),C}function D(k,C){K(()=>{C===void 0&&b(()=>k),x(C!==void 0?"errored":f?"ready":"unresolved"),p(C);for(const E of g.keys())E.decrement();g.clear()},!1)}function H(){const k=Nt,C=h(),E=d();if(E!==void 0&&!i)throw E;return v&&v.user,C}function U(k=!0){if(k!==!1&&c)return;c=!1;const C=u?u():r;if(C==null||C===!1){_(i,T(h));return}const E=l!==$e?l:T(()=>s(C,{value:h(),refetching:k}));return Et(E)?(i=E,"value"in E?(E.status==="success"?_(i,E.value,void 0,C):_(i,void 0,Pe(E.value),C),E):(c=!0,queueMicrotask(()=>c=!1),K(()=>{x(f?"refreshing":"pending"),m()},!1),E.then(W=>_(E,W,void 0,C),W=>_(E,void 0,Pe(W),C)))):(_(i,E,void 0,C),E)}return Object.defineProperties(H,{state:{get:()=>S()},error:{get:()=>d()},loading:{get(){const k=S();return k==="pending"||k==="refreshing"}},latest:{get(){if(!f)return H();const k=d();if(k&&!i)throw k;return h()}}}),u?Pt(()=>U(!1)):U(!1),[H,{refetch:U,mutate:b}]}function Lt(e){return K(e,!1)}function T(e){if(v===null)return e();const t=v;v=null;try{return e()}finally{v=t}}function Re(e,t,n){const r=Array.isArray(e);let s,o=n&&n.defer;return i=>{let l;if(r){l=Array(e.length);for(let c=0;ct(l,s,i));return s=l,a}}function Rt(e){kt(()=>T(e))}function Oe(e){return $===null||($.cleanups===null?$.cleanups=[e]:$.cleanups.push(e)),e}function tt(){return $}function nt(e,t){const n=$,r=v;$=e,v=null;try{return K(t,!0)}catch(s){De(s)}finally{$=n,v=r}}function Ot(e){const t=v,n=$;return Promise.resolve().then(()=>{v=t,$=n;let r;return K(e,!1),v=$=null,r?r.done:void 0})}const[ir,lr]=R(!1);function rt(e,t){const n=Symbol("context");return{id:n,Provider:jt(n),defaultValue:e}}function st(e){let t;return $&&$.context&&(t=$.context[e.id])!==void 0?t:e.defaultValue}function Ne(e){const t=L(e),n=L(()=>ke(t()));return n.toArray=()=>{const r=n();return Array.isArray(r)?r:r!=null?[r]:[]},n}let Nt;function ot(){if(this.sources&&this.state)if(this.state===V)Z(this);else{const e=N;N=null,K(()=>he(this),!1),N=e}if(v){const e=this.observers?this.observers.length:0;v.sources?(v.sources.push(this),v.sourceSlots.push(e)):(v.sources=[this],v.sourceSlots=[e]),this.observers?(this.observers.push(v),this.observerSlots.push(v.sources.length-1)):(this.observers=[v],this.observerSlots=[v.sources.length-1])}return this.value}function it(e,t,n){let r=e.value;return(!e.comparator||!e.comparator(r,t))&&(e.value=t,e.observers&&e.observers.length&&K(()=>{for(let s=0;s1e6)throw N=[],new Error},!1)),t}function Z(e){if(!e.fn)return;se(e);const t=pe;Dt(e,e.value,t)}function Dt(e,t,n){let r;const s=$,o=v;v=$=e;try{r=e.fn(t)}catch(i){return e.pure&&(e.state=V,e.owned&&e.owned.forEach(se),e.owned=null),e.updatedAt=n+1,De(i)}finally{v=o,$=s}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?it(e,r):e.value=r,e.updatedAt=n)}function me(e,t,n,r=V,s){const o={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:$,context:$?$.context:null,pure:n};return $===null||$!==et&&($.owned?$.owned.push(o):$.owned=[o]),o}function de(e){if(e.state===0)return;if(e.state===fe)return he(e);if(e.suspense&&T(e.suspense.inFallback))return e.suspense.effects.push(e);const t=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt=0;n--)if(e=t[n],e.state===V)Z(e);else if(e.state===fe){const r=N;N=null,K(()=>he(e,t[0]),!1),N=r}}function K(e,t){if(N)return e();let n=!1;t||(N=[]),q?n=!0:q=[],pe++;try{const r=e();return Tt(n),r}catch(r){n||(q=null),N=null,De(r)}}function Tt(e){if(N&&(lt(N),N=null),e)return;const t=q;q=null,t.length&&K(()=>ze(t),!1)}function lt(e){for(let t=0;t=0;t--)se(e.tOwned[t]);delete e.tOwned}if(e.owned){for(t=e.owned.length-1;t>=0;t--)se(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}e.state=0}function Pe(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function De(e,t=$){throw Pe(e)}function ke(e){if(typeof e=="function"&&!e.length)return ke(e());if(Array.isArray(e)){const t=[];for(let n=0;ns=T(()=>($.context={...$.context,[e]:r.value},Ne(()=>r.children))),void 0),s}}const Ht=Symbol("fallback");function Ue(e){for(let t=0;t1?[]:null;return Oe(()=>Ue(o)),()=>{let a=e()||[],c=a.length,f,u;return a[At],T(()=>{let h,b,d,p,y,m,S,x,_;if(c===0)i!==0&&(Ue(o),o=[],r=[],s=[],i=0,l&&(l=[])),n.fallback&&(r=[Ht],s[0]=ne(D=>(o[0]=D,n.fallback())),i=1);else if(i===0){for(s=new Array(c),u=0;u=m&&x>=m&&r[S]===a[x];S--,x--)d[x]=s[S],p[x]=o[S],l&&(y[x]=l[S]);for(h=new Map,b=new Array(x+1),u=x;u>=m;u--)_=a[u],f=h.get(_),b[u]=f===void 0?-1:f,h.set(_,u);for(f=m;f<=S;f++)_=r[f],u=h.get(_),u!==void 0&&u!==-1?(d[u]=s[f],p[u]=o[f],l&&(y[u]=l[f]),u=b[u],h.set(_,u)):o[f]();for(u=m;ue(t||{}))}function ae(){return!0}const Bt={get(e,t,n){return t===Ce?n:e.get(t)},has(e,t){return t===Ce?!0:e.has(t)},set:ae,deleteProperty:ae,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:ae,deleteProperty:ae}},ownKeys(e){return e.keys()}};function Se(e){return(e=typeof e=="function"?e():e)?e:{}}function Kt(){for(let e=0,t=this.length;e=0;l--){const a=Se(e[l])[i];if(a!==void 0)return a}},has(i){for(let l=e.length-1;l>=0;l--)if(i in Se(e[l]))return!0;return!1},keys(){const i=[];for(let l=0;l=0;i--){const l=e[i];if(!l)continue;const a=Object.getOwnPropertyNames(l);for(let c=a.length-1;c>=0;c--){const f=a[c];if(f==="__proto__"||f==="constructor")continue;const u=Object.getOwnPropertyDescriptor(l,f);if(!r[f])r[f]=u.get?{enumerable:!0,configurable:!0,get:Kt.bind(n[f]=[u.get.bind(l)])}:u.value!==void 0?u:void 0;else{const g=n[f];g&&(u.get?g.push(u.get.bind(l)):u.value!==void 0&&g.push(()=>u.value))}}}const s={},o=Object.keys(r);for(let i=o.length-1;i>=0;i--){const l=o[i],a=r[l];a&&a.get?Object.defineProperty(s,l,a):s[l]=a?a.value:void 0}return s}function qt(e){let t,n;const r=s=>{const o=w.context;if(o){const[l,a]=R();w.count||(w.count=0),w.count++,(n||(n=e())).then(c=>{!w.done&&te(o),w.count--,a(()=>c.default),te()}),t=l}else if(!t){const[l]=It(()=>(n||(n=e())).then(a=>a.default));t=l}let i;return L(()=>(i=t())?T(()=>{if(!o||w.done)return i(s);const l=w.context;te(o);const a=i(s);return te(l),a}):"")};return r.preload=()=>n||((n=e()).then(s=>t=()=>s.default),n),r}const Vt=e=>`Stale read from <${e}>.`;function ct(e){const t="fallback"in e&&{fallback:()=>e.fallback};return L(Ut(()=>e.each,e.children,t||void 0))}function we(e){const t=e.keyed,n=L(()=>e.when,void 0,void 0),r=t?n:L(n,void 0,{equals:(s,o)=>!s==!o});return L(()=>{const s=r();if(s){const o=e.children;return typeof o=="function"&&o.length>0?T(()=>o(t?s:()=>{if(!T(r))throw Vt("Show");return n()})):o}return e.fallback},void 0,void 0)}function Wt(e,t,n){let r=n.length,s=t.length,o=r,i=0,l=0,a=t[s-1].nextSibling,c=null;for(;if-l){const b=t[i];for(;l{s=o,t===document?e():O(t,e(),t.firstChild?null:void 0,n)},r.owner),()=>{s(),t.textContent=""}}function j(e,t,n,r){let s;const o=()=>{const l=document.createElement("template");return l.innerHTML=e,l.content.firstChild},i=()=>(s||(s=o())).cloneNode(!0);return i.cloneNode=i,i}function z(e,t=window.document){const n=t[Be]||(t[Be]=new Set);for(let r=0,s=e.length;rge(e,t(),s,n),r)}function ut(e){return!!w.context&&!w.done&&(!e||e.isConnected)}function Xt(e){if(w.registry&&w.events&&w.events.find(([a,c])=>c===e))return;let t=e.target;const n=`$$${e.type}`,r=e.target,s=e.currentTarget,o=a=>Object.defineProperty(e,"target",{configurable:!0,value:a}),i=()=>{const a=t[n];if(a&&!t.disabled){const c=t[`${n}Data`];if(c!==void 0?a.call(t,c,e):a.call(t,e),e.cancelBubble)return}return t.host&&typeof t.host!="string"&&!t.host._$host&&t.contains(e.target)&&o(t.host),!0},l=()=>{for(;i()&&(t=t._$host||t.parentNode||t.host););};if(Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return t||document}}),w.registry&&!w.done&&(w.done=_$HY.done=!0),e.composedPath){const a=e.composedPath();o(a[0]);for(let c=0;c{let a=t();for(;typeof a=="function";)a=a();n=ge(e,a,n,r)}),()=>n;if(Array.isArray(t)){const a=[],c=n&&Array.isArray(n);if(Ee(a,t,n,s))return Q(()=>n=ge(e,a,n,r,!0)),()=>n;if(o){if(!a.length)return n;if(r===void 0)return n=[...e.childNodes];let f=a[0];if(f.parentNode!==e)return n;const u=[f];for(;(f=f.nextSibling)!==r;)u.push(f);return n=u}if(a.length===0){if(n=J(e,n,r),l)return n}else c?n.length===0?Me(e,a,r):Wt(e,n,a):(n&&J(e),Me(e,a));n=a}else if(t.nodeType){if(o&&t.parentNode)return n=l?[t]:t;if(Array.isArray(n)){if(l)return n=J(e,n,r,t);J(e,n,null,t)}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}}return n}function Ee(e,t,n,r){let s=!1;for(let o=0,i=t.length;o=0;i--){const l=t[i];if(s!==l){const a=l.parentNode===e;!o&&!i?a?e.replaceChild(s,l):e.insertBefore(s,n):a&&l.remove()}else o=!0}}else e.insertBefore(s,n);return[s]}const Yt=!1,Jt="modulepreload",Qt=function(e){return"/"+e},qe={},Zt=function(t,n,r){let s=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const i=document.querySelector("meta[property=csp-nonce]"),l=(i==null?void 0:i.nonce)||(i==null?void 0:i.getAttribute("nonce"));s=Promise.allSettled(n.map(a=>{if(a=Qt(a),a in qe)return;qe[a]=!0;const c=a.endsWith(".css"),f=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${a}"]${f}`))return;const u=document.createElement("link");if(u.rel=c?"stylesheet":Jt,c||(u.as="script"),u.crossOrigin="",u.href=a,l&&u.setAttribute("nonce",l),document.head.appendChild(u),c)return new Promise((g,h)=>{u.addEventListener("load",g),u.addEventListener("error",()=>h(new Error(`Unable to preload CSS for ${a}`)))})}))}function o(i){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=i,window.dispatchEvent(l),!l.defaultPrevented)throw i}return s.then(i=>{for(const l of i||[])l.status==="rejected"&&o(l.reason);return t().catch(o)})};function ft(){let e=new Set;function t(s){return e.add(s),()=>e.delete(s)}let n=!1;function r(s,o){if(n)return!(n=!1);const i={to:s,options:o,defaultPrevented:!1,preventDefault:()=>i.defaultPrevented=!0};for(const l of e)l.listener({...i,from:l.location,retry:a=>{a&&(n=!0),l.navigate(s,{...o,resolve:!1})}});return!i.defaultPrevented}return{subscribe:t,confirm:r}}let Ie;function Te(){(!window.history.state||window.history.state._depth==null)&&window.history.replaceState({...window.history.state,_depth:window.history.length-1},""),Ie=window.history.state._depth}Te();function zt(e){return{...e,_depth:window.history.state&&window.history.state._depth}}function en(e,t){let n=!1;return()=>{const r=Ie;Te();const s=r==null?null:Ie-r;if(n){n=!1;return}s&&t(s)?(n=!0,window.history.go(-s)):e()}}const tn=/^(?:[a-z0-9]+:)?\/\//i,nn=/^\/+|(\/)\/+$/g,dt="http://sr";function re(e,t=!1){const n=e.replace(nn,"$1");return n?t||/^[?#]/.test(n)?n:"/"+n:""}function ce(e,t,n){if(tn.test(t))return;const r=re(e),s=n&&re(n);let o="";return!s||t.startsWith("/")?o=r:s.toLowerCase().indexOf(r.toLowerCase())!==0?o=r+s:o=s,(o||"/")+re(t,!o)}function rn(e,t){if(e==null)throw new Error(t);return e}function sn(e,t){return re(e).replace(/\/*(\*.*)?$/g,"")+re(t)}function ht(e){const t={};return e.searchParams.forEach((n,r)=>{r in t?Array.isArray(t[r])?t[r].push(n):t[r]=[t[r],n]:t[r]=n}),t}function on(e,t,n){const[r,s]=e.split("/*",2),o=r.split("/").filter(Boolean),i=o.length;return l=>{const a=l.split("/").filter(Boolean),c=a.length-i;if(c<0||c>0&&s===void 0&&!t)return null;const f={path:i?"":"/",params:{}},u=g=>n===void 0?void 0:n[g];for(let g=0;gr===e;return t===void 0?!0:typeof t=="string"?n(t):typeof t=="function"?t(e):Array.isArray(t)?t.some(n):t instanceof RegExp?t.test(e):!1}function ln(e){const[t,n]=e.pattern.split("/*",2),r=t.split("/").filter(Boolean);return r.reduce((s,o)=>s+(o.startsWith(":")?2:3),r.length-(n===void 0?0:1))}function gt(e){const t=new Map,n=tt();return new Proxy({},{get(r,s){return t.has(s)||nt(n,()=>t.set(s,L(()=>e()[s]))),t.get(s)()},getOwnPropertyDescriptor(){return{enumerable:!0,configurable:!0}},ownKeys(){return Reflect.ownKeys(e())}})}function pt(e){let t=/(\/?\:[^\/]+)\?/.exec(e);if(!t)return[e];let n=e.slice(0,t.index),r=e.slice(t.index+t[0].length);const s=[n,n+=t[1]];for(;t=/^(\/\:[^\/]+)\?/.exec(r);)s.push(n+=t[1]),r=r.slice(t[0].length);return pt(r).reduce((o,i)=>[...o,...s.map(l=>l+i)],[])}const an=100,mt=rt(),wt=rt(),cn=()=>rn(st(mt)," and 'use' router primitives can be only used inside a Route."),ar=()=>cn().params;function un(e,t=""){const{component:n,preload:r,load:s,children:o,info:i}=e,l=!o||Array.isArray(o)&&!o.length,a={key:e,component:n,preload:r||s,info:i};return bt(e.path).reduce((c,f)=>{for(const u of pt(f)){const g=sn(t,u);let h=l?g:g.split("/*",1)[0];h=h.split("/").map(b=>b.startsWith(":")||b.startsWith("*")?b:encodeURIComponent(b)).join("/"),c.push({...a,originalPath:f,pattern:h,matcher:on(h,!l,e.matchFilters)})}return c},[])}function fn(e,t=0){return{routes:e,score:ln(e[e.length-1])*1e4-t,matcher(n){const r=[];for(let s=e.length-1;s>=0;s--){const o=e[s],i=o.matcher(n);if(!i)return null;r.unshift({...i,route:o})}return r}}}function bt(e){return Array.isArray(e)?e:[e]}function yt(e,t="",n=[],r=[]){const s=bt(e);for(let o=0,i=s.length;oi.score-o.score)}function _e(e,t){for(let n=0,r=e.length;n{const u=e();try{return new URL(u,r)}catch{return console.error(`Invalid path ${u}`),f}},r,{equals:(f,u)=>f.href===u.href}),o=L(()=>s().pathname),i=L(()=>s().search,!0),l=L(()=>s().hash),a=()=>"",c=Re(i,()=>ht(s()));return{get pathname(){return o()},get search(){return i()},get hash(){return l()},get state(){return t()},get key(){return a()},query:n?n(c):gt(c)}}let G;function hn(){return G}function gn(e,t,n,r={}){const{signal:[s,o],utils:i={}}=e,l=i.parsePath||(A=>A),a=i.renderPath||(A=>A),c=i.beforeLeave||ft(),f=ce("",r.base||"");if(f===void 0)throw new Error(`${f} is not a valid base path`);f&&!s().value&&o({value:f,replace:!0,scroll:!1});const[u,g]=R(!1);let h;const b=(A,P)=>{P.value===d()&&P.state===y()||(h===void 0&&g(!0),G=A,h=P,Ot(()=>{h===P&&(p(h.value),m(h.state),_[1](F=>F.filter(X=>X.pending)))}).finally(()=>{h===P&&Lt(()=>{G=void 0,A==="navigate"&&W(h),g(!1),h=void 0})}))},[d,p]=R(s().value),[y,m]=R(s().state),S=dn(d,y,i.queryWrapper),x=[],_=R([]),D=L(()=>typeof r.transformUrl=="function"?_e(t(),r.transformUrl(S.pathname)):_e(t(),S.pathname)),H=()=>{const A=D(),P={};for(let F=0;Ff,outlet:()=>null,resolvePath(A){return ce(f,A)}};return Q(Re(s,A=>b("native",A),{defer:!0})),{base:k,location:S,params:U,isRouting:u,renderPath:a,parsePath:l,navigatorFactory:E,matches:D,beforeLeave:c,preloadRoute:St,singleFlight:r.singleFlight===void 0?!0:r.singleFlight,submissions:_};function C(A,P,F){T(()=>{if(typeof P=="number"){P&&(i.go?i.go(P):console.warn("Router integration does not support relative routing"));return}const X=!P||P[0]==="?",{replace:be,resolve:Y,scroll:ye,state:ee}={replace:!1,resolve:!X,scroll:!0,...F},le=Y?A.resolvePath(P):ce(X&&S.pathname||"",P);if(le===void 0)throw new Error(`Path '${P}' is not a routable path`);if(x.length>=an)throw new Error("Too many redirects");const je=d();(le!==je||ee!==y())&&(Yt||c.confirm(le,F)&&(x.push({value:je,replace:be,scroll:ye,state:y()}),b("navigate",{value:le,state:ee})))})}function E(A){return A=A||st(wt)||k,(P,F)=>C(A,P,F)}function W(A){const P=x[0];P&&(o({...A,replace:P.replace,scroll:P.scroll}),x.length=0)}function St(A,P){const F=_e(t(),A.pathname),X=G;G="preload";for(let be in F){const{route:Y,params:ye}=F[be];Y.component&&Y.component.preload&&Y.component.preload();const{preload:ee}=Y;P&&ee&&nt(n(),()=>ee({params:ye,location:{pathname:A.pathname,search:A.search,hash:A.hash,query:ht(A),state:null,key:""},intent:"preload"}))}G=X}}function pn(e,t,n,r){const{base:s,location:o,params:i}=e,{pattern:l,component:a,preload:c}=r().route,f=L(()=>r().path);a&&a.preload&&a.preload();const u=c?c({params:i,location:o,intent:G||"initial"}):void 0;return{parent:t,pattern:l,path:f,outlet:()=>a?I(a,{params:i,location:o,data:u,get children(){return n()}}):n(),resolvePath(h){return ce(s.path(),h,f())}}}const mn=e=>t=>{const{base:n}=t,r=Ne(()=>t.children),s=L(()=>yt(r(),t.base||""));let o;const i=gn(e,s,()=>o,{base:n,singleFlight:t.singleFlight,transformUrl:t.transformUrl});return e.create&&e.create(i),I(mt.Provider,{value:i,get children(){return I(wn,{routerState:i,get root(){return t.root},get preload(){return t.rootPreload||t.rootLoad},get children(){return[L(()=>(o=tt())&&null),I(bn,{routerState:i,get branches(){return s()}})]}})}})};function wn(e){const t=e.routerState.location,n=e.routerState.params,r=L(()=>e.preload&&T(()=>{e.preload({params:n,location:t,intent:hn()||"initial"})}));return I(we,{get when(){return e.root},keyed:!0,get fallback(){return e.children},children:s=>I(s,{params:n,location:t,get data(){return r()},get children(){return e.children}})})}function bn(e){const t=[];let n;const r=L(Re(e.routerState.matches,(s,o,i)=>{let l=o&&s.length===o.length;const a=[];for(let c=0,f=s.length;c{t[c]=h,a[c]=pn(e.routerState,a[c-1]||e.routerState.base,Ve(()=>r()[c+1]),()=>e.routerState.matches()[c])}))}return t.splice(s.length).forEach(c=>c()),i&&l?i:(n=a[0],a)}));return Ve(()=>r()&&n)()}const Ve=e=>()=>I(we,{get when(){return e()},keyed:!0,children:t=>I(wt.Provider,{value:t,get children(){return t.outlet()}})}),We=e=>{const t=Ne(()=>e.children);return Mt(e,{get children(){return t()}})};function yn([e,t],n,r){return[e,r?s=>t(r(s)):t]}function $n(e){let t=!1;const n=s=>typeof s=="string"?{value:s}:s,r=yn(R(n(e.get()),{equals:(s,o)=>s.value===o.value&&s.state===o.state}),void 0,s=>(!t&&e.set(s),w.registry&&!w.done&&(w.done=!0),s));return e.init&&Oe(e.init((s=e.get())=>{t=!0,r[1](n(s)),t=!1})),mn({signal:r,create:e.create,utils:e.utils})}function vn(e,t,n){return e.addEventListener(t,n),()=>e.removeEventListener(t,n)}function Sn(e,t){const n=e&&document.getElementById(e);n?n.scrollIntoView():t&&window.scrollTo(0,0)}const xn=new Map;function _n(e=!0,t=!1,n="/_server",r){return s=>{const o=s.base.path(),i=s.navigatorFactory(s.base);let l,a;function c(d){return d.namespaceURI==="http://www.w3.org/2000/svg"}function f(d){if(d.defaultPrevented||d.button!==0||d.metaKey||d.altKey||d.ctrlKey||d.shiftKey)return;const p=d.composedPath().find(D=>D instanceof Node&&D.nodeName.toUpperCase()==="A");if(!p||t&&!p.hasAttribute("link"))return;const y=c(p),m=y?p.href.baseVal:p.href;if((y?p.target.baseVal:p.target)||!m&&!p.hasAttribute("state"))return;const x=(p.getAttribute("rel")||"").split(/\s+/);if(p.hasAttribute("download")||x&&x.includes("external"))return;const _=y?new URL(m,document.baseURI):new URL(m);if(!(_.origin!==window.location.origin||o&&_.pathname&&!_.pathname.toLowerCase().startsWith(o.toLowerCase())))return[p,_]}function u(d){const p=f(d);if(!p)return;const[y,m]=p,S=s.parsePath(m.pathname+m.search+m.hash),x=y.getAttribute("state");d.preventDefault(),i(S,{resolve:!1,replace:y.hasAttribute("replace"),scroll:!y.hasAttribute("noscroll"),state:x?JSON.parse(x):void 0})}function g(d){const p=f(d);if(!p)return;const[y,m]=p;r&&(m.pathname=r(m.pathname)),s.preloadRoute(m,y.getAttribute("preload")!=="false")}function h(d){clearTimeout(l);const p=f(d);if(!p)return a=null;const[y,m]=p;a!==y&&(r&&(m.pathname=r(m.pathname)),l=setTimeout(()=>{s.preloadRoute(m,y.getAttribute("preload")!=="false"),a=y},20))}function b(d){if(d.defaultPrevented)return;let p=d.submitter&&d.submitter.hasAttribute("formaction")?d.submitter.getAttribute("formaction"):d.target.getAttribute("action");if(!p)return;if(!p.startsWith("https://action/")){const m=new URL(p,dt);if(p=s.parsePath(m.pathname+m.search),!p.startsWith(n))return}if(d.target.method.toUpperCase()!=="POST")throw new Error("Only POST forms are supported for Actions");const y=xn.get(p);if(y){d.preventDefault();const m=new FormData(d.target,d.submitter);y.call({r:s,f:d.target},d.target.enctype==="multipart/form-data"?m:new URLSearchParams(m))}}z(["click","submit"]),document.addEventListener("click",u),e&&(document.addEventListener("mousemove",h,{passive:!0}),document.addEventListener("focusin",g,{passive:!0}),document.addEventListener("touchstart",g,{passive:!0})),document.addEventListener("submit",b),Oe(()=>{document.removeEventListener("click",u),e&&(document.removeEventListener("mousemove",h),document.removeEventListener("focusin",g),document.removeEventListener("touchstart",g)),document.removeEventListener("submit",b)})}}function An(e){const t=()=>{const r=window.location.pathname.replace(/^\/+/,"/")+window.location.search,s=window.history.state&&window.history.state._depth&&Object.keys(window.history.state).length===1?void 0:window.history.state;return{value:r+window.location.hash,state:s}},n=ft();return $n({get:t,set({value:r,replace:s,scroll:o,state:i}){s?window.history.replaceState(zt(i),"",r):window.history.pushState(i,"",r),Sn(decodeURIComponent(window.location.hash.slice(1)),o),Te()},init:r=>vn(window,"popstate",en(r,s=>{if(s&&s<0)return!n.confirm(s);{const o=t();return!n.confirm(o.value,{state:o.state})}})),create:_n(e.preload,e.explicitLinks,e.actionBase,e.transformUrl),utils:{go:r=>window.history.go(r),beforeLeave:n}})(e)}const oe="",Cn=async()=>{const e=oe+"/api/all";return await(await fetch(e)).json()},Ge=async(e,t,n)=>{const r=oe+"/api/edit/"+e+"/"+t+"/"+n;return await(await fetch(r)).json()},cr=async e=>{const t=oe+"/api/host/"+e;return await(await fetch(t)).json()},ur=async e=>{const t=oe+"/api/host/del/"+e;return await(await fetch(t)).json()},fr=async(e,t)=>{const n=oe+"/api/port/"+e+"/"+t;return await(await fetch(n)).json()},Pn={ID:0,Name:"",DNS:"",Iface:"",IP:"",Mac:"",Hw:"",Date:"",Known:0,Now:0},[ie,M]=R([]),[Le,kn]=R([]),[En,In]=R([]),[dr,hr]=R(),[$t,Xe]=R(!1),[gr,pr]=R(Pn);let Ye="ID";function Ln(){const e=localStorage.getItem("filterField"),t=localStorage.getItem("filterValue");Fe(e,t)}function Fe(e,t){let n=ie();switch(Ye==e&&(n=Le()),Ye=e,localStorage.setItem("filterField",e),localStorage.setItem("filterValue",t),e){case"Iface":n=n.filter(r=>r.Iface==t);break;case"Known":n=n.filter(r=>r.Known==t);break;case"Now":n=n.filter(r=>r.Now==t);break;default:n=Le()}M([]),M(n)}let B=!1,Ae="";function Rn(){const e=localStorage.getItem("sortField");B=JSON.parse(localStorage.getItem("sortDown")),B=!B,vt(e)}function vt(e){e!=Ae?(Ae=e,B=!B):(Ae="",B=!B),localStorage.setItem("sortDown",B.toString()),localStorage.setItem("sortField",e);let t=ie();e=="IP"?t.sort((n,r)=>Nn(n,r,B)):t.sort((n,r)=>On(n,r,e,B)),M([]),M(t)}function On(e,t,n,r){return e[n]>t[n]?r?1:-1:r?-1:1}function Nn(e,t,n){const r=Je(e),s=Je(t);return n?r-s:s-r}function Je(e){return Number(e.IP.split(".").map(t=>`000${t}`.slice(-3)).join(""))}function Dn(){Qe(),Fe("ID",0),setInterval(()=>{Qe()},6e4)}async function Qe(){const e=await Cn();M(e),kn(e),Rn(),Ln(),Tn()}function Tn(){let e=[];for(let t of ie())e.includes(t.Iface)||e.push(t.Iface);In(e)}var Fn=j(''),jn=j(''),Hn=j(""),Un=j('.
');function Bn(e){const[t,n]=R(e.host.Name),r="http://"+e.host.IP,s="/host/"+e.host.ID;let o=Fn();e.host.Now==1&&(o=jn());let i=!1;e.host.Known==1&&(i=!0);const l=async c=>{n(c),await Ge(e.host.ID,t(),"")},a=async()=>{await Ge(e.host.ID,t(),"toggle")};return(()=>{var c=Un(),f=c.firstChild,u=f.firstChild,g=f.nextSibling,h=g.nextSibling,b=h.nextSibling,d=b.firstChild,p=b.nextSibling,y=p.nextSibling,m=y.nextSibling,S=m.nextSibling,x=S.firstChild,_=x.firstChild,D=S.nextSibling,H=D.nextSibling,U=H.firstChild;return O(f,()=>e.index,u),O(g,I(we,{get when(){return $t()},get fallback(){return t()},get children(){var k=Hn();return k.$$input=C=>l(C.target.value),Q(()=>k.value=t()),k}})),O(h,()=>e.host.Iface),Ke(d,"href",r),O(d,()=>e.host.IP),O(p,()=>e.host.Mac),O(y,()=>e.host.Hw),O(m,()=>e.host.Date),_.$$click=a,_.checked=i,O(D,o),Ke(U,"href",s),c})()}z(["input","click"]);var Kn=j('Name Iface IP MAC Hardware Date Known Online ');function Mn(){const e=t=>{vt(t)};return(()=>{var t=Kn(),n=t.firstChild,r=n.firstChild,s=r.nextSibling,o=s.firstChild,i=o.nextSibling,l=s.nextSibling,a=l.firstChild,c=a.nextSibling,f=l.nextSibling,u=f.firstChild,g=u.nextSibling,h=f.nextSibling,b=h.firstChild,d=b.nextSibling,p=h.nextSibling,y=p.firstChild,m=y.nextSibling,S=p.nextSibling,x=S.firstChild,_=x.nextSibling,D=S.nextSibling,H=D.firstChild,U=H.nextSibling,k=D.nextSibling,C=k.firstChild,E=C.nextSibling;return i.$$click=e,i.$$clickData="Name",c.$$click=e,c.$$clickData="Iface",g.$$click=e,g.$$clickData="IP",d.$$click=e,d.$$clickData="Mac",m.$$click=e,m.$$clickData="Hw",_.$$click=e,_.$$clickData="Date",U.$$click=e,U.$$clickData="Known",E.$$click=e,E.$$clickData="Now",t})()}z(["click"]);var qn=j('
Filter by