| 12 |
- import{d as T,b5 as F,b6 as k,r as I,ap as M,Z as h,$ as b,a0 as a,T as e,b$ as V,aC as H,n as o,bi as K,a5 as m,a6 as n,a7 as d,b3 as x,a1 as W,a3 as X,aP as c,a2 as q,a9 as G,b8 as Z,bn as w,dS as y,b9 as C,cf as j,bp as A,cF as J}from"./index-8a67e3df.js";import{u as Q}from"./index-c6560d80.js";import"./dayjs-919e6097.js";import{_ as Y}from"./scroll-tip.vue_vue_type_script_setup_true_lang-ad39136f.js";import{s as ee}from"./mp4-0d5b1f75.js";import{g as S}from"./utils-cec4b140.js";import{s as te}from"./state-f52d1a34.js";import{u as re}from"./usePlay-e0a28163.js";import{L as se,a as ae}from"./index-b1cfe141.js";import{_ as g}from"./index-66456a53.js";import{F as oe}from"./Form-dde1bdea.js";import{_ as v}from"./FormItem-52c83ce9.js";import"./index-6c00bb26.js";import"./index-82d2c624.js";import"./index-1e695827.js";import"./jb4-5138f1a1.js";import"./canvas-2aaf4e1d.js";import"./index-6a257713.js";import"./gb28181-a8ace5d9.js";import"./index-4c0c9569.js";import"./index-a5661619.js";import"./toInteger-9a80771f.js";const le={style:{padding:"16px"}},ie=T({name:"StreamPush"}),Re=T({...ie,setup(ne){const{t:r}=H(),{pause:$,resume:O}=F(p);k.renderer.add("State",{renderDefault(s,i){const{row:t}=i;return te[t.state]}}),k.renderer.add("BPS",{renderDefault(s,i){const{row:t}=i;let u=0,f=0;return t.audioTrack&&(u=t.audioTrack.bps,f=t.audioTrack.bpsOut),t.videoTrack&&(u+=t.videoTrack.bps,f+=t.videoTrack.bpsOut),`↑${S(u)} ↓${S(f)}`}});const P=Q(),D=s=>{s.length>1&&(s=s.sort((i,t)=>Date.parse(i.startTime)-Date.parse(t.startTime))),P.tableRef.reloadData(s)};async function p(){D(await V())}p();const l=I({visible:!1,form:{streamPath:"",filePath:"records",hours:0,minutes:1,seconds:0}});function R(s){P.tableRef.toggleRowExpand(s)}function _(s){l.form.streamPath=s.path,l.visible=!0}async function B(){try{const s=`${l.form.hours}h${l.form.minutes}m${l.form.seconds}s`;await ee({streamPath:l.form.streamPath,filePath:l.form.filePath,type:"mp4",fragment:s}),l.visible=!1,p()}catch(s){console.error(r("routes.streamPush.录制失败"),s)}}async function E(s){try{await j(s),p()}catch(i){console.error(r("routes.streamPush.停止录制失败"),i)}}const L={maxHeight:"100%",rowConfig:{keyField:"path",useKey:!0},expandConfig:{expandRowKeys:[],accordion:!1,lazy:!1},columnConfig:{useKey:!0},columns:[{field:"pluginName",get title(){return r("routes.streamPush.所属插件")},width:"100px"},{field:"path",get title(){return r("routes.streamPush.流标识")},showOverflow:"tooltip",minWidth:"150px"},{field:"audioTrack",get title(){return r("routes.streamPush.音频")},width:"60px",formatter:({cellValue:s})=>s?.codec},{field:"videoTrack",get title(){return r("routes.streamPush.视频")},width:"60px",formatter:({cellValue:s})=>s?.codec},{field:"state",get title(){return r("routes.streamPush.状态")},showOverflow:"tooltip",cellRender:{name:"State"},width:"120px"},{field:"type",get title(){return r("routes.streamPush.类型")},width:"80px",showOverflow:"tooltip"},{field:"subscribers",get title(){return r("routes.streamPush.订阅")},showOverflow:"tooltip",width:"50px"},{field:"startTime",get title(){return r("routes.streamPush.创建时间")},width:"180px",formatter:({cellValue:s})=>A.toDateString(new Date(s),"yyyy-MM-dd HH:mm:ss")},{field:"BPS",title:"BPS",cellRender:{name:"BPS"}},{field:"recording",get title(){return r("routes.streamPush.录制")},width:"50px",align:"center",slots:{default:"recording",content:"recordingExpand"}},{field:"operate",get title(){return r("routes.streamPush.操作")},width:"170px",align:"center",slots:{default:"operate"}}],data:[]},U=s=>{C.confirm({title:r("routes.streamPush.提示"),content:`${r("routes.streamPush.此操作将停止")} ${s.path}${r("routes.streamPush.是否继续")}`,onOk:async()=>{await J(s.path),p()}})},z=M(),N=s=>{z({name:"StreamPushDetail",query:{path:s}})};return(s,i)=>(h(),b(e(x),{bordered:!1,bodyStyle:{padding:"10px",height:"100%"},style:{height:"calc(100% - 100px)"}},{default:a(()=>[o(e(Y),{windowWidth:1716}),o(e(Z),{uid:e(P).uid,gridOptions:L},{recording:a(({row:t})=>[o(e(K),{color:t.recording.length>0?"blue":"",style:{cursor:"pointer"},onClick:u=>t.recording.length>0?R(t):_(t)},{default:a(()=>[m(n(t.recording.length||0),1)]),_:2},1032,["color","onClick"])]),recordingExpand:a(({row:t})=>[d("div",le,[o(e(g),{direction:"vertical",style:{width:"100%"}},{default:a(()=>[t.recording.length?(h(),b(e(x),{key:0,size:"small",bordered:!1},{title:a(()=>[m(n(e(r)("routes.streamPush.录制列表")),1)]),default:a(()=>[o(e(se),null,{default:a(()=>[(h(!0),W(q,null,X(t.recording,(u,f)=>(h(),b(e(ae),{key:f},{default:a(()=>[o(e(g),null,{default:a(()=>[d("span",null,n(e(r)("routes.streamPush.文件路径"))+": "+n(u.filePath),1),d("span",null,n(e(r)("routes.streamPush.片段时长"))+": "+n(u.fragment),1),o(e(c),{type:"link",danger:"",onClick:()=>E(t.pointer)},{default:a(()=>[m(n(e(r)("routes.streamPush.停止")),1)]),_:2},1032,["onClick"])]),_:2},1024)]),_:2},1024))),128))]),_:2},1024)]),_:2},1024)):G("",!0),o(e(c),{type:"primary",onClick:()=>_(t)},{default:a(()=>[m(n(e(r)("routes.streamPush.新增录制")),1)]),_:2},1032,["onClick"])]),_:2},1024)])]),operate:a(({row:t})=>[o(e(g),null,{default:a(()=>[o(e(c),{size:"small",type:"link",onClick:()=>(e(re)({path:t.path,type:t.type},{onClose:e(O)}),e($)())},{default:a(()=>[m(n(e(r)("routes.streamPush.播放")),1)]),_:2},1032,["onClick"]),o(e(c),{size:"small",type:"link",onClick:()=>N(t.path)},{default:a(()=>[m(n(e(r)("routes.streamPush.详情")),1)]),_:2},1032,["onClick"]),o(e(c),{size:"small",type:"link",onClick:()=>U(t)},{default:a(()=>[m(n(e(r)("routes.streamPush.停止")),1)]),_:2},1032,["onClick"])]),_:2},1024)]),_:1},8,["uid"]),o(e(C),{visible:l.visible,"onUpdate:visible":i[5]||(i[5]=t=>l.visible=t),title:e(r)("routes.streamPush.录制设置"),onOk:B,onCancel:i[6]||(i[6]=t=>l.visible=!1)},{default:a(()=>[o(e(oe),{model:l.form,layout:"vertical"},{default:a(()=>[o(e(v),{label:e(r)("routes.streamPush.流路径")},{default:a(()=>[o(e(w),{value:l.form.streamPath,"onUpdate:value":i[0]||(i[0]=t=>l.form.streamPath=t),disabled:""},null,8,["value"])]),_:1},8,["label"]),o(e(v),{label:e(r)("routes.streamPush.文件路径")},{default:a(()=>[o(e(w),{value:l.form.filePath,"onUpdate:value":i[1]||(i[1]=t=>l.form.filePath=t),placeholder:e(r)("routes.streamPush.请输入保存文件路径")},null,8,["value","placeholder"])]),_:1},8,["label"]),o(e(v),{label:e(r)("routes.streamPush.片段时长")},{default:a(()=>[o(e(g),null,{default:a(()=>[o(e(y),{value:l.form.hours,"onUpdate:value":i[2]||(i[2]=t=>l.form.hours=t),min:0,max:23,placeholder:e(r)("routes.streamPush.时"),style:{width:"80px"}},null,8,["value","placeholder"]),d("span",null,n(e(r)("routes.streamPush.时")),1),o(e(y),{value:l.form.minutes,"onUpdate:value":i[3]||(i[3]=t=>l.form.minutes=t),min:0,max:59,placeholder:e(r)("routes.streamPush.分"),style:{width:"80px"}},null,8,["value","placeholder"]),d("span",null,n(e(r)("routes.streamPush.分")),1),o(e(y),{value:l.form.seconds,"onUpdate:value":i[4]||(i[4]=t=>l.form.seconds=t),min:0,max:59,placeholder:e(r)("routes.streamPush.秒"),style:{width:"80px"}},null,8,["value","placeholder"]),d("span",null,n(e(r)("routes.streamPush.秒")),1)]),_:1})]),_:1},8,["label"])]),_:1},8,["model"])]),_:1},8,["visible","title"])]),_:1}))}});export{Re as default};
- //# sourceMappingURL=index-0533574b.js.map
|