| 12 |
- import{b as bt,d as Y,F as wt,p as ie,bN as kt,o as Ae,J as Pt,c as L,bO as Ct,bj as $t,be as Xe,u as St,f as de,bP as Tt,bQ as Lt,v as Rt,m as It,k as Ot,n as o,bR as zt,bS as Dt,aK as Ve,P as we,bT as Bt,bU as Ze,bV as Mt,aQ as V,bW as jt,K as Ft,a$ as Ne,aC as Q,bp as te,bX as be,a5 as U,bm as je,ba as X,aB as Ce,Y as Oe,Q as ye,b6 as ce,ap as lt,h as Se,bf as rt,Z as O,a1 as W,T as t,$ as E,a0 as h,bY as Fe,b8 as Ht,bZ as At,b_ as Vt,a7 as u,a6 as b,aH as ve,a8 as le,aI as Nt,b4 as ae,bu as Et,bc as ue,bx as Ut,by as Yt,bz as qt,at as it,b$ as _e,a9 as he,c0 as Wt,bA as Te,c1 as Ee,bl as pe,bs as Le,c2 as ut,c3 as xe,c4 as ke,bh as ge,N as ct,C as Kt,a2 as dt,a3 as Gt,br as et,c5 as Qt,bE as mt,bg as Jt,aG as Xt,b0 as Zt,bo as eo,c6 as re,S as to,b1 as oo}from"./index-a8341fa1.js";import{c as q,d as J,a as so,b as ao}from"./vue-flow-background-c4c69975.js";import{c as Pe,d as Z}from"./dayjs-919e6097.js";import{_ as pt}from"./index.vue_vue_type_script_setup_true_lang-92c2842a.js";import{g as no,a as lo}from"./logrotate-962a0737.js";import{S as ro}from"./state-26d8a911.js";import{s as io}from"./schema-df7fda46.js";import{s as uo}from"./tree-title-9b5dcfdd.js";import{g as co}from"./utils-33f6b1e4.js";import{M as mo}from"./index-93635277.js";import{u as ze}from"./system-16e5b9dc.js";import{g as po,a as ho}from"./schema-20900b78.js";import{d as fo,u as vo}from"./pullOnStart-9eaa98c6.js";import"./index-298cfc47.js";import{F as ee}from"./Form-49be2713.js";import{V as go}from"./jb4-7b5b6ba3.js";import{u as _o}from"./useAddPushForm-9a86d03d.js";import{d as yo,g as ht,a as Re}from"./mp4-7619c526.js";import{D as xo}from"./DownloadOutlined-3b02c5ed.js";import{V as bo}from"./VideoPlayer-73dea695.js";import{a as wo}from"./useHeaderSetting-84b59528.js";import"./stream-type-63b6e1e6.js";import"./FormItem-0af405a4.js";import"./toInteger-461bf1e0.js";import"./canvas-b3f2b616.js";import"./index-04d608f8.js";var ko=["placement","overlayClassName"],Po=function(){return ie(ie({},Bt()),{},{prefixCls:String,content:we.any,title:we.any,okType:{type:String,default:"primary"},disabled:{type:Boolean,default:!1},okText:we.any,cancelText:we.any,icon:we.any,okButtonProps:{type:Object,default:void 0},cancelButtonProps:{type:Object,default:void 0},showCancel:{type:Boolean,default:!0},onConfirm:Function,onCancel:Function})},Co=Y({compatConfig:{MODE:3},name:"APopconfirm",props:wt(Po(),ie(ie({},kt()),{},{trigger:"click",transitionName:"zoom-big",placement:"top",mouseEnterDelay:.1,mouseLeaveDelay:.1,arrowPointAtCenter:!1,autoAdjustOverflow:!0,okType:"primary",disabled:!1})),slots:["title","content","okText","icon","cancelText","cancelButton","okButton"],emits:["update:visible","visibleChange"],setup:function(e,i){var a=i.slots,c=i.emit,p=i.expose;Ae(function(){Pt(e.defaultVisible===void 0,"Popconfirm","'defaultVisible' is deprecated, please use 'v-model:visible'")});var R=L();p({getPopupDomNode:function(){var D,H;return(D=R.value)===null||D===void 0||(H=D.getPopupDomNode)===null||H===void 0?void 0:H.call(D)}});var $=Ct(!1,{value:$t(e,"visible"),defaultValue:e.defaultVisible}),z=Xe($,2),d=z[0],B=z[1],T=function(D,H){e.visible===void 0&&B(D),c("update:visible",D),c("visibleChange",D,H)},v=function(D){T(!1,D)},k=function(D){var H;return(H=e.onConfirm)===null||H===void 0?void 0:H.call(e,D)},P=function(D){var H;T(!1,D),(H=e.onCancel)===null||H===void 0||H.call(e,D)},m=function(D){D.keyCode===Ft.ESC&&d&&T(!1,D)},w=function(D){var H=e.disabled;H||T(D)},C=St("popconfirm",e),s=C.prefixCls,n=C.getPrefixCls,r=de(function(){return n()}),f=de(function(){return n("popover")}),S=de(function(){return n("btn")}),M=Tt("Popconfirm",Lt.Popconfirm),F=Xe(M,1),j=F[0],K=function(){var D,H,oe,se,ne=e.okButtonProps,I=e.cancelButtonProps,A=e.title,G=A===void 0?(D=a.title)===null||D===void 0?void 0:D.call(a):A,fe=e.cancelText,y=fe===void 0?(H=a.cancel)===null||H===void 0?void 0:H.call(a):fe,g=e.okText,x=g===void 0?(oe=a.okText)===null||oe===void 0?void 0:oe.call(a):g,_=e.okType,We=e.icon,gt=We===void 0?(se=a.icon)===null||se===void 0?void 0:se.call(a):We,Ke=e.showCancel,_t=Ke===void 0?!0:Ke,Ge=a.cancelButton,Qe=a.okButton,Je=ie({onClick:P,size:"small"},I),yt=ie(ie({onClick:k},Ze(_)),{},{size:"small"},ne);return o("div",{class:"".concat(f.value,"-inner-content")},[o("div",{class:"".concat(f.value,"-message")},[gt||o(Mt,null,null),o("div",{class:"".concat(f.value,"-message-title")},[G])]),o("div",{class:"".concat(f.value,"-buttons")},[_t?Ge?Ge(Je):o(V,Je,{default:function(){return[y||j.value.cancelText]}}):null,Qe?Qe(yt):o(jt,{buttonProps:ie(ie({size:"small"},Ze(_)),ne),actionFn:k,close:v,prefixCls:S.value,quitOnNullishReturnValue:!0,emitEvent:!0},{default:function(){return[x||j.value.okText]}})])])};return function(){var N,D=e.placement,H=e.overlayClassName,oe=Rt(e,ko),se=It(oe,["title","content","cancelText","okText","onUpdate:visible","onConfirm","onCancel"]),ne=Ot(s.value,H);return o(Ve,ie(ie({},se),{},{prefixCls:f.value,placement:D,onVisibleChange:w,visible:d.value,overlayClassName:ne,transitionName:Dt(r.value,"zoom-big",e.transitionName),ref:R}),{default:function(){return[zt(((N=a.default)===null||N===void 0?void 0:N.call(a))||[],{onKeydown:function(G){m(G)}},!1)]},title:K})}}});const $o=bt(Co);var So={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M909.3 506.3L781.7 405.6a7.23 7.23 0 00-11.7 5.7V476H548V254h64.8c6 0 9.4-7 5.7-11.7L517.7 114.7a7.14 7.14 0 00-11.3 0L405.6 242.3a7.23 7.23 0 005.7 11.7H476v222H254v-64.8c0-6-7-9.4-11.7-5.7L114.7 506.3a7.14 7.14 0 000 11.3l127.5 100.8c4.7 3.7 11.7.4 11.7-5.7V548h222v222h-64.8c-6 0-9.4 7-5.7 11.7l100.8 127.5c2.9 3.7 8.5 3.7 11.3 0l100.8-127.5c3.7-4.7.4-11.7-5.7-11.7H548V548h222v64.8c0 6 7 9.4 11.7 5.7l127.5-100.8a7.3 7.3 0 00.1-11.4z"}}]},name:"drag",theme:"outlined"};const To=So;function tt(l){for(var e=1;e<arguments.length;e++){var i=arguments[e]!=null?Object(arguments[e]):{},a=Object.keys(i);typeof Object.getOwnPropertySymbols=="function"&&(a=a.concat(Object.getOwnPropertySymbols(i).filter(function(c){return Object.getOwnPropertyDescriptor(i,c).enumerable}))),a.forEach(function(c){Lo(l,c,i[c])})}return l}function Lo(l,e,i){return e in l?Object.defineProperty(l,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):l[e]=i,l}var Ue=function(e,i){var a=tt({},e,i.attrs);return o(Ne,tt({},a,{icon:To}),null)};Ue.displayName="DragOutlined";Ue.inheritAttrs=!1;const Ro=Ue;var Io={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M623.6 316.7C593.6 290.4 554 276 512 276s-81.6 14.5-111.6 40.7C369.2 344 352 380.7 352 420v7.6c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V420c0-44.1 43.1-80 96-80s96 35.9 96 80c0 31.1-22 59.6-56.1 72.7-21.2 8.1-39.2 22.3-52.1 40.9-13.1 19-19.9 41.8-19.9 64.9V620c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8v-22.7a48.3 48.3 0 0130.9-44.8c59-22.7 97.1-74.7 97.1-132.5.1-39.3-17.1-76-48.3-103.3zM472 732a40 40 0 1080 0 40 40 0 10-80 0z"}}]},name:"question-circle",theme:"outlined"};const Oo=Io;function ot(l){for(var e=1;e<arguments.length;e++){var i=arguments[e]!=null?Object(arguments[e]):{},a=Object.keys(i);typeof Object.getOwnPropertySymbols=="function"&&(a=a.concat(Object.getOwnPropertySymbols(i).filter(function(c){return Object.getOwnPropertyDescriptor(i,c).enumerable}))),a.forEach(function(c){zo(l,c,i[c])})}return l}function zo(l,e,i){return e in l?Object.defineProperty(l,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):l[e]=i,l}var Ye=function(e,i){var a=ot({},e,i.attrs);return o(Ne,ot({},a,{icon:Oo}),null)};Ye.displayName="QuestionCircleOutlined";Ye.inheritAttrs=!1;const me=Ye;var Do={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M912 192H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 284H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 284H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM104 228a56 56 0 10112 0 56 56 0 10-112 0zm0 284a56 56 0 10112 0 56 56 0 10-112 0zm0 284a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"unordered-list",theme:"outlined"};const Bo=Do;function st(l){for(var e=1;e<arguments.length;e++){var i=arguments[e]!=null?Object(arguments[e]):{},a=Object.keys(i);typeof Object.getOwnPropertySymbols=="function"&&(a=a.concat(Object.getOwnPropertySymbols(i).filter(function(c){return Object.getOwnPropertyDescriptor(i,c).enumerable}))),a.forEach(function(c){Mo(l,c,i[c])})}return l}function Mo(l,e,i){return e in l?Object.defineProperty(l,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):l[e]=i,l}var qe=function(e,i){var a=st({},e,i.attrs);return o(Ne,st({},a,{icon:Bo}),null)};qe.displayName="UnorderedListOutlined";qe.inheritAttrs=!1;const jo=qe;function Fo({streamList:l}){const{t:e}=Q(),i=[{title:e("routes.home.所属插件"),dataIndex:"pluginName"},{title:e("routes.home.流路径"),dataIndex:"path"},{title:e("routes.home.状态"),dataIndex:"state",customRender:({record:a})=>ro({state:a.state})},{title:e("routes.home.订阅数"),dataIndex:"subscribers",width:"70px"}];return l.length?o(te,{dataSource:l,columns:i,size:"small",pagination:!1,bordered:!0,scroll:{y:200}},null):o(be,null,null)}function Ho(l){return typeof l=="function"||Object.prototype.toString.call(l)==="[object Object]"&&!Ce(l)}const Ao=/^(tcp|udp|quic|http)/;function Vo({pluginList:l}){const{t:e}=Q(),i=[{title:e("routes.home.名称"),dataIndex:"name",width:"120px"},{title:e("routes.home.端口"),dataIndex:"port",width:"120px",customRender:({record:a})=>{const c=[];if(a.description)for(const p in a.description)Ao.test(p)&&c.push(o(je,{color:"blue"},{default:()=>[p,U(": "),a.description[p]]}));return c}},{title:e("routes.home.操作"),dataIndex:"action",width:"60px",align:"center",customRender:({record:a})=>{let c;return o(V,{type:"link",onClick:()=>{X.confirm({title:e("routes.home.确定重启",{name:a.name}),content:e("routes.home.开发中")})}},Ho(c=e("routes.home.重启"))?c:{default:()=>[c]})}}];return l.length?o(te,{dataSource:l,columns:i,size:"small",pagination:!1,bordered:!0,scroll:{y:200}},null):o(be,null,null)}function No({aliasList:l}){const{t:e}=Q(),i=[{title:e("routes.home.别名流"),dataIndex:"streamPath"},{title:e("routes.home.别名名称"),dataIndex:"alias"},{title:e("routes.home.自动删除"),dataIndex:"autoRemove"},{title:e("routes.home.状态"),dataIndex:"status",customRender:({record:a})=>io[a.status]}];return l.length?o(te,{dataSource:l,columns:i,size:"small",pagination:!1,bordered:!0,scroll:{y:200}},null):o(be,null,null)}function ft(l){return l.children&&l.children.length>0?l.children=l.children.map(ft):delete l.children,l}function Eo(l){const e=[];function i(a){a.forEach(c=>{c.children&&c.children.length>0&&(e.push(String(c.id)),i(c.children))})}return i(l),e}function Uo({taskList:l}){const{t:e}=Q(),i=[{title:e("routes.home.任务所有者"),dataIndex:"owner"},{title:e("routes.home.状态"),dataIndex:"state",width:100,customRender:({record:p})=>uo[p.state]},{title:e("routes.home.任务启动时间"),dataIndex:"startTime",width:100,customRender:({record:p})=>o(pt,{value:p.startTime},null)}],a=L([]);Oe(()=>{const p=Eo(l);a.value=p});const c=(p,R)=>{const $=String(R.id);if(p)a.value.includes($)||a.value.push($);else{const z=a.value.indexOf($);z>-1&&a.value.splice(z,1)}};return l.length?o(te,{dataSource:l,columns:i,size:"small",pagination:!1,bordered:!0,expandedRowKeys:a.value,onExpand:c,childrenColumnName:"children",indentSize:20,rowKey:p=>String(p.id),scroll:{y:200}},null):o(be,null,null)}function Yo(l){return typeof l=="function"||Object.prototype.toString.call(l)==="[object Object]"&&!Ce(l)}function qo({logList:l}){const{t:e}=Q();function i(c){no(c).then(p=>{X.info({title:e("routes.home.查看日志"),width:"1024px",okText:e("routes.home.关闭"),content:o("pre",{class:"w-100% h-600px overflow-auto"},[p])})})}const a=[{title:e("routes.home.文件名"),dataIndex:"name"},{title:e("routes.home.文件大小"),dataIndex:"size",width:100,customRender:({record:c})=>co(c.size)},{title:e("routes.home.操作"),dataIndex:"action",width:70,customRender:({record:c})=>{let p;return o(V,{type:"link",onClick:()=>i(c.name)},Yo(p=e("routes.home.查看"))?p:{default:()=>[p]})}}];return l.length?o(te,{columns:a,dataSource:l,size:"small",pagination:!1,bordered:!0,scroll:{y:200}},null):o(be,null,null)}function Wo({transformList:l}){const{t:e}=Q(),i=[{title:e("routes.home.转换插件"),dataIndex:"pluginName"},{title:e("routes.home.别名流"),dataIndex:"streamPath"},{title:e("routes.home.转换目标"),dataIndex:"target"},{title:e("routes.home.转换配置"),dataIndex:"config"}];return l.length?o(te,{dataSource:l,columns:i,size:"small",pagination:!1,bordered:!0,scroll:{y:200}},null):o(be,null,null)}const Ko={style:{position:"relative"}},Go={class:"version-tag"},Qo={class:"flex-center"},Jo={class:"overview-content"},Xo={class:"info-grid"},Zo={class:"info-card"},es={class:"info-header"},ts={class:"info-title"},os={class:"info-body"},ss={class:"info-item"},as={class:"label"},ns={class:"info-item"},ls={class:"label"},rs={class:"value-tag processing"},is={class:"info-item"},us={class:"label"},cs={class:"value-tag processing"},ds={class:"detail-row"},ms={class:"detail-item"},ps={class:"detail-label"},hs={class:"value-tag default"},fs={class:"detail-item"},vs={class:"detail-label"},gs={class:"value-tag default"},_s={class:"info-card"},ys={class:"info-header"},xs={class:"info-title"},bs={class:"info-body"},ws={class:"resource-section"},ks={class:"resource-title"},Ps={class:"resource-details"},Cs={class:"resource-item"},$s={class:"resource-label"},Ss={class:"value-tag default"},Ts={class:"resource-item"},Ls={class:"resource-label"},Rs={class:"value-tag success"},Is={class:"resource-section"},Os={class:"resource-title"},zs={class:"resource-details"},Ds={class:"resource-item"},Bs={class:"resource-label"},Ms={class:"value-tag default"},js={class:"resource-item"},Fs={class:"resource-label"},Hs={class:"value-tag success"},As={class:"info-card"},Vs={class:"info-header"},Ns={class:"info-title"},Es={class:"info-body"},Us={class:"resource-section"},Ys={class:"resource-title"},qs={class:"network-stats-compact"},Ws={class:"network-item-compact"},Ks={class:"network-label-compact"},Gs={class:"value-tag error"},Qs={class:"network-item-compact"},Js={class:"network-label-compact"},Xs={class:"value-tag success"},Zs={class:"flex-center gap-2px"},ea={class:"flex-center gap-2px"},ta={class:"flex-center gap-2px"},oa={class:"flex-center gap-2px"},sa={class:"flex-center gap-2px"},aa={class:"flex-center gap-2px"},na={key:1},la=Y({name:"Instance"}),ra=Y({...la,props:{data:{}},setup(l){const{t:e}=Q(),i=ze(),{summary:a,online:c,sysInfo:p}=ye(i),R=L([]),$=L([]),z=L([]),d=L([]),B=L([]),T=i.pluginActive("LogRotate");function v(){Fe().then(I=>{R.value=I})}function k(){Ht().then(I=>{$.value=I})}function P(){At().then(I=>{B.value=I})}function m(){Vt().then(I=>{z.value=[I].map(ft)})}function w(){lo().then(I=>{d.value=I})}const C={3:{...ce(v),active(){c.value?(v(),this.resume()):this.pause()}},4:{...ce(P),active(){c.value?(P(),this.resume()):this.pause()}},5:{...ce(k),active(){c.value?(k(),this.resume()):this.pause()}},6:{...ce(m),active(){c.value?(m(),this.resume()):this.pause()}},7:{...ce(w),active(){T.value&&c.value?(w(),this.resume()):this.pause()}}},s=lt(),n=l,r=L(),f=L(),S=L(0),M=L(0),F=L("1");Se(F,(I,A)=>{C[A]?.pause(),C[I]?.active()}),Se(c,I=>{if(I)C[F.value]?.active();else for(const A in C)C[A]?.pause()}),Oe(()=>{(!T.value||!c.value)&&C[7]?.pause()});function j(){X.confirm({title:e("routes.home.热重启"),content:e("routes.home.确定要热重启吗"),okText:e("routes.home.确定"),cancelText:e("routes.home.取消"),onOk:()=>Et()})}const K=i.registerSummaryCallback(I=>{r.value?.handleUpdate(I?.memory?.usage||0),f.value?.handleUpdate(I?.cpuUsage||0),S.value=I?.netWork?.reduce((A,G)=>A+Number(G.sentSpeed||0),0)||0,M.value=I?.netWork?.reduce((A,G)=>A+Number(G.receiveSpeed||0),0)||0});rt(()=>{K();for(const I in C)C[I]?.pause()});function N(){T.value?n.data.onShowLogTrail():ue.error(e("routes.home.需要启用Logrotate插件"))}async function D(){try{let A=await Ut();X.confirm({title:e("routes.home.编辑配置文件"),width:800,style:{top:"20px"},content:()=>o("div",{style:"height: 600px"},[o(mo,{value:A,onChange:G=>A=G,language:"yaml",options:{minimap:{enabled:!1},lineNumbers:"on",automaticLayout:!0}},null)]),onOk:async()=>{try{Yt.parse(A),await qt(A),ue.success(e("routes.home.保存成功"))}catch(G){return Promise.reject(e("routes.home.配置文件格式错误")+":"+G.message)}}})}catch(I){ue.error(e("routes.home.获取配置文件失败")+":"+I.message)}}function H(){n.data.onShowDebugChart()}function oe(I){return I>=1024?`${(I/1024).toFixed(1)}GB`:`${I}MB`}function se(I){return I>=1024?`${(I/1024).toFixed(1)}TB`:`${I}GB`}function ne(I){return I>=1024*1024*1024?`${(I/(1024*1024*1024)).toFixed(1)}GB/s`:I>=1024*1024?`${(I/(1024*1024)).toFixed(1)}MB/s`:I>=1024?`${(I/1024).toFixed(1)}KB/s`:`${I}B/s`}return(I,A)=>(O(),W("div",Ko,[o(t(J),{type:"target",position:t(q).Top,id:"upstream"},null,8,["position"]),o(t(J),{type:"source",position:t(q).Bottom,id:"downstream"},null,8,["position"]),o(t(J),{type:"target",position:t(q).Left,id:"target-pull",style:{top:"20%",bottom:"auto"}},null,8,["position"]),o(t(J),{type:"target",position:t(q).Left,id:"target-push",style:{top:"50%",bottom:"auto"}},null,8,["position"]),o(t(J),{type:"target",position:t(q).Left,id:"target-read",style:{top:"80%",bottom:"auto"}},null,8,["position"]),o(t(J),{type:"source",position:t(q).Right,id:"source-push",style:{top:"20%",bottom:"auto"}},null,8,["position"]),o(t(J),{type:"source",position:t(q).Right,id:"source-play",style:{top:"50%",bottom:"auto"}},null,8,["position"]),o(t(J),{type:"source",position:t(q).Right,id:"source-read",style:{top:"80%",bottom:"auto"}},null,8,["position"]),t(i).online?(O(),E(t(ae),{key:0,size:"small",class:"w-500px drop-shadow-xl","body-style":{paddingBottom:0,paddingTop:0}},{title:h(()=>[A[2]||(A[2]=u("span",null,"SagooMedia ",-1)),u("span",Go,b(t(p).version),1),u("span",null,b(t(p).localIP),1)]),extra:h(()=>[o(t(V),{type:"link",onClick:A[0]||(A[0]=G=>t(s)("Overview"))},{default:h(()=>[U(b(t(e)("routes.home.查看详情")),1)]),_:1})]),actions:h(()=>[o(t(V),{type:"link",onClick:H,size:"small"},{default:h(()=>[U(b(t(e)("routes.home.性能观测")),1)]),_:1}),o(t(V),{type:"link",onClick:D,size:"small"},{default:h(()=>[U(b(t(e)("routes.home.配置")),1)]),_:1}),o(t(V),{type:"link",onClick:N,size:"small"},{default:h(()=>[U(b(t(e)("routes.home.日志跟踪")),1)]),_:1}),o(t(V),{type:"link",onClick:j,size:"small"},{default:h(()=>[U(b(t(e)("routes.home.热重启")),1)]),_:1})]),default:h(()=>[o(t(Nt),{activeKey:F.value,"onUpdate:activeKey":A[1]||(A[1]=G=>F.value=G),size:"small",animated:"","tab-bar-gutter":10,"tab-bar-style":{marginBottom:"2px"}},{default:h(()=>[o(t(ve),{key:"1"},{tab:h(()=>[u("div",Qo,[o(t(le),{icon:"dashicons:dashboard",width:"20",height:"20"}),u("span",null,b(t(e)("routes.home.概览")),1)])]),default:h(()=>[u("div",Jo,[u("div",Xo,[u("div",Zo,[u("div",es,[o(t(le),{icon:"material-symbols:schedule",class:"info-icon"}),u("span",ts,b(t(e)("routes.home.系统信息")),1)]),u("div",os,[u("div",ss,[u("span",as,b(t(e)("routes.home.启动时间"))+":",1),o(t(pt),{value:t(p).startTime,class:"text-primary font-medium"},null,8,["value"])]),u("div",ns,[u("span",ls,b(t(e)("routes.home.Go版本"))+":",1),u("span",rs,b(t(p).goVersion),1)]),u("div",is,[u("span",us,b(t(e)("routes.home.系统"))+":",1),u("span",cs,b(t(p).os),1)]),u("div",ds,[u("span",ms,[u("span",ps,b(t(e)("routes.home.CPU"))+":",1),u("span",hs,b(t(p).cpus)+b(t(e)("routes.home.核")),1)]),u("span",fs,[u("span",vs,b(t(e)("routes.home.架构"))+":",1),u("span",gs,b(t(p).arch),1)])])])]),u("div",_s,[u("div",ys,[o(t(le),{icon:"material-symbols:storage",class:"info-icon"}),u("span",xs,b(t(e)("routes.home.存储内存")),1)]),u("div",bs,[u("div",ws,[u("div",ks,b(t(e)("routes.home.磁盘"))+" "+b(t(a).hardDisk?.usage.toFixed(1)||0)+"% ",1),u("div",Ps,[u("span",Cs,[u("span",$s,b(t(e)("routes.home.总计"))+":",1),u("span",Ss,b(se(t(a).hardDisk?.total||0)),1)]),u("span",Ts,[u("span",Ls,b(t(e)("routes.home.可用"))+":",1),u("span",Rs,b(se(t(a).hardDisk?.free||0)),1)])])]),u("div",Is,[u("div",Os,b(t(e)("routes.home.内存"))+" "+b(t(a).memory?.usage.toFixed(1)||0)+"% ",1),u("div",zs,[u("span",Ds,[u("span",Bs,b(t(e)("routes.home.总计"))+":",1),u("span",Ms,b(oe(t(a).memory?.total||0)),1)]),u("span",js,[u("span",Fs,b(t(e)("routes.home.可用"))+":",1),u("span",Hs,b(oe(t(a).memory?.free||0)),1)])])])])]),u("div",As,[u("div",Vs,[o(t(le),{icon:"material-symbols:network-wifi",class:"info-icon"}),u("span",Ns,b(t(e)("routes.home.网络性能")),1)]),u("div",Es,[u("div",Us,[u("div",Ys," CPU "+b(t(a).cpuUsage?.toFixed(1)||0)+"% ",1),u("div",qs,[u("div",Ws,[u("span",Ks,b(t(e)("routes.home.上传"))+":",1),u("span",Gs,b(ne(S.value)),1)]),u("div",Qs,[u("span",Js,b(t(e)("routes.home.下载"))+":",1),u("span",Xs,b(ne(M.value)),1)])])])])])])])]),_:1}),o(t(ve),{key:"2"},{tab:h(()=>[u("div",Zs,[o(t(le),{icon:"mingcute:plugin-line",width:"24",height:"24"}),u("span",null,b(t(e)("routes.home.插件")),1)])]),default:h(()=>[o(t(Vo),{pluginList:t(p).plugins},null,8,["pluginList"])]),_:1}),o(t(ve),{key:"3"},{tab:h(()=>[u("div",ea,[o(t(le),{icon:"ri:live-line",width:"24",height:"24"}),u("span",null,b(t(e)("routes.home.流")),1)])]),default:h(()=>[o(t(Fo),{streamList:R.value},null,8,["streamList"])]),_:1}),o(t(ve),{key:"4"},{tab:h(()=>[u("div",ta,[o(t(le),{icon:"carbon:transform-binary",width:"24",height:"24"}),u("span",null,b(t(e)("routes.home.转换")),1)])]),default:h(()=>[o(t(Wo),{transformList:B.value},null,8,["transformList"])]),_:1}),o(t(ve),{key:"5"},{tab:h(()=>[u("div",oa,[o(t(le),{icon:"oui:token-alias",width:"24",height:"24"}),u("span",null,b(t(e)("routes.home.别名")),1)])]),default:h(()=>[o(t(No),{aliasList:$.value},null,8,["aliasList"])]),_:1}),o(t(ve),{key:"6"},{tab:h(()=>[u("div",sa,[o(t(le),{icon:"iconoir:task-list",width:"24",height:"24"}),u("span",null,b(t(e)("routes.home.任务")),1)])]),default:h(()=>[o(t(Uo),{taskList:z.value},null,8,["taskList"])]),_:1}),o(t(ve),{key:"7"},{tab:h(()=>[u("div",aa,[o(t(le),{icon:"ix:log",width:"24",height:"24"}),u("span",null,b(t(e)("routes.home.日志")),1)])]),default:h(()=>[t(T)?(O(),E(t(qo),{key:0,logList:d.value},null,8,["logList"])):(O(),W("div",na,b(t(e)("routes.home.需要启用Logrotate插件")),1))]),_:1})]),_:1},8,["activeKey"])]),_:1})):(O(),E(t(ae),{key:1},{default:h(()=>[o(t(le),{icon:"mingcute:plugin-line",width:"24",height:"24"}),u("span",null,b(t(e)("routes.home.SagooMedia离线")),1)]),_:1}))]))}});const ia=it(ra,[["__scopeId","data-v-082cf195"]]),ua={key:1,class:"text-12px"},ca=Y({name:"Device"}),da=Y({...ca,setup(l){const{t:e}=Q(),{pause:i,resume:a}=ce(R),c=L([]),p=L([{title:e("routes.home.名称"),dataIndex:"name"},{title:e("routes.home.状态"),dataIndex:"status",customRender:({record:$})=>fo($.status)}]);function R(){return po().then($=>{c.value=$}).catch($=>{console.error(`stream-proxy-getList-error: ${$}`)})}return R(),($,z)=>(O(),E(t(ae),{size:"small",class:"w-250px drop-shadow-xl"},{title:h(()=>[u("span",null,b(t(e)("routes.home.远端服务器或设备")),1),c.value.length?(O(),E(t(_e),{key:0,title:t(e)("routes.home.帮助"),content:t(e)("routes.home.设备节点用于配置拉流代理")},{default:h(()=>[o(t(V),{type:"link",size:"small"},{default:h(()=>[o(t(me),{class:"ml-1 text-gray-400"})]),_:1})]),_:1},8,["title","content"])):he("",!0)]),extra:h(()=>[o(t(V),{type:"link",onClick:z[0]||(z[0]=d=>t(vo)({updateList:R,pause:t(i),resume:t(a)}))},{default:h(()=>[U(b(t(e)("routes.home.添加")),1)]),_:1})]),default:h(()=>[o(t(J),{type:"source",position:t(q).Right},null,8,["position"]),c.value.length?(O(),E(t(te),{key:0,"data-source":c.value,columns:p.value,size:"small",pagination:!1,bordered:""},null,8,["data-source","columns"])):(O(),W("span",ua,b(t(e)("routes.home.拉流代理功能说明")),1))]),_:1}))}});var He={},ma={get exports(){return He},set exports(l){He=l}};function pa(l){throw new Error('Could not dynamically require "'+l+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Ie={},ha={get exports(){return Ie},set exports(l){Ie=l}},at;function fa(){return at||(at=1,function(l,e){(function(i,a){l.exports=a()})(Pe,function(){var i=i||function(a,c){var p;if(typeof window<"u"&&window.crypto&&(p=window.crypto),typeof self<"u"&&self.crypto&&(p=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(p=globalThis.crypto),!p&&typeof window<"u"&&window.msCrypto&&(p=window.msCrypto),!p&&typeof Pe<"u"&&Pe.crypto&&(p=Pe.crypto),!p&&typeof pa=="function")try{p=Wt}catch{}var R=function(){if(p){if(typeof p.getRandomValues=="function")try{return p.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof p.randomBytes=="function")try{return p.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},$=Object.create||function(){function s(){}return function(n){var r;return s.prototype=n,r=new s,s.prototype=null,r}}(),z={},d=z.lib={},B=d.Base=function(){return{extend:function(s){var n=$(this);return s&&n.mixIn(s),(!n.hasOwnProperty("init")||this.init===n.init)&&(n.init=function(){n.$super.init.apply(this,arguments)}),n.init.prototype=n,n.$super=this,n},create:function(){var s=this.extend();return s.init.apply(s,arguments),s},init:function(){},mixIn:function(s){for(var n in s)s.hasOwnProperty(n)&&(this[n]=s[n]);s.hasOwnProperty("toString")&&(this.toString=s.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),T=d.WordArray=B.extend({init:function(s,n){s=this.words=s||[],n!=c?this.sigBytes=n:this.sigBytes=s.length*4},toString:function(s){return(s||k).stringify(this)},concat:function(s){var n=this.words,r=s.words,f=this.sigBytes,S=s.sigBytes;if(this.clamp(),f%4)for(var M=0;M<S;M++){var F=r[M>>>2]>>>24-M%4*8&255;n[f+M>>>2]|=F<<24-(f+M)%4*8}else for(var j=0;j<S;j+=4)n[f+j>>>2]=r[j>>>2];return this.sigBytes+=S,this},clamp:function(){var s=this.words,n=this.sigBytes;s[n>>>2]&=4294967295<<32-n%4*8,s.length=a.ceil(n/4)},clone:function(){var s=B.clone.call(this);return s.words=this.words.slice(0),s},random:function(s){for(var n=[],r=0;r<s;r+=4)n.push(R());return new T.init(n,s)}}),v=z.enc={},k=v.Hex={stringify:function(s){for(var n=s.words,r=s.sigBytes,f=[],S=0;S<r;S++){var M=n[S>>>2]>>>24-S%4*8&255;f.push((M>>>4).toString(16)),f.push((M&15).toString(16))}return f.join("")},parse:function(s){for(var n=s.length,r=[],f=0;f<n;f+=2)r[f>>>3]|=parseInt(s.substr(f,2),16)<<24-f%8*4;return new T.init(r,n/2)}},P=v.Latin1={stringify:function(s){for(var n=s.words,r=s.sigBytes,f=[],S=0;S<r;S++){var M=n[S>>>2]>>>24-S%4*8&255;f.push(String.fromCharCode(M))}return f.join("")},parse:function(s){for(var n=s.length,r=[],f=0;f<n;f++)r[f>>>2]|=(s.charCodeAt(f)&255)<<24-f%4*8;return new T.init(r,n)}},m=v.Utf8={stringify:function(s){try{return decodeURIComponent(escape(P.stringify(s)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(s){return P.parse(unescape(encodeURIComponent(s)))}},w=d.BufferedBlockAlgorithm=B.extend({reset:function(){this._data=new T.init,this._nDataBytes=0},_append:function(s){typeof s=="string"&&(s=m.parse(s)),this._data.concat(s),this._nDataBytes+=s.sigBytes},_process:function(s){var n,r=this._data,f=r.words,S=r.sigBytes,M=this.blockSize,F=M*4,j=S/F;s?j=a.ceil(j):j=a.max((j|0)-this._minBufferSize,0);var K=j*M,N=a.min(K*4,S);if(K){for(var D=0;D<K;D+=M)this._doProcessBlock(f,D);n=f.splice(0,K),r.sigBytes-=N}return new T.init(n,N)},clone:function(){var s=B.clone.call(this);return s._data=this._data.clone(),s},_minBufferSize:0});d.Hasher=w.extend({cfg:B.extend(),init:function(s){this.cfg=this.cfg.extend(s),this.reset()},reset:function(){w.reset.call(this),this._doReset()},update:function(s){return this._append(s),this._process(),this},finalize:function(s){s&&this._append(s);var n=this._doFinalize();return n},blockSize:16,_createHelper:function(s){return function(n,r){return new s.init(r).finalize(n)}},_createHmacHelper:function(s){return function(n,r){return new C.HMAC.init(s,r).finalize(n)}}});var C=z.algo={};return z}(Math);return i})}(ha)),Ie}(function(l,e){(function(i,a){l.exports=a(fa())})(Pe,function(i){return function(a){var c=i,p=c.lib,R=p.WordArray,$=p.Hasher,z=c.algo,d=[];(function(){for(var m=0;m<64;m++)d[m]=a.abs(a.sin(m+1))*4294967296|0})();var B=z.MD5=$.extend({_doReset:function(){this._hash=new R.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(m,w){for(var C=0;C<16;C++){var s=w+C,n=m[s];m[s]=(n<<8|n>>>24)&16711935|(n<<24|n>>>8)&4278255360}var r=this._hash.words,f=m[w+0],S=m[w+1],M=m[w+2],F=m[w+3],j=m[w+4],K=m[w+5],N=m[w+6],D=m[w+7],H=m[w+8],oe=m[w+9],se=m[w+10],ne=m[w+11],I=m[w+12],A=m[w+13],G=m[w+14],fe=m[w+15],y=r[0],g=r[1],x=r[2],_=r[3];y=T(y,g,x,_,f,7,d[0]),_=T(_,y,g,x,S,12,d[1]),x=T(x,_,y,g,M,17,d[2]),g=T(g,x,_,y,F,22,d[3]),y=T(y,g,x,_,j,7,d[4]),_=T(_,y,g,x,K,12,d[5]),x=T(x,_,y,g,N,17,d[6]),g=T(g,x,_,y,D,22,d[7]),y=T(y,g,x,_,H,7,d[8]),_=T(_,y,g,x,oe,12,d[9]),x=T(x,_,y,g,se,17,d[10]),g=T(g,x,_,y,ne,22,d[11]),y=T(y,g,x,_,I,7,d[12]),_=T(_,y,g,x,A,12,d[13]),x=T(x,_,y,g,G,17,d[14]),g=T(g,x,_,y,fe,22,d[15]),y=v(y,g,x,_,S,5,d[16]),_=v(_,y,g,x,N,9,d[17]),x=v(x,_,y,g,ne,14,d[18]),g=v(g,x,_,y,f,20,d[19]),y=v(y,g,x,_,K,5,d[20]),_=v(_,y,g,x,se,9,d[21]),x=v(x,_,y,g,fe,14,d[22]),g=v(g,x,_,y,j,20,d[23]),y=v(y,g,x,_,oe,5,d[24]),_=v(_,y,g,x,G,9,d[25]),x=v(x,_,y,g,F,14,d[26]),g=v(g,x,_,y,H,20,d[27]),y=v(y,g,x,_,A,5,d[28]),_=v(_,y,g,x,M,9,d[29]),x=v(x,_,y,g,D,14,d[30]),g=v(g,x,_,y,I,20,d[31]),y=k(y,g,x,_,K,4,d[32]),_=k(_,y,g,x,H,11,d[33]),x=k(x,_,y,g,ne,16,d[34]),g=k(g,x,_,y,G,23,d[35]),y=k(y,g,x,_,S,4,d[36]),_=k(_,y,g,x,j,11,d[37]),x=k(x,_,y,g,D,16,d[38]),g=k(g,x,_,y,se,23,d[39]),y=k(y,g,x,_,A,4,d[40]),_=k(_,y,g,x,f,11,d[41]),x=k(x,_,y,g,F,16,d[42]),g=k(g,x,_,y,N,23,d[43]),y=k(y,g,x,_,oe,4,d[44]),_=k(_,y,g,x,I,11,d[45]),x=k(x,_,y,g,fe,16,d[46]),g=k(g,x,_,y,M,23,d[47]),y=P(y,g,x,_,f,6,d[48]),_=P(_,y,g,x,D,10,d[49]),x=P(x,_,y,g,G,15,d[50]),g=P(g,x,_,y,K,21,d[51]),y=P(y,g,x,_,I,6,d[52]),_=P(_,y,g,x,F,10,d[53]),x=P(x,_,y,g,se,15,d[54]),g=P(g,x,_,y,S,21,d[55]),y=P(y,g,x,_,H,6,d[56]),_=P(_,y,g,x,fe,10,d[57]),x=P(x,_,y,g,N,15,d[58]),g=P(g,x,_,y,A,21,d[59]),y=P(y,g,x,_,j,6,d[60]),_=P(_,y,g,x,ne,10,d[61]),x=P(x,_,y,g,M,15,d[62]),g=P(g,x,_,y,oe,21,d[63]),r[0]=r[0]+y|0,r[1]=r[1]+g|0,r[2]=r[2]+x|0,r[3]=r[3]+_|0},_doFinalize:function(){var m=this._data,w=m.words,C=this._nDataBytes*8,s=m.sigBytes*8;w[s>>>5]|=128<<24-s%32;var n=a.floor(C/4294967296),r=C;w[(s+64>>>9<<4)+15]=(n<<8|n>>>24)&16711935|(n<<24|n>>>8)&4278255360,w[(s+64>>>9<<4)+14]=(r<<8|r>>>24)&16711935|(r<<24|r>>>8)&4278255360,m.sigBytes=(w.length+1)*4,this._process();for(var f=this._hash,S=f.words,M=0;M<4;M++){var F=S[M];S[M]=(F<<8|F>>>24)&16711935|(F<<24|F>>>8)&4278255360}return f},clone:function(){var m=$.clone.call(this);return m._hash=this._hash.clone(),m}});function T(m,w,C,s,n,r,f){var S=m+(w&C|~w&s)+n+f;return(S<<r|S>>>32-r)+w}function v(m,w,C,s,n,r,f){var S=m+(w&s|C&~s)+n+f;return(S<<r|S>>>32-r)+w}function k(m,w,C,s,n,r,f){var S=m+(w^C^s)+n+f;return(S<<r|S>>>32-r)+w}function P(m,w,C,s,n,r,f){var S=m+(C^(w|~s))+n+f;return(S<<r|S>>>32-r)+w}c.MD5=$._createHelper(B),c.HmacMD5=$._createHmacHelper(B)}(Math),i.MD5})})(ma);const vt=He;class va{canvas;ctx;videoTrack;mediaStream;isPlaying=!1;animationId;frameCount=0;hue=0;constructor(){this.canvas=document.createElement("canvas"),this.canvas.width=640,this.canvas.height=360,this.ctx=this.canvas.getContext("2d")}render=()=>{if(!this.ctx||!this.isPlaying)return;const{width:e,height:i}=this.canvas;this.frameCount++,this.hue=(this.hue+1)%360;const a=this.ctx.createLinearGradient(0,0,e,i);a.addColorStop(0,`hsl(${this.hue}, 70%, 50%)`),a.addColorStop(1,`hsl(${(this.hue+60)%360}, 70%, 50%)`),this.ctx.fillStyle=a,this.ctx.fillRect(0,0,e,i);const c=Date.now()/1e3,p=e/2+Math.sin(c*2)*150,R=i/2+Math.cos(c*1.5)*80;this.ctx.beginPath(),this.ctx.arc(p,R,40,0,Math.PI*2),this.ctx.fillStyle="white",this.ctx.fill(),this.ctx.fillStyle="white",this.ctx.font="bold 24px Arial",this.ctx.textAlign="center",this.ctx.fillText("Canvas Test Track",e/2,40),this.ctx.font="18px Arial",this.ctx.fillText(`Frame: ${this.frameCount}`,e/2,i-60),this.ctx.fillText(`Time: ${new Date().toLocaleTimeString()}`,e/2,i-30),this.animationId=requestAnimationFrame(this.render)};async play(){this.isPlaying||(this.isPlaying=!0,this.frameCount=0,this.render(),this.mediaStream=this.canvas.captureStream(30),this.videoTrack=this.mediaStream.getVideoTracks()[0])}stop(){this.isPlaying=!1,this.animationId&&(cancelAnimationFrame(this.animationId),this.animationId=void 0),this.videoTrack&&(this.videoTrack.stop(),this.videoTrack=void 0),this.mediaStream=void 0}getVideoTrack(){return this.videoTrack}}const $e=new va,ga=["srcObject"],_a={key:1,class:"text-12px"},ya={class:"flex flex-col gap-8px pl-10px pr-10px"},xa={class:"flex items-center justify-between"},ba={class:"flex items-center justify-between"};function Be(l){return typeof l=="function"||Object.prototype.toString.call(l)==="[object Object]"&&!Ce(l)}const wa=Y({name:"Pusher"}),ka=Y({...wa,props:{data:{}},setup(l){const{t:e}=Q(),i=L(!1),a=L(!1),c=ze(),p=L(""),R=L("live/test"),$=L(!1),z=l,{plugins:d,sysInfo:B}=ye(c),T=c.pluginActive("WebRTC");async function v(){try{return(await navigator.mediaDevices.enumerateDevices()).filter(r=>r.kind==="videoinput").map(r=>({label:r.label||`Camera ${r.deviceId.slice(0,10)}...`,value:r.deviceId,key:r.deviceId}))}catch(n){return console.error(e("routes.home.获取摄像头列表失败"),n),ue.error(e("routes.home.获取摄像头列表失败")),[]}}let k;const P=L(null);async function m(n){a.value=!0;const r=P.value=n,f=new RTCPeerConnection;k=()=>{f.close(),r?.getTracks().forEach(j=>{j.stop()}),$.value&&$e.stop(),P.value=null},f.oniceconnectionstatechange=()=>{ke.info({message:"oniceconnectionstatechange",description:JSON.stringify(f.iceConnectionState)})},f.onicecandidate=j=>{ke.info({message:"onicecandidate",description:JSON.stringify(j.candidate)})},r.getTracks().forEach(j=>{f.addTrack(j,r)});const S=await f.createOffer();await f.setLocalDescription(S),ke.info({message:"createOffer",description:()=>o("div",{class:"h-200px overflow-auto"},[S.sdp])});const M=await fetch(`${ge("webrtc","/push")}/${R.value}`,{method:"POST",mode:"cors",cache:"no-cache",credentials:"include",redirect:"follow",referrerPolicy:"no-referrer",headers:{"Content-Type":"application/sdp"},body:S.sdp}),F=await M.text();if(M.status>=300)throw`${M.status} ${M.statusText}: ${F}`;ke.success({message:"推流成功",description:F||""}),await f.setRemoteDescription(new RTCSessionDescription({type:"answer",sdp:F}))}Oe(()=>{i.value?T.value?$.value?C():s():(ue.error(e("routes.home.请先启用WebRTC插件")),i.value=!1):k?.(),z.data.onPush(i.value)});async function w(){const n=L({useLocalIP:"localhost",secretKey:"",expireTime:Z().add(1,"hour")});X.info({title:e("routes.home.推流地址"),width:800,content:()=>{let r,f,S;const M=j=>{if(!n.value.secretKey||!n.value.expireTime)return"";const K=Math.floor(n.value.expireTime.unix()).toString(16),N=vt(n.value.secretKey+R.value+K).toString();return(j.includes("?")?"&":"?")+`secret=${N}&expire=${K}`},F=[];for(const j of d.value){const K=j.pushAddr;if(K)for(const N of K){const D=N.replace("{hostName}",n.value.useLocalIP).replace("{streamPath}",R.value);F.push({protocol:N.startsWith("http")?j.name.toLocaleLowerCase():N.split(":")[0],path:D+M(D)})}}return F.length?[o(Le,{value:n.value.useLocalIP,onChange:j=>n.value.useLocalIP=j.target.value},{default:()=>[o(pe,{value:"localhost"},Be(r=e("routes.home.使用localhost"))?r:{default:()=>[r]}),o(pe,{value:B.value.publicIP},Be(f=e("routes.home.使用公网IP"))?f:{default:()=>[f]}),o(pe,{value:B.value.localIP},Be(S=e("routes.home.使用内网IP"))?S:{default:()=>[S]})]}),o(ee,{layout:"inline"},{default:()=>[o(ee.Item,null,{default:()=>[o("span",null,[e("routes.home.秘钥"),o(Ve,{title:e("routes.home.需要匹配配置文件中publish下的key配置")},{default:()=>[o(me,{style:"margin-left: 4px"},null)]})]),o(Te,{type:"text",placeholder:e("routes.home.请输入秘钥"),class:"w-250px",style:"margin-bottom: 10px",value:n.value.secretKey,onChange:j=>n.value.secretKey=j.target.value},null)]}),o(ee.Item,{label:e("routes.home.过期时间")},{default:()=>[o(ut,{placeholder:e("routes.home.选择过期时间"),showTime:!0,class:"w-250px",style:"margin-bottom: 10px",value:n.value.expireTime,onChange:j=>n.value.expireTime=j},null)]})]}),o(te,{dataSource:F,columns:[{title:e("routes.home.协议"),dataIndex:"protocol"},{title:e("routes.home.推流地址"),dataIndex:"path"}],pagination:!1,size:"small"},null)]:o("span",null,[e("routes.home.请先启用一些插件")])}})}async function C(){try{await $e.play();const n=$e.mediaStream;if(!n)throw new Error("Canvas stream not available");return m(n).then(()=>{z.data.onPush(i.value),a.value=!1}).catch(r=>{X.error({title:e("routes.home.推流失败"),content:r}),i.value=!1,a.value=!1,$e.stop()})}catch(n){X.error({title:e("routes.home.推流失败"),content:n instanceof Error?n.message:String(n)}),i.value=!1,a.value=!1}}function s(){navigator.mediaDevices.getUserMedia({video:!0}).then(async n=>{n.getTracks().forEach(f=>{f.stop()});const r=await v();p.value||(p.value=r[0]?.value||""),p.value&&(n=await navigator.mediaDevices.getUserMedia({video:{deviceId:p.value}})),X.confirm({title:e("routes.home.选择摄像头"),content:()=>o("div",null,[o(xe,{value:p.value,onChange:async f=>{n.getTracks().forEach(S=>{S.stop()}),n=await navigator.mediaDevices.getUserMedia({video:{deviceId:f}}),p.value=f},options:r,class:"w-250px"},null),o("video",{autoplay:!0,muted:!0,srcObject:n,width:"240",height:"180"},null)]),onCancel:()=>{n.getTracks().forEach(f=>{f.stop()})},onOk:()=>m(n).then(()=>{z.data.onPush(i.value),a.value=!1}).catch(f=>{X.error({title:e("routes.home.推流失败"),content:f}),i.value=!1,a.value=!1})})})}return(n,r)=>(O(),E(t(ae),{size:"small",class:"w-250px drop-shadow-xl"},{title:h(()=>[u("span",null,b(t(e)("routes.home.推流器")),1),P.value?(O(),E(t(_e),{key:0,title:t(e)("routes.home.帮助"),content:t(e)("routes.home.推流器帮助")},{default:h(()=>[o(t(V),{type:"link",size:"small"},{default:h(()=>[o(t(me),{class:"ml-1 text-gray-400"})]),_:1})]),_:1},8,["title","content"])):he("",!0)]),extra:h(()=>[o(t(V),{type:"link",onClick:w},{default:h(()=>[U(b(t(e)("routes.home.推流地址")),1)]),_:1})]),actions:h(()=>[u("div",ya,[u("div",xa,[u("div",null,b(t(e)("routes.home.流标识")),1),o(t(Te),{type:"text",class:"w-120px",value:R.value,"onUpdate:value":r[0]||(r[0]=f=>R.value=f),size:"small"},null,8,["value"]),o(t(Ee),{checked:i.value,"onUpdate:checked":r[1]||(r[1]=f=>i.value=f),loading:a.value,size:"small"},null,8,["checked","loading"])]),u("div",ba,[r[6]||(r[6]=u("div",null,"推流源",-1)),o(t(Le),{value:$.value,"onUpdate:value":r[2]||(r[2]=f=>$.value=f),size:"small"},{default:h(()=>[o(t(pe),{value:!1},{default:h(()=>r[4]||(r[4]=[U("摄像头")])),_:1}),o(t(pe),{value:!0},{default:h(()=>r[5]||(r[5]=[U("Canvas")])),_:1})]),_:1},8,["value"])])])]),default:h(()=>[o(t(J),{type:"source",position:t(q).Right},null,8,["position"]),P.value?(O(),W("video",{key:0,id:"video",width:"224",height:"168",style:{"border-radius":"6px","object-fit":"cover"},autoplay:"",muted:"",srcObject:P.value},null,8,ga)):(O(),W("span",_a,[U(b(t(e)("routes.home.推流器说明"))+" ",1),r[3]||(r[3]=u("br",null,null,-1)),U(" "+b(t(e)("routes.home.推流器说明2")),1)]))]),_:1}))}}),Pa=["src"],Ca=Y({__name:"debug-chart",props:{data:{}},setup(l){const{t:e}=Q(),i=ge("debug","/charts"),a=l,c=()=>{a.data.onClose()};return(p,R)=>(O(),E(t(ae),{size:"small",title:t(e)("routes.home.性能观测标题"),class:"w-800px h-600px drop-shadow-xl relative","body-style":{top:"40px",bottom:0,position:"absolute",left:0,right:0,padding:0}},{extra:h(()=>[o(t(V),{type:"link",onClick:c},{default:h(()=>[o(t(ct),{class:"ml-1 text-gray-400"})]),_:1})]),default:h(()=>[u("iframe",{src:t(i),class:"w-full h-full",style:{border:"none"}},null,8,Pa)]),_:1},8,["title"]))}}),$a={class:"flex items-center"},Sa={class:"mr-2 ml-2 w-50px"},Ta={class:"flex items-center justify-end pr-5"},La={class:"mr-2 ml-2 w-100px"},Ra=Y({__name:"log-trail",props:{data:{}},setup(l){const{t:e}=Q(),i=L(null),a=L(!0),c=L(""),p=L(null);Ae(()=>{i.value=new EventSource(ge("logrotate")+"/trail"),i.value.onmessage=d=>{$.value.push(d.data),a.value&&Kt(()=>{p.value?.scrollTo({top:p.value?.scrollHeight,behavior:"smooth"})})}}),rt(()=>{i.value?.close()});const R=l,$=L([]),z=()=>{R.data.onClose()};return(d,B)=>(O(),E(t(ae),{size:"small",title:t(e)("routes.home.日志标题"),class:"w-700px drop-shadow-2xl"},{extra:h(()=>[o(t(V),{type:"link",onClick:z},{default:h(()=>[o(t(ct),{class:"ml-1 text-gray-400"})]),_:1})]),actions:h(()=>[u("div",$a,[u("div",Sa,b(t(e)("routes.home.过滤")),1),o(t(Te),{value:c.value,"onUpdate:value":B[0]||(B[0]=T=>c.value=T),size:"small"},null,8,["value"])]),u("div",Ta,[u("div",La,b(t(e)("routes.home.自动滚动")),1),o(t(Ee),{checked:a.value,"onUpdate:checked":B[1]||(B[1]=T=>a.value=T),size:"small"},null,8,["checked"])])]),default:h(()=>[u("div",{class:"h-400px w-full overflow-auto",ref_key:"logContainer",ref:p},[(O(!0),W(dt,null,Gt(c.value?$.value.filter(T=>T.includes(c.value)):$.value,(T,v)=>(O(),W("div",{key:v},b(T),1))),128))],512)]),_:1},8,["title"]))}}),Ia={class:"flex flex-col gap-2"},Oa={key:0,class:"flex items-center gap-2 mb-2"},za={key:2,class:"text-12px"},Da={class:"flex items-center justify-between pl-10px pr-10px"};function Me(l){return typeof l=="function"||Object.prototype.toString.call(l)==="[object Object]"&&!Ce(l)}const Ba=Y({name:"Pusher"}),Ma=Y({...Ba,props:{data:{}},setup(l){const{t:e}=Q(),i=L("ws-flv"),a=L("live/test"),c=L(""),p=L(!1),R=L(!1),$=L([]),z=l;Fe().then(v=>{$.value=[{title:"live/test",value:"live/test"}].concat(v.filter(k=>k.path!=="live/test").map(k=>({title:k.path,value:k.path})))});function d(v){R.value=!1,typeof v=="string"&&(ke.error({message:e("routes.home.播放结束"),description:v}),p.value=!1)}function B(v){Fe().then(k=>{$.value=[{title:v,value:v}].concat(k.map(P=>({title:P.path,value:P.path})))})}Oe(()=>{z.data.onPlay(p.value),p.value?(R.value=!0,c.value=a.value):c.value=""});async function T(){const v=L({useLocalIP:"localhost",secretKey:"",expireTime:Z().add(1,"hour")});X.info({title:e("routes.home.播放地址"),width:800,content:()=>{let k,P,m;const w=s=>{if(!v.value.secretKey||!v.value.expireTime)return"";const n=Math.floor(v.value.expireTime.unix()).toString(16),r=vt(v.value.secretKey+a.value+n).toString();return(s.includes("?")?"&":"?")+`secret=${r}&expire=${n}`},C=[];for(const s of z.data.plugins){const n=s.playAddr;if(n)for(const r of n){const f=r.replace("{hostName}",v.value.useLocalIP).replace("{streamPath}",a.value);C.push({protocol:r.startsWith("http")?s.name.toLocaleLowerCase():r.split(":")[0],path:f+w(f)})}}return C.length?[o(Le,{value:v.value.useLocalIP,onChange:s=>v.value.useLocalIP=s.target.value},{default:()=>[o(pe,{value:"localhost"},Me(k=e("routes.home.使用localhost"))?k:{default:()=>[k]}),o(pe,{value:z.data.sysInfo.publicIP},Me(P=e("routes.home.使用公网IP"))?P:{default:()=>[P]}),o(pe,{value:z.data.sysInfo.localIP},Me(m=e("routes.home.使用内网IP"))?m:{default:()=>[m]})]}),o(ee,{layout:"inline"},{default:()=>[o(ee.Item,null,{default:()=>[o("span",null,[e("routes.home.秘钥"),o(Ve,{title:e("routes.home.需要匹配配置文件中subscribe下的key配置")},{default:()=>[o(me,{style:"margin-left: 4px"},null)]})]),o(Te,{type:"text",placeholder:e("routes.home.请输入秘钥"),class:"w-250px",style:"margin-bottom: 10px",value:v.value.secretKey,onChange:s=>v.value.secretKey=s.target.value},null)]}),o(ee.Item,{label:e("routes.home.过期时间")},{default:()=>[o(ut,{placeholder:e("routes.home.选择过期时间"),showTime:!0,class:"w-250px",style:"margin-bottom: 10px",value:v.value.expireTime,onChange:s=>v.value.expireTime=s},null)]})]}),o(te,{dataSource:C,columns:[{title:e("routes.home.协议"),dataIndex:"protocol"},{title:e("routes.home.播放地址"),dataIndex:"path"}],pagination:!1,size:"small"},null)]:o("span",null,[e("routes.home.请先启用一些插件")])}})}return(v,k)=>(O(),E(t(ae),{size:"small",class:"w-250px drop-shadow-xl"},{title:h(()=>[u("span",null,b(t(e)("routes.home.播放器")),1),p.value?(O(),E(t(_e),{key:0,title:t(e)("routes.home.帮助"),content:t(e)("routes.home.播放器帮助")},{default:h(()=>[o(t(V),{type:"link",size:"small"},{default:h(()=>[o(t(me),{class:"ml-1 text-gray-400"})]),_:1})]),_:1},8,["title","content"])):he("",!0)]),extra:h(()=>[o(t(V),{type:"link",onClick:T},{default:h(()=>[U(b(t(e)("routes.home.播放地址")),1)]),_:1})]),actions:h(()=>[u("div",Da,[u("div",null,b(t(e)("routes.home.流标识")),1),o(t(xe),{class:"w-120px",showSearch:"",value:a.value,"onUpdate:value":k[1]||(k[1]=P=>a.value=P),options:$.value,onSearch:B,size:"small"},null,8,["value","options"]),o(t(Ee),{checked:p.value,"onUpdate:checked":k[2]||(k[2]=P=>p.value=P),loading:R.value,size:"small"},null,8,["checked","loading"])])]),default:h(()=>[o(t(J),{type:"source",position:t(q).Left},null,8,["position"]),u("div",Ia,[p.value?(O(),W("div",Oa,[o(t(Le),{value:i.value,"onUpdate:value":k[0]||(k[0]=P=>i.value=P),size:"small"},{default:h(()=>[o(t(et),{value:"ws-flv"},{default:h(()=>k[3]||(k[3]=[U("WS-FLV")])),_:1}),o(t(et),{value:"webrtc"},{default:h(()=>k[4]||(k[4]=[U("WebRTC")])),_:1})]),_:1},8,["value"])])):he("",!0),p.value?(O(),E(go,{key:1,streamPath:c.value,format:i.value,onPlay:d,class:"flex-1 m-r-10px w-224px h-168px"},null,8,["streamPath","format"])):(O(),W("span",za,[U(b(t(e)("routes.home.播放器说明"))+" ",1),k[5]||(k[5]=u("br",null,null,-1)),U(" "+b(t(e)("routes.home.播放器说明2")),1)]))])]),_:1}))}}),ja={key:1,class:"text-12px"},Fa=Y({name:"Remote"}),Ha=Y({...Fa,setup(l){const{t:e}=Q(),{pause:i,resume:a}=ce(R),c=L([]),p=L([{title:e("routes.home.名称"),dataIndex:"name"},{title:e("routes.home.状态"),dataIndex:"status",customRender:({record:$})=>$.status?e("routes.home.在线"):e("routes.home.离线")}]);function R(){return ho().then($=>{c.value=$}).catch($=>{console.error(`stream-proxy-getList-error: ${$}`)})}return R(),($,z)=>(O(),E(t(ae),{size:"small",class:"w-250px drop-shadow-xl"},{title:h(()=>[u("span",null,b(t(e)("routes.home.远端服务器或CDN")),1),c.value.length?(O(),E(t(_e),{key:0,title:t(e)("routes.home.帮助"),content:t(e)("routes.home.可以将流转推到远端服务器")},{default:h(()=>[o(t(V),{type:"link",size:"small"},{default:h(()=>[o(t(me),{class:"ml-1 text-gray-400"})]),_:1})]),_:1},8,["title","content"])):he("",!0)]),extra:h(()=>[o(t(V),{type:"link",onClick:z[0]||(z[0]=d=>t(_o)({updateList:R,pause:t(i),resume:t(a)}))},{default:h(()=>[U(b(t(e)("routes.home.添加")),1)]),_:1})]),default:h(()=>[o(t(J),{type:"target",position:t(q).Left},null,8,["position"]),c.value.length?(O(),E(t(te),{key:0,"data-source":c.value,columns:p.value,size:"small",pagination:!1,bordered:""},null,8,["data-source","columns"])):(O(),W("span",ja,b(t(e)("routes.home.转推功能说明")),1))]),_:1}))}}),Aa={key:1},Va={key:1,class:"text-12px"},Na=Y({name:"ReadRecord"}),Ea=Y({...Na,props:{data:{}},setup(l){const{t:e}=Q(),i=l,a=L([]),c=de(()=>i.data.plugins.some(m=>m.name==="MP4"||m.name==="FLV"));function p(m){const w=new Date(m.startTime),s=new Date(m.endTime).getTime()-w.getTime(),n=s/(36e5*24)>>0,r=(s/36e5>>0)%24,f=(s/6e4>>0)%60,S=(s/1e3>>0)%60;return`${n?`${n}d`:""}${r?`${r}h`:""}${f}'${S}"`}const R=L([{title:e("routes.home.录像路径"),dataIndex:"filePath",customRender:({text:m,record:w})=>o("div",{class:"flex items-center justify-between"},[o("span",{class:"flex-1"},[m]),o("div",{class:"flex gap-2"},[o(xo,{class:"cursor-pointer text-blue-500 hover:text-blue-600",onClick:()=>{P(`${ge(w.type.toLowerCase(),"/download")}/${w.streamPath}?id=${w.id}`,`${w.streamPath}-${w.id}.${w.type.toLowerCase()}`)}},null),o(Qt,{class:"cursor-pointer text-red-500 hover:text-red-600",onClick:()=>{X.confirm({title:e("routes.home.确认删除"),content:e("routes.home.确定要删除这条录像记录吗"),onOk:()=>yo({type:w.type.toLowerCase(),id:w.id}).then(()=>{const C=a.value.find(s=>s.streamPath===w.streamPath);C&&loadDetailRecords(C,pagination.value)})})}},null)])])},{title:e("routes.home.录像开始时间"),dataIndex:"startTime",customRender:({text:m})=>Z(m).format("YYYY-MM-DD HH:mm:ss")},{title:e("routes.home.录像结束时间"),dataIndex:"endTime",customRender:({text:m})=>Z(m).format("YYYY-MM-DD HH:mm:ss")},{title:e("routes.home.录像时长"),customRender:({record:m})=>p(m)}]),$=L([{title:e("routes.home.录像流路径"),dataIndex:"streamPath",customRender:({text:m,record:w})=>{const C=L([]),s=L({current:1,pageSize:10,total:0,onChange:(r,f)=>{s.value.current=r,s.value.pageSize=f,n(w,s.value)},showTotal:r=>e("routes.home.共条",{total:r})});function n(r,f){return ht({streamPath:r.streamPath,type:r.type.toLowerCase(),pageNum:f.current,pageSize:f.pageSize}).then(S=>{C.value=Array.isArray(S)?S:S.list||[],s.value.total=Array.isArray(S)?S.length:S.total||0})}return o("div",{class:"cursor-pointer",onClick:()=>{n(w,s.value),X.info({title:e("routes.home.录像文件列表",{streamPath:w.streamPath}),content:()=>o(te,{dataSource:C.value,columns:R.value,pagination:s.value,size:"small",bordered:!0},null),width:1e3})}},[m,o(jo,{style:{marginLeft:"8px",cursor:"pointer"}},null)])}},{title:e("routes.home.录像时长"),customRender:({record:m})=>p(m)},{title:e("routes.home.录像类型"),dataIndex:"type"}]),{pause:z,resume:d}=ce(v),B=L([]),T=[0,0];function v(){return Promise.all([Re("mp4").catch(m=>(console.error(`mp4-record-catalog-error: ${m}`),[])),Re("flv").catch(m=>(console.error(`flv-record-catalog-error: ${m}`),[]))]).then(([m,w])=>{const C=[...m.map(s=>({...s,type:"MP4"})),...w.map(s=>({...s,type:"FLV"}))];a.value=C,B.value=[...new Set(C.map(s=>s.streamPath))],C.length>0&&(T[0]=Math.min(...C.map(s=>new Date(s.startTime).getTime())),T[1]=Math.max(...C.map(s=>new Date(s.endTime).getTime())))})}const k=()=>{const m=L(B.value[0]),w=L("MP4"),C=L([Z(T[0]),Z(T[1])]);X.confirm({title:e("routes.home.录像下载标题"),width:500,content:()=>o("div",null,[o(ee,{layout:"vertical"},{default:()=>[o(ee.Item,{label:e("routes.home.录像流路径"),required:!0},{default:()=>[o(xe,{value:m.value,onChange:s=>m.value=s,options:B.value.map(s=>({label:s,value:s}))},null)]}),o(ee.Item,{label:e("routes.home.录像类型"),required:!0},{default:()=>[o(xe,{value:w.value,onChange:s=>w.value=s,options:[{label:"MP4",value:"MP4"},{label:"FLV",value:"FLV"}]},null)]}),o(ee.Item,{label:e("routes.home.录像时间范围"),required:!0},{default:()=>[o(mt,{disabledDate:s=>{const n=a.value.find(r=>r.streamPath===m.value&&r.type===w.value);return s&&(s<Z(n?.startTime)||s>Z(n?.endTime))},value:C.value,onChange:s=>C.value=s,showTime:!0,format:"YYYY-MM-DD HH:mm:ss"},null)]})]})]),onOk:()=>{if(!m.value||!C.value[0]||!C.value[1])return Promise.reject(e("routes.home.请填写完整信息"));const s=`${Z(C.value[0]).valueOf()}-${Z(C.value[1]).valueOf()}`;return P(`${ge(w.value.toLowerCase(),"/download")}/${m.value}?range=${s}`,`${m.value}-${C.value[0].format("YYYYMMDDHHmmss")}-${C.value[1].format("YYYYMMDDHHmmss")}.${w.value.toLowerCase()}`),Promise.resolve()}})};function P(m,w){const C=document.createElement("a");C.href=m,C.target="_blank",C.download=w,document.body.appendChild(C),C.click(),document.body.removeChild(C)}return Se(c,m=>{m?(v(),d()):(z(),a.value=[],B.value=[],T[0]=0,T[1]=0)},{immediate:!0}),(m,w)=>(O(),E(t(ae),{size:"small",class:"w-250px drop-shadow-xl"},{title:h(()=>[u("span",null,b(t(e)("routes.home.录像读取")),1),a.value.length?(O(),E(t(_e),{key:0,title:t(e)("routes.home.帮助"),content:t(e)("routes.home.录像读取帮助")},{default:h(()=>[o(t(V),{type:"link",size:"small"},{default:h(()=>[o(t(me),{class:"ml-1 text-gray-400"})]),_:1})]),_:1},8,["title","content"])):he("",!0)]),extra:h(()=>[c.value?(O(),E(t(V),{key:0,type:"link",onClick:k},{default:h(()=>[U(b(t(e)("routes.home.录像下载")),1)]),_:1})):(O(),W("span",Aa,b(t(e)("routes.home.请先启用MP4或FLV插件")),1))]),default:h(()=>[o(t(J),{type:"source",position:t(q).Right},null,8,["position"]),a.value.length?(O(),E(t(te),{key:0,"data-source":a.value,columns:$.value,size:"small",pagination:!1,bordered:"",scroll:{x:"max-content"},class:"record-table"},null,8,["data-source","columns"])):(O(),W("span",Va,b(t(e)("routes.home.录像读取功能说明")),1))]),_:1}))}});const Ua=it(Ea,[["__scopeId","data-v-1bf0d5af"]]),Ya={key:1},qa={key:1,class:"text-12px"},Wa=Y({name:"PlayRecord"}),Ka=Y({...Wa,props:{data:{}},setup(l){const{t:e}=Q(),i=L(null),a=L([]),c=L(),p=L([]),R=L("mp4"),$=l,z=de(()=>$.data.plugins.some(B=>B.name==="MP4"||B.name==="FLV")),d=async()=>{if(p.value.length){p.value=[];return}const[B,T]=await Promise.all([Re("mp4").catch(()=>[]),Re("flv").catch(()=>[])]),v=[...B.map(P=>({...P,type:"mp4"})),...T.map(P=>({...P,type:"flv"}))];if(v.length===0){X.warning({title:e("routes.home.提示"),content:e("routes.home.没有可用的录像记录")});return}a.value=[...new Set(v.map(P=>P.streamPath))].map(P=>({label:P,value:P})),c.value=a.value[0].value,R.value=v.find(P=>P.streamPath===c.value)?.type||"mp4";let k=L([Z(v[0].startTime),Z(v[0].endTime)]);X.confirm({title:e("routes.home.播放录像"),width:500,content:()=>o("div",null,[o(ee,{layout:"vertical"},{default:()=>[o(ee.Item,{label:e("routes.home.录像流路径"),required:!0},{default:()=>[o(xe,{value:c.value,onChange:P=>{c.value=P,R.value=v.find(m=>m.streamPath===P)?.type||"mp4"},placeholder:e("routes.home.请选择流路径"),options:a.value},null)]}),o(ee.Item,{label:e("routes.home.录像类型"),required:!0},{default:()=>[o(xe,{value:R.value,onChange:P=>R.value=P,options:[{label:"MP4",value:"mp4"},{label:"FLV",value:"flv"}]},null)]}),o(ee.Item,{label:e("routes.home.播放时间范围"),required:!0},{default:()=>[o(mt,{value:k.value,disabledDate:P=>{const m=v.find(w=>w.streamPath===c.value&&w.type===R.value);return P&&(P<Z(m?.startTime)||P>Z(m?.endTime))},onChange:P=>k.value=P,showTime:!0,format:"YYYY-MM-DD HH:mm:ss"},null)]})]})]),onOk:async()=>{if(!k.value?.[0]||!k.value?.[1])return Promise.reject(e("routes.home.请选择时间范围"));p.value=await ht({streamPath:c.value,type:R.value,range:`${k.value[0].unix()}-${k.value[1].unix()}`})}})};return(B,T)=>(O(),E(t(ae),{size:"small",class:"w-250px drop-shadow-xl"},{title:h(()=>[u("span",null,b(t(e)("routes.home.录像播放")),1),i.value?(O(),E(t(_e),{key:0,title:t(e)("routes.home.帮助"),content:t(e)("routes.home.录像播放帮助")},{default:h(()=>[o(t(V),{type:"link",size:"small"},{default:h(()=>[o(t(me),{class:"ml-1 text-gray-400"})]),_:1})]),_:1},8,["title","content"])):he("",!0)]),extra:h(()=>[z.value?(O(),E(t(V),{key:0,type:"link",onClick:d},{default:h(()=>[U(b(p.value.length?t(e)("routes.home.停止"):t(e)("routes.home.播放")),1)]),_:1})):(O(),W("span",Ya,b(t(e)("routes.home.请先启用MP4或FLV插件")),1))]),default:h(()=>[o(t(J),{type:"target",position:t(q).Left},null,8,["position"]),p.value.length?(O(),E(bo,{key:0,src:`${t(ge)("hls","/vod")}/fmp4.m3u8?start=${new Date(p.value[0].startTime).getTime()}&streamPath=${c.value}`},null,8,["src"])):(O(),W("span",qa,b(t(e)("routes.home.录像播放功能说明")),1))]),_:1}))}}),Ga={key:0,class:"p-8px"},Qa={key:1,class:"text-12px"},Ja=Y({name:"Upstream"}),Xa=Y({...Ja,setup(l){const{t:e}=Q(),i=ze(),{nodeHistory:a}=ye(i),c=[{title:"M7S ID",dataIndex:"m7sId",key:"m7sId"},{title:"IP",dataIndex:"ip",key:"ip"}];return(p,R)=>(O(),E(t(ae),{size:"small",class:"w-500px drop-shadow-xl"},{title:h(()=>[u("span",null,b(t(e)("routes.home.上级节点")),1)]),extra:h(()=>[o(t(V),{disabled:!t(a).length,type:"link",size:"small",onClick:t(i).removeLastNode},{default:h(()=>[U(b(t(e)("routes.home.返回上一级")),1)]),_:1},8,["disabled","onClick"])]),default:h(()=>[o(t(J),{type:"source",position:t(q).Bottom},null,8,["position"]),t(a).length?(O(),W("div",Ga,[o(t(te),{columns:c,"data-source":t(a),size:"small",pagination:!1},null,8,["data-source"])])):(O(),W("span",Qa,b(t(e)("routes.home.点击右上角按钮可以返回上级节点")),1))]),_:1}))}}),De=Jt({requestOptions:{apiUrl:()=>ge("cascadeserver")}});function Za(){return De.get({url:"/list"})}function en(l){return De.post({url:"/create",data:l})}function tn(l){return De.post({url:`/delete/${l.id}`})}function on(l){return De.post({url:"/update",data:l})}const sn={key:0},an={key:0,class:"p-8px"},nn={key:1,class:"text-12px"},ln={key:1,class:"p-16px text-center text-gray-500"};function nt(l){return typeof l=="function"||Object.prototype.toString.call(l)==="[object Object]"&&!Ce(l)}const rn=Y({name:"Downstream"}),un=Y({...rn,props:{data:{default:()=>({active:!1})}},setup(l){const{t:e}=Q(),i=l,a=L([]);L(!1),L();const c=()=>({type:"object",properties:{name:{type:"string",title:e("routes.home.节点名称"),required:!0,"x-decorator":"FormItem","x-component":"Input","x-component-props":{placeholder:e("routes.home.请输入节点名称")},"x-validator":[{required:!0,message:e("routes.home.请输入节点名称")},{max:50,message:e("routes.home.节点名称不能超过50个字符")}]},secret:{type:"string",title:e("routes.home.密钥"),"x-decorator":"FormItem","x-component":"Password","x-component-props":{placeholder:e("routes.home.请输入密钥")},"x-validator":[{message:e("routes.home.请输入密钥")}]}}}),p=async v=>{try{await tn(v),ue.success(e("routes.home.删除成功")),d()}catch(k){ue.error(e("routes.home.删除失败")+":"+k.message)}},R=lt(),$=[{title:e("routes.home.名称"),dataIndex:"name",key:"name",customRender:({record:v})=>v.online?o(V,{type:"link",size:"small",onClick:()=>{R({name:"Home"})}},{default:()=>[v.name]}):v.name},{title:"IP",dataIndex:"ip",key:"ip"},{title:e("routes.home.状态"),key:"status",width:100,customRender:({record:v})=>v.online?e("routes.home.已连接"):e("routes.home.未连接")},{title:e("routes.home.操作"),key:"action",width:100,customRender:({record:v})=>{let k,P;return o(Xt,null,{default:()=>[o(V,{type:"link",size:"small",onClick:()=>z(v)},nt(k=e("routes.home.修改"))?k:{default:()=>[k]}),o($o,{title:e("routes.home.确定要删除该节点吗"),onConfirm:()=>p(v)},{default:()=>[o(V,{type:"link",size:"small",danger:!0},nt(P=e("routes.home.删除"))?P:{default:()=>[P]})]})]})}}],z=v=>{const k=!!v,P=v||{id:Date.now(),name:"",ip:"",secret:"",online:!1},{FormilyForm:m,form:w,submit:C}=Zt({schema:c(),formProps:{initialValues:P}});eo({content:()=>o(m,null,null),modalConfig:{title:e(k?"routes.home.修改下级节点":"routes.home.添加下级节点"),maskClosable:!1,width:500,onOk:async()=>{try{const s=await C();if(s){const n={...P,...s};return n.online?Promise.reject(e("routes.home.请先断开当前连接")):(k?(await on(n),ue.success(e("routes.home.修改成功"))):(await en(n),ue.success(e("routes.home.添加成功"))),d(),Promise.resolve(!0))}return Promise.reject(!1)}catch(s){return s===!1?Promise.reject(!1):(ue.error(e(k?"routes.home.修改":"routes.home.添加")+"失败:"+s.message),Promise.reject(s))}},onClose:()=>{w.reset()}}})};async function d(){if(i.data.active)try{a.value=await Za()}catch(v){ue.error(e("routes.home.获取下级节点列表失败")+":"+v.message)}}const{pause:B,resume:T}=ce(d);return B(),Se(()=>i.data.active,v=>{v?(d(),T()):(a.value=[],B())}),Ae(()=>{i.data.active&&(d(),T())}),(v,k)=>(O(),E(t(ae),{size:"small",class:"w-500px drop-shadow-xl"},{title:h(()=>[u("span",null,b(t(e)("routes.home.下级节点")),1),o(t(_e),{title:t(e)("routes.home.帮助"),content:t(e)("routes.home.下级节点功能说明")},{default:h(()=>[o(t(V),{type:"link",size:"small"},{default:h(()=>[o(t(me),{class:"ml-1 text-gray-400"})]),_:1})]),_:1},8,["title","content"])]),extra:h(()=>[o(t(V),{type:"link",size:"small",onClick:k[0]||(k[0]=P=>z()),disabled:!i.data.active},{default:h(()=>[U(b(t(e)("routes.home.添加节点")),1)]),_:1},8,["disabled"])]),default:h(()=>[o(t(J),{type:"target",position:t(q).Top},null,8,["position"]),i.data.active?(O(),W("div",sn,[a.value.length?(O(),W("div",an,[o(t(te),{columns:$,"data-source":a.value,size:"small",pagination:!1},null,8,["data-source"])])):(O(),W("span",nn,b(t(e)("routes.home.下级节点功能说明")),1))])):(O(),W("div",ln,b(t(e)("routes.home.服务器需要启用CascadeServer插件")),1))]),_:1}))}}),cn={class:"text-text flex items-center gap-2"},dn=Y({__name:"flow",setup(l){const{t:e}=Q(),i={instance:re(ia),pullProxy:re(da),pusher:re(ka),debugChart:re(Ca),logTrail:re(Ra),preview:re(Ma),pushProxy:re(Ha),readRecord:re(Ua),playRecord:re(Ka),upstream:re(Xa),downstream:re(un)},a=L(!1),c=L(!1),p=L(!1),R=L(!1),$=ze(),{online:z}=ye($),d=de(()=>({id:"center",type:"instance",data:{onShowDebugChart:()=>{p.value=!0},onShowLogTrail:()=>{R.value=!0}},position:{x:400,y:300}})),B=de(()=>z.value?[...p.value?[{id:"debugChart",position:{x:100,y:100},data:{onClose:()=>{p.value=!1}},type:"debugChart",zIndex:1e3}]:[],...R.value?[{id:"logTrail",position:{x:100,y:300},type:"logTrail",data:{onClose:()=>{R.value=!1}},zIndex:1001}]:[],{id:"pullProxy",position:{x:50,y:100},targetPosition:q.Right,data:{plugins:$.plugins},type:"pullProxy"},{id:"pushProxy",position:{x:1e3,y:100},data:{plugins:$.plugins},sourcePosition:q.Left,type:"pushProxy"},{id:"pusher",position:{x:50,y:350},data:{plugins:$.plugins,onPush:v=>{a.value=v}},targetPosition:q.Right,type:"pusher"},{id:"player",position:{x:1e3,y:350},data:{plugins:$.plugins,sysInfo:$.sysInfo,onPlay:v=>{c.value=v}},sourcePosition:q.Left,type:"preview"},{id:"upstream",type:"upstream",position:{x:400,y:100},data:{plugins:$.plugins}},{id:"downstream",type:"downstream",position:{x:400,y:700},data:{plugins:$.plugins,active:$.plugins.some(v=>v.name==="CascadeServer")||!1}},d.value,{id:"readRecord",type:"readRecord",data:{plugins:$.plugins},position:{x:50,y:700},targetPosition:q.Right},{id:"playRecord",type:"playRecord",data:{plugins:$.plugins},position:{x:1e3,y:700},sourcePosition:q.Left}]:[d.value]),T=de(()=>z.value?[{id:"e1->center",source:"pullProxy",target:"center",targetHandle:"target-pull",animated:!0},{id:"epusher->center",source:"pusher",target:"center",targetHandle:"target-push",animated:!0,style:a.value?{stroke:"#000",border:"2px",filter:"drop-shadow(0 0 2px cyan)"}:void 0},{id:"center->pushProxy",source:"center",target:"pushProxy",sourceHandle:"source-push",animated:!0},{id:"center->player",source:"center",target:"player",sourceHandle:"source-play",animated:!0,style:c.value?{stroke:"#000",border:"2px",filter:"drop-shadow(0 0 2px cyan)"}:void 0},{id:"e2->center",source:"upstream",target:"center",targetHandle:"upstream"},{id:"e3->center",source:"center",target:"downstream",sourceHandle:"downstream"},{id:"readRecord->center",source:"readRecord",target:"center",targetHandle:"target-read",animated:!0},{id:"center->playRecord",source:"center",target:"playRecord",sourceHandle:"source-read",animated:!0}]:[]);return(v,k)=>(O(),W(dt,null,[u("h2",cn,[u("span",null,[U(b(t(e)("routes.home.Monibuca超级面板"))+" ",1),o(t(je),{color:"green",class:"text-10px v-text-bottom"},{default:h(()=>k[0]||(k[0]=[U("For m7s Pro V5")])),_:1})]),o(t(je),{color:"blue",class:"text-12px font-normal"},{default:h(()=>[o(t(Ro),{class:"mr-1"}),U(" "+b(t(e)("routes.home.面板拖拽提示")),1)]),_:1})]),o(t(ao),{style:{position:"unset"},nodes:B.value,"node-types":i,edges:T.value,"zoom-on-scroll":!1,"pan-on-drag":!0,"zoom-on-double-click":!1,"nodes-connectable":!1,"select-nodes-on-drag":!1,"connect-on-click":!1,"elements-selectable":!1},{default:h(()=>[o(t(so))]),_:1},8,["nodes","edges"])],64))}});const mn={class:"h-100vh w-100vw p-10px",style:{background:"var(--layout-background)"}},pn={class:"h-full w-full flex min-w-1200px"},hn=Y({name:"Instance"}),Vn=Y({...hn,setup(l){const{t:e}=Q();wo(),ye(to());const i=oo();return ye(i),de(()=>[{title:"Monibuca",description:e("routes.home.开源Go语言流媒体服务器框架"),url:"https://monibuca.com",svg:"logo",size:40},{title:"Jessibuca",description:e("routes.home.纯H5音视频流播放器"),url:"https://jessibuca.com",svg:"jb",size:40},{title:"Rebebuca",description:e("routes.home.Rust桌面端FFMPEG管理器"),url:"https://rebebuca.com",svg:"rb",size:34}]),(a,c)=>(O(),W("div",mn,[u("div",pn,[he("",!0),o(t(ae),{class:"flex-1 rounded-r-lg",bodyStyle:{height:"100%"}},{default:h(()=>[o(dn)]),_:1})])]))}});export{Vn as default};
- //# sourceMappingURL=index-b07799b5.js.map
|