From 5a8856350de7b239d00f6f5968cc867255925b9b Mon Sep 17 00:00:00 2001 From: Corsair-cxs <1494089474@qq.com> Date: Tue, 23 Jun 2026 22:58:13 +0800 Subject: [PATCH] Keep iface filter populated --- backend/internal/web/public/assets/index.js | 2 +- frontend/src/functions/api.ts | 2 +- frontend/src/functions/atstart.ts | 48 +++++++++++++++------ 3 files changed, 38 insertions(+), 14 deletions(-) diff --git a/backend/internal/web/public/assets/index.js b/backend/internal/web/public/assets/index.js index a60b2f5..62f2c2e 100644 --- a/backend/internal/web/public/assets/index.js +++ b/backend/internal/web/public/assets/index.js @@ -1,2 +1,2 @@ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/History.js","assets/MacHistory.js","assets/HostPage.js"])))=>i.map(i=>d[i]); -(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 lt(this.context.count)},getNextContextId(){return lt(this.context.count++)}};function lt(e){const t=String(e),n=t.length-1;return w.context.id+(n?String.fromCharCode(96+n):"")+t}function oe(e){w.context=e}const yt=!1,Wt=(e,t)=>e===t,B=Symbol("solid-proxy"),qt=typeof Proxy=="function",Ve=Symbol("solid-track"),ve={equals:Wt};let wt=_t;const G=1,Se=2,bt={owned:null,cleanups:null,context:null,owner:null},De={};var v=null;let je=null,Gt=null,$=null,T=null,q=null,Ie=0;function le(e,t){const n=$,r=v,s=e.length===0,o=t===void 0?r:t,i=s?bt:{owned:null,cleanups:null,context:o?o.context:null,owner:o},l=s?e:()=>e(()=>j(()=>ue(i)));v=i,$=null;try{return M(l,!0)}finally{$=n,v=r}}function I(e,t){t=t?Object.assign({},ve,t):ve;const n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},r=s=>(typeof s=="function"&&(s=s(n.value)),xt(n,s));return[Pt.bind(n),r]}function Xt(e,t,n){const r=Le(e,t,!0,G);ne(r)}function D(e,t,n){const r=Le(e,t,!1,G);ne(r)}function Yt(e,t,n){wt=nn;const r=Le(e,t,!1,G);r.user=!0,q?q.push(r):ne(r)}function R(e,t,n){n=n?Object.assign({},ve,n):ve;const r=Le(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,ne(r),Pt.bind(r)}function Jt(e){return e&&typeof e=="object"&&"then"in e}function zt(e,t,n){let r,s,o;r=!0,s=e,o={};let i=null,l=De,a=null,f=!1,u="initialValue"in o,c=typeof r=="function"&&R(r);const h=new Set,[d,b]=(o.storage||I)(o.initialValue),[g,m]=I(void 0),[S,p]=I(void 0,{equals:!1}),[E,x]=I(u?"ready":"unresolved");w.context&&(a=w.getNextContextId(),o.ssrLoadFrom==="initial"?l=o.initialValue:w.load&&w.has(a)&&(l=w.load(a)));function k(y,A,O,X){return i===y&&(i=null,X!==void 0&&(u=!0),(y===l||A===l)&&o.onHydrated&&queueMicrotask(()=>o.onHydrated(X,{value:A})),l=De,H(A,O)),A}function H(y,A){M(()=>{A===void 0&&b(()=>y),x(A!==void 0?"errored":u?"ready":"unresolved"),m(A);for(const O of h.keys())O.decrement();h.clear()},!1)}function V(){const y=Zt,A=d(),O=g();if(O!==void 0&&!i)throw O;return $&&$.user,A}function Y(y=!0){if(y!==!1&&f)return;f=!1;const A=c?c():r;if(A==null||A===!1){k(i,j(d));return}const O=l!==De?l:j(()=>s(A,{value:d(),refetching:y}));return Jt(O)?(i=O,"value"in O?(O.status==="success"?k(i,O.value,void 0,A):k(i,void 0,qe(O.value),A),O):(f=!0,queueMicrotask(()=>f=!1),M(()=>{x(u?"refreshing":"pending"),p()},!1),O.then(X=>k(O,X,void 0,A),X=>k(O,void 0,qe(X),A)))):(k(i,O,void 0,A),O)}return Object.defineProperties(V,{state:{get:()=>E()},error:{get:()=>g()},loading:{get(){const y=E();return y==="pending"||y==="refreshing"}},latest:{get(){if(!u)return V();const y=g();if(y&&!i)throw y;return d()}}}),c?Xt(()=>Y(!1)):Y(!1),[V,{refetch:Y,mutate:b}]}function vt(e){return M(e,!1)}function j(e){if($===null)return e();const t=$;$=null;try{return e()}finally{$=t}}function Qe(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 f=0;ft(l,s,i));return s=l,a}}function Ze(e){Yt(()=>j(e))}function ke(e){return v===null||(v.cleanups===null?v.cleanups=[e]:v.cleanups.push(e)),e}function We(){return $}function et(){return v}function St(e,t){const n=v,r=$;v=e,$=null;try{return M(t,!0)}catch(s){nt(s)}finally{v=n,$=r}}function Qt(e){const t=$,n=v;return Promise.resolve().then(()=>{$=t,v=n;let r;return M(e,!1),$=v=null,r?r.done:void 0})}const[Mr,Vr]=I(!1);function $t(e,t){const n=Symbol("context");return{id:n,Provider:rn(n),defaultValue:e}}function At(e){let t;return v&&v.context&&(t=v.context[e.id])!==void 0?t:e.defaultValue}function tt(e){const t=R(e),n=R(()=>Ge(t()));return n.toArray=()=>{const r=n();return Array.isArray(r)?r:r!=null?[r]:[]},n}let Zt;function Pt(){if(this.sources&&this.state)if(this.state===G)ne(this);else{const e=T;T=null,M(()=>Ae(this),!1),T=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 xt(e,t,n){let r=e.value;return(!e.comparator||!e.comparator(r,t))&&(e.value=t,e.observers&&e.observers.length&&M(()=>{for(let s=0;s1e6)throw T=[],new Error},!1)),t}function ne(e){if(!e.fn)return;ue(e);const t=Ie;en(e,e.value,t)}function en(e,t,n){let r;const s=v,o=$;$=v=e;try{r=e.fn(t)}catch(i){return e.pure&&(e.state=G,e.owned&&e.owned.forEach(ue),e.owned=null),e.updatedAt=n+1,nt(i)}finally{$=o,v=s}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?xt(e,r):e.value=r,e.updatedAt=n)}function Le(e,t,n,r=G,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!==bt&&(v.owned?v.owned.push(o):v.owned=[o]),o}function $e(e){if(e.state===0)return;if(e.state===Se)return Ae(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===G)ne(e);else if(e.state===Se){const r=T;T=null,M(()=>Ae(e,t[0]),!1),T=r}}function M(e,t){if(T)return e();let n=!1;t||(T=[]),q?n=!0:q=[],Ie++;try{const r=e();return tn(n),r}catch(r){n||(q=null),T=null,nt(r)}}function tn(e){if(T&&(_t(T),T=null),e)return;const t=q;q=null,t.length&&M(()=>wt(t),!1)}function _t(e){for(let t=0;t=0;t--)ue(e.tOwned[t]);delete e.tOwned}if(e.owned){for(t=e.owned.length-1;t>=0;t--)ue(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 qe(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function nt(e,t=v){throw qe(e)}function Ge(e){if(typeof e=="function"&&!e.length)return Ge(e());if(Array.isArray(e)){const t=[];for(let n=0;ns=j(()=>(v.context={...v.context,[e]:r.value},tt(()=>r.children))),void 0),s}}const sn=Symbol("fallback");function at(e){for(let t=0;t1?[]:null;return ke(()=>at(o)),()=>{let a=e()||[],f=a.length,u,c;return a[Ve],j(()=>{let d,b,g,m,S,p,E,x,k;if(f===0)i!==0&&(at(o),o=[],r=[],s=[],i=0,l&&(l=[])),n.fallback&&(r=[sn],s[0]=le(H=>(o[0]=H,n.fallback())),i=1);else if(i===0){for(s=new Array(f),c=0;c=p&&x>=p&&r[E]===a[x];E--,x--)g[x]=s[E],m[x]=o[E],l&&(S[x]=l[E]);for(d=new Map,b=new Array(x+1),c=x;c>=p;c--)k=a[c],u=d.get(k),b[c]=u===void 0?-1:u,d.set(k,c);for(u=p;u<=E;u++)k=r[u],c=d.get(k),c!==void 0&&c!==-1?(g[c]=s[u],m[c]=o[u],l&&(S[c]=l[u]),c=b[c],d.set(k,c)):o[u]();for(c=p;ce(t||{}))}function ye(){return!0}const ln={get(e,t,n){return t===B?n:e.get(t)},has(e,t){return t===B?!0:e.has(t)},set:ye,deleteProperty:ye,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:ye,deleteProperty:ye}},ownKeys(e){return e.keys()}};function Fe(e){return(e=typeof e=="function"?e():e)?e:{}}function an(){for(let e=0,t=this.length;e=0;l--){const a=Fe(e[l])[i];if(a!==void 0)return a}},has(i){for(let l=e.length-1;l>=0;l--)if(i in Fe(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 f=a.length-1;f>=0;f--){const u=a[f];if(u==="__proto__"||u==="constructor")continue;const c=Object.getOwnPropertyDescriptor(l,u);if(!r[u])r[u]=c.get?{enumerable:!0,configurable:!0,get:an.bind(n[u]=[c.get.bind(l)])}:c.value!==void 0?c:void 0;else{const h=n[u];h&&(c.get?h.push(c.get.bind(l)):c.value!==void 0&&h.push(()=>c.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 He(e){let t,n;const r=s=>{const o=w.context;if(o){const[l,a]=I();w.count||(w.count=0),w.count++,(n||(n=e())).then(f=>{!w.done&&oe(o),w.count--,a(()=>f.default),oe()}),t=l}else if(!t){const[l]=zt(()=>(n||(n=e())).then(a=>a.default));t=l}let i;return R(()=>(i=t())?j(()=>{if(!o||w.done)return i(s);const l=w.context;oe(o);const a=i(s);return oe(l),a}):"")};return r.preload=()=>n||((n=e()).then(s=>t=()=>s.default),n),r}const un=e=>`Stale read from <${e}>.`;function rt(e){const t="fallback"in e&&{fallback:()=>e.fallback};return R(on(()=>e.each,e.children,t||void 0))}function fe(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 un("Show");return n()})):o}return e.fallback},void 0,void 0)}function fn(e,t,n){let r=n.length,s=t.length,o=r,i=0,l=0,a=t[s-1].nextSibling,f=null;for(;iu-l){const b=t[i];for(;l{s=o,t===document?e():L(t,e(),t.firstChild?null:void 0,n)},r.owner),()=>{s(),t.textContent=""}}function N(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 re(e,t=window.document){const n=t[ct]||(t[ct]=new Set);for(let r=0,s=e.length;rPe(e,t(),s,n),r)}function st(e){return!!w.context&&!w.done&&(!e||e.isConnected)}function gn(e){if(w.registry&&w.events&&w.events.find(([a,f])=>f===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 f=t[`${n}Data`];if(f!==void 0?a.call(t,f,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 f=0;f{let a=t();for(;typeof a=="function";)a=a();n=Pe(e,a,n,r)}),()=>n;if(Array.isArray(t)){const a=[],f=n&&Array.isArray(n);if(Xe(a,t,n,s))return D(()=>n=Pe(e,a,n,r,!0)),()=>n;if(o){if(!a.length)return n;if(r===void 0)return n=[...e.childNodes];let u=a[0];if(u.parentNode!==e)return n;const c=[u];for(;(u=u.nextSibling)!==r;)c.push(u);return n=c}if(a.length===0){if(n=ee(e,n,r),l)return n}else f?n.length===0?ut(e,a,r):fn(e,n,a):(n&&ee(e),ut(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=ee(e,n,r,t);ee(e,n,null,t)}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}}return n}function Xe(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 mn=!1,pn="modulepreload",yn=function(e){return"/"+e},ft={},Ue=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=yn(a),a in ft)return;ft[a]=!0;const f=a.endsWith(".css"),u=f?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${a}"]${u}`))return;const c=document.createElement("link");if(c.rel=f?"stylesheet":pn,f||(c.as="script"),c.crossOrigin="",c.href=a,l&&c.setAttribute("nonce",l),document.head.appendChild(c),f)return new Promise((h,d)=>{c.addEventListener("load",h),c.addEventListener("error",()=>d(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 Ot(){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 Ye;function ot(){(!window.history.state||window.history.state._depth==null)&&window.history.replaceState({...window.history.state,_depth:window.history.length-1},""),Ye=window.history.state._depth}ot();function wn(e){return{...e,_depth:window.history.state&&window.history.state._depth}}function bn(e,t){let n=!1;return()=>{const r=Ye;ot();const s=r==null?null:Ye-r;if(n){n=!1;return}s&&t(s)?(n=!0,window.history.go(-s)):e()}}const vn=/^(?:[a-z0-9]+:)?\/\//i,Sn=/^\/+|(\/)\/+$/g,It="http://sr";function ce(e,t=!1){const n=e.replace(Sn,"$1");return n?t||/^[?#]/.test(n)?n:"/"+n:""}function be(e,t,n){if(vn.test(t))return;const r=ce(e),s=n&&ce(n);let o="";return!s||t.startsWith("/")?o=r:s.toLowerCase().indexOf(r.toLowerCase())!==0?o=r+s:o=s,(o||"/")+ce(t,!o)}function $n(e,t){if(e==null)throw new Error(t);return e}function An(e,t){return ce(e).replace(/\/*(\*.*)?$/g,"")+ce(t)}function kt(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 Pn(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),f=a.length-i;if(f<0||f>0&&s===void 0&&!t)return null;const u={path:i?"":"/",params:{}},c=h=>n===void 0?void 0:n[h];for(let h=0;hr===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 xn(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 Lt(e){const t=new Map,n=et();return new Proxy({},{get(r,s){return t.has(s)||St(n,()=>t.set(s,R(()=>e()[s]))),t.get(s)()},getOwnPropertyDescriptor(){return{enumerable:!0,configurable:!0}},ownKeys(){return Reflect.ownKeys(e())}})}function Rt(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 Rt(r).reduce((o,i)=>[...o,...s.map(l=>l+i)],[])}const _n=100,Nt=$t(),Tt=$t(),Cn=()=>$n(At(Nt)," and 'use' router primitives can be only used inside a Route."),Wr=()=>Cn().params;function En(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 Dt(e.path).reduce((f,u)=>{for(const c of Rt(u)){const h=An(t,c);let d=l?h:h.split("/*",1)[0];d=d.split("/").map(b=>b.startsWith(":")||b.startsWith("*")?b:encodeURIComponent(b)).join("/"),f.push({...a,originalPath:u,pattern:d,matcher:Pn(d,!l,e.matchFilters)})}return f},[])}function On(e,t=0){return{routes:e,score:xn(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 Dt(e){return Array.isArray(e)?e:[e]}function jt(e,t="",n=[],r=[]){const s=Dt(e);for(let o=0,i=s.length;oi.score-o.score)}function Be(e,t){for(let n=0,r=e.length;n{const c=e();try{return new URL(c,r)}catch{return console.error(`Invalid path ${c}`),u}},r,{equals:(u,c)=>u.href===c.href}),o=R(()=>s().pathname),i=R(()=>s().search,!0),l=R(()=>s().hash),a=()=>"",f=Qe(i,()=>kt(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(f):Lt(f)}}let z;function kn(){return z}function Ln(e,t,n,r={}){const{signal:[s,o],utils:i={}}=e,l=i.parsePath||(P=>P),a=i.renderPath||(P=>P),f=i.beforeLeave||Ot(),u=be("",r.base||"");if(u===void 0)throw new Error(`${u} is not a valid base path`);u&&!s().value&&o({value:u,replace:!0,scroll:!1});const[c,h]=I(!1);let d;const b=(P,C)=>{C.value===g()&&C.state===S()||(d===void 0&&h(!0),z=P,d=C,Qt(()=>{d===C&&(m(d.value),p(d.state),k[1](F=>F.filter(Q=>Q.pending)))}).finally(()=>{d===C&&vt(()=>{z=void 0,P==="navigate"&&X(d),h(!1),d=void 0})}))},[g,m]=I(s().value),[S,p]=I(s().state),E=In(g,S,i.queryWrapper),x=[],k=I([]),H=R(()=>typeof r.transformUrl=="function"?Be(t(),r.transformUrl(E.pathname)):Be(t(),E.pathname)),V=()=>{const P=H(),C={};for(let F=0;Fu,outlet:()=>null,resolvePath(P){return be(u,P)}};return D(Qe(s,P=>b("native",P),{defer:!0})),{base:y,location:E,params:Y,isRouting:c,renderPath:a,parsePath:l,navigatorFactory:O,matches:H,beforeLeave:f,preloadRoute:Vt,singleFlight:r.singleFlight===void 0?!0:r.singleFlight,submissions:k};function A(P,C,F){j(()=>{if(typeof C=="number"){C&&(i.go?i.go(C):console.warn("Router integration does not support relative routing"));return}const Q=!C||C[0]==="?",{replace:Ne,resolve:Z,scroll:Te,state:se}={replace:!1,resolve:!Q,scroll:!0,...F},pe=Z?P.resolvePath(C):be(Q&&E.pathname||"",C);if(pe===void 0)throw new Error(`Path '${C}' is not a routable path`);if(x.length>=_n)throw new Error("Too many redirects");const it=g();(pe!==it||se!==S())&&(mn||f.confirm(pe,F)&&(x.push({value:it,replace:Ne,scroll:Te,state:S()}),b("navigate",{value:pe,state:se})))})}function O(P){return P=P||At(Tt)||y,(C,F)=>A(P,C,F)}function X(P){const C=x[0];C&&(o({...P,replace:C.replace,scroll:C.scroll}),x.length=0)}function Vt(P,C){const F=Be(t(),P.pathname),Q=z;z="preload";for(let Ne in F){const{route:Z,params:Te}=F[Ne];Z.component&&Z.component.preload&&Z.component.preload();const{preload:se}=Z;C&&se&&St(n(),()=>se({params:Te,location:{pathname:P.pathname,search:P.search,hash:P.hash,query:kt(P),state:null,key:""},intent:"preload"}))}z=Q}}function Rn(e,t,n,r){const{base:s,location:o,params:i}=e,{pattern:l,component:a,preload:f}=r().route,u=R(()=>r().path);a&&a.preload&&a.preload();const c=f?f({params:i,location:o,intent:z||"initial"}):void 0;return{parent:t,pattern:l,path:u,outlet:()=>a?_(a,{params:i,location:o,data:c,get children(){return n()}}):n(),resolvePath(d){return be(s.path(),d,u())}}}const Nn=e=>t=>{const{base:n}=t,r=tt(()=>t.children),s=R(()=>jt(r(),t.base||""));let o;const i=Ln(e,s,()=>o,{base:n,singleFlight:t.singleFlight,transformUrl:t.transformUrl});return e.create&&e.create(i),_(Nt.Provider,{value:i,get children(){return _(Tn,{routerState:i,get root(){return t.root},get preload(){return t.rootPreload||t.rootLoad},get children(){return[R(()=>(o=et())&&null),_(Dn,{routerState:i,get branches(){return s()}})]}})}})};function Tn(e){const t=e.routerState.location,n=e.routerState.params,r=R(()=>e.preload&&j(()=>{e.preload({params:n,location:t,intent:kn()||"initial"})}));return _(fe,{get when(){return e.root},keyed:!0,get fallback(){return e.children},children:s=>_(s,{params:n,location:t,get data(){return r()},get children(){return e.children}})})}function Dn(e){const t=[];let n;const r=R(Qe(e.routerState.matches,(s,o,i)=>{let l=o&&s.length===o.length;const a=[];for(let f=0,u=s.length;f{t[f]=d,a[f]=Rn(e.routerState,a[f-1]||e.routerState.base,dt(()=>r()[f+1]),()=>e.routerState.matches()[f])}))}return t.splice(s.length).forEach(f=>f()),i&&l?i:(n=a[0],a)}));return dt(()=>r()&&n)()}const dt=e=>()=>_(fe,{get when(){return e()},keyed:!0,children:t=>_(Tt.Provider,{value:t,get children(){return t.outlet()}})}),we=e=>{const t=tt(()=>e.children);return cn(e,{get children(){return t()}})};function jn([e,t],n,r){return[e,r?s=>t(r(s)):t]}function Fn(e){let t=!1;const n=s=>typeof s=="string"?{value:s}:s,r=jn(I(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&&ke(e.init((s=e.get())=>{t=!0,r[1](n(s)),t=!1})),Nn({signal:r,create:e.create,utils:e.utils})}function Hn(e,t,n){return e.addEventListener(t,n),()=>e.removeEventListener(t,n)}function Un(e,t){const n=e&&document.getElementById(e);n?n.scrollIntoView():t&&window.scrollTo(0,0)}const Kn=new Map;function Bn(e=!0,t=!1,n="/_server",r){return s=>{const o=s.base.path(),i=s.navigatorFactory(s.base);let l,a;function f(g){return g.namespaceURI==="http://www.w3.org/2000/svg"}function u(g){if(g.defaultPrevented||g.button!==0||g.metaKey||g.altKey||g.ctrlKey||g.shiftKey)return;const m=g.composedPath().find(H=>H instanceof Node&&H.nodeName.toUpperCase()==="A");if(!m||t&&!m.hasAttribute("link"))return;const S=f(m),p=S?m.href.baseVal:m.href;if((S?m.target.baseVal:m.target)||!p&&!m.hasAttribute("state"))return;const x=(m.getAttribute("rel")||"").split(/\s+/);if(m.hasAttribute("download")||x&&x.includes("external"))return;const k=S?new URL(p,document.baseURI):new URL(p);if(!(k.origin!==window.location.origin||o&&k.pathname&&!k.pathname.toLowerCase().startsWith(o.toLowerCase())))return[m,k]}function c(g){const m=u(g);if(!m)return;const[S,p]=m,E=s.parsePath(p.pathname+p.search+p.hash),x=S.getAttribute("state");g.preventDefault(),i(E,{resolve:!1,replace:S.hasAttribute("replace"),scroll:!S.hasAttribute("noscroll"),state:x?JSON.parse(x):void 0})}function h(g){const m=u(g);if(!m)return;const[S,p]=m;r&&(p.pathname=r(p.pathname)),s.preloadRoute(p,S.getAttribute("preload")!=="false")}function d(g){clearTimeout(l);const m=u(g);if(!m)return a=null;const[S,p]=m;a!==S&&(r&&(p.pathname=r(p.pathname)),l=setTimeout(()=>{s.preloadRoute(p,S.getAttribute("preload")!=="false"),a=S},20))}function b(g){if(g.defaultPrevented)return;let m=g.submitter&&g.submitter.hasAttribute("formaction")?g.submitter.getAttribute("formaction"):g.target.getAttribute("action");if(!m)return;if(!m.startsWith("https://action/")){const p=new URL(m,It);if(m=s.parsePath(p.pathname+p.search),!m.startsWith(n))return}if(g.target.method.toUpperCase()!=="POST")throw new Error("Only POST forms are supported for Actions");const S=Kn.get(m);if(S){g.preventDefault();const p=new FormData(g.target,g.submitter);S.call({r:s,f:g.target},g.target.enctype==="multipart/form-data"?p:new URLSearchParams(p))}}re(["click","submit"]),document.addEventListener("click",c),e&&(document.addEventListener("mousemove",d,{passive:!0}),document.addEventListener("focusin",h,{passive:!0}),document.addEventListener("touchstart",h,{passive:!0})),document.addEventListener("submit",b),ke(()=>{document.removeEventListener("click",c),e&&(document.removeEventListener("mousemove",d),document.removeEventListener("focusin",h),document.removeEventListener("touchstart",h)),document.removeEventListener("submit",b)})}}function Mn(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=Ot();return Fn({get:t,set({value:r,replace:s,scroll:o,state:i}){s?window.history.replaceState(wn(i),"",r):window.history.pushState(i,"",r),Un(decodeURIComponent(window.location.hash.slice(1)),o),ot()},init:r=>Hn(window,"popstate",bn(r,s=>{if(s&&s<0)return!n.confirm(s);{const o=t();return!n.confirm(o.value,{state:o.state})}})),create:Bn(e.preload,e.explicitLinks,e.actionBase,e.transformUrl),utils:{go:r=>window.history.go(r),beforeLeave:n}})(e)}const Je=Symbol("store-raw"),te=Symbol("store-node"),W=Symbol("store-has"),Ft=Symbol("store-self");function Ht(e){let t=e[B];if(!t&&(Object.defineProperty(e,B,{value:t=new Proxy(e,qn)}),!Array.isArray(e))){const n=Object.keys(e),r=Object.getOwnPropertyDescriptors(e);for(let s=0,o=n.length;se[B][t]),n}function Ut(e){We()&&he(_e(e,te),Ft)()}function Wn(e){return Ut(e),Reflect.ownKeys(e)}const qn={get(e,t,n){if(t===Je)return e;if(t===B)return n;if(t===Ve)return Ut(e),n;const r=_e(e,te),s=r[t];let o=s?s():e[t];if(t===te||t===W||t==="__proto__")return o;if(!s){const i=Object.getOwnPropertyDescriptor(e,t);We()&&(typeof o!="function"||e.hasOwnProperty(t))&&!(i&&i.get)&&(o=he(r,t,o)())}return xe(o)?Ht(o):o},has(e,t){return t===Je||t===B||t===Ve||t===te||t===W||t==="__proto__"?!0:(We()&&he(_e(e,W),t)(),t in e)},set(){return!0},deleteProperty(){return!0},ownKeys:Wn,getOwnPropertyDescriptor:Vn};function Ce(e,t,n,r=!1){if(!r&&e[t]===n)return;const s=e[t],o=e.length;n===void 0?(delete e[t],e[W]&&e[W][t]&&s!==void 0&&e[W][t].$()):(e[t]=n,e[W]&&e[W][t]&&s===void 0&&e[W][t].$());let i=_e(e,te),l;if((l=he(i,t,s))&&l.$(()=>n),Array.isArray(e)&&e.length!==o){for(let a=e.length;a1){r=t.shift();const i=typeof r,l=Array.isArray(e);if(Array.isArray(r)){for(let a=0;a1){ie(e[r],t,[r].concat(n));return}s=e[r],n=[r].concat(n)}let o=t[0];typeof o=="function"&&(o=o(s,n),o===s)||r===void 0&&o==null||(o=de(o),r===void 0||xe(s)&&xe(o)&&!Array.isArray(o)?Kt(s,o):Ce(e,r,o))}function Xn(...[e,t]){const n=de(e||{}),r=Array.isArray(n),s=Ht(n);function o(...i){vt(()=>{r&&i.length===1?Gn(n,i[0]):ie(n,i)})}return[s,o]}const U="http://0.0.0.0:8840",Yn=async()=>{const e=U+"/api/all";return await(await fetch(e)).json()},Jn=async()=>{const e=U+"/api/config";return await(await fetch(e)).json()},qr=async()=>{const e=U+"/api/version";return await(await fetch(e)).json()},Gr=async()=>{const e=U+"/api/notify_test";await fetch(e)},zn=async()=>{const e=U+"/api/rescan";await fetch(e)},ht=async(e,t,n)=>{const r=U+"/api/edit/"+e+"/"+t+"/"+n;return await(await fetch(r)).json()},Xr=async e=>{const t=U+"/api/host/"+e;return await(await fetch(t)).json()},Qn=async e=>{const t=U+"/api/host/del/"+e;return await(await fetch(t)).json()},Yr=async(e,t)=>{const n=U+"/api/port/"+e+"/"+t;return await(await fetch(n)).json()},Jr=async e=>{const t=U+"/api/history/"+e+"/?num=210";return await(await fetch(t)).json()},zr=async(e,t)=>{const n=U+"/api/history/"+e+"/"+t;return await(await fetch(n)).json()},Qr=async e=>{const t=U+"/api/wol/"+e;return await(await fetch(t)).json()},Zr={ID:0,Name:"",DNS:"",Iface:"",IP:"",Mac:"",Hw:"",Date:"",Known:0,Now:0},Zn={Host:"",Port:"",Theme:"",Color:"",DirPath:"",Timeout:120,NodePath:"",LogLevel:"",Ifaces:"",ArpArgs:"",ArpStrs:[],TrimHist:48,ShoutURL:"",UseDB:"",PGConnect:"",InfluxEnable:!1,InfluxAddr:"",InfluxToken:"",InfluxOrg:"",InfluxBucket:"",InfluxSkipTLS:!1,PrometheusEnable:!1},[Re,ge]=Xn([]),[Ee,er]=I([]),[tr,nr]=I([]),[J,rr]=I(Zn),[ze,sr]=I(!1),[es,ts]=I(200),[ns,gt]=I(!1),[Bt,or]=I([]);let mt="ID";function ir(){const e=localStorage.getItem("filterField"),t=localStorage.getItem("filterValue");Oe(e,t)}function Oe(e,t){let n=Re;switch(mt==e&&(n=Ee()),mt=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=Ee()}ge(n)}let K=!1,Me="";function lr(){const e=localStorage.getItem("sortField");K=JSON.parse(localStorage.getItem("sortDown")),K=!K,Mt(e)}function Mt(e){e!=Me?(Me=e,K=!K):(Me="",K=!K),localStorage.setItem("sortDown",K.toString()),localStorage.setItem("sortField",e);let t=Ee();e=="IP"?t.sort((n,r)=>cr(n,r,K)):t.sort((n,r)=>ar(n,r,e,K)),ge(t)}function ar(e,t,n,r){return e[n]>t[n]?r?1:-1:r?-1:1}function cr(e,t,n){const r=pt(e),s=pt(t);return n?r-s:s-r}function pt(e){return Number(e.IP.split(".").map(t=>`000${t}`.slice(-3)).join(""))}function ur(){me(),Oe("ID",0),setInterval(()=>{me()},6e4)}async function me(){const e=await Yn();e!==null&&(ge(e),er(e),fr(),lr(),ir())}function fr(){let e=[];for(let t of Re)e.includes(t.Iface)||e.push(t.Iface);nr(e)}const dr=(e,t)=>{let n;const r=()=>clearTimeout(n);return et()&&ke(r),Object.assign((...o)=>{n!==void 0&&r(),n=setTimeout(()=>e(...o),t)},{clear:r})};var hr=N(''),gr=N(''),mr=N(""),pr=N(""),yr=N('.
'),wr=N(""),br=N('');function vr(e){const[t,n]=I(e.host.Name),r=()=>{const u=t().trim();if(u!=="")return u;const c=(e.host.Hw||"").trim();if(c!==""&&!c.startsWith("(Unknown"))return c;const h=(e.host.Mac||"").trim();return h!==""?"Unknown "+h.slice(-5):"Unknown"};let s=hr();e.host.Now==1&&(s=gr());let o;e.host.Known===1?o=!0:o=!1;const i=dr(async u=>{await ht(e.host.ID,u,"")},300),l=async u=>{n(u),i(u)},a=async()=>{await ht(e.host.ID,t(),"toggle")},f=u=>{const c=e.host.ID;or(h=>u?h.includes(c)?h:[...h,c]:h.filter(d=>d!==c))};return(()=>{var u=yr(),c=u.firstChild,h=c.firstChild,d=c.nextSibling,b=d.nextSibling,g=b.nextSibling,m=g.firstChild,S=g.nextSibling,p=S.nextSibling,E=p.nextSibling,x=E.nextSibling,k=x.firstChild,H=k.firstChild,V=x.nextSibling,Y=V.nextSibling;return L(c,()=>e.index,h),L(d,_(fe,{get when(){return ze()},get fallback(){return(()=>{var y=wr();return L(y,r),D(()=>Et(y,t().trim()===""?"text-muted":"")),y})()},get children(){var y=mr();return y.$$input=A=>l(A.target.value),D(()=>y.value=t()),y}})),L(b,()=>e.host.Iface),L(m,()=>e.host.IP),L(S,()=>e.host.Mac),L(p,()=>e.host.Hw.slice(0,12)+".."),L(E,()=>e.host.Date),H.$$click=a,H.checked=o,L(V,s),L(Y,_(fe,{get when(){return ze()},get fallback(){return(()=>{var y=br();return D(()=>ae(y,"href","/host/"+e.host.ID)),y})()},get children(){var y=pr();return y.addEventListener("change",A=>f(A.target.checked)),D(()=>y.checked=Bt().includes(e.host.ID)),y}})),D(y=>{var A="http://"+e.host.IP,O=e.host.Hw;return A!==y.e&&ae(m,"href",y.e=A),O!==y.t&&ae(p,"title",y.t=O),y},{e:void 0,t:void 0}),u})()}re(["input","click"]);var Sr=N(''),$r=N(' ');function Ar(){const[e,t]=I("");(()=>{let s=localStorage.getItem("sortField");s==="Mac"&&(s="MAC"),s==="Hw"&&(s="Hardware"),s==="Now"&&(s="On"),t(s)})();const r=s=>{t(s),s==="MAC"&&(s="Mac"),s==="Hardware"&&(s="Hw"),s==="On"&&(s="Now"),Mt(s)};return(()=>{var s=Sr(),o=s.firstChild,i=o.firstChild,l=i.nextSibling;return L(o,_(rt,{each:["Name","Iface","IP","MAC","Hardware","Date","Known","On"],children:a=>(()=>{var f=$r(),u=f.firstChild,c=u.nextSibling;return L(f,a,u),c.$$click=r,c.$$clickData=a,ae(c,"title","Sort by "+a),D(h=>hn(f,a===e()?"color: var(--bs-primary);":"",h)),f})()}),l),s})()}re(["click"]);var Pr=N('