@camera.ui/server 0.0.13-alpha.8 → 0.0.13-alpha.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/interface/assets/{@mdi-DdmeckA1.js → @mdi-jq8isxax.js} +1 -1
- package/dist/interface/assets/{Account-ZiKqQHX6.js → Account-BfQIYSY9.js} +1 -1
- package/dist/interface/assets/{Adminpanel-Cg18OqW-.js → Adminpanel-D-IRPo9j.js} +1 -1
- package/dist/interface/assets/{Appearance-C7Ndxx_B.js → Appearance-B6KmagNC.js} +1 -1
- package/dist/interface/assets/{Backup-Bv_3SH2Z.js → Backup-DAQ5i5CX.js} +1 -1
- package/dist/interface/assets/{Camera-DK9kXD1O.js → Camera-Bi6_ARja.js} +1 -1
- package/dist/interface/assets/{Cameras-gnINcipz.js → Cameras-Bnyqxi_V.js} +1 -1
- package/dist/interface/assets/{Camview-ChB4TxwO.js → Camview-ChqbnO3e.js} +1 -1
- package/dist/interface/assets/{Config-CoCKV5Be.js → Config-BjrMRwfT.js} +1 -1
- package/dist/interface/assets/{Console-pBrl68Lm.js → Console-DvDVSn1k.js} +1 -1
- package/dist/interface/assets/{FirstSteps-BpRbkRcl.js → FirstSteps-Dxd9rz8L.js} +1 -1
- package/dist/interface/assets/{NewCamera-Zu8RFyo6.js → NewCamera-Cok5A6i_.js} +18 -18
- package/dist/interface/assets/NewCamera-DJ3tUBT_.css +1 -0
- package/dist/interface/assets/{Plugin-5bCp3WWh.js → Plugin-BDQynqPw.js} +1 -1
- package/dist/interface/assets/{Plugins-CRX_4x4v.js → Plugins-BmMHP2A8.js} +1 -1
- package/dist/interface/assets/{Recordings-DcdGNthn.js → Recordings-DXXeJXrx.js} +1 -1
- package/dist/interface/assets/{Recordings-CRkD0oFF.js → Recordings-ZTql-w8N.js} +1 -1
- package/dist/interface/assets/{Settings-DFvCIOU_.js → Settings-B9yGAOhD.js} +1 -1
- package/dist/interface/assets/System-1z5qZSaJ.js +4 -0
- package/dist/interface/assets/{User-CqO0vCkm.js → User-8xO4LUlf.js} +1 -1
- package/dist/interface/assets/{VConfigEditor.vue_vue_type_script_setup_true_lang-DoYWC5QN.js → VConfigEditor.vue_vue_type_script_setup_true_lang-DDxLGgGL.js} +1 -1
- package/dist/interface/assets/{VConsole-B5SAtszq.js → VConsole-D85lNxwk.js} +1 -1
- package/dist/interface/assets/VPlayer-B53-f3Ad.js +1 -0
- package/dist/interface/assets/{VPlayer-4vWU8KqJ.css → VPlayer-H4sGdlHU.css} +1 -1
- package/dist/interface/assets/VPluginCard--4QV9IM6.css +1 -0
- package/dist/interface/assets/VPluginCard-Cl6Zw1Dg.js +4 -0
- package/dist/interface/assets/main-C2N2tbw_.js +9 -0
- package/dist/interface/assets/main-CKofdZVi.css +1 -0
- package/dist/interface/assets/{plugins-Cij0rj3_.js → plugins-Cs7BJHj-.js} +1 -1
- package/dist/interface/assets/{system--ZtvyuQf.js → system-C1OmXhti.js} +1 -1
- package/dist/interface/index.html +3 -3
- package/dist/interface/sw.js +1 -1
- package/dist/server/package.json +2 -2
- package/dist/server/src/api/schemas/cameras.schema.d.ts +5 -4
- package/dist/server/src/api/schemas/cameras.schema.js +44 -2
- package/dist/server/src/api/schemas/cameras.schema.js.map +1 -1
- package/dist/server/src/camera/streaming/peer-connection.js +1 -0
- package/dist/server/src/camera/streaming/peer-connection.js.map +1 -1
- package/package.json +2 -2
- package/dist/interface/assets/NewCamera-C7naTyF1.css +0 -1
- package/dist/interface/assets/System-DM54C-lb.js +0 -4
- package/dist/interface/assets/VPlayer-DxUydCDj.js +0 -1
- package/dist/interface/assets/VPluginCard-CgebF8Ml.js +0 -4
- package/dist/interface/assets/VPluginCard-DsbuLNH9.css +0 -1
- package/dist/interface/assets/main-CXQ__khI.css +0 -1
- package/dist/interface/assets/main-GKvN044v.js +0 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
import{F as ne,r as g,U as ft,e as r,f as F,j as i,M as n,R as l,V as W,T as y,u as e,q as Z,t as fe,c as N,w as J,X as pe,O as E,Q as ue,N as ve,aa as pt,l as H,an as gt,n as me,W as _t,i as ke,m as Ee,ai as wt,aj as yt}from"./@vue-CIFymae3.js";import{J as Qe,K as ht,L as xt,s as bt,M as je,E as Vt,F as kt,N as Ct,O as Dt,P as $t,Q as zt,R as Mt,S as Pt,T as St,U as Ft,V as It,W as At}from"./@mdi-DdmeckA1.js";import{e as G,b as ee,o as $e,G as Oe,H as We,f as we,j as Re,V as Tt,c as Be,n as Le,I as Et,J as Rt}from"./vuetify-B_vGZaGi.js";import{d as ie,s as He,f as Ce,t as ye,u as Bt,U as Lt,v as Ut,w as Qt}from"./main-GKvN044v.js";import{F as Ue,a as jt}from"./vee-validate-DHjm38DY.js";import{_ as Pe,C as Ot}from"./VPlayer-DxUydCDj.js";import{H as Ne}from"./react-dnd-html5-backend-1HQjlkwI.js";import{T as Xe}from"./react-dnd-touch-backend-NgACaG8W.js";import{u as Ye,a as qe,D as Ge}from"./vue3-dnd-Dn4SH4Ex.js";import{u as Je}from"./ui-CdiPlYMM.js";import{s as ze}from"./pinia-B_gX_pHL.js";import{m as Ke,v as Ze,k as et,w as tt}from"./@vueuse-DbPVvJxZ.js";import"./vue-inline-svg-DDdr3aAz.js";import"./vue3-toastify-Cy6dUyKO.js";import"./vue-i18n-CHUfunSC.js";import"./@intlify-YW_pt133.js";import"./axios-BI2i94Vb.js";import"./@tanstack-DPd4-F0t.js";import"./vue-router-C55prZ5l.js";import"./@vee-validate-CmTVjJBY.js";import"./zod-BaF2dDCd.js";import"./uuid-DvF23Exx.js";import"./socket.io-client-Bq_SHkin.js";import"./engine.io-client-DBBxzneW.js";import"./engine.io-parser-BiEtp6m2.js";import"./@socket.io-Dkula2eQ.js";import"./socket.io-parser-BBkuslX-.js";import"./rxjs-DmqiRszP.js";import"./tslib-9k7AwCpt.js";import"./v-calendar-CbEkwI4D.js";import"./@popperjs-BQBsAJpH.js";import"./nprogress-QK5AFhFr.js";import"./@xterm-LO7TPXYg.js";import"./qrcode-SHonoxyK.js";import"./dijkstrajs-D_NXgYpA.js";import"./plugins-Cij0rj3_.js";import"./draggabilly-YEGzHR3_.js";import"./get-size-D1dS-IaP.js";import"./unidragger-91TYirAP.js";import"./ev-emitter-t78oQA8k.js";import"./@react-dnd-CcwRs9xb.js";import"./dnd-core-SnWOpY0X.js";import"./redux-CuxFRhX_.js";import"./fast-deep-equal-Bs1__Kao.js";const Wt={class:"mt-auto flex flex-col"},Ht={class:"relative flex flex-col items-center justify-center"},Nt=ne({__name:"VAudioVisualizer",emits:["listening"],setup(X,{emit:R}){const Y=R,M=g(),I=g(null),T=g(),m=g(!1),u=()=>{var o,s;(o=M.value)==null||o.close(),M.value=void 0,(s=T.value)==null||s.forEach(k=>k.stop()),T.value=void 0,m.value=!1,Y("listening",!1)},x=(o,s,k,U,V,L)=>{const P=o.createLinearGradient(s,k,U,V);P.addColorStop(0,"#5b040f"),P.addColorStop(.5,"#b50b21"),P.addColorStop(.9,"#df2a4c"),P.addColorStop(1,"#df6380"),o.lineWidth=L,o.strokeStyle=P,o.beginPath(),o.moveTo(s,k),o.lineTo(U,V),o.stroke(),o.closePath()},b=async()=>{var o;if(m.value)u();else try{M.value&&u();let s;try{s=await navigator.mediaDevices.getUserMedia({audio:!0})}catch(z){console.warn("Can not enable AudioVisualizer",z);return}m.value=!0,Y("listening",!0),M.value=new AudioContext;let k=M.value.createAnalyser();k.fftSize=1024,T.value=s.getTracks(),M.value.createMediaStreamSource(s).connect(k);const V=90;let L=3,P;const $=(o=I.value)==null?void 0:o.getContext("2d"),S=()=>{if(I.value&&$){const z=[],C=[];$.clearRect(0,0,I.value.width,I.value.height),requestAnimationFrame(S);let v=k.frequencyBinCount,_=new Uint8Array(v);k.getByteFrequencyData(_),z.push(_);for(let p=0;p<z[0].length;p++)C.push(0),z.forEach(Q=>{C[p]+=Q[p]});const h=I.value.width/2,c=I.value.height/2,f=30;$.beginPath(),$.arc(h,c,f,0,2*Math.PI),$.lineWidth=1,$.stroke(),$.closePath();for(let p=0;p<V;p++){P=C[p]*.4;let Q=Math.PI*2/V,j=h+Math.cos(Q*p)*f,le=c+Math.sin(Q*p)*f,re=h+Math.cos(Q*p)*(f+P),he=c+Math.sin(Q*p)*(f+P);x($,j,le,re,he,L)}m.value||$.clearRect(0,0,I.value.width,I.value.height)}};S()}catch(s){u(),console.error(s)}};return ft(()=>{u()}),(o,s)=>(r(),F("div",Wt,[i("div",Ht,[n(ee,{class:"mic-button",variant:"elevated",color:"white",icon:"",size:"60",onClick:Z(b,["prevent"])},{default:l(()=>[n(G,{size:"35"},{default:l(()=>[W(y(e(Qe)),1)]),_:1})]),_:1}),i("canvas",{ref_key:"canvas",ref:I,height:"300",width:"300"},null,512)])]))}}),Xt=ie(Nt,[["__scopeId","data-v-5c30fb5d"]]),Yt=["data-handler-id"],qt=ne({__name:"VDnDCard",props:{id:{},index:{},camera:{},moveCard:{type:Function}},setup(X,{expose:R}){const Y=Je(),M=X,{camera:I}=fe(M),{uiSettings:T}=ze(Y),m=g(),u=g(),x=g(null);let b=null,o=0,s=0;const k=N(()=>T.value.camview.dragDisabled===!1),{x:U,y:V,sourceType:L}=Ke(),{top:P,left:$}=Ze(x),[S,z]=Ye({accept:"camera",collect(D){return{handlerId:D.getHandlerId()}},hover(D,se){var be;if(!m.value)return;const ae=D.index,ce=M.index;if(ae===ce)return;const ge=(be=m.value)==null?void 0:be.getBoundingClientRect(),te=(ge.bottom-ge.top)/2,xe=se.getClientOffset().y-ge.top;ae<ce&&xe<te||ae>ce&&xe>te||(M.moveCard(ae,ce),D.index=ce)}}),[C,v]=qe({type:"camera",canDrag(){return k.value},item:()=>({id:M.id,index:M.index}),collect:D=>({isDragging:D.isDragging()})}),{handlerId:_}=fe(S.value),h=N(()=>C.value.isDragging),c=N(()=>h.value&&L.value==="touch"),f=N(()=>e(h)?0:1);J(c,D=>{D?(b=p(),o=U.value-$.value,s=V.value-P.value):(j(b),b=null)}),J([U,V],()=>{Q(b,o,s)});const p=()=>{if(x.value){const D=x.value.cloneNode(!0);return D.classList.add("drag-preview"),document.body.appendChild(D),D}return null},Q=(D,se,ae)=>{D&&(D.style.left=`${U.value-se}px`,D.style.top=`${V.value-ae}px`)},j=D=>{D&&document.body.removeChild(D)},le=D=>{m.value=v(z(D))};return R({togglePlayerMute:D=>{var se;(se=u.value)==null||se.toggleMute(D)},toggleMicrophone:async(D,se)=>{var ae;await((ae=u.value)==null?void 0:ae.toggleMicrophone(D,se))}}),(D,se)=>(r(),F("div",{ref_key:"boxEl",ref:x},[i("div",{ref:le,class:"camera-card",style:pe({opacity:e(f),color:"#000",cursor:e(T).camview.dragDisabled?"default":"grab"}),"data-handler-id":e(_)},[n(Pe,{ref_key:"playerRef",ref:u,"current-camera":e(I).name,"border-radius":0,target:"stream","show-camera-name":"","enable-control":"","auto-hide-control":"","source-role":"low-resolution","show-mode":!1},null,8,["current-camera"])],12,Yt)],512))}}),Gt=ie(qt,[["__scopeId","data-v-a157f34a"]]),Jt={class:"conference"},Kt=ne({__name:"VDnD",props:{cameras:{},dbCameras:{}},emits:["drag"],setup(X,{expose:R,emit:Y}){const{isTouch:M}=He(),{smallMobileActive:I}=Ce(),T=Y,m=X,{cameras:u,dbCameras:x}=fe(m),b=g(null),o=g(null),s=g("16:9"),k=g(2),U=et(o),V=g([]),L=g(),{isFullscreen:P,toggle:$}=tt(b);J(u,c=>{V.value=ye(c).sort((f,p)=>f.index-p.index)},{immediate:!0,deep:!0});const S=(c,f)=>{const p=V.value[c];V.value.splice(c,1),V.value.splice(f,0,p),V.value=V.value.map((Q,j)=>(Q.index=j,Q)).sort((Q,j)=>Q.index-j.index),T("drag",V.value)},z=c=>{const f=U.height.value-k.value*2,p=U.width.value-k.value*2,Q=parseInt(s.value.split(":")[1])/parseInt(s.value.split(":")[0]);let j=0,le=0,re=c*Q+k.value*2;for(;j<V.value.length;)le+c>p&&(le=0,re=re+c*Q+k.value*2),le=le+c+k.value*2,j++;return re>f||c>p?!1:c},C=N(()=>{if(I.value)return"100%";let c=0,f=1;for(;f<5e3;){if(z(f)===!1){c=f-1;break}f++}return c=c-k.value,`${c}px`});return R({toggleFullscreen:async()=>{await $()},togglePlayerMute:c=>{for(const f of L.value||[])f.togglePlayerMute(c)},togglePlayerMicrophone:async(c,f)=>{for(const p of L.value||[])await p.toggleMicrophone(c,f)},isFullscreen:P,selectedCameras:V}),(c,f)=>(r(),E(e(Ge),{backend:e(M)?e(Xe):e(Ne)},{default:l(()=>[i("div",{ref_key:"cameraDnd",ref:b,class:"scenary"},[i("div",Jt,[n(pt,{ref_key:"dishEl",ref:o,name:"list",tag:"div",class:"dish"},{default:l(()=>[(r(!0),F(ve,null,ue(e(V),(p,Q)=>(r(),E(Gt,{id:p.cameraId,ref_for:!0,ref_key:"dndCards",ref:L,key:p.cameraId,index:Q,camera:e(x).find(j=>j._id===p.cameraId),"move-card":S,style:pe({width:e(C)})},null,8,["id","index","camera","style"]))),128))]),_:1},512)])],512)]),_:1},8,["backend"]))}}),Zt=ie(Kt,[["__scopeId","data-v-c22c99a6"]]),ea={class:"camera-snapshot"},ta={class:"camera-info flex flex-row items-center"},aa={class:"text-passive truncate"},sa=ne({__name:"VViewDrag",props:{camera:{},isDropped:{type:Boolean},canDrag:{type:Boolean}},setup(X){const R=X,{isDropped:Y,camera:M,canDrag:I}=fe(R),T=g(null);let m=null,u=0,x=0;const{x:b,y:o,sourceType:s}=Ke(),{top:k,left:U}=Ze(T),[V,L]=qe(()=>({type:"camera",options:{dropEffect:"copy"},item:M.value,canDrag:I.value,collect:v=>({style:{opacity:v.isDragging()?.4:1},isDragging:v.isDragging()})})),P=N(()=>V.value.isDragging),$=N(()=>P.value&&s.value==="touch");J($,v=>{v?(m=S(),u=b.value-U.value,x=o.value-k.value):(C(m),m=null)}),J([b,o],()=>{z(m,u,x)});const S=()=>{if(T.value){const v=T.value.cloneNode(!0);return v.classList.add("drag-preview"),document.body.appendChild(v),v}return null},z=(v,_,h)=>{v&&(v.style.left=`${b.value-_}px`,v.style.top=`${o.value-h}px`)},C=v=>{v&&document.body.removeChild(v)};return(v,_)=>{const h=Pe;return r(),F("div",{ref_key:"boxEl",ref:T},[i("div",{ref:e(L),style:pe({...e(V).style,cursor:e(Y)?"default":"grab"}),class:"drag-box p-2 flex flex-row items-center relative"},[n(G,{size:"20",class:"text-passive mr-2"},{default:l(()=>[W(y(e(ht)),1)]),_:1}),i("div",ea,[n(h,{"current-camera":e(M).name,"border-radius":6,target:"snapshot","show-mode":!1},null,8,["current-camera"])]),i("div",ta,[i("span",aa,y(e(M).name),1),e(Y)?(r(),E(G,{key:0,size:"25",class:"ml-auto text-green mr-4"},{default:l(()=>[W(y(e(xt)),1)]),_:1})):H("",!0)])],4)],512)}}}),la=ie(sa,[["__scopeId","data-v-7dfa63f3"]]),Me={WIDTH:400},oa={class:"camera-view-edit flex flex-col p-2"},ra={class:"mb-4 text-lg"},na={class:"text-passive mb-5 mt-5"},ia={class:"camera-container py-3"},ca=ne({__name:"VViewSidebar",props:{cameras:{},droppedCameras:{},title:{}},setup(X){gt(x=>({"7ea40162":e(T)}));const R=X,{cameras:Y,droppedCameras:M,title:I}=fe(R),T=g(`${Me.WIDTH}px`),m=g(!1),u=x=>M.value.some(b=>b.name===x.name);return(x,b)=>{const o=la;return r(),F("div",oa,[i("b",ra,y(e(I)),1),i("span",na,y(x.$t("components.view_box.available_streams")),1),i("div",ia,[(r(!0),F(ve,null,ue(e(Y),(s,k)=>(r(),F("div",{key:k,class:"mb-4"},[n(o,{camera:s,"is-dropped":u(s),"can-drag":!u(s),class:me({shake:e(m)})},null,8,["camera","is-dropped","can-drag","class"])]))),128))])])}}}),da=ie(ca,[["__scopeId","data-v-420802a2"]]),ua={key:0,class:"overlay-button-text truncate",color:"#fff"},va={key:1,class:"w-full h-full flex items-center justify-center"},ma=ne({__name:"VViewCard",props:{lastDroppedCamera:{},editMode:{type:Boolean},cameras:{},droppedCameras:{},onDrop:{type:Function}},emits:["drop","remove"],setup(X,{expose:R,emit:Y}){const{desktopActive:M}=Ce(),I=Y,T=X,{lastDroppedCamera:m,editMode:u,cameras:x,droppedCameras:b}=fe(T),o=g(null),s=g(),{width:k}=et(o),[U,V]=Ye({accept:"camera",drop:T.onDrop,collect:_=>({isOver:_.isOver(),canDrop:_.canDrop()&&m.value===void 0}),canDrop:()=>m.value===void 0}),L=N(()=>U.value.canDrop&&U.value.isOver),P=N(()=>u.value?L.value?"#171717":"#202020":"#000"),$=N(()=>k.value<=200),S=N(()=>x.value.filter(_=>!z(_))),z=_=>b.value.some(h=>h.name===_.name);return R({togglePlayerMute:_=>{var h;(h=s.value)==null||h.toggleMute(_)},toggleMicrophone:async(_,h)=>{var c;await((c=s.value)==null?void 0:c.toggleMicrophone(_,h))}}),(_,h)=>(r(),F("div",{ref:e(V),style:pe({backgroundColor:e(P)}),class:"overflow-hidden"},[e(m)?(r(),F("div",{key:0,ref_key:"container",ref:o,class:"w-full h-full flex items-center justify-center relative"},[e(u)?(r(),E(ee,{key:0,icon:e($),size:e($)?32:void 0,class:"overlay-button flex items-center justify-center",color:"#df2a4c",onClick:h[0]||(h[0]=Z(c=>I("remove",e(m)),["prevent"]))},{default:l(()=>[n(G,{size:"18"},{default:l(()=>[W(y(e(bt)),1)]),_:1}),e($)?H("",!0):(r(),F("span",ua,y(e(m).name),1))]),_:1},8,["icon","size"])):H("",!0),n(_t,{name:"fade",mode:"in-out"},{default:l(()=>[e(m)?(r(),E(Pe,{key:0,ref_key:"playerRef",ref:s,class:me({"camera-overlay":e(u)}),"current-camera":e(m).name,"border-radius":0,target:e(u)?"snapshot":"stream",style:pe({opacity:e(u)?.2:1}),"show-camera-name":!e(u),"enable-control":!e(u),"auto-hide-control":"","source-role":"low-resolution","show-mode":!1},null,8,["class","current-camera","target","style","show-camera-name","enable-control"])):H("",!0)]),_:1})],512)):!e(M)&&e(u)?(r(),F("div",va,[n(ee,{icon:"",size:"32",color:"#df2a4c"},{default:l(()=>[n(G,{size:"18",color:"#ffff"},{default:l(()=>[W(y(e(je)),1)]),_:1}),n($e,{activator:"parent",class:"select-menu"},{default:l(()=>[n(Oe,{"onClick:select":h[1]||(h[1]=c=>I("drop",c.id))},{default:l(()=>[(r(!0),F(ve,null,ue(e(S),(c,f)=>(r(),E(we,{key:f,value:c},{default:l(()=>[n(We,null,{default:l(()=>[W(y(c.name),1)]),_:2},1024)]),_:2},1032,["value"]))),128))]),_:1})]),_:1})]),_:1})])):H("",!0)],4))}}),fa=ie(ma,[["__scopeId","data-v-5b755b3b"]]),pa=ne({__name:"VView",props:{cameras:{},viewSize:{},cards:{},title:{},editMode:{type:Boolean,default:!1}},emits:["drop","remove"],setup(X,{expose:R,emit:Y}){const{isTouch:M}=He(),{desktopActive:I}=Ce(),T=Y,m=X,{cameras:u,editMode:x,viewSize:b,cards:o,title:s}=fe(m),k=g(null),U=g(`${Me.WIDTH}px`),V=g(),{isFullscreen:L,toggle:P}=tt(k),$=N(()=>o.value.filter(v=>v.lastDroppedCamera).map(v=>v.lastDroppedCamera));return R({toggleFullscreen:async()=>{await P()},togglePlayerMute:v=>{for(const _ of V.value||[])_.togglePlayerMute(v)},togglePlayerMicrophone:async(v,_)=>{for(const h of V.value||[])await h.toggleMicrophone(v,_)},isFullscreen:L}),(v,_)=>{const h=da;return r(),E(e(Ge),{backend:e(M)?e(Xe):e(Ne)},{default:l(()=>[i("div",{ref_key:"cameraView",ref:k,class:"view-container flex items-center mx-2",style:pe({width:e(x)&&e(I)?`calc(100% - ${e(U)})`:void 0})},[i("div",{class:me(`view-wrap w-full camera-view-${e(b)}`)},[(r(!0),F(ve,null,ue(e(o),(c,f)=>(r(),E(fa,{ref_for:!0,ref_key:"dragContainer",ref:V,key:f,class:me(`div${f+1}-${e(b)}`),"last-dropped-camera":c.lastDroppedCamera,cameras:e(u),"dropped-cameras":e($),"edit-mode":e(x),onDrop:p=>T("drop",f,p),onRemove:_[0]||(_[0]=p=>T("remove",p))},null,8,["class","last-dropped-camera","cameras","dropped-cameras","edit-mode","onDrop"]))),128))],2)],4),e(x)&&e(I)?(r(),E(h,{key:0,cameras:e(u),"dropped-cameras":e($),title:e(s),class:"view-box",style:pe({"margin-right":e(x)?"0px":`-${e(Me).WIDTH}px`})},null,8,["cameras","dropped-cameras","title","style"])):H("",!0)]),_:1},8,["backend"])}}}),ga=ie(pa,[["__scopeId","data-v-8ef83e91"]]),at=X=>(wt("data-v-ebd2ec2a"),X=X(),yt(),X),_a={class:"w-full h-full"},wa={class:"camview-topbar p-2 flex flex-row items-center"},ya={class:"flex w-full justify-start items-center"},ha={class:"camview-title truncate"},xa={style:{margin:"5px"}},ba={class:"flex flex-row w-full justify-start items-center"},Va={class:"menu-item"},ka={class:"flex w-full justify-start items-center"},Ca={class:"camview-title truncate"},Da=at(()=>i("div",{class:"ml-auto"},null,-1)),$a={style:{margin:"5px"}},za={class:"flex flex-row w-full justify-start items-center"},Ma={class:"icon-wrapper"},Pa={class:"menu-item ml-2"},Sa=at(()=>i("div",{class:"my-1"},null,-1)),Fa={class:"flex flex-row w-full justify-start items-center"},Ia={class:"icon-wrapper"},Aa={class:"menu-item ml-2"},Ta={key:9,class:"flex flex-row items-center"},Ea={class:"text-white"},Ra={class:"h-full w-full inline-size mb-safe"},Ba={key:0,class:"h-full w-full flex items-center justify-center"},La={key:1,class:"w-full h-full"},Ua={key:0,class:"w-full h-full relative"},Qa={key:1,class:"w-full h-full flex flex-row"},ja={key:2,class:"flex flex-col items-center justify-center w-full h-full"},Oa={class:"mt-5",style:{color:"#525252"}},Wa={class:"flex flex-col h-full w-full"},Ha={class:"relative"},Na={for:"name",class:"v-label"},Xa={key:0,class:"text-red text-center mb-5"},Ya={class:"view-scroll-container"},qa={class:"view-select-container"},Ga=["onClick"],Ja={class:"flex flex-col h-full w-full"},Ka={class:"relative"},Za={for:"name",class:"v-label"},es={key:0,class:"text-red text-center mb-5"},ts={class:"flex flex-col"},as=ne({__name:"Camview",setup(X){var Se;const R=new Lt,Y=new Ot,{smallMobileActive:M}=Ce(),I=Bt(),T=Je(),{uiSettings:m}=ze(T),{loginState:u}=ze(I),x=g(),b=g(),o=g(),s=g({}),k=g(!1),U=g({page:1,pageSize:-1}),V=g([1,4,6,7,9,10,12,13,15,16,20,26]),L=g(!1),P=g(!1),$=g(!0),S=g(!1),z=g(!1),C=g(!1),v=g(!1),_=g(!1),h=g(!1),c=g([]),f=g([]),{data:p,isLoading:Q}=Y.getCamerasQuery(U),{data:j,isLoading:le}=R.getViewsQuery(((Se=u.value.user)==null?void 0:Se.username)||"",U),{mutate:re,isPending:he}=R.removeViewQuery(),{mutateAsync:D,isPending:se}=R.createViewQuery(),{mutateAsync:ae,isPending:ce}=R.patchViewQuery(),{mutateAsync:ge}=R.patchViewQuerySilent(),te=N(()=>S.value||C.value||z.value),oe=N(()=>Q.value||le.value||he.value||se.value||ce.value),xe=N(()=>{var a,t;return((a=b.value)==null?void 0:a.isFullscreen)||((t=b.value)==null?void 0:t.isFullscreen)||!1}),be=N(()=>navigator.mediaDevices!==void 0),A=N(()=>{var t,w;const a=((t=j.value)==null?void 0:t.result.find(B=>B._id===m.value.camview.viewid))||((w=j.value)==null?void 0:w.result[0]);return a?(s.value=a,m.value.camview.viewid=a._id):s.value={},a}),De=N(()=>te.value&&s.value.viewSize>0?s.value.viewSize:A.value?A.value.viewSize:1);J(u,a=>{R.toggleQueryActivator("getUserQuery",a!==null)}),J([De,A,p,te,m],()=>{var t,w,B;if(((t=A.value)==null?void 0:t.type)==="dnd"&&!S.value&&!C.value)return;const a=Array.from({length:De.value}).map((O,K)=>({accept:"camera",index:K,lastDroppedCamera:void 0}));if(!C.value&&!v.value)for(const O of((w=A.value)==null?void 0:w.cameras)||[])a[O.index].lastDroppedCamera=(B=p.value)==null?void 0:B.result.find(K=>K._id===O.cameraId);c.value=a},{deep:!0,immediate:!0}),J(s,a=>{var t,w,B;if(Object.keys(a).length===0)(t=o.value)==null||t.resetForm(),L.value=!1,P.value=!1;else{for(const[O,K]of Object.entries(a))(w=o.value)==null||w.setFieldValue(O,K);a.viewSize&&(L.value=!1),(B=a.cameras)!=null&&B.length&&(P.value=!1)}},{deep:!0}),J([v,C],([a,t])=>{(!a&&!t||a)&&(s.value={},L.value=!1)}),J([_,z],()=>{z.value||(f.value=[],s.value={},P.value=!1)}),J(_,a=>{a||(z.value=!1)}),J(z,a=>{var t;a?(f.value=((t=p.value)==null?void 0:t.result.filter(w=>{var B;return(B=A.value)==null?void 0:B.cameras.some(O=>O.cameraId===w._id)}))||[],_.value=!0):(f.value=[],_.value=!1)}),J(f,a=>{a.length&&(P.value=!1)}),J(te,a=>{a&&A.value&&!C.value&&(s.value=ye(A.value))}),J(u,a=>{a.user?R.toggleQueryActivator("getUserQuery",!0):R.toggleQueryActivator("getUserQuery",!1)},{immediate:!0,deep:!0});const st=async a=>{if(!A.value||!u.value.user)return;const t=ye(A.value);t.cameras=a;const w=await ge({username:u.value.user.username,viewid:t._id,viewData:t});_e(w)},lt=(a,t)=>{c.value[a].lastDroppedCamera=t},ot=a=>{c.value=c.value.map(t=>{var w;return((w=t.lastDroppedCamera)==null?void 0:w.name)===a.name&&(t.lastDroppedCamera=void 0),t})},rt=async()=>{var w;if(!o.value||!u.value.user)return;const a=f.value.map((B,O)=>({cameraId:B._id,index:O}));s.value.cameras=a,s.value.type="dnd",s.value.viewSize=1,o.value.setFieldValue("type","dnd"),o.value.setFieldValue("viewSize",1),o.value.setFieldValue("cameras",a);const t=await o.value.validate();if(t){if(((w=j.value)==null?void 0:w.result.find(K=>K.name===s.value.name))&&!z.value){o.value.setFieldError("name","View already exists");return}if(a.length===0){P.value=!0;return}if(!t.valid)return;const O=ye(s.value);if(O._id){const K=await ae({username:u.value.user.username,viewid:O._id,viewData:O});_e(K)}else{const K=await D({username:u.value.user.username,viewData:O});_e(K)}_.value=!1}},nt=async()=>{var t,w;if(!o.value)return;s.value.cameras=[],s.value.type="view",o.value.setFieldValue("type","view"),o.value.setFieldValue("cameras",[]);const a=await o.value.validate();if(a){if((t=j.value)==null?void 0:t.result.find(O=>O.name===s.value.name)){o.value.setFieldError("name","View already exists");return}if(!a.valid){((w=a.results.viewSize)==null?void 0:w.valid)===!1&&(L.value=!0);return}v.value=!1,C.value=!0}},it=async()=>{if(!o.value||!u.value.user||Object.keys(s.value).length===0)return;const a=c.value.filter(w=>w.lastDroppedCamera).map(w=>({cameraId:w.lastDroppedCamera._id,index:w.index})).sort((w,B)=>w.index-B.index);if(!a.length)return;o.value.setFieldValue("name",s.value.name),o.value.setFieldValue("cameras",a);const t=await o.value.validate();if(t!=null&&t.valid){const w=ye(s.value);if(w.cameras=a,w._id){const B=await ae({username:u.value.user.username,viewid:w._id,viewData:w});_e(B)}else{const B=await D({username:u.value.user.username,viewData:w});_e(B)}}},_e=a=>{m.value.camview.viewid=a._id,v.value=!1,_.value=!1,C.value=!1,S.value=!1},ct=()=>{!A.value||!u.value.user||re({username:u.value.user.username,viewid:A.value._id},{onSuccess:a=>{a.length?m.value.camview.viewid=a[0]._id:m.value.camview.viewid=void 0}})},dt=a=>{m.value.camview.viewid=a._id},ut=async()=>{b.value?await b.value.toggleFullscreen():x.value&&await x.value.toggleFullscreen()},vt=()=>{$.value=!$.value,b.value?b.value.togglePlayerMute($.value):x.value&&x.value.togglePlayerMute($.value)},mt=async a=>{b.value?await b.value.togglePlayerMicrophone(a):x.value&&await x.value.togglePlayerMicrophone(a)};return(a,t)=>{const w=Qt,B=Xt;return r(),F("main",_a,[n(e(jt),{ref_key:"viewVeeForm",ref:o,class:"h-full w-full","validation-schema":e(Ut),"initial-values":e(s)},{default:l(()=>{var O,K,Fe,Ie,Ae,Te;return[i("div",wa,[!e(C)&&e(A)?(r(),E(ee,{key:0,size:"small",variant:"flat",style:{background:"rgba(var(--color-rgb), 0.1)","padding-left":"8px"}},{default:l(()=>[i("div",ya,[e(te)?H("",!0):(r(),E(G,{key:0,size:"18",class:"text-color mr-1"},{default:l(()=>[W(y(e(k)?e(Vt):e(kt)),1)]),_:1})),i("span",ha,y(e(A).name),1)]),e(te)?H("",!0):(r(),E($e,{key:0,activator:"parent",width:"324",offset:"5",location:"bottom",class:"select-menu","onUpdate:modelValue":t[0]||(t[0]=d=>k.value=d)},{default:l(()=>[n(Re,{width:"200",style:{border:"1px solid var(--background-timeline)","border-radius":"10px"},elevation:"3"},{default:l(()=>{var d;return[i("div",xa,[(r(!0),F(ve,null,ue(((d=e(j))==null?void 0:d.result)||[],(q,de)=>(r(),E(we,{key:de,active:q._id===e(A)._id,value:q,style:{"border-radius":"5px !important"},disabled:e(oe),onClick:Z(Ve=>dt(q),["prevent"])},{default:l(()=>[i("div",ba,[i("span",Va,y(q.name),1)])]),_:2},1032,["active","value","disabled","onClick"]))),128))])]}),_:1})]),_:1}))]),_:1})):e(C)&&e(s).name?(r(),E(ee,{key:1,size:"small",variant:"flat",style:{background:"rgba(var(--color-rgb), 0.1)","padding-left":"8px"}},{default:l(()=>[i("div",ka,[i("span",Ca,y(e(s).name),1)])]),_:1})):H("",!0),Da,!e(te)&&((O=e(A))==null?void 0:O.type)==="dnd"?(r(),E(ee,{key:2,class:"disabled-text mr-2",size:"30",rounded:"",density:"compact",variant:"text",onClick:t[1]||(t[1]=Z(d=>e(m).camview.dragDisabled=!e(m).camview.dragDisabled,["prevent"]))},{default:l(()=>[n(G,{size:"18"},{default:l(()=>[W(y(e(m).camview.dragDisabled?e(Ct):e(Dt)),1)]),_:1})]),_:1})):H("",!0),!e(te)&&e(A)?(r(),E(ee,{key:3,class:"disabled-text mr-2",size:"30",rounded:"",density:"compact",variant:"text",onClick:t[2]||(t[2]=Z(d=>vt(),["prevent"]))},{default:l(()=>[n(G,{size:"22"},{default:l(()=>[W(y(e($)?e($t):e(zt)),1)]),_:1})]),_:1})):H("",!0),!e(te)&&e(A)&&e(be)?(r(),E(ee,{key:4,class:"disabled-text mr-2",size:"30",rounded:"",density:"compact",variant:"text",onClick:t[3]||(t[3]=Z(d=>h.value=!0,["prevent"]))},{default:l(()=>[n(G,{size:"22"},{default:l(()=>[W(y(e(Qe)),1)]),_:1})]),_:1})):H("",!0),!e(te)&&e(A)?(r(),E(ee,{key:5,class:"disabled-text mr-2",size:"30",rounded:"",density:"compact",variant:"text",onClick:t[4]||(t[4]=Z(d=>ut(),["prevent"]))},{default:l(()=>[n(G,{size:"22"},{default:l(()=>[W(y(e(xe)?e(Mt):e(Pt)),1)]),_:1})]),_:1})):H("",!0),!e(te)&&e(A)?(r(),E(ee,{key:6,class:"disabled-text mr-2",size:"30",rounded:"",density:"compact",variant:"text",onClick:t[5]||(t[5]=Z(d=>ct(),["prevent"]))},{default:l(()=>[n(G,{size:"20"},{default:l(()=>[W(y(e(St)),1)]),_:1})]),_:1})):H("",!0),!e(z)&&!e(S)&&!e(C)&&e(A)?(r(),E(ee,{key:7,class:"disabled-text mr-2",size:"30",rounded:"",density:"compact",variant:"text",onClick:t[6]||(t[6]=Z(d=>{var q;return((q=e(A))==null?void 0:q.type)==="dnd"?z.value=!e(z):S.value=!e(S)},["prevent"]))},{default:l(()=>[n(G,{size:"19"},{default:l(()=>[W(y(e(Ft)),1)]),_:1})]),_:1})):H("",!0),!e(z)&&!e(S)&&!e(C)?(r(),E(ee,{key:8,class:"disabled-text mr-2",size:"30",rounded:"",density:"compact",variant:"text"},{default:l(()=>[n(G,{size:"22"},{default:l(()=>[W(y(e(je)),1)]),_:1}),n($e,{activator:"parent",offset:"5",location:"bottom",class:"select-menu"},{default:l(()=>[n(Re,{width:"200",style:{border:"1px solid var(--background-timeline)","border-radius":"10px"},elevation:"3"},{default:l(()=>[i("div",$a,[n(we,{style:{"border-radius":"5px !important"},disabled:e(oe),onClick:t[7]||(t[7]=Z(d=>v.value=!0,["prevent"]))},{default:l(()=>[i("div",za,[i("div",Ma,[n(G,{size:"20",class:"text-passive"},{default:l(()=>[W(y(e(It)),1)]),_:1})]),i("span",Pa,y(a.$t("views.camview.new_view")),1)])]),_:1},8,["disabled"]),Sa,n(we,{style:{"border-radius":"5px !important"},disabled:e(oe),onClick:t[8]||(t[8]=Z(d=>_.value=!0,["prevent"]))},{default:l(()=>[i("div",Fa,[i("div",Ia,[n(G,{size:"20",class:"text-passive"},{default:l(()=>[W(y(e(At)),1)]),_:1})]),i("span",Aa,y(a.$t("views.camview.new_dnd")),1)])]),_:1},8,["disabled"])])]),_:1})]),_:1})]),_:1})):H("",!0),e(S)||e(C)?(r(),F("div",Ta,[n(ee,{class:"disabled-text mr-2",size:"small",variant:"flat",border:"",onClick:t[9]||(t[9]=Z(d=>e(S)?S.value=!1:C.value=!1,["prevent"]))},{default:l(()=>[W(y(a.$t("components.form.button.cancel")),1)]),_:1}),n(ee,{disabled:e(c).every(d=>d.lastDroppedCamera===void 0),class:"disabled-text",size:"small",color:"#df2a4c",variant:"flat",border:"",onClick:t[10]||(t[10]=Z(d=>it(),["prevent"]))},{default:l(()=>[i("span",Ea,y(a.$t("components.form.button.save")),1)]),_:1},8,["disabled"])])):H("",!0)]),i("div",{class:me(["camview-container",{"px-0":e(M)}])},[i("div",Ra,[e(oe)||!e(j)?(r(),F("div",Ba,[n(Tt,{color:"#df2a4c",indeterminate:""})])):(r(),F("div",La,[!e(C)&&!e(S)&&(e(z)||((K=e(A))==null?void 0:K.type)==="dnd")?(r(),F("div",Ua,[n(Zt,{ref_key:"dndRef",ref:x,cameras:((Fe=e(A))==null?void 0:Fe.cameras)||[],"db-cameras":((Ie=e(p))==null?void 0:Ie.result)||[],onDrag:st},null,8,["cameras","db-cameras"])])):!e(z)&&(e(C)||e(S)||((Ae=e(A))==null?void 0:Ae.type)==="view")?(r(),F("div",Qa,[(r(),E(ga,{ref_key:"viewRef",ref:b,key:e(m).camview.viewid+(e(C)?"-new":e(S)?"-edit":"-view"),cameras:((Te=e(p))==null?void 0:Te.result)||[],"edit-mode":e(C)||e(S),"view-size":e(C)?e(s).viewSize:e(De),title:e(s).name,cards:e(c),onDrop:lt,onRemove:ot},null,8,["cameras","edit-mode","view-size","title","cards"]))])):(r(),F("div",ja,[i("span",Oa,y(a.$t("views.camview.no_views_configured")),1)]))]))])],2),n(w,{modelValue:e(v),"onUpdate:modelValue":t[12]||(t[12]=d=>ke(v)?v.value=d:null),title:a.$t("components.dialog.title.new_view"),"confirm-text":"components.form.button.next",loading:e(oe),onConfirm:t[13]||(t[13]=d=>nt())},{content:l(()=>[i("div",Wa,[i("div",Ha,[n(e(Ue),{modelValue:e(s).name,"onUpdate:modelValue":t[11]||(t[11]=d=>e(s).name=d),name:"name"},{default:l(({field:d,errorMessage:q,errors:de})=>[i("label",Na,y(a.$t("components.form.label.name")),1),n(Be,Ee({loading:e(oe),variant:"outlined",name:"name",type:"text",density:"compact"},d,{error:de.length>0,"error-messages":q}),null,16,["loading","error","error-messages"])]),_:1},8,["modelValue"])]),n(Le,{class:"my-5"}),e(L)?(r(),F("span",Xa,y(a.$t("components.form.error.no_view_selected")),1)):H("",!0),i("div",Ya,[i("div",qa,[(r(!0),F(ve,null,ue(e(V),d=>(r(),F("div",{key:d,class:"view-select-item h-full w-full",onClick:Z(q=>e(s).viewSize=d,["prevent"])},[i("div",{class:me(["view-select-item-icon w-full h-full p-3",{"selected-view":e(s).viewSize===d}])},[n(G,{class:"disabled-text",style:{width:"100%",height:"100%"}},{default:l(()=>[W(y(`$cuiGrid${d}`),1)]),_:2},1024)],2),i("span",{class:me(["view-select-item-label disabled-text mt-2 px-2 py-1",{"selected-view-label":e(s).viewSize===d}])},y(d)+" "+y(a.$t("views.camview.cameras")),3)],8,Ga))),128))])])])]),_:1},8,["modelValue","title","loading"]),n(w,{modelValue:e(_),"onUpdate:modelValue":t[16]||(t[16]=d=>ke(_)?_.value=d:null),title:a.$t("components.dialog.title.new_dnd"),"confirm-text":"components.form.button.save",loading:e(oe),onConfirm:t[17]||(t[17]=d=>rt())},{content:l(()=>[i("div",Ja,[i("div",Ka,[n(e(Ue),{modelValue:e(s).name,"onUpdate:modelValue":t[14]||(t[14]=d=>e(s).name=d),name:"name"},{default:l(({field:d,errorMessage:q,errors:de})=>[i("label",Za,y(a.$t("components.form.label.name")),1),n(Be,Ee({loading:e(oe),variant:"outlined",name:"name",type:"text",density:"compact"},d,{error:de.length>0,"error-messages":q}),null,16,["loading","error","error-messages"])]),_:1},8,["modelValue"])]),n(Le,{class:"mb-10 mt-5"}),e(P)?(r(),F("span",es,y(a.$t("components.form.error.no_cameras_selected")),1)):H("",!0),n(Oe,{selected:e(f),"onUpdate:selected":t[15]||(t[15]=d=>ke(f)?f.value=d:null),"select-strategy":"classic",class:"py-0 mb-5",density:"compact"},{default:l(()=>{var d;return[(r(!0),F(ve,null,ue(((d=e(p))==null?void 0:d.result)||[],(q,de)=>(r(),E(we,{key:de,value:q,active:e(f).some(Ve=>Ve.name===q.name)},{prepend:l(({isActive:Ve})=>[n(Et,{start:""},{default:l(()=>[n(Rt,{"model-value":Ve,color:"#df2a4c"},null,8,["model-value"])]),_:2},1024)]),default:l(()=>[n(We,null,{default:l(()=>[W(y(q.name),1)]),_:2},1024)]),_:2},1032,["value","active"]))),128))]}),_:1},8,["selected"])])]),_:1},8,["modelValue","title","loading"]),n(w,{modelValue:e(h),"onUpdate:modelValue":t[18]||(t[18]=d=>ke(h)?h.value=d:null),title:a.$t("components.dialog.title.intercom"),loading:e(oe),"hide-confirm-button":""},{content:l(()=>[i("div",ts,[i("span",null,y(a.$t("components.dialog.message.intercom_info")),1),n(B,{onListening:mt})])]),_:1},8,["modelValue","title","loading"])]}),_:1},8,["validation-schema","initial-values"])])}}}),Xs=ie(as,[["__scopeId","data-v-ebd2ec2a"]]);export{Xs as default};
|
|
1
|
+
import{F as ne,r as g,U as ft,e as r,f as F,j as i,M as n,R as l,V as W,T as y,u as e,q as Z,t as fe,c as N,w as J,X as pe,O as E,Q as ue,N as ve,aa as pt,l as H,an as gt,n as me,W as _t,i as ke,m as Ee,ai as wt,aj as yt}from"./@vue-CIFymae3.js";import{J as Qe,K as ht,L as xt,s as bt,M as je,E as Vt,F as kt,N as Ct,O as Dt,P as $t,Q as zt,R as Mt,S as Pt,T as St,U as Ft,V as It,W as At}from"./@mdi-jq8isxax.js";import{e as G,b as ee,o as $e,G as Oe,H as We,f as we,j as Re,V as Tt,c as Be,n as Le,I as Et,J as Rt}from"./vuetify-B_vGZaGi.js";import{d as ie,s as He,f as Ce,t as ye,u as Bt,U as Lt,v as Ut,w as Qt}from"./main-C2N2tbw_.js";import{F as Ue,a as jt}from"./vee-validate-DHjm38DY.js";import{_ as Pe,C as Ot}from"./VPlayer-B53-f3Ad.js";import{H as Ne}from"./react-dnd-html5-backend-1HQjlkwI.js";import{T as Xe}from"./react-dnd-touch-backend-NgACaG8W.js";import{u as Ye,a as qe,D as Ge}from"./vue3-dnd-Dn4SH4Ex.js";import{u as Je}from"./ui-CdiPlYMM.js";import{s as ze}from"./pinia-B_gX_pHL.js";import{m as Ke,v as Ze,k as et,w as tt}from"./@vueuse-DbPVvJxZ.js";import"./vue-inline-svg-DDdr3aAz.js";import"./vue3-toastify-Cy6dUyKO.js";import"./vue-i18n-CHUfunSC.js";import"./@intlify-YW_pt133.js";import"./axios-BI2i94Vb.js";import"./@tanstack-DPd4-F0t.js";import"./vue-router-C55prZ5l.js";import"./@vee-validate-CmTVjJBY.js";import"./zod-BaF2dDCd.js";import"./uuid-DvF23Exx.js";import"./socket.io-client-Bq_SHkin.js";import"./engine.io-client-DBBxzneW.js";import"./engine.io-parser-BiEtp6m2.js";import"./@socket.io-Dkula2eQ.js";import"./socket.io-parser-BBkuslX-.js";import"./rxjs-DmqiRszP.js";import"./tslib-9k7AwCpt.js";import"./v-calendar-CbEkwI4D.js";import"./@popperjs-BQBsAJpH.js";import"./nprogress-QK5AFhFr.js";import"./@xterm-LO7TPXYg.js";import"./qrcode-SHonoxyK.js";import"./dijkstrajs-D_NXgYpA.js";import"./plugins-Cs7BJHj-.js";import"./draggabilly-YEGzHR3_.js";import"./get-size-D1dS-IaP.js";import"./unidragger-91TYirAP.js";import"./ev-emitter-t78oQA8k.js";import"./@react-dnd-CcwRs9xb.js";import"./dnd-core-SnWOpY0X.js";import"./redux-CuxFRhX_.js";import"./fast-deep-equal-Bs1__Kao.js";const Wt={class:"mt-auto flex flex-col"},Ht={class:"relative flex flex-col items-center justify-center"},Nt=ne({__name:"VAudioVisualizer",emits:["listening"],setup(X,{emit:R}){const Y=R,M=g(),I=g(null),T=g(),m=g(!1),u=()=>{var o,s;(o=M.value)==null||o.close(),M.value=void 0,(s=T.value)==null||s.forEach(k=>k.stop()),T.value=void 0,m.value=!1,Y("listening",!1)},x=(o,s,k,U,V,L)=>{const P=o.createLinearGradient(s,k,U,V);P.addColorStop(0,"#5b040f"),P.addColorStop(.5,"#b50b21"),P.addColorStop(.9,"#df2a4c"),P.addColorStop(1,"#df6380"),o.lineWidth=L,o.strokeStyle=P,o.beginPath(),o.moveTo(s,k),o.lineTo(U,V),o.stroke(),o.closePath()},b=async()=>{var o;if(m.value)u();else try{M.value&&u();let s;try{s=await navigator.mediaDevices.getUserMedia({audio:!0})}catch(z){console.warn("Can not enable AudioVisualizer",z);return}m.value=!0,Y("listening",!0),M.value=new AudioContext;let k=M.value.createAnalyser();k.fftSize=1024,T.value=s.getTracks(),M.value.createMediaStreamSource(s).connect(k);const V=90;let L=3,P;const $=(o=I.value)==null?void 0:o.getContext("2d"),S=()=>{if(I.value&&$){const z=[],C=[];$.clearRect(0,0,I.value.width,I.value.height),requestAnimationFrame(S);let v=k.frequencyBinCount,_=new Uint8Array(v);k.getByteFrequencyData(_),z.push(_);for(let p=0;p<z[0].length;p++)C.push(0),z.forEach(Q=>{C[p]+=Q[p]});const h=I.value.width/2,c=I.value.height/2,f=30;$.beginPath(),$.arc(h,c,f,0,2*Math.PI),$.lineWidth=1,$.stroke(),$.closePath();for(let p=0;p<V;p++){P=C[p]*.4;let Q=Math.PI*2/V,j=h+Math.cos(Q*p)*f,le=c+Math.sin(Q*p)*f,re=h+Math.cos(Q*p)*(f+P),he=c+Math.sin(Q*p)*(f+P);x($,j,le,re,he,L)}m.value||$.clearRect(0,0,I.value.width,I.value.height)}};S()}catch(s){u(),console.error(s)}};return ft(()=>{u()}),(o,s)=>(r(),F("div",Wt,[i("div",Ht,[n(ee,{class:"mic-button",variant:"elevated",color:"white",icon:"",size:"60",onClick:Z(b,["prevent"])},{default:l(()=>[n(G,{size:"35"},{default:l(()=>[W(y(e(Qe)),1)]),_:1})]),_:1}),i("canvas",{ref_key:"canvas",ref:I,height:"300",width:"300"},null,512)])]))}}),Xt=ie(Nt,[["__scopeId","data-v-5c30fb5d"]]),Yt=["data-handler-id"],qt=ne({__name:"VDnDCard",props:{id:{},index:{},camera:{},moveCard:{type:Function}},setup(X,{expose:R}){const Y=Je(),M=X,{camera:I}=fe(M),{uiSettings:T}=ze(Y),m=g(),u=g(),x=g(null);let b=null,o=0,s=0;const k=N(()=>T.value.camview.dragDisabled===!1),{x:U,y:V,sourceType:L}=Ke(),{top:P,left:$}=Ze(x),[S,z]=Ye({accept:"camera",collect(D){return{handlerId:D.getHandlerId()}},hover(D,se){var be;if(!m.value)return;const ae=D.index,ce=M.index;if(ae===ce)return;const ge=(be=m.value)==null?void 0:be.getBoundingClientRect(),te=(ge.bottom-ge.top)/2,xe=se.getClientOffset().y-ge.top;ae<ce&&xe<te||ae>ce&&xe>te||(M.moveCard(ae,ce),D.index=ce)}}),[C,v]=qe({type:"camera",canDrag(){return k.value},item:()=>({id:M.id,index:M.index}),collect:D=>({isDragging:D.isDragging()})}),{handlerId:_}=fe(S.value),h=N(()=>C.value.isDragging),c=N(()=>h.value&&L.value==="touch"),f=N(()=>e(h)?0:1);J(c,D=>{D?(b=p(),o=U.value-$.value,s=V.value-P.value):(j(b),b=null)}),J([U,V],()=>{Q(b,o,s)});const p=()=>{if(x.value){const D=x.value.cloneNode(!0);return D.classList.add("drag-preview"),document.body.appendChild(D),D}return null},Q=(D,se,ae)=>{D&&(D.style.left=`${U.value-se}px`,D.style.top=`${V.value-ae}px`)},j=D=>{D&&document.body.removeChild(D)},le=D=>{m.value=v(z(D))};return R({togglePlayerMute:D=>{var se;(se=u.value)==null||se.toggleMute(D)},toggleMicrophone:async(D,se)=>{var ae;await((ae=u.value)==null?void 0:ae.toggleMicrophone(D,se))}}),(D,se)=>(r(),F("div",{ref_key:"boxEl",ref:x},[i("div",{ref:le,class:"camera-card",style:pe({opacity:e(f),color:"#000",cursor:e(T).camview.dragDisabled?"default":"grab"}),"data-handler-id":e(_)},[n(Pe,{ref_key:"playerRef",ref:u,"current-camera":e(I).name,"border-radius":0,target:"stream","show-camera-name":"","enable-control":"","auto-hide-control":"","source-role":"low-resolution","show-mode":!1},null,8,["current-camera"])],12,Yt)],512))}}),Gt=ie(qt,[["__scopeId","data-v-a157f34a"]]),Jt={class:"conference"},Kt=ne({__name:"VDnD",props:{cameras:{},dbCameras:{}},emits:["drag"],setup(X,{expose:R,emit:Y}){const{isTouch:M}=He(),{smallMobileActive:I}=Ce(),T=Y,m=X,{cameras:u,dbCameras:x}=fe(m),b=g(null),o=g(null),s=g("16:9"),k=g(2),U=et(o),V=g([]),L=g(),{isFullscreen:P,toggle:$}=tt(b);J(u,c=>{V.value=ye(c).sort((f,p)=>f.index-p.index)},{immediate:!0,deep:!0});const S=(c,f)=>{const p=V.value[c];V.value.splice(c,1),V.value.splice(f,0,p),V.value=V.value.map((Q,j)=>(Q.index=j,Q)).sort((Q,j)=>Q.index-j.index),T("drag",V.value)},z=c=>{const f=U.height.value-k.value*2,p=U.width.value-k.value*2,Q=parseInt(s.value.split(":")[1])/parseInt(s.value.split(":")[0]);let j=0,le=0,re=c*Q+k.value*2;for(;j<V.value.length;)le+c>p&&(le=0,re=re+c*Q+k.value*2),le=le+c+k.value*2,j++;return re>f||c>p?!1:c},C=N(()=>{if(I.value)return"100%";let c=0,f=1;for(;f<5e3;){if(z(f)===!1){c=f-1;break}f++}return c=c-k.value,`${c}px`});return R({toggleFullscreen:async()=>{await $()},togglePlayerMute:c=>{for(const f of L.value||[])f.togglePlayerMute(c)},togglePlayerMicrophone:async(c,f)=>{for(const p of L.value||[])await p.toggleMicrophone(c,f)},isFullscreen:P,selectedCameras:V}),(c,f)=>(r(),E(e(Ge),{backend:e(M)?e(Xe):e(Ne)},{default:l(()=>[i("div",{ref_key:"cameraDnd",ref:b,class:"scenary"},[i("div",Jt,[n(pt,{ref_key:"dishEl",ref:o,name:"list",tag:"div",class:"dish"},{default:l(()=>[(r(!0),F(ve,null,ue(e(V),(p,Q)=>(r(),E(Gt,{id:p.cameraId,ref_for:!0,ref_key:"dndCards",ref:L,key:p.cameraId,index:Q,camera:e(x).find(j=>j._id===p.cameraId),"move-card":S,style:pe({width:e(C)})},null,8,["id","index","camera","style"]))),128))]),_:1},512)])],512)]),_:1},8,["backend"]))}}),Zt=ie(Kt,[["__scopeId","data-v-c22c99a6"]]),ea={class:"camera-snapshot"},ta={class:"camera-info flex flex-row items-center"},aa={class:"text-passive truncate"},sa=ne({__name:"VViewDrag",props:{camera:{},isDropped:{type:Boolean},canDrag:{type:Boolean}},setup(X){const R=X,{isDropped:Y,camera:M,canDrag:I}=fe(R),T=g(null);let m=null,u=0,x=0;const{x:b,y:o,sourceType:s}=Ke(),{top:k,left:U}=Ze(T),[V,L]=qe(()=>({type:"camera",options:{dropEffect:"copy"},item:M.value,canDrag:I.value,collect:v=>({style:{opacity:v.isDragging()?.4:1},isDragging:v.isDragging()})})),P=N(()=>V.value.isDragging),$=N(()=>P.value&&s.value==="touch");J($,v=>{v?(m=S(),u=b.value-U.value,x=o.value-k.value):(C(m),m=null)}),J([b,o],()=>{z(m,u,x)});const S=()=>{if(T.value){const v=T.value.cloneNode(!0);return v.classList.add("drag-preview"),document.body.appendChild(v),v}return null},z=(v,_,h)=>{v&&(v.style.left=`${b.value-_}px`,v.style.top=`${o.value-h}px`)},C=v=>{v&&document.body.removeChild(v)};return(v,_)=>{const h=Pe;return r(),F("div",{ref_key:"boxEl",ref:T},[i("div",{ref:e(L),style:pe({...e(V).style,cursor:e(Y)?"default":"grab"}),class:"drag-box p-2 flex flex-row items-center relative"},[n(G,{size:"20",class:"text-passive mr-2"},{default:l(()=>[W(y(e(ht)),1)]),_:1}),i("div",ea,[n(h,{"current-camera":e(M).name,"border-radius":6,target:"snapshot","show-mode":!1},null,8,["current-camera"])]),i("div",ta,[i("span",aa,y(e(M).name),1),e(Y)?(r(),E(G,{key:0,size:"25",class:"ml-auto text-green mr-4"},{default:l(()=>[W(y(e(xt)),1)]),_:1})):H("",!0)])],4)],512)}}}),la=ie(sa,[["__scopeId","data-v-7dfa63f3"]]),Me={WIDTH:400},oa={class:"camera-view-edit flex flex-col p-2"},ra={class:"mb-4 text-lg"},na={class:"text-passive mb-5 mt-5"},ia={class:"camera-container py-3"},ca=ne({__name:"VViewSidebar",props:{cameras:{},droppedCameras:{},title:{}},setup(X){gt(x=>({"7ea40162":e(T)}));const R=X,{cameras:Y,droppedCameras:M,title:I}=fe(R),T=g(`${Me.WIDTH}px`),m=g(!1),u=x=>M.value.some(b=>b.name===x.name);return(x,b)=>{const o=la;return r(),F("div",oa,[i("b",ra,y(e(I)),1),i("span",na,y(x.$t("components.view_box.available_streams")),1),i("div",ia,[(r(!0),F(ve,null,ue(e(Y),(s,k)=>(r(),F("div",{key:k,class:"mb-4"},[n(o,{camera:s,"is-dropped":u(s),"can-drag":!u(s),class:me({shake:e(m)})},null,8,["camera","is-dropped","can-drag","class"])]))),128))])])}}}),da=ie(ca,[["__scopeId","data-v-420802a2"]]),ua={key:0,class:"overlay-button-text truncate",color:"#fff"},va={key:1,class:"w-full h-full flex items-center justify-center"},ma=ne({__name:"VViewCard",props:{lastDroppedCamera:{},editMode:{type:Boolean},cameras:{},droppedCameras:{},onDrop:{type:Function}},emits:["drop","remove"],setup(X,{expose:R,emit:Y}){const{desktopActive:M}=Ce(),I=Y,T=X,{lastDroppedCamera:m,editMode:u,cameras:x,droppedCameras:b}=fe(T),o=g(null),s=g(),{width:k}=et(o),[U,V]=Ye({accept:"camera",drop:T.onDrop,collect:_=>({isOver:_.isOver(),canDrop:_.canDrop()&&m.value===void 0}),canDrop:()=>m.value===void 0}),L=N(()=>U.value.canDrop&&U.value.isOver),P=N(()=>u.value?L.value?"#171717":"#202020":"#000"),$=N(()=>k.value<=200),S=N(()=>x.value.filter(_=>!z(_))),z=_=>b.value.some(h=>h.name===_.name);return R({togglePlayerMute:_=>{var h;(h=s.value)==null||h.toggleMute(_)},toggleMicrophone:async(_,h)=>{var c;await((c=s.value)==null?void 0:c.toggleMicrophone(_,h))}}),(_,h)=>(r(),F("div",{ref:e(V),style:pe({backgroundColor:e(P)}),class:"overflow-hidden"},[e(m)?(r(),F("div",{key:0,ref_key:"container",ref:o,class:"w-full h-full flex items-center justify-center relative"},[e(u)?(r(),E(ee,{key:0,icon:e($),size:e($)?32:void 0,class:"overlay-button flex items-center justify-center",color:"#df2a4c",onClick:h[0]||(h[0]=Z(c=>I("remove",e(m)),["prevent"]))},{default:l(()=>[n(G,{size:"18"},{default:l(()=>[W(y(e(bt)),1)]),_:1}),e($)?H("",!0):(r(),F("span",ua,y(e(m).name),1))]),_:1},8,["icon","size"])):H("",!0),n(_t,{name:"fade",mode:"in-out"},{default:l(()=>[e(m)?(r(),E(Pe,{key:0,ref_key:"playerRef",ref:s,class:me({"camera-overlay":e(u)}),"current-camera":e(m).name,"border-radius":0,target:e(u)?"snapshot":"stream",style:pe({opacity:e(u)?.2:1}),"show-camera-name":!e(u),"enable-control":!e(u),"auto-hide-control":"","source-role":"low-resolution","show-mode":!1},null,8,["class","current-camera","target","style","show-camera-name","enable-control"])):H("",!0)]),_:1})],512)):!e(M)&&e(u)?(r(),F("div",va,[n(ee,{icon:"",size:"32",color:"#df2a4c"},{default:l(()=>[n(G,{size:"18",color:"#ffff"},{default:l(()=>[W(y(e(je)),1)]),_:1}),n($e,{activator:"parent",class:"select-menu"},{default:l(()=>[n(Oe,{"onClick:select":h[1]||(h[1]=c=>I("drop",c.id))},{default:l(()=>[(r(!0),F(ve,null,ue(e(S),(c,f)=>(r(),E(we,{key:f,value:c},{default:l(()=>[n(We,null,{default:l(()=>[W(y(c.name),1)]),_:2},1024)]),_:2},1032,["value"]))),128))]),_:1})]),_:1})]),_:1})])):H("",!0)],4))}}),fa=ie(ma,[["__scopeId","data-v-5b755b3b"]]),pa=ne({__name:"VView",props:{cameras:{},viewSize:{},cards:{},title:{},editMode:{type:Boolean,default:!1}},emits:["drop","remove"],setup(X,{expose:R,emit:Y}){const{isTouch:M}=He(),{desktopActive:I}=Ce(),T=Y,m=X,{cameras:u,editMode:x,viewSize:b,cards:o,title:s}=fe(m),k=g(null),U=g(`${Me.WIDTH}px`),V=g(),{isFullscreen:L,toggle:P}=tt(k),$=N(()=>o.value.filter(v=>v.lastDroppedCamera).map(v=>v.lastDroppedCamera));return R({toggleFullscreen:async()=>{await P()},togglePlayerMute:v=>{for(const _ of V.value||[])_.togglePlayerMute(v)},togglePlayerMicrophone:async(v,_)=>{for(const h of V.value||[])await h.toggleMicrophone(v,_)},isFullscreen:L}),(v,_)=>{const h=da;return r(),E(e(Ge),{backend:e(M)?e(Xe):e(Ne)},{default:l(()=>[i("div",{ref_key:"cameraView",ref:k,class:"view-container flex items-center mx-2",style:pe({width:e(x)&&e(I)?`calc(100% - ${e(U)})`:void 0})},[i("div",{class:me(`view-wrap w-full camera-view-${e(b)}`)},[(r(!0),F(ve,null,ue(e(o),(c,f)=>(r(),E(fa,{ref_for:!0,ref_key:"dragContainer",ref:V,key:f,class:me(`div${f+1}-${e(b)}`),"last-dropped-camera":c.lastDroppedCamera,cameras:e(u),"dropped-cameras":e($),"edit-mode":e(x),onDrop:p=>T("drop",f,p),onRemove:_[0]||(_[0]=p=>T("remove",p))},null,8,["class","last-dropped-camera","cameras","dropped-cameras","edit-mode","onDrop"]))),128))],2)],4),e(x)&&e(I)?(r(),E(h,{key:0,cameras:e(u),"dropped-cameras":e($),title:e(s),class:"view-box",style:pe({"margin-right":e(x)?"0px":`-${e(Me).WIDTH}px`})},null,8,["cameras","dropped-cameras","title","style"])):H("",!0)]),_:1},8,["backend"])}}}),ga=ie(pa,[["__scopeId","data-v-8ef83e91"]]),at=X=>(wt("data-v-ebd2ec2a"),X=X(),yt(),X),_a={class:"w-full h-full"},wa={class:"camview-topbar p-2 flex flex-row items-center"},ya={class:"flex w-full justify-start items-center"},ha={class:"camview-title truncate"},xa={style:{margin:"5px"}},ba={class:"flex flex-row w-full justify-start items-center"},Va={class:"menu-item"},ka={class:"flex w-full justify-start items-center"},Ca={class:"camview-title truncate"},Da=at(()=>i("div",{class:"ml-auto"},null,-1)),$a={style:{margin:"5px"}},za={class:"flex flex-row w-full justify-start items-center"},Ma={class:"icon-wrapper"},Pa={class:"menu-item ml-2"},Sa=at(()=>i("div",{class:"my-1"},null,-1)),Fa={class:"flex flex-row w-full justify-start items-center"},Ia={class:"icon-wrapper"},Aa={class:"menu-item ml-2"},Ta={key:9,class:"flex flex-row items-center"},Ea={class:"text-white"},Ra={class:"h-full w-full inline-size mb-safe"},Ba={key:0,class:"h-full w-full flex items-center justify-center"},La={key:1,class:"w-full h-full"},Ua={key:0,class:"w-full h-full relative"},Qa={key:1,class:"w-full h-full flex flex-row"},ja={key:2,class:"flex flex-col items-center justify-center w-full h-full"},Oa={class:"mt-5",style:{color:"#525252"}},Wa={class:"flex flex-col h-full w-full"},Ha={class:"relative"},Na={for:"name",class:"v-label"},Xa={key:0,class:"text-red text-center mb-5"},Ya={class:"view-scroll-container"},qa={class:"view-select-container"},Ga=["onClick"],Ja={class:"flex flex-col h-full w-full"},Ka={class:"relative"},Za={for:"name",class:"v-label"},es={key:0,class:"text-red text-center mb-5"},ts={class:"flex flex-col"},as=ne({__name:"Camview",setup(X){var Se;const R=new Lt,Y=new Ot,{smallMobileActive:M}=Ce(),I=Bt(),T=Je(),{uiSettings:m}=ze(T),{loginState:u}=ze(I),x=g(),b=g(),o=g(),s=g({}),k=g(!1),U=g({page:1,pageSize:-1}),V=g([1,4,6,7,9,10,12,13,15,16,20,26]),L=g(!1),P=g(!1),$=g(!0),S=g(!1),z=g(!1),C=g(!1),v=g(!1),_=g(!1),h=g(!1),c=g([]),f=g([]),{data:p,isLoading:Q}=Y.getCamerasQuery(U),{data:j,isLoading:le}=R.getViewsQuery(((Se=u.value.user)==null?void 0:Se.username)||"",U),{mutate:re,isPending:he}=R.removeViewQuery(),{mutateAsync:D,isPending:se}=R.createViewQuery(),{mutateAsync:ae,isPending:ce}=R.patchViewQuery(),{mutateAsync:ge}=R.patchViewQuerySilent(),te=N(()=>S.value||C.value||z.value),oe=N(()=>Q.value||le.value||he.value||se.value||ce.value),xe=N(()=>{var a,t;return((a=b.value)==null?void 0:a.isFullscreen)||((t=b.value)==null?void 0:t.isFullscreen)||!1}),be=N(()=>navigator.mediaDevices!==void 0),A=N(()=>{var t,w;const a=((t=j.value)==null?void 0:t.result.find(B=>B._id===m.value.camview.viewid))||((w=j.value)==null?void 0:w.result[0]);return a?(s.value=a,m.value.camview.viewid=a._id):s.value={},a}),De=N(()=>te.value&&s.value.viewSize>0?s.value.viewSize:A.value?A.value.viewSize:1);J(u,a=>{R.toggleQueryActivator("getUserQuery",a!==null)}),J([De,A,p,te,m],()=>{var t,w,B;if(((t=A.value)==null?void 0:t.type)==="dnd"&&!S.value&&!C.value)return;const a=Array.from({length:De.value}).map((O,K)=>({accept:"camera",index:K,lastDroppedCamera:void 0}));if(!C.value&&!v.value)for(const O of((w=A.value)==null?void 0:w.cameras)||[])a[O.index].lastDroppedCamera=(B=p.value)==null?void 0:B.result.find(K=>K._id===O.cameraId);c.value=a},{deep:!0,immediate:!0}),J(s,a=>{var t,w,B;if(Object.keys(a).length===0)(t=o.value)==null||t.resetForm(),L.value=!1,P.value=!1;else{for(const[O,K]of Object.entries(a))(w=o.value)==null||w.setFieldValue(O,K);a.viewSize&&(L.value=!1),(B=a.cameras)!=null&&B.length&&(P.value=!1)}},{deep:!0}),J([v,C],([a,t])=>{(!a&&!t||a)&&(s.value={},L.value=!1)}),J([_,z],()=>{z.value||(f.value=[],s.value={},P.value=!1)}),J(_,a=>{a||(z.value=!1)}),J(z,a=>{var t;a?(f.value=((t=p.value)==null?void 0:t.result.filter(w=>{var B;return(B=A.value)==null?void 0:B.cameras.some(O=>O.cameraId===w._id)}))||[],_.value=!0):(f.value=[],_.value=!1)}),J(f,a=>{a.length&&(P.value=!1)}),J(te,a=>{a&&A.value&&!C.value&&(s.value=ye(A.value))}),J(u,a=>{a.user?R.toggleQueryActivator("getUserQuery",!0):R.toggleQueryActivator("getUserQuery",!1)},{immediate:!0,deep:!0});const st=async a=>{if(!A.value||!u.value.user)return;const t=ye(A.value);t.cameras=a;const w=await ge({username:u.value.user.username,viewid:t._id,viewData:t});_e(w)},lt=(a,t)=>{c.value[a].lastDroppedCamera=t},ot=a=>{c.value=c.value.map(t=>{var w;return((w=t.lastDroppedCamera)==null?void 0:w.name)===a.name&&(t.lastDroppedCamera=void 0),t})},rt=async()=>{var w;if(!o.value||!u.value.user)return;const a=f.value.map((B,O)=>({cameraId:B._id,index:O}));s.value.cameras=a,s.value.type="dnd",s.value.viewSize=1,o.value.setFieldValue("type","dnd"),o.value.setFieldValue("viewSize",1),o.value.setFieldValue("cameras",a);const t=await o.value.validate();if(t){if(((w=j.value)==null?void 0:w.result.find(K=>K.name===s.value.name))&&!z.value){o.value.setFieldError("name","View already exists");return}if(a.length===0){P.value=!0;return}if(!t.valid)return;const O=ye(s.value);if(O._id){const K=await ae({username:u.value.user.username,viewid:O._id,viewData:O});_e(K)}else{const K=await D({username:u.value.user.username,viewData:O});_e(K)}_.value=!1}},nt=async()=>{var t,w;if(!o.value)return;s.value.cameras=[],s.value.type="view",o.value.setFieldValue("type","view"),o.value.setFieldValue("cameras",[]);const a=await o.value.validate();if(a){if((t=j.value)==null?void 0:t.result.find(O=>O.name===s.value.name)){o.value.setFieldError("name","View already exists");return}if(!a.valid){((w=a.results.viewSize)==null?void 0:w.valid)===!1&&(L.value=!0);return}v.value=!1,C.value=!0}},it=async()=>{if(!o.value||!u.value.user||Object.keys(s.value).length===0)return;const a=c.value.filter(w=>w.lastDroppedCamera).map(w=>({cameraId:w.lastDroppedCamera._id,index:w.index})).sort((w,B)=>w.index-B.index);if(!a.length)return;o.value.setFieldValue("name",s.value.name),o.value.setFieldValue("cameras",a);const t=await o.value.validate();if(t!=null&&t.valid){const w=ye(s.value);if(w.cameras=a,w._id){const B=await ae({username:u.value.user.username,viewid:w._id,viewData:w});_e(B)}else{const B=await D({username:u.value.user.username,viewData:w});_e(B)}}},_e=a=>{m.value.camview.viewid=a._id,v.value=!1,_.value=!1,C.value=!1,S.value=!1},ct=()=>{!A.value||!u.value.user||re({username:u.value.user.username,viewid:A.value._id},{onSuccess:a=>{a.length?m.value.camview.viewid=a[0]._id:m.value.camview.viewid=void 0}})},dt=a=>{m.value.camview.viewid=a._id},ut=async()=>{b.value?await b.value.toggleFullscreen():x.value&&await x.value.toggleFullscreen()},vt=()=>{$.value=!$.value,b.value?b.value.togglePlayerMute($.value):x.value&&x.value.togglePlayerMute($.value)},mt=async a=>{b.value?await b.value.togglePlayerMicrophone(a):x.value&&await x.value.togglePlayerMicrophone(a)};return(a,t)=>{const w=Qt,B=Xt;return r(),F("main",_a,[n(e(jt),{ref_key:"viewVeeForm",ref:o,class:"h-full w-full","validation-schema":e(Ut),"initial-values":e(s)},{default:l(()=>{var O,K,Fe,Ie,Ae,Te;return[i("div",wa,[!e(C)&&e(A)?(r(),E(ee,{key:0,size:"small",variant:"flat",style:{background:"rgba(var(--color-rgb), 0.1)","padding-left":"8px"}},{default:l(()=>[i("div",ya,[e(te)?H("",!0):(r(),E(G,{key:0,size:"18",class:"text-color mr-1"},{default:l(()=>[W(y(e(k)?e(Vt):e(kt)),1)]),_:1})),i("span",ha,y(e(A).name),1)]),e(te)?H("",!0):(r(),E($e,{key:0,activator:"parent",width:"324",offset:"5",location:"bottom",class:"select-menu","onUpdate:modelValue":t[0]||(t[0]=d=>k.value=d)},{default:l(()=>[n(Re,{width:"200",style:{border:"1px solid var(--background-timeline)","border-radius":"10px"},elevation:"3"},{default:l(()=>{var d;return[i("div",xa,[(r(!0),F(ve,null,ue(((d=e(j))==null?void 0:d.result)||[],(q,de)=>(r(),E(we,{key:de,active:q._id===e(A)._id,value:q,style:{"border-radius":"5px !important"},disabled:e(oe),onClick:Z(Ve=>dt(q),["prevent"])},{default:l(()=>[i("div",ba,[i("span",Va,y(q.name),1)])]),_:2},1032,["active","value","disabled","onClick"]))),128))])]}),_:1})]),_:1}))]),_:1})):e(C)&&e(s).name?(r(),E(ee,{key:1,size:"small",variant:"flat",style:{background:"rgba(var(--color-rgb), 0.1)","padding-left":"8px"}},{default:l(()=>[i("div",ka,[i("span",Ca,y(e(s).name),1)])]),_:1})):H("",!0),Da,!e(te)&&((O=e(A))==null?void 0:O.type)==="dnd"?(r(),E(ee,{key:2,class:"disabled-text mr-2",size:"30",rounded:"",density:"compact",variant:"text",onClick:t[1]||(t[1]=Z(d=>e(m).camview.dragDisabled=!e(m).camview.dragDisabled,["prevent"]))},{default:l(()=>[n(G,{size:"18"},{default:l(()=>[W(y(e(m).camview.dragDisabled?e(Ct):e(Dt)),1)]),_:1})]),_:1})):H("",!0),!e(te)&&e(A)?(r(),E(ee,{key:3,class:"disabled-text mr-2",size:"30",rounded:"",density:"compact",variant:"text",onClick:t[2]||(t[2]=Z(d=>vt(),["prevent"]))},{default:l(()=>[n(G,{size:"22"},{default:l(()=>[W(y(e($)?e($t):e(zt)),1)]),_:1})]),_:1})):H("",!0),!e(te)&&e(A)&&e(be)?(r(),E(ee,{key:4,class:"disabled-text mr-2",size:"30",rounded:"",density:"compact",variant:"text",onClick:t[3]||(t[3]=Z(d=>h.value=!0,["prevent"]))},{default:l(()=>[n(G,{size:"22"},{default:l(()=>[W(y(e(Qe)),1)]),_:1})]),_:1})):H("",!0),!e(te)&&e(A)?(r(),E(ee,{key:5,class:"disabled-text mr-2",size:"30",rounded:"",density:"compact",variant:"text",onClick:t[4]||(t[4]=Z(d=>ut(),["prevent"]))},{default:l(()=>[n(G,{size:"22"},{default:l(()=>[W(y(e(xe)?e(Mt):e(Pt)),1)]),_:1})]),_:1})):H("",!0),!e(te)&&e(A)?(r(),E(ee,{key:6,class:"disabled-text mr-2",size:"30",rounded:"",density:"compact",variant:"text",onClick:t[5]||(t[5]=Z(d=>ct(),["prevent"]))},{default:l(()=>[n(G,{size:"20"},{default:l(()=>[W(y(e(St)),1)]),_:1})]),_:1})):H("",!0),!e(z)&&!e(S)&&!e(C)&&e(A)?(r(),E(ee,{key:7,class:"disabled-text mr-2",size:"30",rounded:"",density:"compact",variant:"text",onClick:t[6]||(t[6]=Z(d=>{var q;return((q=e(A))==null?void 0:q.type)==="dnd"?z.value=!e(z):S.value=!e(S)},["prevent"]))},{default:l(()=>[n(G,{size:"19"},{default:l(()=>[W(y(e(Ft)),1)]),_:1})]),_:1})):H("",!0),!e(z)&&!e(S)&&!e(C)?(r(),E(ee,{key:8,class:"disabled-text mr-2",size:"30",rounded:"",density:"compact",variant:"text"},{default:l(()=>[n(G,{size:"22"},{default:l(()=>[W(y(e(je)),1)]),_:1}),n($e,{activator:"parent",offset:"5",location:"bottom",class:"select-menu"},{default:l(()=>[n(Re,{width:"200",style:{border:"1px solid var(--background-timeline)","border-radius":"10px"},elevation:"3"},{default:l(()=>[i("div",$a,[n(we,{style:{"border-radius":"5px !important"},disabled:e(oe),onClick:t[7]||(t[7]=Z(d=>v.value=!0,["prevent"]))},{default:l(()=>[i("div",za,[i("div",Ma,[n(G,{size:"20",class:"text-passive"},{default:l(()=>[W(y(e(It)),1)]),_:1})]),i("span",Pa,y(a.$t("views.camview.new_view")),1)])]),_:1},8,["disabled"]),Sa,n(we,{style:{"border-radius":"5px !important"},disabled:e(oe),onClick:t[8]||(t[8]=Z(d=>_.value=!0,["prevent"]))},{default:l(()=>[i("div",Fa,[i("div",Ia,[n(G,{size:"20",class:"text-passive"},{default:l(()=>[W(y(e(At)),1)]),_:1})]),i("span",Aa,y(a.$t("views.camview.new_dnd")),1)])]),_:1},8,["disabled"])])]),_:1})]),_:1})]),_:1})):H("",!0),e(S)||e(C)?(r(),F("div",Ta,[n(ee,{class:"disabled-text mr-2",size:"small",variant:"flat",border:"",onClick:t[9]||(t[9]=Z(d=>e(S)?S.value=!1:C.value=!1,["prevent"]))},{default:l(()=>[W(y(a.$t("components.form.button.cancel")),1)]),_:1}),n(ee,{disabled:e(c).every(d=>d.lastDroppedCamera===void 0),class:"disabled-text",size:"small",color:"#df2a4c",variant:"flat",border:"",onClick:t[10]||(t[10]=Z(d=>it(),["prevent"]))},{default:l(()=>[i("span",Ea,y(a.$t("components.form.button.save")),1)]),_:1},8,["disabled"])])):H("",!0)]),i("div",{class:me(["camview-container",{"px-0":e(M)}])},[i("div",Ra,[e(oe)||!e(j)?(r(),F("div",Ba,[n(Tt,{color:"#df2a4c",indeterminate:""})])):(r(),F("div",La,[!e(C)&&!e(S)&&(e(z)||((K=e(A))==null?void 0:K.type)==="dnd")?(r(),F("div",Ua,[n(Zt,{ref_key:"dndRef",ref:x,cameras:((Fe=e(A))==null?void 0:Fe.cameras)||[],"db-cameras":((Ie=e(p))==null?void 0:Ie.result)||[],onDrag:st},null,8,["cameras","db-cameras"])])):!e(z)&&(e(C)||e(S)||((Ae=e(A))==null?void 0:Ae.type)==="view")?(r(),F("div",Qa,[(r(),E(ga,{ref_key:"viewRef",ref:b,key:e(m).camview.viewid+(e(C)?"-new":e(S)?"-edit":"-view"),cameras:((Te=e(p))==null?void 0:Te.result)||[],"edit-mode":e(C)||e(S),"view-size":e(C)?e(s).viewSize:e(De),title:e(s).name,cards:e(c),onDrop:lt,onRemove:ot},null,8,["cameras","edit-mode","view-size","title","cards"]))])):(r(),F("div",ja,[i("span",Oa,y(a.$t("views.camview.no_views_configured")),1)]))]))])],2),n(w,{modelValue:e(v),"onUpdate:modelValue":t[12]||(t[12]=d=>ke(v)?v.value=d:null),title:a.$t("components.dialog.title.new_view"),"confirm-text":"components.form.button.next",loading:e(oe),onConfirm:t[13]||(t[13]=d=>nt())},{content:l(()=>[i("div",Wa,[i("div",Ha,[n(e(Ue),{modelValue:e(s).name,"onUpdate:modelValue":t[11]||(t[11]=d=>e(s).name=d),name:"name"},{default:l(({field:d,errorMessage:q,errors:de})=>[i("label",Na,y(a.$t("components.form.label.name")),1),n(Be,Ee({loading:e(oe),variant:"outlined",name:"name",type:"text",density:"compact"},d,{error:de.length>0,"error-messages":q}),null,16,["loading","error","error-messages"])]),_:1},8,["modelValue"])]),n(Le,{class:"my-5"}),e(L)?(r(),F("span",Xa,y(a.$t("components.form.error.no_view_selected")),1)):H("",!0),i("div",Ya,[i("div",qa,[(r(!0),F(ve,null,ue(e(V),d=>(r(),F("div",{key:d,class:"view-select-item h-full w-full",onClick:Z(q=>e(s).viewSize=d,["prevent"])},[i("div",{class:me(["view-select-item-icon w-full h-full p-3",{"selected-view":e(s).viewSize===d}])},[n(G,{class:"disabled-text",style:{width:"100%",height:"100%"}},{default:l(()=>[W(y(`$cuiGrid${d}`),1)]),_:2},1024)],2),i("span",{class:me(["view-select-item-label disabled-text mt-2 px-2 py-1",{"selected-view-label":e(s).viewSize===d}])},y(d)+" "+y(a.$t("views.camview.cameras")),3)],8,Ga))),128))])])])]),_:1},8,["modelValue","title","loading"]),n(w,{modelValue:e(_),"onUpdate:modelValue":t[16]||(t[16]=d=>ke(_)?_.value=d:null),title:a.$t("components.dialog.title.new_dnd"),"confirm-text":"components.form.button.save",loading:e(oe),onConfirm:t[17]||(t[17]=d=>rt())},{content:l(()=>[i("div",Ja,[i("div",Ka,[n(e(Ue),{modelValue:e(s).name,"onUpdate:modelValue":t[14]||(t[14]=d=>e(s).name=d),name:"name"},{default:l(({field:d,errorMessage:q,errors:de})=>[i("label",Za,y(a.$t("components.form.label.name")),1),n(Be,Ee({loading:e(oe),variant:"outlined",name:"name",type:"text",density:"compact"},d,{error:de.length>0,"error-messages":q}),null,16,["loading","error","error-messages"])]),_:1},8,["modelValue"])]),n(Le,{class:"mb-10 mt-5"}),e(P)?(r(),F("span",es,y(a.$t("components.form.error.no_cameras_selected")),1)):H("",!0),n(Oe,{selected:e(f),"onUpdate:selected":t[15]||(t[15]=d=>ke(f)?f.value=d:null),"select-strategy":"classic",class:"py-0 mb-5",density:"compact"},{default:l(()=>{var d;return[(r(!0),F(ve,null,ue(((d=e(p))==null?void 0:d.result)||[],(q,de)=>(r(),E(we,{key:de,value:q,active:e(f).some(Ve=>Ve.name===q.name)},{prepend:l(({isActive:Ve})=>[n(Et,{start:""},{default:l(()=>[n(Rt,{"model-value":Ve,color:"#df2a4c"},null,8,["model-value"])]),_:2},1024)]),default:l(()=>[n(We,null,{default:l(()=>[W(y(q.name),1)]),_:2},1024)]),_:2},1032,["value","active"]))),128))]}),_:1},8,["selected"])])]),_:1},8,["modelValue","title","loading"]),n(w,{modelValue:e(h),"onUpdate:modelValue":t[18]||(t[18]=d=>ke(h)?h.value=d:null),title:a.$t("components.dialog.title.intercom"),loading:e(oe),"hide-confirm-button":""},{content:l(()=>[i("div",ts,[i("span",null,y(a.$t("components.dialog.message.intercom_info")),1),n(B,{onListening:mt})])]),_:1},8,["modelValue","title","loading"])]}),_:1},8,["validation-schema","initial-values"])])}}}),Xs=ie(as,[["__scopeId","data-v-ebd2ec2a"]]);export{Xs as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var se=Object.defineProperty;var ie=(n,t,o)=>t in n?se(n,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):n[t]=o;var R=(n,t,o)=>ie(n,typeof t!="symbol"?t+"":t,o);import{i as Q,x as C,a as re,f as ce,y as le,w as ue,B as me,d as fe}from"./main-
|
|
1
|
+
var se=Object.defineProperty;var ie=(n,t,o)=>t in n?se(n,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):n[t]=o;var R=(n,t,o)=>ie(n,typeof t!="symbol"?t+"":t,o);import{i as Q,x as C,a as re,f as ce,y as le,w as ue,B as me,d as fe}from"./main-C2N2tbw_.js";import{_ as ge}from"./VConfigEditor.vue_vue_type_script_setup_true_lang-DDxLGgGL.js";import{r as l,u as e,F as de,c as I,w as K,x as pe,e as c,f as O,O as d,M as s,l as ye,ae as Ce,j,R as a,X as _e,ar as ve,i as F,m as he,V as p,T as f,q as V,g as P,v as E}from"./@vue-CIFymae3.js";import{_ as be,$ as we,I as Qe,H as Ve}from"./@mdi-jq8isxax.js";import{i as x}from"./vue3-toastify-Cy6dUyKO.js";import{u as xe,a as N,b as k}from"./@tanstack-DPd4-F0t.js";import{r as ke}from"./system-C1OmXhti.js";import{u as qe}from"./ui-CdiPlYMM.js";import{s as ze}from"./utils-BvINh1mj.js";import{s as U}from"./pinia-B_gX_pHL.js";import{P as Se,Q as Re,e as y,b as q}from"./vuetify-B_vGZaGi.js";import"./vue-inline-svg-DDdr3aAz.js";import"./vue-i18n-CHUfunSC.js";import"./@intlify-YW_pt133.js";import"./axios-BI2i94Vb.js";import"./vue-router-C55prZ5l.js";import"./@vueuse-DbPVvJxZ.js";import"./nprogress-QK5AFhFr.js";import"./@xterm-LO7TPXYg.js";import"./vee-validate-DHjm38DY.js";import"./@vee-validate-CmTVjJBY.js";import"./zod-BaF2dDCd.js";import"./uuid-DvF23Exx.js";import"./socket.io-client-Bq_SHkin.js";import"./engine.io-client-DBBxzneW.js";import"./engine.io-parser-BiEtp6m2.js";import"./@socket.io-Dkula2eQ.js";import"./socket.io-parser-BBkuslX-.js";import"./rxjs-DmqiRszP.js";import"./tslib-9k7AwCpt.js";import"./v-calendar-CbEkwI4D.js";import"./@popperjs-BQBsAJpH.js";import"./ace-builds-Jtyk_kwI.js";const Fe=async({json:n,signal:t})=>(await C.get("/config",{params:{json:n},signal:t})).data,Ge=async({json:n,signal:t})=>(await C.get("/config/go2rtc",{params:{json:n},signal:t})).data,Ae=async({configData:n})=>(await C.patch("/config",n,{headers:{"Content-Type":"text/yaml"}})).data,Le=async({configData:n})=>(await C.patch("/config/go2rtc",n,{headers:{"Content-Type":"text/yaml"}})).data,Me=async()=>(await C.delete("/config")).data,Te=async()=>(await C.delete("/config/go2rtc")).data;class Be{constructor(){R(this,"_queryClient",xe());R(this,"queryActivator",l([{name:"getConfigQuery",enabled:!0},{name:"getGo2RtcConfigQuery",enabled:!0}]))}get queryClient(){return this._queryClient}getConfigQuery(t=!1){return N({queryKey:["config",{json:t}],queryFn:({signal:o})=>Fe({json:e(t),signal:o}),enabled:()=>this.queryActivator.value.some(o=>o.name==="getConfigQuery"&&o.enabled)})}getGo2RtcConfigQuery(t=!1){return N({queryKey:["go2rtcConfig"],queryFn:({signal:o})=>Ge({json:e(t),signal:o}),enabled:()=>this.queryActivator.value.some(o=>o.name==="getGo2RtcConfigQuery"&&o.enabled)})}patchConfigQuery(){return k({mutationFn:Ae,onSuccess:async()=>{await this._queryClient.refetchQueries({queryKey:["config"]}),x.success(Q.global.t("components.toast.config_updated"))}})}patchGo2RtcConfigQuery(){return k({mutationFn:Le,onSuccess:async()=>{await this._queryClient.refetchQueries({queryKey:["go2rtcConfig"]}),x.success(Q.global.t("components.toast.config_go2rtc_updated"))}})}delteConfigQuery(){return k({mutationFn:Me,onSuccess:async()=>{await this._queryClient.refetchQueries({queryKey:["config"]}),x.success(Q.global.t("components.toast.config_deleted"))}})}delteGo2RtcConfigQuery(){return k({mutationFn:Te,onSuccess:async()=>{await this._queryClient.refetchQueries({queryKey:["go2rtcConfig"]}),x.success(Q.global.t("components.toast.config_go2rtc_deleted"))}})}toggleQueryActivator(t,o){const w=this.queryActivator.value.find(z=>z.name===t);w&&(w.enabled=o)}}const De={class:"w-full h-full"},$e={key:0,class:"flex w-full h-full justify-center items-center fixed top-0 left-0",style:{"z-index":"9000"}},Ie=de({__name:"Config",setup(n){const t=new Be,o=re(),w=qe(),{extraSmallMobileActive:z}=ce(),{theme:G}=U(o),{uiSettings:u}=U(w),g=l("camera.ui"),_=l(""),v=l(""),A=l(!1),S=l(!1),L=l(!1),h=l(!1),M=I(()=>({fontSize:u.value.config.zoom})),{data:T,isLoading:H}=t.getConfigQuery(A),{data:B,isLoading:X}=t.getGo2RtcConfigQuery(A),{mutateAsync:Z,isPending:J}=t.patchConfigQuery(),{mutateAsync:W,isPending:Y}=t.patchGo2RtcConfigQuery(),m=I(()=>H.value||X.value||J.value||Y.value);K(T,()=>{_.value=T.value||""},{deep:!0,immediate:!0}),K(B,()=>{v.value=B.value||""},{deep:!0,immediate:!0});const D=async b=>{g.value==="camera.ui"?(await Z({configData:_.value}),b&&(L.value=!0,ke())):await W({configData:v.value}),b||(h.value=!1)},ee=()=>{g.value=g.value==="camera.ui"?"go2rtc":"camera.ui"},te=()=>{u.value.config.zoom!==8&&u.value.config.zoom--},oe=()=>{u.value.config.zoom!==20&&u.value.config.zoom++};return pe(async()=>{await ze(100),S.value=!0}),(b,i)=>{const ne=le,$=ge,ae=ue;return c(),O("main",De,[(c(),d(Ce,{to:".app"},[e(L)?(c(),O("div",$e,[s(ne,{reload:""})])):ye("",!0)])),j("div",{class:"text-editor-buttons flex flex-row justify-center",style:_e(e(z)?`bottom: calc(1rem + ${e(me).HEIGHT}px + env(safe-area-inset-bottom, 0px))`:"bottom: calc(1rem + env(safe-area-inset-bottom, 0px))")},[s(Se,{location:"top center",transition:"fade-transition","close-on-content-click":!1},{activator:a(({props:r})=>[s(Re,he(r,{size:"default",icon:""}),{default:a(()=>[s(y,{size:"20"},{default:a(()=>[p(f(e(be)),1)]),_:1})]),_:2},1040)]),default:a(()=>[s(q,{key:"1",loading:e(m),color:"success",icon:"",onClick:i[0]||(i[0]=V(r=>e(g)==="go2rtc"?D(!1):h.value=!0,["prevent"]))},{default:a(()=>[s(y,{size:"20"},{default:a(()=>[p(f(e(we)),1)]),_:1})]),_:1},8,["loading"]),s(q,{key:"2",loading:e(m),color:"#df2a4c",icon:"",onClick:V(ee,["prevent"])},{default:a(()=>[e(g)==="camera.ui"?(c(),d(y,{key:0,size:"20"},{default:a(()=>[p(f("$cuiLogo"))]),_:1})):(c(),d(y,{key:1,size:"30"},{default:a(()=>[p(f("$cuiGo2rtc"))]),_:1}))]),_:1},8,["loading"]),s(q,{key:"3",loading:e(m),icon:"",disabled:e(u).config.zoom===20,onClick:V(oe,["prevent"])},{default:a(()=>[s(y,{size:"20"},{default:a(()=>[p(f(e(Qe)),1)]),_:1})]),_:1},8,["loading","disabled"]),s(q,{key:"4",loading:e(m),disabled:e(u).config.zoom===8,icon:"",onClick:V(te,["prevent"])},{default:a(()=>[s(y,{size:"20"},{default:a(()=>[p(f(e(Ve)),1)]),_:1})]),_:1},8,["loading","disabled"])]),_:1})],4),(c(),d(ve,null,{default:a(()=>[e(g)==="camera.ui"?P((c(),d($,{key:0,modelValue:e(_),"onUpdate:modelValue":i[1]||(i[1]=r=>F(_)?_.value=r:null),lang:"yaml",theme:e(G),options:e(M),"read-only":e(m),class:"text-editor"},null,8,["modelValue","theme","options","read-only"])),[[E,e(S)]]):P((c(),d($,{key:1,modelValue:e(v),"onUpdate:modelValue":i[2]||(i[2]=r=>F(v)?v.value=r:null),lang:"yaml",theme:e(G),options:e(M),"read-only":e(m),class:"text-editor"},null,8,["modelValue","theme","options","read-only"])),[[E,e(S)]])]),_:1})),s(ae,{modelValue:e(h),"onUpdate:modelValue":i[3]||(i[3]=r=>F(h)?h.value=r:null),title:b.$t("components.dialog.title.confirm"),"confirm-text":"components.form.button.save_and_restart",loading:e(m),onConfirm:i[4]||(i[4]=r=>D(!0))},{content:a(()=>[j("span",null,f(b.$t("components.dialog.message.confirm_restart_server")),1)]),_:1},8,["modelValue","title","loading"])])}}}),bt=fe(Ie,[["__scopeId","data-v-7cc49202"]]);export{bt as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{z as O,f as U,w as E,B as $,d as N}from"./main-
|
|
1
|
+
import{z as O,f as U,w as E,B as $,d as N}from"./main-C2N2tbw_.js";import{F as P,r as k,c as z,a3 as h,U as j,e as H,f as F,M as t,u as o,j as S,R as n,X as q,i as G,m as W,V as f,T as m,q as y}from"./@vue-CIFymae3.js";import{_ as X,a0 as Z,a1 as J,I as K,H as Y}from"./@mdi-jq8isxax.js";import{S as oo}from"./system-C1OmXhti.js";import{V as eo}from"./VConsole-D85lNxwk.js";import{u as to}from"./ui-CdiPlYMM.js";import{s as no}from"./pinia-B_gX_pHL.js";import{P as ao,Q as so,e as g,b as _}from"./vuetify-B_vGZaGi.js";import"./vue-inline-svg-DDdr3aAz.js";import"./vue3-toastify-Cy6dUyKO.js";import"./vue-i18n-CHUfunSC.js";import"./@intlify-YW_pt133.js";import"./axios-BI2i94Vb.js";import"./@tanstack-DPd4-F0t.js";import"./vue-router-C55prZ5l.js";import"./@vueuse-DbPVvJxZ.js";import"./nprogress-QK5AFhFr.js";import"./@xterm-LO7TPXYg.js";import"./vee-validate-DHjm38DY.js";import"./@vee-validate-CmTVjJBY.js";import"./zod-BaF2dDCd.js";import"./uuid-DvF23Exx.js";import"./socket.io-client-Bq_SHkin.js";import"./engine.io-client-DBBxzneW.js";import"./engine.io-parser-BiEtp6m2.js";import"./@socket.io-Dkula2eQ.js";import"./socket.io-parser-BBkuslX-.js";import"./rxjs-DmqiRszP.js";import"./tslib-9k7AwCpt.js";import"./v-calendar-CbEkwI4D.js";import"./@popperjs-BQBsAJpH.js";const lo={class:"w-full h-full"},io=P({__name:"Console",setup(ro){const u=new oo,L=O(),V=to(),{extraSmallMobileActive:x}=U(),{uiSettings:i}=no(V),v=k(null),c=k(),d=k(!1),C=z(()=>({fontSize:i.value.console.zoom}));u.toggleQueryActivator("downloadLogQuery",!1);const{data:w,isLoading:Q,suspense:B}=u.downloadLogQuery(),{mutate:T,isPending:M}=u.clearLogQuery(),p=z(()=>Q.value||M.value),R=async()=>{T(void 0,{onSuccess:()=>{d.value=!1}})},D=async()=>{try{if(u.toggleQueryActivator("downloadLogQuery",!0),await B(),w.value){const a=w.value,e=window.URL.createObjectURL(new Blob([a])),s=document.createElement("a");s.href=e,s.setAttribute("download","camera.ui.log.txt"),document.body.appendChild(s),s.click(),s.remove()}}finally{u.toggleQueryActivator("downloadLogQuery",!1)}},I=()=>{i.value.console.zoom!==8&&i.value.console.zoom--},A=()=>{i.value.console.zoom!==20&&i.value.console.zoom++};return h(()=>{var a,e,s,l;c.value=L.connectToNamespace("/logs"),(a=c.value)==null||a.socket.on("stdout",r=>{var b;(b=v.value)==null||b.writeTerminal(r)}),(e=c.value)==null||e.socket.on("disconnect",()=>{var r;(r=v.value)==null||r.writeTerminal(`
|
|
2
2
|
\rWebsocket failed to connect! Is the server running?
|
|
3
3
|
\r
|
|
4
4
|
\r`)}),(s=c.value)==null||s.socket.on("clear-log",()=>{var r;(r=v.value)==null||r.clearTerminal()}),(l=c.value)==null||l.socket.emit("get-log")}),j(()=>{var a,e;(e=(a=c.value)==null?void 0:a.end)==null||e.call(a)}),(a,e)=>{const s=E;return H(),F("main",lo,[t(eo,{ref_key:"consoleRef",ref:v,class:"text-editor",options:o(C)},null,8,["options"]),S("div",{class:"text-editor-buttons flex flex-row justify-center",style:q(o(x)?`bottom: calc(1rem + ${o($).HEIGHT}px + env(safe-area-inset-bottom, 0px))`:"bottom: calc(1rem + env(safe-area-inset-bottom, 0px))")},[t(ao,{location:"top center",transition:"fade-transition","close-on-content-click":!1},{activator:n(({props:l})=>[t(so,W(l,{size:"default",icon:""}),{default:n(()=>[t(g,{size:"20"},{default:n(()=>[f(m(o(X)),1)]),_:1})]),_:2},1040)]),default:n(()=>[t(_,{key:"1",loading:o(p),color:"success",icon:"",onClick:y(D,["prevent"])},{default:n(()=>[t(g,{size:"20"},{default:n(()=>[f(m(o(Z)),1)]),_:1})]),_:1},8,["loading"]),t(_,{key:"2",loading:o(p),color:"red",icon:"",onClick:e[0]||(e[0]=y(l=>d.value=!0,["prevent"]))},{default:n(()=>[t(g,{size:"20"},{default:n(()=>[f(m(o(J)),1)]),_:1})]),_:1},8,["loading"]),t(_,{key:"3",loading:o(p),icon:"",disabled:o(i).console.zoom===20,onClick:y(A,["prevent"])},{default:n(()=>[t(g,{size:"20"},{default:n(()=>[f(m(o(K)),1)]),_:1})]),_:1},8,["loading","disabled"]),t(_,{key:"4",loading:o(p),disabled:o(i).console.zoom===8,icon:"",onClick:y(I,["prevent"])},{default:n(()=>[t(g,{size:"20"},{default:n(()=>[f(m(o(Y)),1)]),_:1})]),_:1},8,["loading","disabled"])]),_:1})],4),t(s,{modelValue:o(d),"onUpdate:modelValue":e[1]||(e[1]=l=>G(d)?d.value=l:null),title:a.$t("components.dialog.title.confirm"),"confirm-text":"components.form.button.clear",loading:o(p),onConfirm:e[2]||(e[2]=l=>R())},{content:n(()=>[S("span",null,m(a.$t("components.dialog.message.confirm_clear_log")),1)]),_:1},8,["modelValue","title","loading"])])}}}),Po=N(io,[["__scopeId","data-v-b446efca"]]);export{Po as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as ie,a as de,b as me,i as ce,g as pe,c as ue,r as fe,_ as ve,d as he}from"./main-
|
|
1
|
+
import{u as ie,a as de,b as me,i as ce,g as pe,c as ue,r as fe,_ as ve,d as he}from"./main-C2N2tbw_.js";import{F as ge,r as u,b as be,c as G,w as _e,e as f,f as R,j as t,u as e,O as z,q as B,l as E,T as m,N as we,Q as ye,M as l,R as c,n as xe,i as V,m as S,V as L,ai as ke,aj as Ve}from"./@vue-CIFymae3.js";import{m as H,a as J}from"./@mdi-jq8isxax.js";import{F as b,a as Se}from"./vee-validate-DHjm38DY.js";import{I as $e}from"./vue-inline-svg-DDdr3aAz.js";import{a as Ce}from"./vue-router-C55prZ5l.js";import{s as N}from"./pinia-B_gX_pHL.js";import{b as $,w as Fe,x as P,y as K,d as T,c as O,z as X}from"./vuetify-B_vGZaGi.js";import"./vue3-toastify-Cy6dUyKO.js";import"./vue-i18n-CHUfunSC.js";import"./@intlify-YW_pt133.js";import"./axios-BI2i94Vb.js";import"./@tanstack-DPd4-F0t.js";import"./@vueuse-DbPVvJxZ.js";import"./nprogress-QK5AFhFr.js";import"./@xterm-LO7TPXYg.js";import"./@vee-validate-CmTVjJBY.js";import"./zod-BaF2dDCd.js";import"./uuid-DvF23Exx.js";import"./socket.io-client-Bq_SHkin.js";import"./engine.io-client-DBBxzneW.js";import"./engine.io-parser-BiEtp6m2.js";import"./@socket.io-Dkula2eQ.js";import"./socket.io-parser-BBkuslX-.js";import"./rxjs-DmqiRszP.js";import"./tslib-9k7AwCpt.js";import"./v-calendar-CbEkwI4D.js";import"./@popperjs-BQBsAJpH.js";const q=_=>(ke("data-v-0cbf5310"),_=_(),Ve(),_),Ie={class:"w-full h-full"},Ue={class:"firststeps-progress flex flex-col items-center p-5 w-full"},je={class:"firststeps-progress-inner pt-safe flex flex-col h-full w-full"},Me={class:"flex flex-row items-center"},Re={class:"firststeps-progress-title mt-3"},ze={class:"firststeps-progress-text mt-1"},Be={class:"flex flex-row gap-2 mt-3 mb-3"},Ee={class:"firststeps flex flex-col items-center p-5 w-full h-full hide-scrollbar"},Le={class:"relative"},Ne={for:"theme",class:"v-label"},Pe=q(()=>t("div",{class:"py-2"},null,-1)),Te={class:"ml-auto flex"},Oe=q(()=>t("div",{class:"py-3"},null,-1)),qe={class:"relative"},Ae={for:"language",class:"v-label"},De={class:"flex flex-row relative"},We={class:"w-100 mr-5"},Qe={for:"username",class:"v-label"},Ge={class:"image-upload ml-auto mt-3"},He={for:"file-input"},Je={class:"relative mt-5"},Ke={for:"password",class:"v-label"},Xe={class:"relative"},Ye={for:"password",class:"v-label"},Ze={class:"ml-auto flex"},es=q(()=>t("div",{class:"py-3"},null,-1)),ss={class:"ml-auto flex"},ts={class:"w-full flex flex-col justify-center items-center"},os={class:"text-center mt-10 firststeps-info"},as=ge({__name:"FirstSteps",setup(_){const C=ie(),Y=de(),Z=me(),ee=Ce(),{t:F}=ce.global,{loading:v,loginState:se}=N(C),{locale:I,languages:te}=N(Z),{colors:oe,theme:U,autoMode:w}=N(Y),n=u(0),A=u(),j=u(),y=u(!1),x=u(!1),h=u(),D=u(!1),k=be([{title:F("views.firststeps.step_appearance")},{title:F("views.firststeps.step_account")},{title:F("views.firststeps.step_finish")}]),ae=G(()=>Math.round((n.value+1)/k.length*100)),M=G(()=>n.value===k.length-1);_e(n,o=>{o===0&&(D.value=!1)});const le=async o=>{var d;const s=(d=o.target)==null?void 0:d.files;j.value=s==null?void 0:s[0],A.value=await fe(o)},re=async()=>{var o,s;try{await C.logout()}catch(d){console.error(((s=(o=d.response)==null?void 0:o.data)==null?void 0:s.message)??d.message??d)}},W=async()=>{var o,s,d,a;if(n.value>0){const r=(o=h.value)==null?void 0:o.getValues();if(r&&!r.password){(s=h.value)==null||s.setFieldError("password","Required"),(d=h.value)==null||d.setFieldError("passwordConfirm","Required");return}const i=await((a=h.value)==null?void 0:a.validate());i!=null&&i.valid&&!M.value&&n.value++}else n.value++},ne=async o=>{var s,d;if(D.value=!0,M.value){let a;const r={...o};r.firstLogin=!1,delete r.upload;try{v.value=!0,j.value&&(a=new FormData,a.append("upload",j.value)),await C.updateUser(r,a,!0),ee.push({path:"/cameras"})}catch(i){console.error(((d=(s=i.response)==null?void 0:s.data)==null?void 0:d.message)??i.message??i)}}},Q=()=>{n.value>0&&n.value--};return(o,s)=>{const d=ve;return f(),R("main",Ie,[t("div",Ue,[t("div",je,[t("div",Me,[e(n)>0?(f(),z($,{key:0,density:"compact",class:"firststeps-button no-drag",variant:"tonal",color:"tonal",text:o.$t("components.form.button.previous"),loading:e(v),onClick:s[0]||(s[0]=B(a=>Q(),["prevent"]))},null,8,["text","loading"])):E("",!0),e(n)===0?(f(),z($,{key:1,density:"compact",class:"firststeps-button no-drag",variant:"tonal",color:"white",text:o.$t("components.form.button.logout"),loading:e(v),onClick:s[1]||(s[1]=B(a=>re(),["prevent"]))},null,8,["text","loading"])):E("",!0),e(M)?E("",!0):(f(),z($,{key:2,density:"compact",class:"firststeps-button ml-auto no-drag",variant:"tonal",color:"white",text:o.$t("components.form.button.next"),loading:e(v),onClick:s[2]||(s[2]=B(a=>W(),["prevent"]))},null,8,["text","loading"]))]),t("h1",Re,m(e(k)[e(n)].title),1),t("h1",ze,[t("b",null,m(e(ae))+"%",1),t("span",null,m(o.$t("views.firststeps.complete")),1)]),t("div",Be,[(f(!0),R(we,null,ye(e(k),(a,r)=>(f(),R("div",{key:r,class:xe(["firststeps-step-bar",{"firststeps-step-bar-active":e(n)===r}])},null,2))),128))])])]),t("div",Ee,[l(e(Se),{ref_key:"userForm",ref:h,class:"firststeps-form flex flex-col h-full w-full","validation-schema":e(ue),onSubmit:s[10]||(s[10]=a=>ne(a))},{default:c(()=>[l(Fe,{modelValue:e(n),"onUpdate:modelValue":s[9]||(s[9]=a=>V(n)?n.value=a:null),class:"window",touch:{left:W,right:Q}},{default:c(()=>[l(P,{value:0,transition:"fade","reverse-transition":"fade-reverse",disabled:!1},{default:c(()=>[t("div",Le,[t("label",Ne,m(o.$t("components.form.label.theme")),1),l(K,{modelValue:e(U),"onUpdate:modelValue":s[3]||(s[3]=a=>V(U)?U.value=a:null),variant:"outlined",name:"theme","hide-details":"",density:"compact",items:e(oe),disabled:e(w)},null,8,["modelValue","items","disabled"])]),Pe,t("div",null,[t("div",Te,[l(T,{modelValue:e(w),"onUpdate:modelValue":s[4]||(s[4]=a=>V(w)?w.value=a:null),color:"#df2a4c",type:"checkbox",label:o.$t("components.form.label.system_preference"),"hide-details":""},null,8,["modelValue","label"])])]),Oe,t("div",qe,[t("label",Ae,m(o.$t("components.form.label.language")),1),l(K,{modelValue:e(I),"onUpdate:modelValue":s[5]||(s[5]=a=>V(I)?I.value=a:null),variant:"outlined",name:"language","hide-details":"",density:"compact",items:e(te)},null,8,["modelValue","items"])])]),_:1}),l(P,{value:1,transition:"fade","reverse-transition":"fade-reverse",disabled:!1},{default:c(()=>{var a;return[t("div",De,[t("div",We,[t("label",Qe,m(o.$t("components.form.label.username")),1),l(O,{variant:"outlined",type:"text",disabled:"","hide-details":"",density:"compact",value:(a=e(se).user)==null?void 0:a.username},null,8,["value"])]),t("div",Ge,[t("label",He,[l(d,{src:e(A),size:"4rem",style:{"border-radius":"4rem",border:"1px solid var(--border)"}},null,8,["src"]),l(e(b),{id:"file-input",type:"file",name:"upload",accept:"image/png,image/jpeg,image/jpg",onChange:s[6]||(s[6]=r=>le(r))})])])]),t("div",Je,[t("label",Ke,m(o.$t("components.form.label.new_password")),1),l(e(b),{name:"password"},{default:c(({field:r,errorMessage:i,errors:p})=>[l(O,S({variant:"outlined"},r,{name:"password",type:e(y)?"text":"password",error:p.length>0,"error-messages":i,density:"compact","append-inner-icon":e(y)?e(H):e(J),"onClick:appendInner":s[7]||(s[7]=g=>y.value=!e(y))}),null,16,["type","error","error-messages","append-inner-icon"])]),_:1})]),t("div",Xe,[t("label",Ye,m(o.$t("components.form.label.new_password_confirm")),1),l(e(b),{name:"passwordConfirm"},{default:c(({field:r,errorMessage:i,errors:p})=>[l(O,S({variant:"outlined"},r,{name:"passwordConfirm",type:e(x)?"text":"password",error:p.length>0,"error-messages":i,density:"compact","append-inner-icon":e(x)?e(H):e(J),"onClick:appendInner":s[8]||(s[8]=g=>x.value=!e(x))}),null,16,["type","error","error-messages","append-inner-icon"])]),_:1})]),t("div",null,[t("div",Ze,[l(e(b),{name:"oneLogin",type:"checkbox","checked-value":!0,"unchecked-value":!1},{default:c(({field:r,errorMessage:i,errors:p,value:g})=>[l(T,S(r,{name:"oneLogin",color:"#df2a4c",type:"checkbox",error:p.length>0,"error-messages":i,value:g,label:o.$t("components.form.label.one_login"),"hide-details":""}),null,16,["error","error-messages","value","label"])]),_:1})]),l(X,{theme:"dark",density:"compact",variant:"tonal",style:{"font-size":"0.7rem",color:"var(--color-disabled)"}},{default:c(()=>[L(m(o.$t("components.form.hint.one_login")),1)]),_:1})]),es,t("div",null,[t("div",ss,[l(e(b),{name:"rememberMe",type:"checkbox","checked-value":!0,"unchecked-value":!1},{default:c(({field:r,errorMessage:i,errors:p,value:g})=>[l(T,S({name:"rememberMe"},r,{color:"#df2a4c",type:"checkbox",error:p.length>0,"error-messages":i,value:g,label:o.$t("components.form.label.remember_me"),"hide-details":""}),null,16,["error","error-messages","value","label"])]),_:1})]),l(X,{class:"mb-safe",theme:"dark",density:"compact",variant:"tonal",style:{"font-size":"0.7rem",color:"var(--color-disabled)"}},{default:c(()=>[L(m(o.$t("components.form.hint.remember_me")),1)]),_:1})])]}),_:1}),l(P,{value:2,transition:"fade","reverse-transition":"fade-reverse",disabled:!1},{default:c(()=>[t("div",ts,[l(e($e),{src:e(pe)("logo_animated.svg"),width:"78px",height:"84px",title:"camera.ui","aria-label":"camera.ui"},null,8,["src"]),t("p",os,m(o.$t("views.firststeps.finish_message")),1),l($,{class:"mt-7 text-white",type:"submit",elevation:"1",color:"#df2a4c",loading:e(v)},{default:c(()=>[L(m(o.$t("views.firststeps.enjoy")),1)]),_:1},8,["loading"])])]),_:1})]),_:1},8,["modelValue","touch"])]),_:1},8,["validation-schema"])])])}}}),Rs=he(as,[["__scopeId","data-v-0cbf5310"]]);export{Rs as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{C as
|
|
1
|
+
import{C as xe,c as ke,_ as Se}from"./VPlayer-B53-f3Ad.js";import{f as Te,w as Pe,d as Re}from"./main-C2N2tbw_.js";import{F as Ae,r as v,D as Ie,c as Ce,w as Ve,e as d,f as k,M as n,R as a,u as e,i as G,n as Y,j as u,T as l,V as h,m as V,N as K,Q as q,O as P,q as _,l as M,X as He}from"./@vue-CIFymae3.js";import{H as A,t as je,y as Ee,j as Oe,p as Ge}from"./highlight.js-fBaokXp-.js";import{e as J,s as Me,E as Ue,F as $e,X,Y as Le,Z as We}from"./@mdi-jq8isxax.js";import{j as De}from"./@vueuse-DbPVvJxZ.js";import{M as Be}from"./markdown-it-DI8MEbma.js";import{F as I,a as Fe}from"./vee-validate-DHjm38DY.js";import{s as ze}from"./utils-BvINh1mj.js";import{a as Ne}from"./vue-router-C55prZ5l.js";import{b as S,e as x,K as Q,L as Z,M as ee,N as te,c as oe,y as L,m as Ye,O as Ke,V as ae}from"./vuetify-B_vGZaGi.js";import"./qrcode-SHonoxyK.js";import"./dijkstrajs-D_NXgYpA.js";import"./zod-BaF2dDCd.js";import"./pinia-B_gX_pHL.js";import"./@vee-validate-CmTVjJBY.js";import"./vue3-toastify-Cy6dUyKO.js";import"./plugins-Cs7BJHj-.js";import"./@tanstack-DPd4-F0t.js";import"./draggabilly-YEGzHR3_.js";import"./@xterm-LO7TPXYg.js";import"./get-size-D1dS-IaP.js";import"./unidragger-91TYirAP.js";import"./ev-emitter-t78oQA8k.js";import"./vue-inline-svg-DDdr3aAz.js";import"./vue-i18n-CHUfunSC.js";import"./@intlify-YW_pt133.js";import"./axios-BI2i94Vb.js";import"./uuid-DvF23Exx.js";import"./socket.io-client-Bq_SHkin.js";import"./engine.io-client-DBBxzneW.js";import"./engine.io-parser-BiEtp6m2.js";import"./@socket.io-Dkula2eQ.js";import"./socket.io-parser-BBkuslX-.js";import"./rxjs-DmqiRszP.js";import"./tslib-9k7AwCpt.js";import"./v-calendar-CbEkwI4D.js";import"./@popperjs-BQBsAJpH.js";import"./nprogress-QK5AFhFr.js";import"./mdurl-k9Sl0PQj.js";import"./uc.micro-kMc2yuuw.js";import"./entities-C20TfXL6.js";import"./linkify-it-DmNjr4Kv.js";import"./punycode.js-Dj65hjkv.js";const ne=["bubble://","dvrip://","echo:","exec:","expr:","ffmpeg:","gopro://","hass:","homekit://","http://","https://","httpx://","isapi://","ivideon:","kasa://","nest:","onvif://","roborock://","rtmp://","rtsp://","rtspx://","tapo://","tcp://","webrtc:","webtorrent:"],qe=["#backchannel=0","#header=","#media=audio","#media=video","#timeout=10","#timeout=20","#timeout=30","#transport="],se=["#audio=aac","#audio=aac/16000","#audio=mp3","#audio=opus","#audio=pcm","#audio=pcm/8000","#audio=pcm/16000","#audio=pcm/48000","#audio=pcma","#audio=pcma/8000","#audio=pcma/16000","#audio=pcma/48000","#audio=pcml","#audio=pcml/8000","#audio=pcml/44100","#audio=pcmu","#audio=pcmu/8000","#audio=pcmu/16000","#audio=pcmu/48000","#drawtext","#hardware","#hardware=cuda","#hardware=dxva2","#hardware=rkmpp","#hardware=v4l2m2m","#hardware=vaapi","#hardware=videotoolbox","#height=","#raw=","#rotate=-90","#rotate=90","#rotate=180","#rotate=270","#video=copy","#video=h264","#video=h265","#video=mjpeg","#width="],Je=["client_id=","client_private=","device_id=","device_public="],Xe=["#header="],Qe=["client_id=","client_secret=","refresh_token=","project_id=","device_id="],Ze=["#client_id=","#format=openipc","#format=wyze","#format=kinesis","#ice_servers="],et="#### Source: Bubble\n\nOther names: [ESeeCloud](http://www.eseecloud.com/), [dvr163](http://help.dvr163.com/).\n\n- you can skip `username`, `password`, `port`, `ch` and `stream` if they are default\n- setup separate streams for different channels and streams\n\n```yaml\nstreams:\n camera1: bubble://username:password@192.168.1.123:34567/bubble/live?ch=0&stream=0\n```\n\n_Source: [Go2Rtc Bubble](https://github.com/AlexxIT/go2rtc#source-bubble)_\n",tt="#### Source: DVRIP\n\nOther names: DVR-IP, NetSurveillance, Sofia protocol (NETsurveillance ActiveX plugin XMeye SDK).\n\n- you can skip `username`, `password`, `port`, `channel` and `subtype` if they are default\n- setup separate streams for different channels\n- use `subtype=0` for Main stream, and `subtype=1` for Extra1 stream\n- only the TCP protocol is supported\n\n```yaml\nstreams:\n only_stream: dvrip://username:password@192.168.1.123:34567?channel=0&subtype=0\n only_tts: dvrip://username:password@192.168.1.123:34567?backchannel=1\n two_way_audio:\n - dvrip://username:password@192.168.1.123:34567?channel=0&subtype=0\n - dvrip://username:password@192.168.1.123:34567?backchannel=1\n```\n\n_Source: [Go2Rtc DVRIP](https://github.com/AlexxIT/go2rtc#source-dvrip)_\n",ot=`#### Source: Echo
|
|
2
2
|
|
|
3
3
|
Some sources may have a dynamic link. And you will need to get it using a bash or python script. Your script should echo a link to the source. RTSP, FFmpeg or any of the [supported sources](https://github.com/AlexxIT/go2rtc#module-streams).
|
|
4
4
|
|
|
@@ -11,7 +11,7 @@ streams:
|
|
|
11
11
|
\`\`\`
|
|
12
12
|
|
|
13
13
|
_Source: [Go2Rtc Echo](https://github.com/AlexxIT/go2rtc#source-echo)_
|
|
14
|
-
`,
|
|
14
|
+
`,at=`#### Source: Exec
|
|
15
15
|
|
|
16
16
|
Exec source can run any external application and expect data from it. Two transports are supported - **pipe** and **RTSP**.
|
|
17
17
|
|
|
@@ -34,7 +34,7 @@ streams:
|
|
|
34
34
|
\`\`\`
|
|
35
35
|
|
|
36
36
|
_Source: [Go2Rtc Exec](https://github.com/AlexxIT/go2rtc#source-exec)_
|
|
37
|
-
`,
|
|
37
|
+
`,nt=`#### Source: Expr
|
|
38
38
|
|
|
39
39
|
[Expr](https://github.com/antonmedv/expr) - expression language and expression evaluation for Go.
|
|
40
40
|
|
|
@@ -125,7 +125,7 @@ streams:
|
|
|
125
125
|
| r.json() | r.json() | await r.json() |
|
|
126
126
|
| r.headers | r.headers | r.headers |
|
|
127
127
|
| let m = match(text, "abc") | m = re.search("abc", text) | let m = text.match(/abc/) |
|
|
128
|
-
`,
|
|
128
|
+
`,st="#### Source: FFmpeg\n\nYou can get any stream or file or device via FFmpeg and push it to go2rtc. The app will automatically start FFmpeg with the proper arguments when someone starts watching the stream.\n\n- FFmpeg preistalled for **Docker** and **Hass Add-on** users\n- **Hass Add-on** users can target files from [/media](https://www.home-assistant.io/more-info/local-media/setup-media/) folder\n\nFormat: `ffmpeg:{input}#{param1}#{param2}#{param3}`. Examples:\n\n```yaml\nstreams:\n # [FILE] all tracks will be copied without transcoding codecs\n file1: ffmpeg:/media/BigBuckBunny.mp4\n\n # [FILE] video will be transcoded to H264, audio will be skipped\n file2: ffmpeg:/media/BigBuckBunny.mp4#video=h264\n\n # [FILE] video will be copied, audio will be transcoded to pcmu\n file3: ffmpeg:/media/BigBuckBunny.mp4#video=copy#audio=pcmu\n\n # [HLS] video will be copied, audio will be skipped\n hls: ffmpeg:https://devstreaming-cdn.apple.com/videos/streaming/examples/bipbop_16x9/gear5/prog_index.m3u8#video=copy\n\n # [MJPEG] video will be transcoded to H264\n mjpeg: ffmpeg:http://185.97.122.128/cgi-bin/faststream.jpg#video=h264\n\n # [RTSP] video with rotation, should be transcoded, so select H264\n rotate: ffmpeg:rtsp://rtsp:12345678@192.168.1.123/av_stream/ch0#video=h264#rotate=90\n```\n\nAll trascoding formats has [built-in templates](https://github.com/AlexxIT/go2rtc/blob/master/internal/ffmpeg/ffmpeg.go): `h264`, `h265`, `opus`, `pcmu`, `pcmu/16000`, `pcmu/48000`, `pcma`, `pcma/16000`, `pcma/48000`, `aac`, `aac/16000`.\n\nBut you can override them via YAML config. You can also add your own formats to config and use them with source params.\n\n```yaml\nffmpeg:\n bin: ffmpeg # path to ffmpeg binary\n h264: '-codec:v libx264 -g:v 30 -preset:v superfast -tune:v zerolatency -profile:v main -level:v 4.1'\n mycodec: '-any args that supported by ffmpeg...'\n myinput: '-fflags nobuffer -flags low_delay -timeout 5000000 -i {input}'\n myraw: '-ss 00:00:20'\n```\n\n- You can use go2rtc stream name as ffmpeg input (ex. `ffmpeg:camera1#video=h264`)\n- You can use `video` and `audio` params multiple times (ex. `#video=copy#audio=copy#audio=pcmu`)\n- You can use `rotate` param with `90`, `180`, `270` or `-90` values, important with transcoding (ex. `#video=h264#rotate=90`)\n- You can use `width` and/or `height` params, important with transcoding (ex. `#video=h264#width=1280`)\n- You can use `drawtext` to add a timestamp (ex. `drawtext=x=2:y=2:fontsize=12:fontcolor=white:box=1:boxcolor=black`)\n - This will greatly increase the CPU of the server, even with hardware acceleration\n- You can use `raw` param for any additional FFmpeg arguments (ex. `#raw=-vf transpose=1`)\n- You can use `input` param to override default input template (ex. `#input=rtsp/udp` will change RTSP transport from TCP to UDP+TCP)\n - You can use raw input value (ex. `#input=-timeout 5000000 -i {input}`)\n - You can add your own input templates\n\nRead more about [hardware acceleration](https://github.com/AlexxIT/go2rtc/wiki/Hardware-acceleration).\n\n**PS.** It is recommended to check the available hardware in the WebUI add page.\n\n<hr>\n\n#### Source: FFmpeg Device\n\nYou can get video from any USB-camera or Webcam as RTSP or WebRTC stream. This is part of FFmpeg integration.\n\n- check available devices in Web interface\n- `video_size` and `framerate` must be supported by your camera!\n- for Linux supported only video for now\n- for macOS you can stream Facetime camera or whole Desktop!\n- for macOS important to set right framerate\n\nFormat: `ffmpeg:device?{input-params}#{param1}#{param2}#{param3}`\n\n```yaml\nstreams:\n linux_usbcam: ffmpeg:device?video=0&video_size=1280x720#video=h264\n windows_webcam: ffmpeg:device?video=0#video=h264\n macos_facetime: ffmpeg:device?video=0&audio=1&video_size=1280x720&framerate=30#video=h264#audio=pcma\n```\n\n**PS.** It is recommended to check the available devices in the WebUI add page.\n\n_Source: [Go2Rtc FFmpeg](https://github.com/AlexxIT/go2rtc#source-ffmpeg) & [Go2Rtc FFmpeg Device](https://github.com/AlexxIT/go2rtc#source-ffmpeg-device)_\n",rt=`#### Source: GoPro
|
|
129
129
|
|
|
130
130
|
Supported models: HERO9, HERO10, HERO11, HERO12.
|
|
131
131
|
Supported OS: Linux, Mac, Windows, [HassOS](https://www.home-assistant.io/installation/)
|
|
@@ -152,7 +152,7 @@ streams:
|
|
|
152
152
|
- https://gopro.github.io/OpenGoPro/
|
|
153
153
|
|
|
154
154
|
_Source: [Go2Rtc Hass](https://github.com/AlexxIT/go2rtc#source-hass)_
|
|
155
|
-
`,
|
|
155
|
+
`,it=`#### Source: Hass
|
|
156
156
|
|
|
157
157
|
Support import camera links from [Home Assistant](https://www.home-assistant.io/) config files:
|
|
158
158
|
|
|
@@ -189,7 +189,7 @@ streams:
|
|
|
189
189
|
By default, the Home Assistant API does not allow you to get dynamic RTSP link to a camera stream. So more cameras, like [Tuya](https://www.home-assistant.io/integrations/tuya/), and possibly others can also be imported by using [this method](https://github.com/felipecrs/hass-expose-camera-stream-source#importing-home-assistant-cameras-to-go2rtc-andor-frigate).
|
|
190
190
|
|
|
191
191
|
_Source: [Go2Rtc Hass](https://github.com/AlexxIT/go2rtc#source-hass)_
|
|
192
|
-
`,
|
|
192
|
+
`,ct=`#### Source: HomeKit
|
|
193
193
|
|
|
194
194
|
**Important:**
|
|
195
195
|
|
|
@@ -223,7 +223,7 @@ RTSP link with "normal" audio for any player: \`rtsp://192.168.1.123:8554/aqara_
|
|
|
223
223
|
**This source is in active development!** Tested only with [Aqara Camera Hub G3](https://www.aqara.com/eu/product/camera-hub-g3) (both EU and CN versions).
|
|
224
224
|
|
|
225
225
|
_Source: [Go2Rtc HomeKit](https://github.com/AlexxIT/go2rtc#source-homekit)_
|
|
226
|
-
`,
|
|
226
|
+
`,lt=`#### Source: HTTP
|
|
227
227
|
|
|
228
228
|
Support Content-Type:
|
|
229
229
|
|
|
@@ -267,7 +267,7 @@ streams:
|
|
|
267
267
|
\`\`\`
|
|
268
268
|
|
|
269
269
|
_Source: [Go2Rtc Isapi](https://github.com/AlexxIT/go2rtc#source-isapi)_
|
|
270
|
-
`,
|
|
270
|
+
`,ut=`#### Source: Ivideon
|
|
271
271
|
|
|
272
272
|
Support public cameras from service [Ivideon](https://tv.ivideon.com/).
|
|
273
273
|
|
|
@@ -277,7 +277,7 @@ streams:
|
|
|
277
277
|
\`\`\`
|
|
278
278
|
|
|
279
279
|
_Source: [Go2Rtc Ivideon](https://github.com/AlexxIT/go2rtc#source-ivideon)_
|
|
280
|
-
`,
|
|
280
|
+
`,pt=`#### Source: Kasa
|
|
281
281
|
|
|
282
282
|
[TP-Link Kasa](https://www.kasasmart.com/) non-standard protocol [more info](https://medium.com/@hu3vjeen/reverse-engineering-tp-link-kc100-bac4641bf1cd).
|
|
283
283
|
|
|
@@ -287,7 +287,7 @@ streams:
|
|
|
287
287
|
\`\`\`
|
|
288
288
|
|
|
289
289
|
_Source: [Go2Rtc Kasa](https://github.com/AlexxIT/go2rtc#source-kasa)_
|
|
290
|
-
`,
|
|
290
|
+
`,dt=`#### Source: Nest
|
|
291
291
|
|
|
292
292
|
Currently only WebRTC cameras are supported. Stream reconnects every 5 minutes.
|
|
293
293
|
|
|
@@ -299,7 +299,7 @@ streams:
|
|
|
299
299
|
\`\`\`
|
|
300
300
|
|
|
301
301
|
_Source: [Go2Rtc Nest](https://github.com/AlexxIT/go2rtc#source-nest)_
|
|
302
|
-
`,
|
|
302
|
+
`,ht=`#### Source: ONVIF
|
|
303
303
|
|
|
304
304
|
The source is not very useful if you already know RTSP and snapshot links for your camera. But it can be useful if you don't.
|
|
305
305
|
|
|
@@ -313,7 +313,7 @@ streams:
|
|
|
313
313
|
\`\`\`
|
|
314
314
|
|
|
315
315
|
_Source: [Go2Rtc Onvif](https://github.com/AlexxIT/go2rtc#source-onvif)_
|
|
316
|
-
`,
|
|
316
|
+
`,gt=`#### Source: Roborock
|
|
317
317
|
|
|
318
318
|
This source type support Roborock vacuums with cameras. Known working models:
|
|
319
319
|
|
|
@@ -325,7 +325,7 @@ Source support load Roborock credentials from Home Assistant [custom integration
|
|
|
325
325
|
If you have graphic pin for your vacuum - add it as numeric pin (lines: 123, 456, 678) to the end of the roborock-link.
|
|
326
326
|
|
|
327
327
|
_Source: [Go2Rtc Roborock](https://github.com/AlexxIT/go2rtc#source-roborock)_
|
|
328
|
-
`,
|
|
328
|
+
`,ft=`#### Source: RTMP
|
|
329
329
|
|
|
330
330
|
You can get stream from RTMP server, for example [Frigate](https://docs.frigate.video/configuration/rtmp).
|
|
331
331
|
|
|
@@ -335,7 +335,7 @@ streams:
|
|
|
335
335
|
\`\`\`
|
|
336
336
|
|
|
337
337
|
_Source: [Go2Rtc RTMP](https://github.com/AlexxIT/go2rtc#source-rtmp)_
|
|
338
|
-
`,
|
|
338
|
+
`,bt=`#### Source: RTSP
|
|
339
339
|
|
|
340
340
|
\`\`\`yaml
|
|
341
341
|
streams:
|
|
@@ -382,7 +382,7 @@ streams:
|
|
|
382
382
|
\`\`\`
|
|
383
383
|
|
|
384
384
|
_Source: [Go2Rtc RTSP](https://github.com/AlexxIT/go2rtc#source-rtsp)_
|
|
385
|
-
`,
|
|
385
|
+
`,wt=`#### Source: Tapo
|
|
386
386
|
|
|
387
387
|
[TP-Link Tapo](https://www.tapo.com/) proprietary camera protocol with **two way audio** support.
|
|
388
388
|
|
|
@@ -399,7 +399,7 @@ streams:
|
|
|
399
399
|
\`\`\`
|
|
400
400
|
|
|
401
401
|
_Source: [Go2Rtc Tapo](https://github.com/AlexxIT/go2rtc#source-tapo)_
|
|
402
|
-
`,
|
|
402
|
+
`,vt=`#### Source: WebRTC
|
|
403
403
|
|
|
404
404
|
This source type support four connection formats.
|
|
405
405
|
|
|
@@ -435,7 +435,7 @@ streams:
|
|
|
435
435
|
**PS.** For \`kinesis\` sources you can use [echo](https://github.com/AlexxIT/go2rtc#source-echo) to get connection params using \`bash\`/\`python\` or any other script language.
|
|
436
436
|
|
|
437
437
|
_Source: [Go2Rtc WebRTC](https://github.com/AlexxIT/go2rtc#source-webrtc)_
|
|
438
|
-
`,
|
|
438
|
+
`,_t=`#### Source: WebTorrent
|
|
439
439
|
|
|
440
440
|
This source can get a stream from another go2rtc via [WebTorrent](https://github.com/AlexxIT/go2rtc#module-webtorrent) protocol.
|
|
441
441
|
|
|
@@ -445,4 +445,4 @@ streams:
|
|
|
445
445
|
\`\`\`
|
|
446
446
|
|
|
447
447
|
_Source: [Go2Rtc Webtorrent](https://github.com/AlexxIT/go2rtc#source-webtorrent)_
|
|
448
|
-
`,_t={class:"page-title"},yt={class:"window"},xt={class:"subview-title text-color"},kt={class:"relative"},St={for:"name",class:"v-label"},Tt={class:"mt-5"},Pt={class:"subview-title text-color"},Rt={class:"flex flex-row items-center justify-center ml-auto"},It={class:"relative w-full flex flex-col"},At=["for"],Ct=["for"],Ht=["for"],Vt={class:"w-full flex flex-row justify-center my-1"},jt={class:"ml-2 flex items-center justify-center",style:{"max-height":"44px"}},Et={class:"flex items-center ml-auto"},Ot={class:"flex flex-row w-full items-center justify-center mt-3"},Gt={key:0,class:"w-full h-full flex items-center justify-center"},Mt=["innerHTML"],Ut={key:1,class:"w-full h-full flex items-center justify-center"},Ft={key:0,class:"w-full h-full flex items-center justify-center"},$t=Se({__name:"NewCamera",setup(Lt){P.registerLanguage("typescript",Ce),P.registerLanguage("yaml",He),P.registerLanguage("json",Ve),P.registerLanguage("python",je);const{smallMobileActive:H}=ye(),ee=Be(),U=new we,te=w(new Set),oe=w(),ae=w(!1),M=w(0),V=w([0]),T=w(),ne=w(["high-resolution","mid-resolution","low-resolution","snapshot"]),j=Te(),R=w(!1),E=w(!1),g=w({disabled:!1,name:"",info:{manufacturer:"",model:"",hardware:"",serialNumber:"",firmwareVersion:"",supportUrl:""},sources:[{name:"",roles:[],urls:[{protocol:"rtsp://",url:[]}]}],recording:{enabled:!1},interface:{streamingMode:"webrtc"},extensions:{hub:[],plugins:[]}}),{mutate:se,isPending:re}=U.createCameraQuery(),{mutateAsync:ie,isPending:ce}=U.previewCameraQuery(),u=Pe(()=>re.value||ae.value),F=Le("commonmark",{highlight(o,e){if(e&&P.getLanguage(e))try{return'<pre><code class="hljs">'+P.highlight(o,{language:e,ignoreIllegals:!0}).value+"</code></pre>"}catch{}return'<pre><code class="hljs">'+F.utils.escapeHtml(o)+"</code></pre>"}});Re(R,o=>{o||setTimeout(()=>{j.value={presets:[],md:void 0}},300)});const me=o=>{g.value.sources[o].urls.push({protocol:"rtsp://",url:[]})},le=(o,e)=>{g.value.sources[o].urls.splice(e,1)},ue=()=>{g.value.sources.push({name:"",roles:[],urls:[{protocol:"rtsp://",url:[]}]}),V.value=[g.value.sources.length]},pe=o=>{g.value.sources.splice(o,1)},$=o=>{let e,s,b;switch(o){case"bubble://":e=[],s=Object.assign({"../markdowns/bubble.md":Ze});break;case"dvrip://":e=[],s=Object.assign({"../markdowns/dvrip.md":et});break;case"echo:":e=[],s=Object.assign({"../markdowns/echo.md":tt});break;case"exec:":e=[],s=Object.assign({"../markdowns/exec.md":ot});break;case"expr:":e=[],s=Object.assign({"../markdowns/expr.md":at});break;case"ffmpeg:":e=Z,s=Object.assign({"../markdowns/ffmpeg.md":nt});break;case"gopro://":e=Z,s=Object.assign({"../markdowns/gopro.md":st});break;case"hass:":e=[],s=Object.assign({"../markdowns/hass.md":rt});break;case"homekit://":e=qe,s=Object.assign({"../markdowns/homekit.md":it});break;case"http://":case"https://":case"httpx://":case"tcp://":e=Je,s=Object.assign({"../markdowns/http.md":ct});break;case"isapi://":e=[],s=Object.assign({"../markdowns/isapi.md":mt});break;case"ivideon:":e=[],s=Object.assign({"../markdowns/ivideon.md":lt});break;case"kasa://":e=[],s=Object.assign({"../markdowns/kasa.md":ut});break;case"nest:":e=Xe,s=Object.assign({"../markdowns/nest.md":pt});break;case"onvif://":e=[],s=Object.assign({"../markdowns/onvif.md":dt});break;case"roborock://":e=[],s=Object.assign({"../markdowns/roborock.md":ht});break;case"rtmp://":e=[],s=Object.assign({"../markdowns/rtmp.md":gt});break;case"rtsp://":case"rtspx://":e=Ke,s=Object.assign({"../markdowns/rtsp.md":ft});break;case"tapo://":e=[],s=Object.assign({"../markdowns/tapo.md":bt});break;case"webrtc:":e=Qe,s=Object.assign({"../markdowns/webrtc.md":wt});break;case"webtorrent:":e=[],s=Object.assign({"../markdowns/webtorrent.md":vt});break;default:e=[],s=void 0;break}return s&&(b=Object.values(s)[0]),j.value={presets:e,md:b},{presets:e,md:b}},de=o=>{$(o),R.value=!0},he=async o=>{T.value=void 0,E.value=!0;const e=o.url.join(""),b={url:e.includes(o.protocol)?e:`${o.protocol}${e}`},r=await ie({cameraData:b});T.value=r?`data:image/jpeg;base64,${r}`:"ERROR",T.value!=="ERROR"&&te.value.add(b.url)},ge=o=>({...o,pluginId:"native",type:"camera",isCloud:!1,hasLight:!1,hasSiren:!1,hasBinarySensor:!1,hasBattery:!1,activityZones:[],activitySettings:{motion:{timeout:20},object:{confidence:.7}},frameWorkerSettings:{decoder:"wasm",fps:10,resolution:640},sources:o.sources.map(s=>{let b=s.urls.map(r=>{if(r.url){const c=r.url.join("");return c.includes(r.protocol)?c:`${r.protocol}${c}`}}).filter(Boolean);return{_id:"",...s,urls:b}})}),fe=o=>{const{isLoading:e}=$e(0,{parent:".topbar"});e.value=!0;let s=ge(o);se({cameraData:s},{onSuccess:async()=>{e.value=!1,await De(500),ee.push({path:"/cameras"})}})},be=(o,e)=>{e.protocol=o};return(o,e)=>{const s=xe,b=_e;return h(),k("main",{class:W(["w-full h-full",{"px-0":t(H)}])},[a(t(We),{ref_key:"cameraVeeForm",ref:oe,class:"firststeps-form flex flex-col h-full w-full","validation-schema":t(ve),"initial-values":t(g),onSubmit:e[3]||(e[3]=r=>fe(r))},{default:n(()=>[l("div",{class:W(["mb-3 flex items-center",{"mx-2":t(H)}]),style:{height:"30px"}},[l("h1",_t,m(o.$t("views.new_camera.title")),1),a(S,{loading:t(u),variant:"text",color:"green",type:"submit",class:"ml-auto"},{default:n(()=>[a(y,{size:"15",class:"mr-1"},{default:n(()=>[d(m(t(z)),1)]),_:1}),d(" "+m(o.$t("components.form.button.add")),1)]),_:1},8,["loading"])],2),l("div",yt,[l("div",null,[l("span",xt,m(o.$t("components.form.label.camera")),1),a(N,{modelValue:t(M),"onUpdate:modelValue":e[1]||(e[1]=r=>O(M)?M.value=r:null),class:"inner-component mt-2"},{default:n(()=>[a(Y,{elevation:"0",value:1},{default:n(()=>[a(K,{style:{height:"48px"},class:"truncate"},{default:n(()=>[d(m(o.$t("views.new_camera.camera")),1)]),_:1}),a(q,{eager:""},{default:n(()=>[l("div",kt,[a(t(C),{modelValue:t(g).name,"onUpdate:modelValue":e[0]||(e[0]=r=>t(g).name=r),name:"name"},{default:n(({field:r,errorMessage:c,errors:i})=>[l("label",St,m(o.$t("components.form.label.camera_name")),1),a(J,G({loading:t(u),variant:"outlined",name:"name",type:"text",density:"compact"},r,{error:i.length>0,"error-messages":c}),null,16,["loading","error","error-messages"])]),_:1},8,["modelValue"])])]),_:1})]),_:1})]),_:1},8,["modelValue"])]),l("div",Tt,[l("span",Pt,m(o.$t("components.form.label.camera_sources")),1),a(N,{modelValue:t(V),"onUpdate:modelValue":e[2]||(e[2]=r=>O(V)?V.value=r:null),class:"inner-component mt-2",multiple:"",variant:"accordion"},{default:n(()=>[(h(!0),k(D,null,B(t(g).sources,(r,c)=>(h(),A(Y,{key:c,value:c+1,elevation:"0",style:Ae(t(H)?"border-radius: 0px !important":"")},{default:n(()=>[a(K,{style:{height:"48px"},class:"truncate"},{actions:n(({expanded:i})=>[l("div",Rt,[a(S,{disabled:t(g).sources.length<2||t(u),size:"22.5",rounded:"",color:"red",variant:"text",class:"mx-2",onClick:_(f=>pe(c),["stop"])},{default:n(()=>[a(y,null,{default:n(()=>[d(m(t(Ee)),1)]),_:1})]),_:2},1032,["disabled","onClick"]),i?(h(),A(y,{key:0,size:"22.5"},{default:n(()=>[d(m(t(Oe)),1)]),_:1})):(h(),A(y,{key:1,size:"22.5"},{default:n(()=>[d(m(t(Ge)),1)]),_:1}))])]),default:n(()=>[d(m(o.$t("views.new_camera.source")+": "+c)+" ",1)]),_:2},1024),a(q,{eager:""},{default:n(()=>[l("div",It,[a(t(C),{modelValue:r.name,"onUpdate:modelValue":i=>r.name=i,name:`sources[${c}].name`},{default:n(({field:i,errorMessage:f,errors:p})=>[l("label",{for:`sources[${c}].name`,class:"v-label"},m(o.$t("components.form.label.source_name")),9,At),a(J,G({loading:t(u),variant:"outlined",name:`sources[${c}].name`,type:"text",density:"compact",ref_for:!0},i,{error:p.length>0,"error-messages":f}),null,16,["loading","name","error","error-messages"])]),_:2},1032,["modelValue","onUpdate:modelValue","name"]),a(t(C),{modelValue:r.roles,"onUpdate:modelValue":i=>r.roles=i,name:`sources[${c}].roles`},{default:n(({field:i,errorMessage:f,errors:p})=>[l("label",{for:`sources[${c}].roles`,class:"v-label"},m(o.$t("components.form.label.source_role")),9,Ct),a(X,G({loading:t(u),items:t(ne).filter(x=>!t(g).sources.some((I,v)=>{var L;return((L=I.roles)==null?void 0:L.includes(x))&&v!==c})),variant:"outlined",name:`sources[${c}].roles`,type:"text",density:"compact",chips:"",multiple:"",clearable:"",ref_for:!0},i,{error:p.length>0,"error-messages":f,"model-value":i.value,onKeydown:_(()=>null,["prevent"])}),{chip:n(({item:x})=>[a(ze,{color:"#df2a4c"},{default:n(()=>[d(m(x.title),1)]),_:2},1024)]),_:2},1040,["loading","items","name","error","error-messages","model-value"])]),_:2},1032,["modelValue","onUpdate:modelValue","name"]),l("label",{for:`sources[${c}].urls[].url`,class:"v-label"},m(o.$t("components.form.label.camera_sources")),9,Ht),(h(!0),k(D,null,B(r.urls,(i,f)=>(h(),k("div",{key:f},[l("div",Vt,[a(t(C),{modelValue:i.protocol,"onUpdate:modelValue":p=>i.protocol=p,name:`sources[${c}].urls[${f}].protocol`},{default:n(({field:p,errors:x,errorMessage:I})=>[a(X,G({loading:t(u),items:t(Ye),"hide-no-data":"","hide-details":"",variant:"outlined",name:`sources[${c}].urls[${f}].protocol`,type:"text",density:"compact",style:{"min-width":"125px","max-width":"125px","min-height":"40px","max-height":"40px"},class:"camera-protocol",ref_for:!0},p,{error:x.length>0,"error-messages":I,"model-value":p.value,onKeydown:_(()=>null,["prevent"]),"onUpdate:modelValue":v=>be(v,i)}),null,16,["loading","items","name","error","error-messages","model-value","onUpdate:modelValue"])]),_:2},1032,["modelValue","onUpdate:modelValue","name"]),a(t(C),{modelValue:i.url,"onUpdate:modelValue":p=>i.url=p,name:`sources[${c}].urls[${f}].url`},{default:n(({field:p,errorMessage:x,errors:I})=>[a(Ne,{modelValue:i.url,"onUpdate:modelValue":[v=>i.url=v,v=>p.value=v],loading:t(u),clearable:"",chips:"",multiple:"",items:$(i.protocol).presets,variant:"outlined",name:`sources[${c}].urls[${f}].url`,type:"text",density:"compact",class:"camera-source",error:I.length>0,"error-messages":x},{"append-inner":n(()=>[r.urls.length>1?(h(),A(S,{key:0,size:"28",variant:"text",rounded:"",density:"compact",color:"red",disabled:r.urls.length<2||t(u),onClick:_(v=>le(c,f),["prevent"])},{default:n(()=>[a(y,{size:"20"},{default:n(()=>[d(m(t(Me)),1)]),_:1})]),_:2},1032,["disabled","onClick"])):Ie("",!0)]),_:2},1032,["modelValue","onUpdate:modelValue","loading","items","name","error","error-messages"])]),_:2},1032,["modelValue","onUpdate:modelValue","name"]),l("div",jt,[a(S,{disabled:!i.protocol||!i.url.length||t(u),color:"#5e5e5e",density:"compact",icon:"",variant:"text",onClick:_(p=>he(i),["prevent"])},{default:n(()=>[a(y,{size:"20"},{default:n(()=>[d(m(t(Ue)),1)]),_:1})]),_:2},1032,["disabled","onClick"]),a(S,{disabled:t(u),color:"#5e5e5e",density:"compact",icon:"",variant:"text",onClick:_(p=>de(i.protocol),["prevent"])},{default:n(()=>[a(y,{size:"20"},{default:n(()=>[d(m(t(Fe)),1)]),_:1})]),_:2},1032,["disabled","onClick"])])])]))),128)),l("div",Et,[a(S,{disabled:t(u),color:"#df2a4c",variant:"flat",onClick:_(i=>me(c),["prevent"])},{default:n(()=>[d(m(o.$t("components.form.button.add_source")),1)]),_:2},1032,["disabled","onClick"])])])]),_:2},1024)]),_:2},1032,["value","style"]))),128))]),_:1},8,["modelValue"]),l("div",Ot,[a(S,{disabled:t(u),variant:"text",color:"#df2a4c",icon:"",onClick:_(ue,["prevent"])},{default:n(()=>[a(y,{size:"30"},{default:n(()=>[d(m(t(z)),1)]),_:1})]),_:1},8,["disabled"])])])])]),_:1},8,["validation-schema","initial-values"]),a(s,{modelValue:t(R),"onUpdate:modelValue":e[4]||(e[4]=r=>O(R)?R.value=r:null),title:o.$t("components.dialog.title.information"),loading:t(u),"hide-confirm-button":""},{content:n(()=>{var r;return[(r=t(j))!=null&&r.md?(h(),k("div",Gt,[l("div",{class:"w-full markdown-body",innerHTML:t(F).render(t(j).md)},null,8,Mt)])):(h(),k("div",Ut,[a(Q,{color:"#df2a4c",indeterminate:""})]))]}),_:1},8,["modelValue","title","loading"]),a(s,{modelValue:t(E),"onUpdate:modelValue":e[5]||(e[5]=r=>O(E)?E.value=r:null),title:o.$t("components.dialog.title.preview"),loading:t(u),"hide-confirm-button":""},{content:n(()=>[!t(T)||t(ce)?(h(),k("div",Ft,[a(Q,{color:"#df2a4c",indeterminate:""})])):(h(),A(b,{key:1,class:"mt-5 inner-component","show-camera-name":"","current-camera":t(T),"border-radius":t(H)?0:3,border:!1,target:"preview","preview-src":t(T),"button-elevation":"1"},null,8,["current-camera","border-radius","preview-src"]))]),_:1},8,["modelValue","title","loading"])],2)}}}),jo=ke($t,[["__scopeId","data-v-d2dfec8d"]]);export{jo as default};
|
|
448
|
+
`,yt={class:"page-title"},xt={class:"window"},kt={class:"subview-title text-color"},St={class:"relative"},Tt={for:"name",class:"v-label"},Pt={class:"mt-5"},Rt={class:"subview-title text-color"},At={class:"flex flex-row items-center justify-center ml-auto"},It={class:"relative w-full flex flex-col"},Ct=["for"],Vt=["for"],Ht=["for"],jt={key:0,class:"w-full flex flex-row justify-center my-1"},Et={class:"ml-2 flex items-center justify-center",style:{"max-height":"44px"}},Ot={class:"w-full flex flex-row justify-center my-1"},Gt={class:"ml-2 flex items-center justify-center",style:{"max-height":"44px"}},Mt={class:"flex items-center ml-auto"},Ut={class:"flex flex-row w-full items-center justify-center mt-3"},$t={key:0,class:"w-full h-full"},Lt=["innerHTML"],Wt={key:1,class:"w-full h-full flex items-center justify-center"},Dt={key:0,class:"w-full h-full flex items-center justify-center"},Bt=Ae({__name:"NewCamera",setup(Ft){A.registerLanguage("typescript",je),A.registerLanguage("yaml",Ee),A.registerLanguage("json",Oe),A.registerLanguage("python",Ge);const{smallMobileActive:H,extraSmallMobileActive:U}=Te(),re=Ne(),W=new xe,ie=v(new Set),ce=v(),le=v(!1),$=v(0),j=v([0]),R=v(),me=v(["high-resolution","mid-resolution","low-resolution","snapshot"]),E=Ie(),C=v(!1),O=v(!1),f=v({disabled:!1,name:"",info:{manufacturer:"",model:"",hardware:"",serialNumber:"",firmwareVersion:"",supportUrl:""},sources:[{name:"",roles:[],urls:[{protocol:"rtsp://",url:[]}]}],recording:{enabled:!1},interface:{streamingMode:"webrtc"},extensions:{hub:[],plugins:[]}}),{mutate:ue,isPending:pe}=W.createCameraQuery(),{mutateAsync:de,isPending:he}=W.previewCameraQuery(),p=Ce(()=>pe.value||le.value),D=Be("commonmark",{highlight(o,t){if(t&&A.getLanguage(t))try{return'<pre><code class="hljs">'+A.highlight(o,{language:t,ignoreIllegals:!0}).value+"</code></pre>"}catch{}return'<pre><code class="hljs">'+D.utils.escapeHtml(o)+"</code></pre>"}});Ve(C,o=>{o||setTimeout(()=>{E.value={presets:[],md:void 0}},300)});const ge=o=>{f.value.sources[o].urls.push({protocol:"rtsp://",url:[]})},fe=(o,t)=>{f.value.sources[o].urls.splice(t,1)},be=()=>{f.value.sources.push({name:"",roles:[],urls:[{protocol:"rtsp://",url:[]}]}),j.value=[f.value.sources.length]},we=o=>{f.value.sources.splice(o,1)},B=o=>{let t,s,b;switch(o){case"bubble://":t=[],s=Object.assign({"../markdowns/bubble.md":et});break;case"dvrip://":t=[],s=Object.assign({"../markdowns/dvrip.md":tt});break;case"echo:":t=[],s=Object.assign({"../markdowns/echo.md":ot});break;case"exec:":t=[],s=Object.assign({"../markdowns/exec.md":at});break;case"expr:":t=[],s=Object.assign({"../markdowns/expr.md":nt});break;case"ffmpeg:":t=se,s=Object.assign({"../markdowns/ffmpeg.md":st});break;case"gopro://":t=se,s=Object.assign({"../markdowns/gopro.md":rt});break;case"hass:":t=[],s=Object.assign({"../markdowns/hass.md":it});break;case"homekit://":t=Je,s=Object.assign({"../markdowns/homekit.md":ct});break;case"http://":case"https://":case"httpx://":case"tcp://":t=Xe,s=Object.assign({"../markdowns/http.md":lt});break;case"isapi://":t=[],s=Object.assign({"../markdowns/isapi.md":mt});break;case"ivideon:":t=[],s=Object.assign({"../markdowns/ivideon.md":ut});break;case"kasa://":t=[],s=Object.assign({"../markdowns/kasa.md":pt});break;case"nest:":t=Qe,s=Object.assign({"../markdowns/nest.md":dt});break;case"onvif://":t=[],s=Object.assign({"../markdowns/onvif.md":ht});break;case"roborock://":t=[],s=Object.assign({"../markdowns/roborock.md":gt});break;case"rtmp://":t=[],s=Object.assign({"../markdowns/rtmp.md":ft});break;case"rtsp://":case"rtspx://":t=qe,s=Object.assign({"../markdowns/rtsp.md":bt});break;case"tapo://":t=[],s=Object.assign({"../markdowns/tapo.md":wt});break;case"webrtc:":t=Ze,s=Object.assign({"../markdowns/webrtc.md":vt});break;case"webtorrent:":t=[],s=Object.assign({"../markdowns/webtorrent.md":_t});break;default:t=[],s=void 0;break}return s&&(b=Object.values(s)[0]),E.value={presets:t,md:b},{presets:t,md:b}},F=o=>{B(o),C.value=!0},ve=async o=>{R.value=void 0,O.value=!0;const t=o.url.join(""),b={url:t.includes(o.protocol)?t:`${o.protocol}${t}`},r=await de({cameraData:b});R.value=r?`data:image/jpeg;base64,${r}`:"ERROR",R.value!=="ERROR"&&ie.value.add(b.url)},_e=o=>({...o,pluginId:"native",type:"camera",isCloud:!1,hasLight:!1,hasSiren:!1,hasBinarySensor:!1,hasBattery:!1,activityZones:[],activitySettings:{motion:{timeout:20},object:{confidence:.7}},frameWorkerSettings:{decoder:"wasm",fps:10,resolution:640},sources:o.sources.map(s=>{let b=s.urls.map(r=>{if(r.url){const c=r.url.join("");return c.includes(r.protocol)?c:`${r.protocol}${c}`}}).filter(Boolean);return{_id:"",...s,urls:b}})}),ye=o=>{const{isLoading:t}=De(0,{parent:".topbar"});t.value=!0;let s=_e(o);ue({cameraData:s},{onSuccess:async()=>{t.value=!1,await ze(500),re.push({path:"/cameras"})}})},z=(o,t)=>{t.protocol=o};return(o,t)=>{const s=Pe,b=Se;return d(),k("main",{class:Y(["w-full h-full",{"px-0":e(H)}])},[n(e(Fe),{ref_key:"cameraVeeForm",ref:ce,class:"firststeps-form flex flex-col h-full w-full","validation-schema":e(ke),"initial-values":e(f),onSubmit:t[3]||(t[3]=r=>ye(r))},{default:a(()=>[u("div",{class:Y(["mb-3 flex items-center",{"mx-2":e(H)}]),style:{height:"30px"}},[u("h1",yt,l(o.$t("views.new_camera.title")),1),n(S,{loading:e(p),variant:"text",color:"green",type:"submit",class:"ml-auto"},{default:a(()=>[n(x,{size:"15",class:"mr-1"},{default:a(()=>[h(l(e(J)),1)]),_:1}),h(" "+l(o.$t("components.form.button.add")),1)]),_:1},8,["loading"])],2),u("div",xt,[u("div",null,[u("span",kt,l(o.$t("components.form.label.camera")),1),n(Q,{modelValue:e($),"onUpdate:modelValue":t[1]||(t[1]=r=>G($)?$.value=r:null),class:"inner-component mt-2"},{default:a(()=>[n(Z,{elevation:"0",value:1},{default:a(()=>[n(ee,{style:{height:"48px"},class:"truncate"},{default:a(()=>[h(l(o.$t("views.new_camera.camera")),1)]),_:1}),n(te,{eager:""},{default:a(()=>[u("div",St,[n(e(I),{modelValue:e(f).name,"onUpdate:modelValue":t[0]||(t[0]=r=>e(f).name=r),name:"name"},{default:a(({field:r,errorMessage:c,errors:i})=>[u("label",Tt,l(o.$t("components.form.label.camera_name")),1),n(oe,V({loading:e(p),variant:"outlined",name:"name",type:"text",density:"compact"},r,{error:i.length>0,"error-messages":c}),null,16,["loading","error","error-messages"])]),_:1},8,["modelValue"])])]),_:1})]),_:1})]),_:1},8,["modelValue"])]),u("div",Pt,[u("span",Rt,l(o.$t("components.form.label.camera_sources")),1),n(Q,{modelValue:e(j),"onUpdate:modelValue":t[2]||(t[2]=r=>G(j)?j.value=r:null),class:"inner-component mt-2",multiple:"",variant:"accordion"},{default:a(()=>[(d(!0),k(K,null,q(e(f).sources,(r,c)=>(d(),P(Z,{key:c,value:c+1,elevation:"0",style:He(e(H)?"border-radius: 0px !important":"")},{default:a(()=>[n(ee,{style:{height:"48px"},class:"truncate"},{actions:a(({expanded:i})=>[u("div",At,[n(S,{disabled:e(f).sources.length<2||e(p),size:"22.5",rounded:"",color:"red",variant:"text",class:"mx-2",onClick:_(g=>we(c),["stop"])},{default:a(()=>[n(x,null,{default:a(()=>[h(l(e(Me)),1)]),_:1})]),_:2},1032,["disabled","onClick"]),i?(d(),P(x,{key:0,size:"22.5"},{default:a(()=>[h(l(e(Ue)),1)]),_:1})):(d(),P(x,{key:1,size:"22.5"},{default:a(()=>[h(l(e($e)),1)]),_:1}))])]),default:a(()=>[h(l(o.$t("views.new_camera.source")+": "+c)+" ",1)]),_:2},1024),n(te,{eager:""},{default:a(()=>[u("div",It,[n(e(I),{modelValue:r.name,"onUpdate:modelValue":i=>r.name=i,name:`sources[${c}].name`},{default:a(({field:i,errorMessage:g,errors:m})=>[u("label",{for:`sources[${c}].name`,class:"v-label"},l(o.$t("components.form.label.source_name")),9,Ct),n(oe,V({loading:e(p),variant:"outlined",name:`sources[${c}].name`,type:"text",density:"compact",ref_for:!0},i,{error:m.length>0,"error-messages":g}),null,16,["loading","name","error","error-messages"])]),_:2},1032,["modelValue","onUpdate:modelValue","name"]),n(e(I),{modelValue:r.roles,"onUpdate:modelValue":i=>r.roles=i,name:`sources[${c}].roles`},{default:a(({field:i,errorMessage:g,errors:m})=>[u("label",{for:`sources[${c}].roles`,class:"v-label"},l(o.$t("components.form.label.source_role")),9,Vt),n(L,V({loading:e(p),items:e(me).filter(y=>!e(f).sources.some((T,w)=>{var N;return((N=T.roles)==null?void 0:N.includes(y))&&w!==c})),variant:"outlined",name:`sources[${c}].roles`,type:"text",density:"compact",chips:"",multiple:"",clearable:"",ref_for:!0},i,{error:m.length>0,"error-messages":g,"model-value":i.value,onKeydown:_(()=>null,["prevent"])}),{chip:a(({item:y})=>[n(Ye,{color:"#df2a4c"},{default:a(()=>[h(l(y.title),1)]),_:2},1024)]),_:2},1040,["loading","items","name","error","error-messages","model-value"])]),_:2},1032,["modelValue","onUpdate:modelValue","name"]),u("label",{for:`sources[${c}].urls[].url`,class:"v-label"},l(o.$t("components.form.label.camera_sources")),9,Ht),(d(!0),k(K,null,q(r.urls,(i,g)=>(d(),k("div",{key:g},[e(U)?(d(),k("div",jt,[n(e(I),{modelValue:i.protocol,"onUpdate:modelValue":m=>i.protocol=m,name:`sources[${c}].urls[${g}].protocol`},{default:a(({field:m,errors:y,errorMessage:T})=>[n(L,V({loading:e(p),items:e(ne),"hide-no-data":"","hide-details":"",variant:"outlined",name:`sources[${c}].urls[${g}].protocol`,type:"text",density:"compact",class:"camera-protocol",ref_for:!0},m,{error:y.length>0,"error-messages":T,"model-value":m.value,onKeydown:_(()=>null,["prevent"]),"onUpdate:modelValue":w=>z(w,i)}),null,16,["loading","items","name","error","error-messages","model-value","onUpdate:modelValue"])]),_:2},1032,["modelValue","onUpdate:modelValue","name"]),u("div",Et,[n(S,{disabled:e(p),color:"#5e5e5e",density:"compact",icon:"",variant:"text",onClick:_(m=>F(i.protocol),["prevent"])},{default:a(()=>[n(x,{size:"20"},{default:a(()=>[h(l(e(X)),1)]),_:1})]),_:2},1032,["disabled","onClick"])])])):M("",!0),u("div",Ot,[e(U)?M("",!0):(d(),P(e(I),{key:0,modelValue:i.protocol,"onUpdate:modelValue":m=>i.protocol=m,name:`sources[${c}].urls[${g}].protocol`},{default:a(({field:m,errors:y,errorMessage:T})=>[n(L,V({loading:e(p),items:e(ne),"hide-no-data":"","hide-details":"",variant:"outlined",name:`sources[${c}].urls[${g}].protocol`,type:"text",density:"compact",style:{"min-width":"125px","max-width":"125px","min-height":"40px","max-height":"40px"},class:"camera-protocol",ref_for:!0},m,{error:y.length>0,"error-messages":T,"model-value":m.value,onKeydown:_(()=>null,["prevent"]),"onUpdate:modelValue":w=>z(w,i)}),null,16,["loading","items","name","error","error-messages","model-value","onUpdate:modelValue"])]),_:2},1032,["modelValue","onUpdate:modelValue","name"])),n(e(I),{modelValue:i.url,"onUpdate:modelValue":m=>i.url=m,name:`sources[${c}].urls[${g}].url`},{default:a(({field:m,errorMessage:y,errors:T})=>[n(Ke,{modelValue:i.url,"onUpdate:modelValue":[w=>i.url=w,w=>m.value=w],loading:e(p),clearable:"",chips:"",multiple:"",items:B(i.protocol).presets,variant:"outlined",name:`sources[${c}].urls[${g}].url`,type:"text",density:"compact",class:"camera-source",error:T.length>0,"error-messages":y},{"append-inner":a(()=>[r.urls.length>1?(d(),P(S,{key:0,size:"28",variant:"text",rounded:"",density:"compact",color:"red",disabled:r.urls.length<2||e(p),onClick:_(w=>fe(c,g),["prevent"])},{default:a(()=>[n(x,{size:"20"},{default:a(()=>[h(l(e(Le)),1)]),_:1})]),_:2},1032,["disabled","onClick"])):M("",!0)]),_:2},1032,["modelValue","onUpdate:modelValue","loading","items","name","error","error-messages"])]),_:2},1032,["modelValue","onUpdate:modelValue","name"]),u("div",Gt,[n(S,{disabled:!i.protocol||!i.url.length||e(p),color:"#5e5e5e",density:"compact",icon:"",variant:"text",onClick:_(m=>ve(i),["prevent"])},{default:a(()=>[n(x,{size:"20"},{default:a(()=>[h(l(e(We)),1)]),_:1})]),_:2},1032,["disabled","onClick"]),e(U)?M("",!0):(d(),P(S,{key:0,disabled:e(p),color:"#5e5e5e",density:"compact",icon:"",variant:"text",onClick:_(m=>F(i.protocol),["prevent"])},{default:a(()=>[n(x,{size:"20"},{default:a(()=>[h(l(e(X)),1)]),_:1})]),_:2},1032,["disabled","onClick"]))])])]))),128)),u("div",Mt,[n(S,{disabled:e(p),color:"#df2a4c",variant:"flat",onClick:_(i=>ge(c),["prevent"])},{default:a(()=>[h(l(o.$t("components.form.button.add_source")),1)]),_:2},1032,["disabled","onClick"])])])]),_:2},1024)]),_:2},1032,["value","style"]))),128))]),_:1},8,["modelValue"]),u("div",Ut,[n(S,{disabled:e(p),variant:"text",color:"#df2a4c",icon:"",onClick:_(be,["prevent"])},{default:a(()=>[n(x,{size:"30"},{default:a(()=>[h(l(e(J)),1)]),_:1})]),_:1},8,["disabled"])])])])]),_:1},8,["validation-schema","initial-values"]),n(s,{modelValue:e(C),"onUpdate:modelValue":t[4]||(t[4]=r=>G(C)?C.value=r:null),title:o.$t("components.dialog.title.information"),loading:e(p),"hide-confirm-button":""},{content:a(()=>{var r;return[(r=e(E))!=null&&r.md?(d(),k("div",$t,[u("div",{class:"w-full markdown-body",innerHTML:e(D).render(e(E).md)},null,8,Lt)])):(d(),k("div",Wt,[n(ae,{color:"#df2a4c",indeterminate:""})]))]}),_:1},8,["modelValue","title","loading"]),n(s,{modelValue:e(O),"onUpdate:modelValue":t[5]||(t[5]=r=>G(O)?O.value=r:null),title:o.$t("components.dialog.title.preview"),loading:e(p),"hide-confirm-button":""},{content:a(()=>[!e(R)||e(he)?(d(),k("div",Dt,[n(ae,{color:"#df2a4c",indeterminate:""})])):(d(),P(b,{key:1,class:"mt-5 inner-component","show-camera-name":"","current-camera":e(R),"border-radius":e(H)?0:3,border:!1,target:"preview","preview-src":e(R),"button-elevation":"1"},null,8,["current-camera","border-radius","preview-src"]))]),_:1},8,["modelValue","title","loading"])],2)}}}),Go=Re(Bt,[["__scopeId","data-v-65da19aa"]]);export{Go as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
div[data-v-65da19aa] .v-expansion-panel-title__overlay,div[data-v-65da19aa] .v-expansion-panel__shadow{background:var(--background-inner-component);border-radius:4px;border:1px solid var(--border-card);box-shadow:none!important}@media screen and (max-width: 639px){div[data-v-65da19aa] .v-expansion-panel-title__overlay,div[data-v-65da19aa] .v-expansion-panel__shadow{border-radius:0}}.new-source-container[data-v-65da19aa]{padding:1rem;background:rgba(var(--color-rgb),.04);border-radius:10px}.camera-protocol[data-v-65da19aa] .v-input__prepend,.camera-source[data-v-65da19aa] .v-input__prepend{margin:0!important}.camera-protocol[data-v-65da19aa] .v-field{border-radius:4px 0 0 4px/4px 0px 0px 4px!important}.camera-source[data-v-65da19aa] .v-field{border-top-left-radius:0;border-bottom-left-radius:0}.camera-source[data-v-65da19aa] .v-input__append{margin-left:5px}.window[data-v-65da19aa]{min-height:calc(100% - 36px)}
|