diff --git a/frontend/Makefile b/frontend/Makefile index 7c003d6..b54a7b8 100644 --- a/frontend/Makefile +++ b/frontend/Makefile @@ -16,6 +16,8 @@ replace: cp tmp History-*.js && \ cat HostPage-*.js | sed 's/index-.*\.js/index.js/g' > tmp && \ cp tmp HostPage-*.js && \ + cat MacHistory-*.js | sed 's/index-.*\.js/index.js/g' > tmp && \ + cp tmp MacHistory-*.js && \ rm tmp index-* all: build replace \ No newline at end of file diff --git a/frontend/src/App.css b/frontend/src/App.css index 8707468..dae3db3 100644 --- a/frontend/src/App.css +++ b/frontend/src/App.css @@ -1,10 +1,33 @@ +/* VARS */ +:root { + --transparent-light: #ffffff15; +} + /* Sort button */ .my-btn { height: 100%; background-color: #00000000; color: var(--bs-primary); text-align: center; + cursor: pointer; + padding: 1px; + border-radius: 15%; } .my-btn:hover { + background-color: var(--transparent-light); +} + +/* History box */ +.my-box-on::before, .my-box-off::before { + content: url("data:image/svg+xml;utf8,"); + 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; } \ No newline at end of file diff --git a/frontend/src/components/Body/TableHead.tsx b/frontend/src/components/Body/TableHead.tsx index 4b91d44..384a66e 100644 --- a/frontend/src/components/Body/TableHead.tsx +++ b/frontend/src/components/Body/TableHead.tsx @@ -10,7 +10,7 @@ function TableHead() { return ( - + Name Iface IP diff --git a/frontend/src/components/Body/TableRow.tsx b/frontend/src/components/Body/TableRow.tsx index 2959734..64aba53 100644 --- a/frontend/src/components/Body/TableRow.tsx +++ b/frontend/src/components/Body/TableRow.tsx @@ -53,7 +53,7 @@ function TableRow(_props: any) { {now} - + ) diff --git a/frontend/src/components/HostPage/HistCard.tsx b/frontend/src/components/HostPage/HistCard.tsx new file mode 100644 index 0000000..3f0553f --- /dev/null +++ b/frontend/src/components/HostPage/HistCard.tsx @@ -0,0 +1,18 @@ +import MacHistory from "../MacHistory" + +function HistCard(_props: any) { + + return ( +
+
History
+
+ {_props.mac !== "" + ? + : <>Loading... + } +
+
+ ) +} + +export default HistCard \ No newline at end of file diff --git a/frontend/src/components/HostPage/HostCard.tsx b/frontend/src/components/HostPage/HostCard.tsx index 47b1e42..c3a4524 100644 --- a/frontend/src/components/HostPage/HostCard.tsx +++ b/frontend/src/components/HostPage/HostCard.tsx @@ -1,28 +1,27 @@ import { apiDelHost, apiEditHost } from "../../functions/api"; -import { currentHost } from "../../functions/exports"; -function HostCard() { +function HostCard(_props: any) { let name:string = ""; const handleInput = async (n: string) => { name = n; - await apiEditHost(currentHost().ID, name, ''); + await apiEditHost(_props.host.ID, name, ''); }; const handleToggle = async () => { if (name == "") { - name = currentHost().Name; + name = _props.host.Name; } - await apiEditHost(currentHost().ID, name, 'toggle'); + await apiEditHost(_props.host.ID, name, 'toggle'); }; const handleDel = async () => { - await apiDelHost(currentHost().ID); + await apiDelHost(_props.host.ID); window.location.href = '/'; }; @@ -34,40 +33,40 @@ function HostCard() { ID - {currentHost().ID} + {_props.host.ID} Name - handleInput(e.target.value)}> DNS name - {currentHost().DNS} + {_props.host.DNS} Iface - {currentHost().Iface} + {_props.host.Iface} IP - {currentHost().IP} + {_props.host.IP} MAC - {currentHost().Mac} + {_props.host.Mac} Hardware - {currentHost().Hw} + {_props.host.Hw} Date - {currentHost().Date} + {_props.host.Date} Known @@ -75,7 +74,7 @@ function HostCard() {
Online - {currentHost().Now == 1 + {_props.host.Now == 1 ? : } diff --git a/frontend/src/components/HostPage/Ping.tsx b/frontend/src/components/HostPage/Ping.tsx index 6799892..fd3b26f 100644 --- a/frontend/src/components/HostPage/Ping.tsx +++ b/frontend/src/components/HostPage/Ping.tsx @@ -1,9 +1,7 @@ import { createSignal, For } from "solid-js"; import { apiPortScan } from "../../functions/api"; -import { currentHost } from "../../functions/exports"; - -function Ping() { +function Ping(_props: any) { let stop = false; @@ -31,7 +29,7 @@ function Ping() { break; } setCurPort(i.toString()); - portOpened = await apiPortScan(currentHost().IP, i); + portOpened = await apiPortScan(_props.IP, i); if (portOpened) { setFoundPorts([...foundPorts(), i]); } @@ -67,7 +65,7 @@ function Ping() { }
{(port) => - {port} + {port} }
diff --git a/frontend/src/components/MacHistory.tsx b/frontend/src/components/MacHistory.tsx new file mode 100644 index 0000000..206a3cb --- /dev/null +++ b/frontend/src/components/MacHistory.tsx @@ -0,0 +1,29 @@ +import { createSignal, For, onMount } from "solid-js"; +import { apiGetHistory } from "../functions/api"; +import { Host } from "../functions/exports"; + +function MacHistory(_props: any) { + + const [hist, setHist] = createSignal([]); + + onMount(async () => { + let h:Host[] = []; + h = await apiGetHistory(_props.mac); + if (h != null) { + h.sort((a:Host, b:Host) => (a.Date < b.Date ? 1 : -1)); + if (_props.show > 0) { + h = h.slice(0, _props.show); + } + setHist(h); + } + }); + + return ( + {h => + + } + ) +} + +export default MacHistory diff --git a/frontend/src/functions/api.ts b/frontend/src/functions/api.ts index 34fdedc..5a572a9 100644 --- a/frontend/src/functions/api.ts +++ b/frontend/src/functions/api.ts @@ -59,4 +59,11 @@ export const apiPortScan = async (ip:string, port:number) => { const res = await (await fetch(url)).json(); return res; +}; + +export const apiGetHistory = async (mac:string) => { + const url = apiPath+'/api/history/'+mac; + const hosts = await (await fetch(url)).json(); + + return hosts; }; \ No newline at end of file diff --git a/frontend/src/functions/exports.ts b/frontend/src/functions/exports.ts index e065b0d..4d105db 100644 --- a/frontend/src/functions/exports.ts +++ b/frontend/src/functions/exports.ts @@ -88,6 +88,4 @@ export const [ifaces, setIfaces] = createSignal([]); export const [appConfig, setAppConfig] = createSignal(emptyConf); -export const [editNames, setEditNames] = createSignal(false); - -export const [currentHost, setCurrentHost] = createSignal(emptyHost); \ No newline at end of file +export const [editNames, setEditNames] = createSignal(false); \ No newline at end of file diff --git a/frontend/src/pages/History.tsx b/frontend/src/pages/History.tsx index 259d248..b494630 100644 --- a/frontend/src/pages/History.tsx +++ b/frontend/src/pages/History.tsx @@ -1,13 +1,35 @@ +import { For } from "solid-js" +import Filter from "../components/Filter" +import { allHosts } from "../functions/exports" +import MacHistory from "../components/MacHistory" function History() { return ( -
-
- History page +
+
+ +
+
+ + + {(host, index) => + + + + + + } + +
{index()}. + {host.Name}

+ {host.IP} +
+ +
) } -export default History \ No newline at end of file +export default History diff --git a/frontend/src/pages/HostPage.tsx b/frontend/src/pages/HostPage.tsx index c27aedd..da6bde6 100644 --- a/frontend/src/pages/HostPage.tsx +++ b/frontend/src/pages/HostPage.tsx @@ -1,14 +1,17 @@ import { useParams } from "@solidjs/router"; -import { onMount } from "solid-js"; +import { createSignal, onMount } from "solid-js"; import { apiGetHost } from "../functions/api"; -import { setCurrentHost } from "../functions/exports"; import HostCard from "../components/HostPage/HostCard"; import Ping from "../components/HostPage/Ping"; +import HistCard from "../components/HostPage/HistCard"; +import { emptyHost, Host } from "../functions/exports"; function HostPage() { + const [currentHost, setCurrentHost] = createSignal(emptyHost); + onMount(async () => { const params = useParams(); const host = await apiGetHost(params.id); @@ -17,14 +20,21 @@ function HostPage() { }); return ( + <>
- +
- +
+
+
+ +
+
+ ) } diff --git a/internal/models/models.go b/internal/models/models.go index 8061331..6e79dcd 100644 --- a/internal/models/models.go +++ b/internal/models/models.go @@ -54,11 +54,3 @@ type Stat struct { Known int Unknown int } - -// GuiData - all data sent to html page -type GuiData struct { - Config Conf - Host Host - Themes []string - Version string -} diff --git a/internal/web/public/assets/Config-BbCoAEkY.js b/internal/web/public/assets/Config-B-Lp_aW1.js similarity index 100% rename from internal/web/public/assets/Config-BbCoAEkY.js rename to internal/web/public/assets/Config-B-Lp_aW1.js diff --git a/internal/web/public/assets/History-Be3nB-kA.js b/internal/web/public/assets/History-Be3nB-kA.js deleted file mode 100644 index 3e155ed..0000000 --- a/internal/web/public/assets/History-Be3nB-kA.js +++ /dev/null @@ -1 +0,0 @@ -import{t}from"./index.js";var r=t("
History page");function o(){return r()}export{o as default}; diff --git a/internal/web/public/assets/History-DlXapsnh.js b/internal/web/public/assets/History-DlXapsnh.js new file mode 100644 index 0000000..a459a2e --- /dev/null +++ b/internal/web/public/assets/History-DlXapsnh.js @@ -0,0 +1 @@ +import{t as _,i as e,e as i,k as x,b as C,s as v,l as S,F}from"./index.js";var I=_('
'),M=_("
.
");function j(){return(()=>{var s=I(),d=s.firstChild,$=d.nextSibling,h=$.firstChild,m=h.firstChild;return e(d,i(x,{})),e(m,i(F,{get each(){return S()},children:(t,u)=>(()=>{var n=M(),l=n.firstChild,y=l.firstChild,c=l.nextSibling,a=c.firstChild,g=a.nextSibling,o=g.nextSibling,p=c.nextSibling;return e(l,u,y),e(a,()=>t.Name),e(o,()=>t.IP),e(p,i(H,{get mac(){return t.Mac},show:200})),C(r=>{var f="/host/"+t.ID,b="http://"+t.IP;return f!==r.e&&v(a,"href",r.e=f),b!==r.t&&v(o,"href",r.t=b),r},{e:void 0,t:void 0}),n})()})),s})()}export{j as default}; diff --git a/internal/web/public/assets/HostPage-BWCN9Byb.js b/internal/web/public/assets/HostPage-BWCN9Byb.js deleted file mode 100644 index a726e0b..0000000 --- a/internal/web/public/assets/HostPage-BWCN9Byb.js +++ /dev/null @@ -1 +0,0 @@ -import{t as o,i as l,k as t,j as K,b as x,s as O,l as A,m as et,h as q,c as v,e as I,F as lt,n as it,o as nt,u as rt,p as at,q 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,p=a.firstChild,g=p.nextSibling,N=g.nextSibling,m=a.nextSibling;return p.$$input=i=>$(i.target.value),g.$$input=i=>b(i.target.value),N.$$click=f,l(c,(()=>{var i=K(()=>_()!="");return()=>i()?(()=>{var d=_t(),S=d.firstChild,h=S.nextSibling;return h.firstChild,S.$$click=k,l(h,_,null),d})():[]})(),m),l(m,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})()}q(["input","click"]);var pt=o("
");function ht(){return nt(async()=>{const e=rt(),s=await at(e.id);st(s)}),(()=>{var e=pt(),s=e.firstChild,$=s.nextSibling;return l(s,I($t,{})),l($,I(ft,{})),e})()}export{ht as default}; diff --git a/internal/web/public/assets/HostPage-CWNBClYI.js b/internal/web/public/assets/HostPage-CWNBClYI.js new file mode 100644 index 0000000..396e629 --- /dev/null +++ b/internal/web/public/assets/HostPage-CWNBClYI.js @@ -0,0 +1 @@ +import{t as c,i as e,j as N,b as p,s as O,m as K,n as et,h as q,c as S,e as x,F as lt,p as it,q as rt,o as nt,u as at,r as st}from"./index.js";var ct=c('
Host
ID
Name
DNS name
Iface
IP
MAC
Hardware
Date
Known
Online
'),ht=c('
Scanning port: '),ft=c("");function _t(t){let l=!1;const[i,r]=S(""),[$,u]=S(""),[h,w]=S(""),[f,P]=S([]),_=async()=>{l=!1;let a=Number(i());(Number.isNaN(a)||a<1||a>65535)&&(a=1);let s=Number($());(Number.isNaN(s)||s<1||s>65535)&&(s=65535);let b;for(let d=a;d<=s&&!l;d++)w(d.toString()),b=await it(t.IP,d),b&&P([...f(),d])},I=()=>{l?(r(h()),_()):l=!0};return(()=>{var a=ut(),s=a.firstChild,b=s.nextSibling,d=b.firstChild,g=d.firstChild,m=g.nextSibling,k=m.nextSibling,C=d.nextSibling;return g.$$input=n=>r(n.target.value),m.$$input=n=>u(n.target.value),k.$$click=_,e(b,(()=>{var n=N(()=>h()!="");return()=>n()?(()=>{var o=ht(),y=o.firstChild,v=y.nextSibling;return v.firstChild,y.$$click=I,e(v,h,null),o})():[]})(),C),e(C,x(lt,{get each(){return f()},children:n=>(()=>{var o=ft();return e(o,n),p(()=>O(o,"href","http://"+t.IP+":"+n)),o})()})),a})()}q(["input","click"]);var gt=c('
History
');function mt(t){return(()=>{var l=gt(),i=l.firstChild,r=i.nextSibling;return e(r,(()=>{var $=N(()=>t.mac!=="");return()=>$()?x(dt,{get mac(){return t.mac}}):"Loading..."})()),l})()}var vt=c("
"),St=c('
');function yt(){const[t,l]=S(rt);return nt(async()=>{const i=at(),r=await st(i.id);l(r)}),[(()=>{var i=vt(),r=i.firstChild,$=r.nextSibling;return e(r,x(bt,{get host(){return t()}})),e($,x(_t,{get IP(){return t().IP}})),i})(),(()=>{var i=St(),r=i.firstChild;return e(r,x(mt,{get mac(){return t().Mac}})),i})()]}export{yt as default}; diff --git a/internal/web/public/assets/MacHistory-CwNdmW4v.js b/internal/web/public/assets/MacHistory-CwNdmW4v.js new file mode 100644 index 0000000..e72382c --- /dev/null +++ b/internal/web/public/assets/MacHistory-CwNdmW4v.js @@ -0,0 +1,4 @@ +import{c,o as l,e as f,t as m,b as u,s as v,v as w,F as y,w as b}from"./index.js";var d=m("");function I(n){const[r,i]=c([]);return l(async()=>{let t=[];t=await b(n.mac),t!=null&&(t.sort((a,e)=>a.Date0&&(t=t.slice(0,n.show)),i(t))}),f(y,{get each(){return r()},children:t=>(()=>{var a=d();return u(e=>{var o="Date:"+t.Date+` +Iface:`+t.Iface+` +IP:`+t.IP+` +Known:`+t.Known,s=t.Now===0?"my-box-off":"my-box-on";return o!==e.e&&v(a,"title",e.e=o),s!==e.t&&w(a,e.t=s),e},{e:void 0,t:void 0}),a})()})}export{I as M}; diff --git a/internal/web/public/assets/index.css b/internal/web/public/assets/index.css index 356ac8c..4adc222 100644 --- a/internal/web/public/assets/index.css +++ b/internal/web/public/assets/index.css @@ -1 +1 @@ -.my-btn{height:100%;background-color:#0000;color:var(--bs-primary);text-align:center}.my-btn:hover{background-color:#0000001a} +:root{--transparent-light: #ffffff15}.my-btn{height:100%;background-color:#0000;color:var(--bs-primary);text-align:center;cursor:pointer;padding:1px;border-radius:15%}.my-btn:hover{background-color:var(--transparent-light)}.my-box-on:before,.my-box-off:before{content:url("data:image/svg+xml;utf8,");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} diff --git a/internal/web/public/assets/index.js b/internal/web/public/assets/index.js index 3cd0d7e..760c9a0 100644 --- a/internal/web/public/assets/index.js +++ b/internal/web/public/assets/index.js @@ -1 +1,2 @@ -(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 b={context:void 0,registry:void 0,effects:void 0,done:!1,getContextId(){return Ve(this.context.count)},getNextContextId(){return Ve(this.context.count++)}};function Ve(e){const t=String(e),n=t.length-1;return b.context.id+(n?String.fromCharCode(96+n):"")+t}function re(e){b.context=e}const nt=!1,Pt=(e,t)=>e===t,Le=Symbol("solid-proxy"),kt=typeof Proxy=="function",Et=Symbol("solid-track"),de={equals:Pt};let rt=ft;const q=1,he=2,st={owned:null,cleanups:null,context:null,owner:null},xe={};var v=null;let _e=null,It=null,$=null,N=null,V=null,we=0;function se(e,t){const n=$,r=v,s=e.length===0,o=t===void 0?r:t,i=s?st:{owned:null,cleanups:null,context:o?o.context:null,owner:o},l=s?e:()=>e(()=>j(()=>ie(i)));v=i,$=null;try{return K(l,!0)}finally{$=n,v=r}}function L(e,t){t=t?Object.assign({},de,t):de;const n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},r=s=>(typeof s=="function"&&(s=s(n.value)),ut(n,s));return[ct.bind(n),r]}function Lt(e,t,n){const r=ye(e,t,!0,q);ee(r)}function G(e,t,n){const r=ye(e,t,!1,q);ee(r)}function Rt(e,t,n){rt=Bt;const r=ye(e,t,!1,q);r.user=!0,V?V.push(r):ee(r)}function R(e,t,n){n=n?Object.assign({},de,n):de;const r=ye(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,ee(r),ct.bind(r)}function Ot(e){return e&&typeof e=="object"&&"then"in e}function Nt(e,t,n){let r,s,o;r=!0,s=e,o={};let i=null,l=xe,a=null,c=!1,f="initialValue"in o,u=typeof r=="function"&&R(r);const p=new Set,[h,w]=(o.storage||L)(o.initialValue),[d,g]=L(void 0),[y,m]=L(void 0,{equals:!1}),[S,x]=L(f?"ready":"unresolved");b.context&&(a=b.getNextContextId(),o.ssrLoadFrom==="initial"?l=o.initialValue:b.load&&b.has(a)&&(l=b.load(a)));function _(k,A,E,W){return i===k&&(i=null,W!==void 0&&(f=!0),(k===l||A===l)&&o.onHydrated&&queueMicrotask(()=>o.onHydrated(W,{value:A})),l=xe,T(A,E)),A}function T(k,A){K(()=>{A===void 0&&w(()=>k),x(A!==void 0?"errored":f?"ready":"unresolved"),g(A);for(const E of p.keys())E.decrement();p.clear()},!1)}function H(){const k=Ft,A=h(),E=d();if(E!==void 0&&!i)throw E;return $&&$.user,A}function U(k=!0){if(k!==!1&&c)return;c=!1;const A=u?u():r;if(A==null||A===!1){_(i,j(h));return}const E=l!==xe?l:j(()=>s(A,{value:h(),refetching:k}));return Ot(E)?(i=E,"value"in E?(E.status==="success"?_(i,E.value,void 0,A):_(i,void 0,Re(E.value),A),E):(c=!0,queueMicrotask(()=>c=!1),K(()=>{x(f?"refreshing":"pending"),m()},!1),E.then(W=>_(E,W,void 0,A),W=>_(E,void 0,Re(W),A)))):(_(i,E,void 0,A),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?Lt(()=>U(!1)):U(!1),[H,{refetch:U,mutate:w}]}function Tt(e){return K(e,!1)}function j(e){if($===null)return e();const t=$;$=null;try{return e()}finally{$=t}}function je(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 Dt(e){Rt(()=>j(e))}function Fe(e){return v===null||(v.cleanups===null?v.cleanups=[e]:v.cleanups.push(e)),e}function ot(){return v}function it(e,t){const n=v,r=$;v=e,$=null;try{return K(t,!0)}catch(s){Ue(s)}finally{v=n,$=r}}function jt(e){const t=$,n=v;return Promise.resolve().then(()=>{$=t,v=n;let r;return K(e,!1),$=v=null,r?r.done:void 0})}const[hr,pr]=L(!1);function lt(e,t){const n=Symbol("context");return{id:n,Provider:Kt(n),defaultValue:e}}function at(e){let t;return v&&v.context&&(t=v.context[e.id])!==void 0?t:e.defaultValue}function He(e){const t=R(e),n=R(()=>Oe(t()));return n.toArray=()=>{const r=n();return Array.isArray(r)?r:r!=null?[r]:[]},n}let Ft;function ct(){if(this.sources&&this.state)if(this.state===q)ee(this);else{const e=N;N=null,K(()=>ge(this),!1),N=e}if($){const e=this.observers?this.observers.length:0;$.sources?($.sources.push(this),$.sourceSlots.push(e)):($.sources=[this],$.sourceSlots=[e]),this.observers?(this.observers.push($),this.observerSlots.push($.sources.length-1)):(this.observers=[$],this.observerSlots=[$.sources.length-1])}return this.value}function ut(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 ee(e){if(!e.fn)return;ie(e);const t=we;Ht(e,e.value,t)}function Ht(e,t,n){let r;const s=v,o=$;$=v=e;try{r=e.fn(t)}catch(i){return e.pure&&(e.state=q,e.owned&&e.owned.forEach(ie),e.owned=null),e.updatedAt=n+1,Ue(i)}finally{$=o,v=s}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?ut(e,r):e.value=r,e.updatedAt=n)}function ye(e,t,n,r=q,s){const o={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:v,context:v?v.context:null,pure:n};return v===null||v!==st&&(v.owned?v.owned.push(o):v.owned=[o]),o}function pe(e){if(e.state===0)return;if(e.state===he)return ge(e);if(e.suspense&&j(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===q)ee(e);else if(e.state===he){const r=N;N=null,K(()=>ge(e,t[0]),!1),N=r}}function K(e,t){if(N)return e();let n=!1;t||(N=[]),V?n=!0:V=[],we++;try{const r=e();return Ut(n),r}catch(r){n||(V=null),N=null,Ue(r)}}function Ut(e){if(N&&(ft(N),N=null),e)return;const t=V;V=null,t.length&&K(()=>rt(t),!1)}function ft(e){for(let t=0;t=0;t--)ie(e.tOwned[t]);delete e.tOwned}if(e.owned){for(t=e.owned.length-1;t>=0;t--)ie(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 Re(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function Ue(e,t=v){throw Re(e)}function Oe(e){if(typeof e=="function"&&!e.length)return Oe(e());if(Array.isArray(e)){const t=[];for(let n=0;ns=j(()=>(v.context={...v.context,[e]:r.value},He(()=>r.children))),void 0),s}}const Mt=Symbol("fallback");function qe(e){for(let t=0;t1?[]:null;return Fe(()=>qe(o)),()=>{let a=e()||[],c=a.length,f,u;return a[Et],j(()=>{let h,w,d,g,y,m,S,x,_;if(c===0)i!==0&&(qe(o),o=[],r=[],s=[],i=0,l&&(l=[])),n.fallback&&(r=[Mt],s[0]=se(T=>(o[0]=T,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],g[x]=o[S],l&&(y[x]=l[S]);for(h=new Map,w=new Array(x+1),u=x;u>=m;u--)_=a[u],f=h.get(_),w[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],g[u]=o[f],l&&(y[u]=l[f]),u=w[u],h.set(_,u)):o[f]();for(u=m;ue(t||{}))}function ce(){return!0}const qt={get(e,t,n){return t===Le?n:e.get(t)},has(e,t){return t===Le?!0:e.has(t)},set:ce,deleteProperty:ce,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:ce,deleteProperty:ce}},ownKeys(e){return e.keys()}};function Ce(e){return(e=typeof e=="function"?e():e)?e:{}}function Wt(){for(let e=0,t=this.length;e=0;l--){const a=Ce(e[l])[i];if(a!==void 0)return a}},has(i){for(let l=e.length-1;l>=0;l--)if(i in Ce(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:Wt.bind(n[f]=[u.get.bind(l)])}:u.value!==void 0?u:void 0;else{const p=n[f];p&&(u.get?p.push(u.get.bind(l)):u.value!==void 0&&p.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 Ae(e){let t,n;const r=s=>{const o=b.context;if(o){const[l,a]=L();b.count||(b.count=0),b.count++,(n||(n=e())).then(c=>{!b.done&&re(o),b.count--,a(()=>c.default),re()}),t=l}else if(!t){const[l]=Nt(()=>(n||(n=e())).then(a=>a.default));t=l}let i;return R(()=>(i=t())?j(()=>{if(!o||b.done)return i(s);const l=b.context;re(o);const a=i(s);return re(l),a}):"")};return r.preload=()=>n||((n=e()).then(s=>t=()=>s.default),n),r}const Xt=e=>`Stale read from <${e}>.`;function ht(e){const t="fallback"in e&&{fallback:()=>e.fallback};return R(Vt(()=>e.each,e.children,t||void 0))}function ve(e){const t=e.keyed,n=R(()=>e.when,void 0,void 0),r=t?n:R(n,void 0,{equals:(s,o)=>!s==!o});return R(()=>{const s=r();if(s){const o=e.children;return typeof o=="function"&&o.length>0?j(()=>o(t?s:()=>{if(!j(r))throw Xt("Show");return n()})):o}return e.fallback},void 0,void 0)}function Yt(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 w=t[i];for(;l{s=o,t===document?e():O(t,e(),t.firstChild?null:void 0,n)},r.owner),()=>{s(),t.textContent=""}}function D(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 te(e,t=window.document){const n=t[We]||(t[We]=new Set);for(let r=0,s=e.length;rbe(e,t(),s,n),r)}function pt(e){return!!b.context&&!b.done&&(!e||e.isConnected)}function Qt(e){if(b.registry&&b.events&&b.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}}),b.registry&&!b.done&&(b.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=be(e,a,n,r)}),()=>n;if(Array.isArray(t)){const a=[],c=n&&Array.isArray(n);if(Ne(a,t,n,s))return G(()=>n=be(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=z(e,n,r),l)return n}else c?n.length===0?Ge(e,a,r):Yt(e,n,a):(n&&z(e),Ge(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=z(e,n,r,t);z(e,n,null,t)}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}}return n}function Ne(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 Zt=!1,zt="modulepreload",en=function(e){return"/"+e},Xe={},Pe=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=en(a),a in Xe)return;Xe[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":zt,c||(u.as="script"),u.crossOrigin="",u.href=a,l&&u.setAttribute("nonce",l),document.head.appendChild(u),c)return new Promise((p,h)=>{u.addEventListener("load",p),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 gt(){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 Te;function Be(){(!window.history.state||window.history.state._depth==null)&&window.history.replaceState({...window.history.state,_depth:window.history.length-1},""),Te=window.history.state._depth}Be();function tn(e){return{...e,_depth:window.history.state&&window.history.state._depth}}function nn(e,t){let n=!1;return()=>{const r=Te;Be();const s=r==null?null:Te-r;if(n){n=!1;return}s&&t(s)?(n=!0,window.history.go(-s)):e()}}const rn=/^(?:[a-z0-9]+:)?\/\//i,sn=/^\/+|(\/)\/+$/g,mt="http://sr";function oe(e,t=!1){const n=e.replace(sn,"$1");return n?t||/^[?#]/.test(n)?n:"/"+n:""}function fe(e,t,n){if(rn.test(t))return;const r=oe(e),s=n&&oe(n);let o="";return!s||t.startsWith("/")?o=r:s.toLowerCase().indexOf(r.toLowerCase())!==0?o=r+s:o=s,(o||"/")+oe(t,!o)}function on(e,t){if(e==null)throw new Error(t);return e}function ln(e,t){return oe(e).replace(/\/*(\*.*)?$/g,"")+oe(t)}function bt(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 an(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=p=>n===void 0?void 0:n[p];for(let p=0;pr===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 cn(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 wt(e){const t=new Map,n=ot();return new Proxy({},{get(r,s){return t.has(s)||it(n,()=>t.set(s,R(()=>e()[s]))),t.get(s)()},getOwnPropertyDescriptor(){return{enumerable:!0,configurable:!0}},ownKeys(){return Reflect.ownKeys(e())}})}function yt(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 yt(r).reduce((o,i)=>[...o,...s.map(l=>l+i)],[])}const un=100,vt=lt(),$t=lt(),fn=()=>on(at(vt)," and 'use' router primitives can be only used inside a Route."),gr=()=>fn().params;function dn(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 St(e.path).reduce((c,f)=>{for(const u of yt(f)){const p=ln(t,u);let h=l?p:p.split("/*",1)[0];h=h.split("/").map(w=>w.startsWith(":")||w.startsWith("*")?w:encodeURIComponent(w)).join("/"),c.push({...a,originalPath:f,pattern:h,matcher:an(h,!l,e.matchFilters)})}return c},[])}function hn(e,t=0){return{routes:e,score:cn(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 St(e){return Array.isArray(e)?e:[e]}function xt(e,t="",n=[],r=[]){const s=St(e);for(let o=0,i=s.length;oi.score-o.score)}function Ee(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=R(()=>s().pathname),i=R(()=>s().search,!0),l=R(()=>s().hash),a=()=>"",c=je(i,()=>bt(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):wt(c)}}let J;function gn(){return J}function mn(e,t,n,r={}){const{signal:[s,o],utils:i={}}=e,l=i.parsePath||(C=>C),a=i.renderPath||(C=>C),c=i.beforeLeave||gt(),f=fe("",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,p]=L(!1);let h;const w=(C,P)=>{P.value===d()&&P.state===y()||(h===void 0&&p(!0),J=C,h=P,jt(()=>{h===P&&(g(h.value),m(h.state),_[1](F=>F.filter(Q=>Q.pending)))}).finally(()=>{h===P&&Tt(()=>{J=void 0,C==="navigate"&&W(h),p(!1),h=void 0})}))},[d,g]=L(s().value),[y,m]=L(s().state),S=pn(d,y,i.queryWrapper),x=[],_=L([]),T=R(()=>typeof r.transformUrl=="function"?Ee(t(),r.transformUrl(S.pathname)):Ee(t(),S.pathname)),H=()=>{const C=T(),P={};for(let F=0;Ff,outlet:()=>null,resolvePath(C){return fe(f,C)}};return G(je(s,C=>w("native",C),{defer:!0})),{base:k,location:S,params:U,isRouting:u,renderPath:a,parsePath:l,navigatorFactory:E,matches:T,beforeLeave:c,preloadRoute:At,singleFlight:r.singleFlight===void 0?!0:r.singleFlight,submissions:_};function A(C,P,F){j(()=>{if(typeof P=="number"){P&&(i.go?i.go(P):console.warn("Router integration does not support relative routing"));return}const Q=!P||P[0]==="?",{replace:$e,resolve:Z,scroll:Se,state:ne}={replace:!1,resolve:!Q,scroll:!0,...F},ae=Z?C.resolvePath(P):fe(Q&&S.pathname||"",P);if(ae===void 0)throw new Error(`Path '${P}' is not a routable path`);if(x.length>=un)throw new Error("Too many redirects");const Me=d();(ae!==Me||ne!==y())&&(Zt||c.confirm(ae,F)&&(x.push({value:Me,replace:$e,scroll:Se,state:y()}),w("navigate",{value:ae,state:ne})))})}function E(C){return C=C||at($t)||k,(P,F)=>A(C,P,F)}function W(C){const P=x[0];P&&(o({...C,replace:P.replace,scroll:P.scroll}),x.length=0)}function At(C,P){const F=Ee(t(),C.pathname),Q=J;J="preload";for(let $e in F){const{route:Z,params:Se}=F[$e];Z.component&&Z.component.preload&&Z.component.preload();const{preload:ne}=Z;P&&ne&&it(n(),()=>ne({params:Se,location:{pathname:C.pathname,search:C.search,hash:C.hash,query:bt(C),state:null,key:""},intent:"preload"}))}J=Q}}function bn(e,t,n,r){const{base:s,location:o,params:i}=e,{pattern:l,component:a,preload:c}=r().route,f=R(()=>r().path);a&&a.preload&&a.preload();const u=c?c({params:i,location:o,intent:J||"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 fe(s.path(),h,f())}}}const wn=e=>t=>{const{base:n}=t,r=He(()=>t.children),s=R(()=>xt(r(),t.base||""));let o;const i=mn(e,s,()=>o,{base:n,singleFlight:t.singleFlight,transformUrl:t.transformUrl});return e.create&&e.create(i),I(vt.Provider,{value:i,get children(){return I(yn,{routerState:i,get root(){return t.root},get preload(){return t.rootPreload||t.rootLoad},get children(){return[R(()=>(o=ot())&&null),I(vn,{routerState:i,get branches(){return s()}})]}})}})};function yn(e){const t=e.routerState.location,n=e.routerState.params,r=R(()=>e.preload&&j(()=>{e.preload({params:n,location:t,intent:gn()||"initial"})}));return I(ve,{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 vn(e){const t=[];let n;const r=R(je(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]=bn(e.routerState,a[c-1]||e.routerState.base,Ye(()=>r()[c+1]),()=>e.routerState.matches()[c])}))}return t.splice(s.length).forEach(c=>c()),i&&l?i:(n=a[0],a)}));return Ye(()=>r()&&n)()}const Ye=e=>()=>I(ve,{get when(){return e()},keyed:!0,children:t=>I($t.Provider,{value:t,get children(){return t.outlet()}})}),ue=e=>{const t=He(()=>e.children);return Gt(e,{get children(){return t()}})};function $n([e,t],n,r){return[e,r?s=>t(r(s)):t]}function Sn(e){let t=!1;const n=s=>typeof s=="string"?{value:s}:s,r=$n(L(n(e.get()),{equals:(s,o)=>s.value===o.value&&s.state===o.state}),void 0,s=>(!t&&e.set(s),b.registry&&!b.done&&(b.done=!0),s));return e.init&&Fe(e.init((s=e.get())=>{t=!0,r[1](n(s)),t=!1})),wn({signal:r,create:e.create,utils:e.utils})}function xn(e,t,n){return e.addEventListener(t,n),()=>e.removeEventListener(t,n)}function _n(e,t){const n=e&&document.getElementById(e);n?n.scrollIntoView():t&&window.scrollTo(0,0)}const Cn=new Map;function An(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 g=d.composedPath().find(T=>T instanceof Node&&T.nodeName.toUpperCase()==="A");if(!g||t&&!g.hasAttribute("link"))return;const y=c(g),m=y?g.href.baseVal:g.href;if((y?g.target.baseVal:g.target)||!m&&!g.hasAttribute("state"))return;const x=(g.getAttribute("rel")||"").split(/\s+/);if(g.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[g,_]}function u(d){const g=f(d);if(!g)return;const[y,m]=g,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 p(d){const g=f(d);if(!g)return;const[y,m]=g;r&&(m.pathname=r(m.pathname)),s.preloadRoute(m,y.getAttribute("preload")!=="false")}function h(d){clearTimeout(l);const g=f(d);if(!g)return a=null;const[y,m]=g;a!==y&&(r&&(m.pathname=r(m.pathname)),l=setTimeout(()=>{s.preloadRoute(m,y.getAttribute("preload")!=="false"),a=y},20))}function w(d){if(d.defaultPrevented)return;let g=d.submitter&&d.submitter.hasAttribute("formaction")?d.submitter.getAttribute("formaction"):d.target.getAttribute("action");if(!g)return;if(!g.startsWith("https://action/")){const m=new URL(g,mt);if(g=s.parsePath(m.pathname+m.search),!g.startsWith(n))return}if(d.target.method.toUpperCase()!=="POST")throw new Error("Only POST forms are supported for Actions");const y=Cn.get(g);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))}}te(["click","submit"]),document.addEventListener("click",u),e&&(document.addEventListener("mousemove",h,{passive:!0}),document.addEventListener("focusin",p,{passive:!0}),document.addEventListener("touchstart",p,{passive:!0})),document.addEventListener("submit",w),Fe(()=>{document.removeEventListener("click",u),e&&(document.removeEventListener("mousemove",h),document.removeEventListener("focusin",p),document.removeEventListener("touchstart",p)),document.removeEventListener("submit",w)})}}function Pn(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=gt();return Sn({get:t,set({value:r,replace:s,scroll:o,state:i}){s?window.history.replaceState(tn(i),"",r):window.history.pushState(i,"",r),_n(decodeURIComponent(window.location.hash.slice(1)),o),Be()},init:r=>xn(window,"popstate",nn(r,s=>{if(s&&s<0)return!n.confirm(s);{const o=t();return!n.confirm(o.value,{state:o.state})}})),create:An(e.preload,e.explicitLinks,e.actionBase,e.transformUrl),utils:{go:r=>window.history.go(r),beforeLeave:n}})(e)}const X="",kn=async()=>{const e=X+"/api/all";return await(await fetch(e)).json()},En=async()=>{const e=X+"/api/config/";return await(await fetch(e)).json()},mr=async()=>{const e=X+"/api/version";return await(await fetch(e)).json()},br=async()=>{const e=X+"/api/notify_test";await fetch(e)},Je=async(e,t,n)=>{const r=X+"/api/edit/"+e+"/"+t+"/"+n;return await(await fetch(r)).json()},wr=async e=>{const t=X+"/api/host/"+e;return await(await fetch(t)).json()},yr=async e=>{const t=X+"/api/host/del/"+e;return await(await fetch(t)).json()},vr=async(e,t)=>{const n=X+"/api/port/"+e+"/"+t;return await(await fetch(n)).json()},In={ID:0,Name:"",DNS:"",Iface:"",IP:"",Mac:"",Hw:"",Date:"",Known:0,Now:0},Ln={Host:"",Port:"",Theme:"",Color:"",DirPath:"",Timeout:120,NodePath:"",LogLevel:"",Ifaces:"",ArpArgs:"",ArpStrs:[],TrimHist:48,HistInDB:!1,ShoutURL:"",UseDB:"",PGConnect:"",InfluxEnable:!1,InfluxAddr:"",InfluxToken:"",InfluxOrg:"",InfluxBucket:"",InfluxSkipTLS:!1,PrometheusEnable:!1},[le,M]=L([]),[De,Rn]=L([]),[On,Nn]=L([]),[Y,Tn]=L(Ln),[_t,Qe]=L(!1),[$r,Sr]=L(In);let Ze="ID";function Dn(){const e=localStorage.getItem("filterField"),t=localStorage.getItem("filterValue");Ke(e,t)}function Ke(e,t){let n=le();switch(Ze==e&&(n=De()),Ze=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=De()}M([]),M(n)}let B=!1,Ie="";function jn(){const e=localStorage.getItem("sortField");B=JSON.parse(localStorage.getItem("sortDown")),B=!B,Ct(e)}function Ct(e){e!=Ie?(Ie=e,B=!B):(Ie="",B=!B),localStorage.setItem("sortDown",B.toString()),localStorage.setItem("sortField",e);let t=le();e=="IP"?t.sort((n,r)=>Hn(n,r,B)):t.sort((n,r)=>Fn(n,r,e,B)),M([]),M(t)}function Fn(e,t,n,r){return e[n]>t[n]?r?1:-1:r?-1:1}function Hn(e,t,n){const r=ze(e),s=ze(t);return n?r-s:s-r}function ze(e){return Number(e.IP.split(".").map(t=>`000${t}`.slice(-3)).join(""))}function Un(){et(),Ke("ID",0),setInterval(()=>{et()},6e4)}async function et(){const e=await kn();M(e),Rn(e),jn(),Dn(),Bn()}function Bn(){let e=[];for(let t of le())e.includes(t.Iface)||e.push(t.Iface);Nn(e)}var Kn=D(''),Mn=D(''),Vn=D(""),qn=D('
.
');function Wn(e){const[t,n]=L(e.host.Name),r="http://"+e.host.IP,s="/host/"+e.host.ID;let o=Kn();e.host.Now==1&&(o=Mn());let i=!1;e.host.Known==1&&(i=!0);const l=async c=>{n(c),await Je(e.host.ID,t(),"")},a=async()=>{await Je(e.host.ID,t(),"toggle")};return(()=>{var c=qn(),f=c.firstChild,u=f.firstChild,p=f.nextSibling,h=p.nextSibling,w=h.nextSibling,d=w.firstChild,g=w.nextSibling,y=g.nextSibling,m=y.nextSibling,S=m.nextSibling,x=S.firstChild,_=x.firstChild,T=S.nextSibling,H=T.nextSibling,U=H.firstChild;return O(f,()=>e.index,u),O(p,I(ve,{get when(){return _t()},get fallback(){return t()},get children(){var k=Vn();return k.$$input=A=>l(A.target.value),G(()=>k.value=t()),k}})),O(h,()=>e.host.Iface),me(d,"href",r),O(d,()=>e.host.IP),O(g,()=>e.host.Mac),O(y,()=>e.host.Hw),O(m,()=>e.host.Date),_.$$click=a,_.checked=i,O(T,o),me(U,"href",s),c})()}te(["input","click"]);var Gn=D('
Name Iface IP MAC Hardware Date Known Online ');function Xn(){const e=t=>{Ct(t)};return(()=>{var t=Gn(),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,p=u.nextSibling,h=f.nextSibling,w=h.firstChild,d=w.nextSibling,g=h.nextSibling,y=g.firstChild,m=y.nextSibling,S=g.nextSibling,x=S.firstChild,_=x.nextSibling,T=S.nextSibling,H=T.firstChild,U=H.nextSibling,k=T.nextSibling,A=k.firstChild,E=A.nextSibling;return i.$$click=e,i.$$clickData="Name",c.$$click=e,c.$$clickData="Iface",p.$$click=e,p.$$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})()}te(["click"]);var Yn=D('