1 line
9.7 KiB
JavaScript
1 line
9.7 KiB
JavaScript
import{c as J,o as K,a as X,t,i as l,b as c,s as G,d as z,e as d,S as V,f as e,F as O,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><p>● After changing <b>Host</b> or <b>Port</b> the app must be restarted</p><p>● <b>Shoutrrr URL</b> provides notifications to Discord, Email, Gotify, Telegram and other services. <a href=https://nicholas-fedor.github.io/shoutrrr/ target=_blank>Link to documentation</a></p><p>● <b>Interfaces</b> - one or more, space separated</p><p>● <b>Timeout (seconds)</b> - time between scans</p><p>● <b>Args for arp-scan</b> - 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.</p><p>● <b>Arp Strings</b> - 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.</p><p>● <b>Trim History</b> - remove history after (hours)</p><p>● <b>Store History in DB</b> - DEPRECATED. Now History is always stored in DB. Use <b>Trim History</b> to reduce DB size</p><p>● <b>PG Connect URL</b> - 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</a></p><p>● If you find this app useful, please, <a href=https://github.com/aceberg#donate target=_blank>donate');function lt(){const[i,n]=J(""),[a,s]=J("");return K(async()=>{const r=await X();n(r),s("https://github.com/aceberg/WatchYourLAN/releases/tag/"+r)}),(()=>{var r=et(),o=r.firstChild,p=o.firstChild,b=p.nextSibling;return l(b,i),c(()=>G(b,"href",a())),r})()}var rt=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>'),nt=t("<option selected>"),at=t("<option>"),ot=t("<option value=dark>dark"),dt=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"],n=()=>{Z()};return(()=>{var a=st(),s=a.firstChild,r=s.nextSibling,o=r.firstChild,p=o.firstChild,b=p.firstChild,_=b.firstChild,m=_.firstChild,f=m.nextSibling,P=f.firstChild,k=_.nextSibling,E=k.firstChild,g=E.nextSibling,I=g.firstChild,w=k.nextSibling,B=w.firstChild,v=B.nextSibling,N=v.firstChild,x=w.nextSibling,R=x.firstChild,C=R.nextSibling,D=C.firstChild,A=x.nextSibling,U=A.firstChild,L=U.nextSibling,H=L.firstChild,T=A.nextSibling,q=T.firstChild,u=q.nextSibling,F=u.firstChild,W=T.nextSibling,Y=W.firstChild,j=Y.nextSibling,M=j.firstChild;return G(o,"action",z+"/api/config/"),l(N,d(O,{each:i,children:S=>d(V,{get when(){return S==e().Theme},get fallback(){return(()=>{var h=at();return h.value=S,l(h,S),h})()},get children(){var h=nt();return h.value=S,l(h,S),h}})})),l(D,d(V,{get when(){return e().Color=="dark"},get fallback(){return[ot(),dt()]},get children(){return[rt(),it()]}})),l(F,()=>e().ShoutURL),M.$$click=n,c(()=>P.value=e().Host),c(()=>I.value=e().Port),c(()=>H.value=e().NodePath),a})()}tt(["click"]);var pt=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>'),bt=t("<input class=form-check-input type=checkbox name=enable checked>"),$t=t("<input class=form-check-input type=checkbox name=enable>"),ft=t("<input class=form-check-input type=checkbox name=skip checked>"),ht=t("<input class=form-check-input type=checkbox name=skip>");function _t(){return(()=>{var i=pt(),n=i.firstChild,a=n.nextSibling,s=a.firstChild,r=s.firstChild,o=r.firstChild,p=o.firstChild,b=p.firstChild,_=b.nextSibling,m=_.firstChild,f=p.nextSibling,P=f.firstChild,k=P.nextSibling,E=k.firstChild,g=f.nextSibling,I=g.firstChild,w=I.nextSibling,B=w.firstChild,v=g.nextSibling,N=v.firstChild,x=N.nextSibling,R=x.firstChild,C=v.nextSibling,D=C.firstChild,A=D.nextSibling,U=A.firstChild,L=C.nextSibling,H=L.firstChild,T=H.nextSibling,q=T.firstChild;return G(s,"action",z+"/api/config_influx/"),l(m,(()=>{var u=Q(()=>!!e().InfluxEnable);return()=>u()?bt():$t()})()),l(q,(()=>{var u=Q(()=>!!e().InfluxSkipTLS);return()=>u()?ft():ht()})()),c(()=>E.value=e().InfluxAddr),c(()=>B.value=e().InfluxToken),c(()=>R.value=e().InfluxOrg),c(()=>U.value=e().InfluxBucket),i})()}var ut=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'),mt=t("<input class=form-check-input type=checkbox name=enable checked>"),gt=t("<input class=form-check-input type=checkbox name=enable>");function vt(){return(()=>{var i=ut(),n=i.firstChild,a=n.nextSibling,s=a.firstChild,r=s.firstChild,o=r.firstChild,p=o.firstChild,b=p.firstChild,_=b.nextSibling,m=_.firstChild;return G(s,"action",z+"/api/config_prometheus/"),l(m,(()=>{var f=Q(()=>!!e().PrometheusEnable);return()=>f()?mt():gt()})()),i})()}var xt=t("<option value=sqlite selected>sqlite"),Ct=t("<option value=postgres>postgres"),St=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>'),yt=t("<input name=arpstrs type=text class=form-control>"),kt=t("<option selected>"),wt=t("<option>"),At=t("<option value=sqlite>sqlite"),Lt=t("<option value=postgres selected>postgres");function Tt(){return(()=>{var i=St(),n=i.firstChild,a=n.nextSibling,s=a.firstChild,r=s.firstChild,o=r.firstChild,p=o.firstChild,b=p.firstChild,_=b.nextSibling,m=_.firstChild,f=p.nextSibling,P=f.firstChild,k=P.nextSibling,E=k.firstChild,g=f.nextSibling,I=g.firstChild,w=I.nextSibling,B=w.firstChild,v=g.nextSibling,N=v.firstChild,x=N.nextSibling,R=x.firstChild,C=v.nextSibling,D=C.firstChild,A=D.nextSibling,U=A.firstChild,L=C.nextSibling,H=L.firstChild,T=H.nextSibling,q=T.firstChild,u=L.nextSibling,F=u.firstChild,W=F.nextSibling,Y=W.firstChild,j=u.nextSibling,M=j.firstChild,S=M.nextSibling,h=S.firstChild;return G(s,"action",z+"/api/config_settings/"),l(x,d(O,{get each(){return e().ArpStrs},children:y=>(()=>{var $=yt();return $.value=y,$})()}),R),l(U,d(O,{each:["debug","info","warn","error"],children:y=>d(V,{get when(){return y==e().LogLevel},get fallback(){return(()=>{var $=wt();return $.value=y,l($,y),$})()},get children(){var $=kt();return $.value=y,l($,y),$}})})),l(Y,d(V,{get when(){return e().UseDB=="sqlite"},get fallback(){return[At(),Lt()]},get children(){return[xt(),Ct()]}})),l(h,()=>e().PGConnect),c(()=>m.value=e().Ifaces),c(()=>E.value=e().Timeout),c(()=>B.value=e().ArpArgs),c(()=>q.value=e().TrimHist),i})()}var Pt=t("<div class=row><div class=col-md><div class=mt-4></div></div><div class=col-md><div class=mt-4></div><div class=mt-4>");function It(){return(()=>{var i=Pt(),n=i.firstChild,a=n.firstChild,s=n.nextSibling,r=s.firstChild,o=r.nextSibling;return l(n,d(ct,{}),a),l(a,d(Tt,{})),l(s,d(_t,{}),r),l(r,d(vt,{})),l(o,d(lt,{})),i})()}export{It as default};
|