MCPcopy
hub / github.com/aceberg/WatchYourLAN / ct

Function ct

backend/internal/web/public/assets/Config.js:1–1  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1import{c as J,o as K,a as X,t,i as r,b,s as H,d as W,e as c,S as V,f as e,F as M,g as Z,h as tt,j as Q}from"./index.js";var et=t('<div class="card border-primary"><div class=card-header>About (<a target=_blank></a>)</div><div class="card-body table-responsive"><table class="table table-striped"><tbody><tr><td><b>Swagger API docs</b></td><td><a href=/swagger/index.html target=_blank>/swagger/index.html</a></td></tr><tr><td><b>Local node-bootstrap URL</b></td><td>local themes and fonts (optional). If empty, the app will pull everything from <code>cdn</code></td></tr><tr><td><b>Shoutrrr URL</b></td><td>provides notifications to Discord, Email, Gotify, Telegram and other services. <a href=https://shoutrrr.nickfedor.com/services/overview/ target=_blank>Link to documentation</a></td></tr><tr><td><b>Interfaces</b></td><td>one or more, space separated</td></tr><tr><td><b>Timeout (seconds)</b></td><td>time between scans</td></tr><tr><td><b>Args for arp-scan</b></td><td>pass your own arguments to <code>arp-scan</code>. Enable <b>debug</b> log level to see resulting command. (Example: <code>-r 1</code>). See <a href=https://github.com/aceberg/WatchYourLAN/blob/main/docs/VLAN_ARP_SCAN.md target=_blank>docs</a> for more</td></tr><tr><td><b>Arp Strings</b></td><td>can setup scans for <code>vlans</code>, <code>docker0</code> and etcetera. See <a href=https://github.com/aceberg/WatchYourLAN/blob/main/docs/VLAN_ARP_SCAN.md target=_blank>docs</a> for more</td></tr><tr><td><b>Trim History</b></td><td>remove history after (hours)</td></tr><tr><td><b>PG Connect URL</b></td><td>address to connect to PostgreSQL DB. (Example: <code>postgres://username:password@192.168.0.1:5432/dbname?sslmode=disable</code>). Full list of URL parameters <a href=https://pkg.go.dev/github.com/lib/pq#hdr-Connection_String_Parameters target=_blank>here');function rt(){const[i,d]=J(""),[s,a]=J("");return K(async()=>{const l=await X();d(l),a("https://github.com/aceberg/WatchYourLAN/releases/tag/"+l)}),(()=>{var l=et(),n=l.firstChild,o=n.firstChild,p=o.nextSibling;return r(p,i),b(()=>H(p,"href",s())),l})()}var lt=t("<option value=dark selected>dark"),it=t("<option value=light>light"),st=t('<div class="card border-primary"><div class=card-header>Basic config</div><div class="card-body table-responsive"><form method=post><table class="table table-borderless"><tbody><tr><td>Host</td><td><input name=host type=text class=form-control></td></tr><tr><td>Port</td><td><input name=port type=text class=form-control></td></tr><tr><td>Theme</td><td><select name=theme class=form-select></select></td></tr><tr><td>Color mode</td><td><select name=color class=form-select></select></td></tr><tr><td>Local node-bootstrap URL</td><td><input name=node type=text class=form-control></td></tr><tr><td>Shoutrrr URL</td><td><textarea name=shout class=form-control style=width:100%; rows=3 wrap=soft></textarea></td></tr><tr><td><button type=submit class="btn btn-primary">Save</button></td><td><button type=button style=float:right; class="btn btn-info">Test notification</button></td><td>'),at=t("<option selected>"),nt=t("<option>"),dt=t("<option value=dark>dark"),ot=t("<option value=light selected>light");function ct(){const i=["cerulean","cosmo","cyborg","darkly","emerald","flatly","grass","grayscale","journal","litera","lumen","lux","materia","minty","morph","ocean","pulse","quartz","sand","sandstone","simplex","sketchy","slate","solar","spacelab","superhero","united","vapor","wood","yeti","zephyr"],d=()=>{Z()};return(()=>{var s=st(),a=s.firstChild,l=a.nextSibling,n=l.firstChild,o=n.firstChild,p=o.firstChild,$=p.firstChild,u=$.firstChild,h=u.nextSibling,P=h.firstChild,k=$.nextSibling,I=k.firstChild,g=I.nextSibling,E=g.firstChild,w=k.nextSibling,R=w.firstChild,v=R.nextSibling,N=v.firstChild,x=w.nextSibling,U=x.firstChild,C=U.nextSibling,B=C.firstChild,A=x.nextSibling,q=A.firstChild,L=q.nextSibling,D=L.firstChild,T=A.nextSibling,G=T.firstChild,_=G.nextSibling,F=_.firstChild,O=T.nextSibling,Y=O.firstChild,j=Y.nextSibling,z=j.firstChild;return H(n,"action",W+"/api/config/"),r(N,c(M,{each:i,children:S=>c(V,{get when(){return S==e().Theme},get fallback(){return(()=>{var m=nt();return m.value=S,r(m,S),m})()},get children(){var m=at();return m.value=S,r(m,S),m}})})),r(B,c(V,{get when(){return e().Color=="dark"},get fallback(){return[dt(),ot()]},get children(){return[lt(),it()]}})),r(F,()=>e().ShoutURL),z.$$click=d,b(()=>P.value=e().Host),b(()=>E.value=e().Port),b(()=>D.value=e().NodePath),s})()}tt(["click"]);var bt=t('<div class="card border-info"><div class=card-header>Donations and Work</div><div class=card-body><p>Every <a href=https://github.com/aceberg#donate target=_blank>donation</a> is truly appreciated!</p><p>I am offering self-hosted and mobile apps development for a small price. The Open Source apps I created are listed in my <a href=https://aceberg.github.io/portfolio/ target=_blank>portfolio</a>. They are all human-coded, not generated by AI. Please, <a href=https://github.com/aceberg#contact target=_blank>contact</a> me, if you are interested.');function pt(){return bt()}var ft=t('<div class="card border-primary"><div class=card-header>InfluxDB2 config</div><div class="card-body table-responsive"><form method=post><table class="table table-borderless"><tbody><tr><td>Enable</td><td><div class="form-check form-switch"></div></td></tr><tr><td>Address</td><td><input name=addr type=text class=form-control></td></tr><tr><td>Token</td><td><input name=token type=text class=form-control></td></tr><tr><td>Org</td><td><input name=org type=text class=form-control></td></tr><tr><td>Bucket</td><td><input name=bucket type=text class=form-control></td></tr><tr><td>Skip TLS verify</td><td><div class="form-check form-switch"></div></td></tr><tr><td><button type=submit class="btn btn-primary">Save</button></td><td>'),ht=t("<input class=form-check-input type=checkbox name=enable checked>"),mt=t("<input class=form-check-input type=checkbox name=enable>"),$t=t("<input class=form-check-input type=checkbox name=skip checked>"),_t=t("<input class=form-check-input type=checkbox name=skip>");function ut(){return(()=>{var i=ft(),d=i.firstChild,s=d.nextSibling,a=s.firstChild,l=a.firstChild,n=l.firstChild,o=n.firstChild,p=o.firstChild,$=p.nextSibling,u=$.firstChild,h=o.nextSibling,P=h.firstChild,k=P.nextSibling,I=k.firstChild,g=h.nextSibling,E=g.firstChild,w=E.nextSibling,R=w.firstChild,v=g.nextSibling,N=v.firstChild,x=N.nextSibling,U=x.firstChild,C=v.nextSibling,B=C.firstChild,A=B.nextSibling,q=A.firstChild,L=C.nextSibling,D=L.firstChild,T=D.nextSibling,G=T.firstChild;return H(a,"action",W+"/api/config_influx/"),r(u,(()=>{var _=Q(()=>!!e().InfluxEnable);return()=>_()?ht():mt()})()),r(G,(()=>{var _=Q(()=>!!e().InfluxSkipTLS);return()=>_()?$t():_t()})()),b(()=>I.value=e().InfluxAddr),b(()=>R.value=e().InfluxToken),b(()=>U.value=e().InfluxOrg),b(()=>q.value=e().InfluxBucket),i})()}var gt=t('<div class="card border-primary"><div class=card-header>Prometheus config</div><div class="card-body table-responsive"><form method=post><table class="table table-borderless"><tbody><tr><td>Enable</td><td><div class="form-check form-switch"></div></td></tr><tr><td><button type=submit class="btn btn-primary">Save</button></td><td><a href=/metrics target=_blank>/metrics'),vt=t("<input class=form-check-input type=checkbox name=enable checked>"),xt=t("<input class=form-check-input type=checkbox name=enable>");function Ct(){return(()=>{var i=gt(),d=i.firstChild,s=d.nextSibling,a=s.firstChild,l=a.firstChild,n=l.firstChild,o=n.firstChild,p=o.firstChild,$=p.nextSibling,u=$.firstChild;return H(a,"action",W+"/api/config_prometheus/"),r(u,(()=>{var h=Q(()=>!!e().PrometheusEnable);return()=>h()?vt():xt()})()),i})()}var St=t("<option value=sqlite selected>sqlite"),yt=t("<option value=postgres>postgres"),kt=t('<div class="card border-primary"><div class=card-header>Scan settings</div><div class="card-body table-responsive"><form method=post><table class="table table-borderless"><tbody><tr><td>Interfaces</td><td><input name=ifaces type=text class=form-control></td></tr><tr><td>Timeout (seconds)</td><td><input name=timeout type=number class=form-control></td></tr><tr><td>Args for arp-scan</td><td><input name=arpargs type=text class=form-control></td></tr><tr><td>Arp Strings</td><td><input name=arpstrs type=text class=form-control></td></tr><tr><td>Log level</td><td><select name=log class=form-select></select></td></tr><tr><td>Trim History (hours)</td><td><input name=trim type=number class=form-control></td></tr><tr><td>Use DB</td><td><select name=usedb class=form-select></select></td></tr><tr><td>PG Connect URL</td><td><textarea name=pgconnect class=form-control style=width:100%; rows=3 wrap=soft></textarea></td></tr><tr><td><button type=submit class="btn btn-primary">Save</button></td><td class=text-muted>*Pressing <b>Save</b> button will trigger rescan'),wt=t("<input name=arpstrs type=text class=form-control>"),At=t("<option selected>"),Lt=t("<option>"),Tt=t("<option value=sqlite>sqlite"),Pt=t("<option value=postgres selected>postgres");function It(){return(()=>{var i=kt(),d=i.firstChild,s=d.nextSibling,a=s.firstChild,l=a.firstChild,n=l.firstChild,o=n.firstChild,p=o.firstChild,$=p.nextSibling,u=$.firstChild,h=o.nextSibling,P=h.firstChild,k=P.nextSibling,I=k.firstChild,g=h.nextSibling,E=g.firstChild,w=E.nextSibling,R=w.firstChild,v=g.nextSibling,N=v.firstChild,x=N.nextSibling,U=x.firstChild,C=v.nextSibling,B=C.firstChild,A=B.nextSibling,q=A.firstChild,L=C.nextSibling,D=L.firstChild,T=D.nextSibling,G=T.firstChild,_=L.nextSibling,F=_.firstChild,O=F.nextSibling,Y=O.firstChild,j=_.nextSibling,z=j.firstChild,S=z.nextSibling,m=S.firstChild;return H(a,"action",W+"/api/config_settings/"),r(x,c(M,{get each(){return e().ArpStrs},children:y=>(()=>{var f=wt();return f.value=y,f})()}),U),r(q,c(M,{each:["debug","info","warn","error"],children:y=>c(V,{get when(){return y==e().LogLevel},get fallback(){return(()=>{var f=Lt();return f.value=y,r(f,y),f})()},get children(){var f=At();return f.value=y,r(f,y),f}})})),r(Y,c(V,{get when(){return e().UseDB=="sqlite"},get fallback(){return[Tt(),Pt()]},get children(){return[St(),yt()]}})),r(m,()=>e().PGConnect),b(()=>u.value=e().Ifaces),b(()=>I.value=e().Timeout),b(()=>R.value=e().ArpArgs),b(()=>G.value=e().TrimHist),i})()}var Et=t('<div class=row><div class=col-md><div class=mt-4></div><div class="mt-4 mb-4"></div></div><div class=col-md><div class=mt-4></div><div class=mt-4>');function Nt(){return(()=>{var i=Et(),d=i.firstChild,s=d.firstChild,a=s.nextSibling,l=d.nextSibling,n=l.firstChild,o=n.nextSibling;return r(d,c(ct,{}),s),r(s,c(pt,{})),r(a,c(It,{})),r(l,c(ut,{}),n),r(n,c(Ct,{})),r(o,c(rt,{})),i})()}export{Nt as default};

Callers

nothing calls this directly

Calls 4

cFunction · 0.90
eFunction · 0.90
stFunction · 0.85
rFunction · 0.85

Tested by

no test coverage detected