watchyourlan/backend/internal/web/public/assets/index.js
2025-03-17 09:31:51 +07:00

1 line
12 KiB
JavaScript

(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))i(n);new MutationObserver(n=>{for(const s of n)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function l(n){const s={};return n.integrity&&(s.integrity=n.integrity),n.referrerPolicy&&(s.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?s.credentials="include":n.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(n){if(n.ep)return;n.ep=!0;const s=l(n);fetch(n.href,s)}})();const pe=!1,$e=(e,t)=>e===t,we=Symbol("solid-track"),B={equals:$e};let te=re;const E=1,M=2,le={owned:null,cleanups:null,context:null,owner:null};var d=null;let F=null,ye=null,h=null,g=null,A=null,R=0;function P(e,t){const l=h,i=d,n=e.length===0,s=t===void 0?i:t,o=n?le:{owned:null,cleanups:null,context:s?s.context:null,owner:s},r=n?e:()=>e(()=>T(()=>N(o)));d=o,h=null;try{return O(r,!0)}finally{h=l,d=i}}function ie(e,t){t=t?Object.assign({},B,t):B;const l={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},i=n=>(typeof n=="function"&&(n=n(l.value)),se(l,n));return[ne.bind(l),i]}function V(e,t,l){const i=q(e,t,!1,E);D(i)}function me(e,t,l){te=ve;const i=q(e,t,!1,E);i.user=!0,A?A.push(i):D(i)}function Se(e,t,l){l=l?Object.assign({},B,l):B;const i=q(e,t,!0,0);return i.observers=null,i.observerSlots=null,i.comparator=l.equals||void 0,D(i),ne.bind(i)}function T(e){if(h===null)return e();const t=h;h=null;try{return e()}finally{h=t}}function _e(e){me(()=>T(e))}function xe(e){return d===null||(d.cleanups===null?d.cleanups=[e]:d.cleanups.push(e)),e}function ne(){if(this.sources&&this.state)if(this.state===E)D(this);else{const e=g;g=null,O(()=>U(this),!1),g=e}if(h){const e=this.observers?this.observers.length:0;h.sources?(h.sources.push(this),h.sourceSlots.push(e)):(h.sources=[this],h.sourceSlots=[e]),this.observers?(this.observers.push(h),this.observerSlots.push(h.sources.length-1)):(this.observers=[h],this.observerSlots=[h.sources.length-1])}return this.value}function se(e,t,l){let i=e.value;return(!e.comparator||!e.comparator(i,t))&&(e.value=t,e.observers&&e.observers.length&&O(()=>{for(let n=0;n<e.observers.length;n+=1){const s=e.observers[n],o=F&&F.running;o&&F.disposed.has(s),(o?!s.tState:!s.state)&&(s.pure?g.push(s):A.push(s),s.observers&&oe(s)),o||(s.state=E)}if(g.length>1e6)throw g=[],new Error},!1)),t}function D(e){if(!e.fn)return;N(e);const t=R;Ce(e,e.value,t)}function Ce(e,t,l){let i;const n=d,s=h;h=d=e;try{i=e.fn(t)}catch(o){return e.pure&&(e.state=E,e.owned&&e.owned.forEach(N),e.owned=null),e.updatedAt=l+1,ce(o)}finally{h=s,d=n}(!e.updatedAt||e.updatedAt<=l)&&(e.updatedAt!=null&&"observers"in e?se(e,i):e.value=i,e.updatedAt=l)}function q(e,t,l,i=E,n){const s={fn:e,state:i,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:d,context:d?d.context:null,pure:l};return d===null||d!==le&&(d.owned?d.owned.push(s):d.owned=[s]),s}function H(e){if(e.state===0)return;if(e.state===M)return U(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<R);)e.state&&t.push(e);for(let l=t.length-1;l>=0;l--)if(e=t[l],e.state===E)D(e);else if(e.state===M){const i=g;g=null,O(()=>U(e,t[0]),!1),g=i}}function O(e,t){if(g)return e();let l=!1;t||(g=[]),A?l=!0:A=[],R++;try{const i=e();return Ae(l),i}catch(i){l||(A=null),g=null,ce(i)}}function Ae(e){if(g&&(re(g),g=null),e)return;const t=A;A=null,t.length&&O(()=>te(t),!1)}function re(e){for(let t=0;t<e.length;t++)H(e[t])}function ve(e){let t,l=0;for(t=0;t<e.length;t++){const i=e[t];i.user?e[l++]=i:H(i)}for(t=0;t<l;t++)H(e[t])}function U(e,t){e.state=0;for(let l=0;l<e.sources.length;l+=1){const i=e.sources[l];if(i.sources){const n=i.state;n===E?i!==t&&(!i.updatedAt||i.updatedAt<R)&&H(i):n===M&&U(i,t)}}}function oe(e){for(let t=0;t<e.observers.length;t+=1){const l=e.observers[t];l.state||(l.state=M,l.pure?g.push(l):A.push(l),l.observers&&oe(l))}}function N(e){let t;if(e.sources)for(;e.sources.length;){const l=e.sources.pop(),i=e.sourceSlots.pop(),n=l.observers;if(n&&n.length){const s=n.pop(),o=l.observerSlots.pop();i<n.length&&(s.sourceSlots[o]=i,n[i]=s,l.observerSlots[i]=o)}}if(e.tOwned){for(t=e.tOwned.length-1;t>=0;t--)N(e.tOwned[t]);delete e.tOwned}if(e.owned){for(t=e.owned.length-1;t>=0;t--)N(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 Ee(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function ce(e,t=d){throw Ee(e)}const ke=Symbol("fallback");function Z(e){for(let t=0;t<e.length;t++)e[t]()}function Ne(e,t,l={}){let i=[],n=[],s=[],o=0,r=t.length>1?[]:null;return xe(()=>Z(s)),()=>{let f=e()||[],a=f.length,u,c;return f[we],T(()=>{let b,p,S,x,C,w,$,y,v;if(a===0)o!==0&&(Z(s),s=[],i=[],n=[],o=0,r&&(r=[])),l.fallback&&(i=[ke],n[0]=P(L=>(s[0]=L,l.fallback())),o=1);else if(o===0){for(n=new Array(a),c=0;c<a;c++)i[c]=f[c],n[c]=P(m);o=a}else{for(S=new Array(a),x=new Array(a),r&&(C=new Array(a)),w=0,$=Math.min(o,a);w<$&&i[w]===f[w];w++);for($=o-1,y=a-1;$>=w&&y>=w&&i[$]===f[y];$--,y--)S[y]=n[$],x[y]=s[$],r&&(C[y]=r[$]);for(b=new Map,p=new Array(y+1),c=y;c>=w;c--)v=f[c],u=b.get(v),p[c]=u===void 0?-1:u,b.set(v,c);for(u=w;u<=$;u++)v=i[u],c=b.get(v),c!==void 0&&c!==-1?(S[c]=n[u],x[c]=s[u],r&&(C[c]=r[u]),c=p[c],b.set(v,c)):s[u]();for(c=w;c<a;c++)c in S?(n[c]=S[c],s[c]=x[c],r&&(r[c]=C[c],r[c](c))):n[c]=P(m);n=n.slice(0,o=a),i=f.slice(0)}return n});function m(b){if(s[c]=b,r){const[p,S]=ie(c);return r[c]=S,t(f[c],p)}return t(f[c])}}}function j(e,t){return T(()=>e(t||{}))}function Te(e){const t="fallback"in e&&{fallback:()=>e.fallback};return Se(Ne(()=>e.each,e.children,t||void 0))}function De(e,t,l){let i=l.length,n=t.length,s=i,o=0,r=0,f=t[n-1].nextSibling,a=null;for(;o<n||r<s;){if(t[o]===l[r]){o++,r++;continue}for(;t[n-1]===l[s-1];)n--,s--;if(n===o){const u=s<i?r?l[r-1].nextSibling:l[s-r]:f;for(;r<s;)e.insertBefore(l[r++],u)}else if(s===r)for(;o<n;)(!a||!a.has(t[o]))&&t[o].remove(),o++;else if(t[o]===l[s-1]&&l[r]===t[n-1]){const u=t[--n].nextSibling;e.insertBefore(l[r++],t[o++].nextSibling),e.insertBefore(l[--s],u),t[n]=l[s]}else{if(!a){a=new Map;let c=r;for(;c<s;)a.set(l[c],c++)}const u=a.get(t[o]);if(u!=null)if(r<u&&u<s){let c=o,m=1,b;for(;++c<n&&c<s&&!((b=a.get(t[c]))==null||b!==u+m);)m++;if(m>u-r){const p=t[o];for(;r<u;)e.insertBefore(l[r++],p)}else e.replaceChild(l[r++],t[o++])}else o++;else t[o++].remove()}}}const z="_$DX_DELEGATE";function Oe(e,t,l,i={}){let n;return P(s=>{n=s,t===document?e():_(t,e(),t.firstChild?null:void 0,l)},i.owner),()=>{n(),t.textContent=""}}function I(e,t,l,i){let n;const s=()=>{const r=document.createElement("template");return r.innerHTML=e,r.content.firstChild},o=()=>(n||(n=s())).cloneNode(!0);return o.cloneNode=o,o}function Ie(e,t=window.document){const l=t[z]||(t[z]=new Set);for(let i=0,n=e.length;i<n;i++){const s=e[i];l.has(s)||(l.add(s),t.addEventListener(s,Pe))}}function Le(e,t,l){l==null?e.removeAttribute(t):e.setAttribute(t,l)}function _(e,t,l,i){if(l!==void 0&&!i&&(i=[]),typeof t!="function")return K(e,t,i,l);V(n=>K(e,t(),n,l),i)}function Pe(e){let t=e.target;const l=`$$${e.type}`,i=e.target,n=e.currentTarget,s=f=>Object.defineProperty(e,"target",{configurable:!0,value:f}),o=()=>{const f=t[l];if(f&&!t.disabled){const a=t[`${l}Data`];if(a!==void 0?f.call(t,a,e):f.call(t,e),e.cancelBubble)return}return t.host&&typeof t.host!="string"&&!t.host._$host&&t.contains(e.target)&&s(t.host),!0},r=()=>{for(;o()&&(t=t._$host||t.parentNode||t.host););};if(Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return t||document}}),e.composedPath){const f=e.composedPath();s(f[0]);for(let a=0;a<f.length-2&&(t=f[a],!!o());a++){if(t._$host){t=t._$host,r();break}if(t.parentNode===n)break}}else r();s(i)}function K(e,t,l,i,n){for(;typeof l=="function";)l=l();if(t===l)return l;const s=typeof t,o=i!==void 0;if(e=o&&l[0]&&l[0].parentNode||e,s==="string"||s==="number"){if(s==="number"&&(t=t.toString(),t===l))return l;if(o){let r=l[0];r&&r.nodeType===3?r.data!==t&&(r.data=t):r=document.createTextNode(t),l=k(e,l,i,r)}else l!==""&&typeof l=="string"?l=e.firstChild.data=t:l=e.textContent=t}else if(t==null||s==="boolean")l=k(e,l,i);else{if(s==="function")return V(()=>{let r=t();for(;typeof r=="function";)r=r();l=K(e,r,l,i)}),()=>l;if(Array.isArray(t)){const r=[],f=l&&Array.isArray(l);if(G(r,t,l,n))return V(()=>l=K(e,r,l,i,!0)),()=>l;if(r.length===0){if(l=k(e,l,i),o)return l}else f?l.length===0?ee(e,r,i):De(e,l,r):(l&&k(e),ee(e,r));l=r}else if(t.nodeType){if(Array.isArray(l)){if(o)return l=k(e,l,i,t);k(e,l,null,t)}else l==null||l===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);l=t}}return l}function G(e,t,l,i){let n=!1;for(let s=0,o=t.length;s<o;s++){let r=t[s],f=l&&l[e.length],a;if(!(r==null||r===!0||r===!1))if((a=typeof r)=="object"&&r.nodeType)e.push(r);else if(Array.isArray(r))n=G(e,r,f)||n;else if(a==="function")if(i){for(;typeof r=="function";)r=r();n=G(e,Array.isArray(r)?r:[r],Array.isArray(f)?f:[f])||n}else e.push(r),n=!0;else{const u=String(r);f&&f.nodeType===3&&f.data===u?e.push(f):e.push(document.createTextNode(u))}}return n}function ee(e,t,l=null){for(let i=0,n=t.length;i<n;i++)e.insertBefore(t[i],l)}function k(e,t,l,i){if(l===void 0)return e.textContent="";const n=i||document.createTextNode("");if(t.length){let s=!1;for(let o=t.length-1;o>=0;o--){const r=t[o];if(n!==r){const f=r.parentNode===e;!s&&!o?f?e.replaceChild(n,r):e.insertBefore(n,l):f&&r.remove()}else s=!0}}else e.insertBefore(n,l);return[n]}const[Be,Me]=ie([]),He="",Ue=async()=>{const e=He+"/api/all";return await(await fetch(e)).json()};var je=I('<i class="bi bi-circle-fill"style=color:var(--bs-gray-500);>'),Ke=I('<i class="bi bi-check-circle-fill"style=color:var(--bs-success);>'),Re=I('<tr><td class=opacity-50>.</td><td></td><td></td><td><a target=_blank></a></td><td></td><td></td><td></td><td><div class="form-check form-switch"><input class=form-check-input type=checkbox></div></td><td></td><td><i class="bi bi-three-dots-vertical my-btn">');function Fe(e){const t="http://"+e.host.IP;let l=je();e.host.Now==1&&(l=Ke());let i=!1;return e.host.Known==1&&(i=!0),(()=>{var n=Re(),s=n.firstChild,o=s.firstChild,r=s.nextSibling,f=r.nextSibling,a=f.nextSibling,u=a.firstChild,c=a.nextSibling,m=c.nextSibling,b=m.nextSibling,p=b.nextSibling,S=p.firstChild,x=S.firstChild,C=p.nextSibling;return _(s,()=>e.index,o),_(r,()=>e.host.Name),_(f,()=>e.host.Iface),Le(u,"href",t),_(u,()=>e.host.IP),_(c,()=>e.host.Mac),_(m,()=>e.host.Hw),_(b,()=>e.host.Date),x.checked=i,_(C,l),n})()}var Ve=I('<div class="card border-primary"><div class=card-header>Header</div><div class="card-body table-responsive"><table class="table table-striped"><thead><tr><th style=width:3em;></th><th>Name <i class="bi bi-sort-down-alt my-btn"></i></th><th>Iface <i class="bi bi-sort-down-alt my-btn"></i></th><th>IP <i class="bi bi-sort-down-alt my-btn"></i></th><th>MAC <i class="bi bi-sort-down-alt my-btn"></i></th><th>Hardware <i class="bi bi-sort-down-alt my-btn"></i></th><th>Date <i class="bi bi-sort-down-alt my-btn"></i></th><th>Known <i class="bi bi-sort-down-alt my-btn"></i></th><th>Online <i class="bi bi-sort-down-alt my-btn"></i></th><th style=width:2em;></th></tr></thead><tbody></tbody>');function Ge(){const e=t=>{console.log("SORT BY",t)};return _e(async()=>{Me(await Ue())}),(()=>{var t=Ve(),l=t.firstChild,i=l.nextSibling,n=i.firstChild,s=n.firstChild,o=s.firstChild,r=o.firstChild,f=r.nextSibling,a=f.firstChild,u=a.nextSibling,c=f.nextSibling,m=c.firstChild,b=m.nextSibling,p=c.nextSibling,S=p.firstChild,x=S.nextSibling,C=p.nextSibling,w=C.firstChild,$=w.nextSibling,y=C.nextSibling,v=y.firstChild,L=v.nextSibling,Q=y.nextSibling,fe=Q.firstChild,W=fe.nextSibling,X=Q.nextSibling,ae=X.firstChild,Y=ae.nextSibling,ue=X.nextSibling,he=ue.firstChild,J=he.nextSibling,de=s.nextSibling;return u.$$click=e,u.$$clickData="Name",b.$$click=e,b.$$clickData="Iface",x.$$click=e,x.$$clickData="IP",$.$$click=e,$.$$clickData="Mac",L.$$click=e,L.$$clickData="Hw",W.$$click=e,W.$$clickData="Date",Y.$$click=e,Y.$$clickData="Known",J.$$click=e,J.$$clickData="Now",_(de,j(Te,{get each(){return Be()},children:(be,ge)=>j(Fe,{host:be,index:ge})})),t})()}Ie(["click"]);var qe=I('<div class=container-lg><div class=row><div class="col-md mt-4 mb-4">');function Qe(){return(()=>{var e=qe(),t=e.firstChild,l=t.firstChild;return _(l,j(Ge,{})),e})()}const We=document.getElementById("root");Oe(()=>j(Qe,{}),We);