push-427c5fc5.js 3.7 KB

1
  1. import{f as t,E as n,d as w,X as D,a6 as E,Z as a,u as o,F}from"./vue-fae2b924.js";import{a0 as i,aa as P,aV as c,aW as B,aG as M,U as m,M as R}from"./radical-e583b742.js";import{V as x,k as T,x as A}from"./index-7a259168.js";import{u as L}from"./index-ac72395e.js";import{q as V,a as $,e as z}from"./schema-ef6bcc49.js";import{u as h}from"./useAddPushForm-9b5ed18d.js";import{u as H}from"./global-f6e5c3a3.js";import{u as I}from"./usePlay-2edeeb77.js";import"./index-3ee11f11.js";import"./jb4-52644b2c.js";import"./canvas-14fb4930.js";import"./gb28181-c1c04a54.js";const U={0:t("span",null,[t(i,{icon:"mdi:lan-disconnect",class:"v-text-bottom mr-8px"},null),n("离线")]),1:t("span",null,[t(i,{icon:"mdi:lan-connect",class:"v-text-bottom mr-8px"},null),n("在线")]),2:t("span",null,[t(i,{icon:"svg-spinners:3-dots-fade",class:"v-text-bottom mr-8px"},null),n("推流")]),3:t("span",null,[t(i,{icon:"nimbus:forbidden",class:"v-text-bottom mr-8px"},null),n("禁用")])},y={0:t("span",null,[t(i,{icon:"line-md:beer-loop",class:"v-text-bottom mr-8px"},null),n("等待发布后转推")]),1:t("span",null,[t(i,{icon:"line-md:compass-loop",class:"v-text-bottom mr-8px"},null),n("按需拉流后转推")])},W=u=>U[u],q=u=>u?y[1]:y[0],K=w({name:"StreamProxy"}),nt=w({...K,setup(u){x.renderer.add("DeviceStatus",{renderDefault(e,l){const{row:s}=l;return W(s.status)}}),x.renderer.add("PushOnStart",{renderDefault(e,l){const{row:s}=l;return q(s.pushOnStart)}});const{pause:d,resume:p}=H(r),v=()=>{h({updateList:r,pause:d,resume:p})},{FormilyForm:g}=P({schema:V(v,"添加推流代理")}),_={toggleRowExpand:({expanded:e})=>{e?d():p()}},f=L(),b=e=>{f.tableRef.reloadData(e||[])};function r(){return $().then(e=>{b(e)}).catch(e=>{console.error(`stream-proxy-getList-error: ${e}`)})}r();const O=e=>{R.confirm({title:"提示",content:"确定要删除吗?",onOk:()=>{z(e).then(r)}})},C=e=>{h({updateList:r,pause:d,resume:p,row:e})},S={maxHeight:"100%",rowConfig:{keyField:"ID",useKey:!0},columnConfig:{useKey:!0},columns:[{field:"name",title:"名称",showOverflow:"tooltip",width:"200px",fixed:"left",type:"html"},{field:"streamPath",title:"流标识",showOverflow:"tooltip",width:"200px",fixed:"left",type:"html"},{field:"pushURL",title:"推流地址",showOverflow:"tooltip",minWidth:"250px",type:"html"},{field:"type",title:"类型",showOverflow:"tooltip",width:"80px",fixed:"left",type:"html"},{field:"status",title:"状态",showOverflow:"tooltip",width:"80px",fixed:"left",cellRender:{name:"DeviceStatus"}},{field:"rtt",title:"RTT",showOverflow:"tooltip",width:"60px",fixed:"left"},{field:"pushOnStart",title:"推流模式",showOverflow:"tooltip",width:"150px",cellRender:{name:"PushOnStart"}},{field:"createTime",title:"创建时间",width:"200px",formatter:({cellValue:e})=>A.toDateString(new Date(e),"yyyy-MM-dd HH:mm:ss")},{field:"operate",title:"操作",width:"180px",fixed:"right",align:"center",slots:{default:"operate"}}],data:[]};return(e,l)=>(D(),E(F,null,[t(o(c),{bordered:!1,bodyStyle:{padding:"10px",marginBottom:"8px"}},{default:a(()=>[t(o(g))]),_:1}),t(o(c),{bordered:!1,bodyStyle:{padding:"10px",height:"calc(100% - 50px)"},style:{height:"calc(100% - 100px)"}},{default:a(()=>[t(o(B),{windowWidth:1716}),t(o(T),{uid:o(f).uid,gridOptions:S,gridEvent:_},{operate:a(({row:s})=>[t(o(M),null,{default:a(()=>[t(o(m),{size:"small",type:"link",onClick:()=>(o(I)({path:s.streamPath},{onClose:o(p)}),o(d)())},{default:a(()=>l[0]||(l[0]=[n(" 播放 ")])),_:2},1032,["onClick"]),t(o(m),{size:"small",type:"link",onClick:k=>C(s)},{default:a(()=>l[1]||(l[1]=[n(" 编辑 ")])),_:2},1032,["onClick"]),t(o(m),{size:"small",type:"link",onClick:k=>O(s)},{default:a(()=>l[2]||(l[2]=[n(" 删除 ")])),_:2},1032,["onClick"])]),_:2},1024)]),_:1},8,["uid"])]),_:1})],64))}});export{nt as default};