1 line
12 KiB
JavaScript
Vendored
1 line
12 KiB
JavaScript
Vendored
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6964],{64830:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin",function(){return n(40341)}])},86177:function(e,t,n){"use strict";n.d(t,{o:function(){return m}});var s=n(85893);n(67294);var a=n(85818),l=n(20550),r=n(54398),i=n(53731),o=n(58091);let{Title:c}=a.Z;function d(e,t){let n="black";return"warning"===t.level?n="orange":"error"===t.level&&(n="red"),(0,s.jsx)(l.Z,{color:n,children:e})}function u(e){return(0,s.jsx)(i.Z,{children:e})}let m=e=>{let{logs:t,pageSize:n}=e;return(null==t?void 0:t.length)?(0,s.jsxs)("div",{className:"logs-section",children:[(0,s.jsx)(c,{children:"Logs"}),(0,s.jsx)(r.Z,{size:"middle",dataSource:t,columns:[{title:"Level",dataIndex:"level",key:"level",filters:[{text:"Info",value:"info"},{text:"Warning",value:"warning"},{text:"Error",value:"Error"}],onFilter:(e,t)=>0===t.level.indexOf(e),render:d},{title:"Timestamp",dataIndex:"time",key:"time",render:e=>{let t=new Date(e);return(0,o.Z)(t,"pp P")},sorter:(e,t)=>new Date(e.time).getTime()-new Date(t.time).getTime(),sortDirections:["descend","ascend"],defaultSortOrder:"descend"},{title:"Message",dataIndex:"message",key:"message",render:u}],rowKey:e=>e.time,pagination:{pageSize:n||20}})]}):null}},53920:function(e,t,n){"use strict";n.d(t,{j:function(){return g}});var s=n(85893),a=n(59652),l=n(71230),r=n(15746),i=n(74763),o=n(85818),c=n(14670),d=n(71577),u=n(5152),m=n.n(u),h=n(41664),x=n.n(h),j=n(67294),p=n(38631);let f=m()(()=>Promise.all([n.e(2074),n.e(7996)]).then(n.t.bind(n,67996,23)),{loadableGenerated:{webpack:()=>[67996]},ssr:!1}),v=m()(()=>Promise.all([n.e(2074),n.e(7039)]).then(n.t.bind(n,67039,23)),{loadableGenerated:{webpack:()=>[67039]},ssr:!1}),g=e=>{let{showTroubleshootButton:t}=e,n=(0,j.useContext)(p.aC),{health:u}=n;if(!u)return null;let{healthy:m,healthPercentage:h,message:g,representation:w}=u,b="#3f8600",y="info";return h<80?(b="#cf000f",y="error"):h<30&&(b="#f0ad4e",y="error"),(0,s.jsx)("div",{children:(0,s.jsxs)(a.Z,{type:"inner",children:[(0,s.jsxs)(l.Z,{gutter:8,children:[(0,s.jsx)(r.Z,{span:12,children:(0,s.jsx)(i.Z,{title:"Healthy Stream",value:m?"Yes":"No",valueStyle:{color:b},prefix:m?(0,s.jsx)(f,{}):(0,s.jsx)(v,{})})}),(0,s.jsx)(r.Z,{span:12,children:(0,s.jsx)(i.Z,{title:"Playback Health",value:h,valueStyle:{color:b},suffix:"%"})})]}),(0,s.jsx)(l.Z,{style:{display:w<100&&0!==w?"grid":"none"},children:(0,s.jsxs)(o.Z.Text,{type:"secondary",style:{textAlign:"center",fontSize:"0.7em",opacity:"0.3"},children:["Stream health represents ",w,"% of all known players. Other player status is unknown."]})}),(0,s.jsx)(l.Z,{gutter:16,style:{width:"100%",display:g?"grid":"none",marginTop:"10px"},children:(0,s.jsx)(r.Z,{span:24,children:(0,s.jsx)(c.Z,{message:g,type:y,showIcon:!0,action:t&&(0,s.jsx)(x(),{passHref:!0,href:"/stream-health",children:(0,s.jsx)(d.Z,{size:"small",type:"text",style:{color:"black"},children:"TROUBLESHOOT"})})})})})]})})};g.defaultProps={showTroubleshootButton:!0}},40341:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return A}});var s=n(85893),a=n(67294),l=n(26303),r=n(74763),i=n(59652),o=n(71230),c=n(15746),d=n(19642),u=n(45938),m=n(5152),h=n.n(m),x=n(38631),j=n(86177),p=n(85818),f=n(41664),v=n.n(f),g=n(42099),w=n(54907),b=n(58091),y=n(81453);let{Panel:Z}=w.Z,{Title:k,Link:N}=p.Z,S=e=>{let{title:t,url:n,content_html:a,date_published:l}=e,r=new Date(l),i=(0,b.Z)(r,"MMM dd, yyyy, HH:mm");return(0,s.jsx)("article",{children:(0,s.jsx)(w.Z,{children:(0,s.jsxs)(Z,{header:t,children:[(0,s.jsxs)("p",{className:"timestamp",children:[i," (",(0,s.jsx)(N,{href:"".concat("https://owncast.online").concat(n),target:"_blank",rel:"noopener noreferrer",children:"Link"}),")"]}),(0,s.jsx)("div",{dangerouslySetInnerHTML:{__html:a}})]},n)})})},C=()=>{let[e,t]=(0,a.useState)([]),[n,r]=(0,a.useState)(!0),i=async()=>{r(!1);try{let e=await (0,y.kg)("https://owncast.online/news/index.json");(null==e?void 0:e.items.length)>0&&t(e.items)}catch(e){console.log("==== error",e)}};(0,a.useEffect)(()=>{i()},[]);let o=n?(0,s.jsx)(l.Z,{loading:!0,active:!0}):null,c=n||0!==e.length?null:(0,s.jsx)("div",{children:"No news."});return(0,s.jsxs)("section",{className:"news-feed form-module",children:[(0,s.jsx)(k,{level:2,children:"News & Updates from Owncast"}),o,e.map(e=>(0,a.createElement)(S,{...e,key:e.url})),c]})},{Paragraph:_,Text:O}=p.Z,{Title:E}=p.Z,{Meta:T}=i.Z,P=h()(()=>Promise.all([n.e(2074),n.e(3371)]).then(n.t.bind(n,33371,23)),{loadableGenerated:{webpack:()=>[33371]},ssr:!1}),D=h()(()=>Promise.all([n.e(2074),n.e(5308)]).then(n.t.bind(n,85308,23)),{loadableGenerated:{webpack:()=>[85308]},ssr:!1}),U=h()(()=>Promise.all([n.e(2074),n.e(856)]).then(n.t.bind(n,20856,23)),{loadableGenerated:{webpack:()=>[20856]},ssr:!1}),I=h()(()=>Promise.all([n.e(2074),n.e(9208)]).then(n.t.bind(n,99208,23)),{loadableGenerated:{webpack:()=>[99208]},ssr:!1}),L=e=>{var t,l,r;let d,{logs:u=[],config:m}=e,h=(0,a.useContext)(x.aC),{serverConfig:p}=h||{},{rtmpServerPort:f,streamKeyOverridden:w}=p,b=(null===(t=n.g.window)||void 0===t?void 0:t.location.hostname)||"";b&&f&&(d="rtmp://".concat(b.replace(/(^\w+:|^)\/\//,""),":").concat(f,"/live"));let y=[{icon:(0,s.jsx)(P,{twoToneColor:"#6f42c1"}),title:"Use your broadcasting software",content:(0,s.jsxs)("div",{children:[(0,s.jsx)("a",{href:"https://owncast.online/docs/broadcasting/?source=admin",target:"_blank",rel:"noopener noreferrer",children:"Learn how to point your existing software to your new server and start streaming your content."}),(0,s.jsxs)("div",{className:"stream-info-container",children:[(0,s.jsx)(O,{strong:!0,className:"stream-info-label",children:"Streaming URL:"}),d&&(0,s.jsx)(_,{className:"stream-info-box",copyable:!0,children:d}),(0,s.jsx)(O,{strong:!0,className:"stream-info-label",children:"Streaming Keys:"}),(0,s.jsx)(O,{strong:!0,className:"stream-info-box",children:w?(0,s.jsx)("span",{style:{paddingLeft:"10px",fontWeight:"normal"},children:"Overridden via command line."}):(0,s.jsx)(v(),{href:"/admin/config/server",children:" View "})})]})]})},{icon:(0,s.jsx)(U,{twoToneColor:"#f9826c"}),title:"Embed your video onto other sites",content:(0,s.jsx)("div",{children:(0,s.jsx)("a",{href:"https://owncast.online/docs/embed?source=admin",target:"_blank",rel:"noopener noreferrer",children:"Learn how you can add your Owncast stream to other sites you control."})})}];return(null==m?void 0:m.chatDisabled)||y.push({icon:(0,s.jsx)(D,{twoToneColor:"#0366d6"}),title:"Chat is disabled",content:(0,s.jsx)("span",{children:"Chat will continue to be disabled until you begin a live stream."})}),(null==m?void 0:null===(l=m.yp)||void 0===l?void 0:l.enabled)||y.push({icon:(0,s.jsx)(I,{twoToneColor:"#D18BFE"}),title:"Find an audience on the Owncast Directory",content:(0,s.jsxs)("div",{children:["List yourself in the Owncast Directory and show off your stream. Enable it in"," ",(0,s.jsx)(v(),{href:"/admin/config/general/",children:"settings."})]})}),(null==m?void 0:null===(r=m.federation)||void 0===r?void 0:r.enabled)||y.push({icon:(0,s.jsx)("img",{alt:"fediverse",width:"20px",src:"/img/fediverse-color.png"}),title:"Add your Owncast instance to the Fediverse",content:(0,s.jsxs)("div",{children:[(0,s.jsx)(v(),{href:"/admin/config-federation/",children:"Enable Owncast social"})," features to have your instance join the Fediverse, allowing people to follow, share and engage with your live stream."]})}),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(o.Z,{children:(0,s.jsx)(c.Z,{span:12,offset:6,children:(0,s.jsxs)("div",{className:"offline-intro",children:[(0,s.jsx)("span",{className:"logo",children:(0,s.jsx)(g.C,{variant:"simple"})}),(0,s.jsxs)("div",{children:[(0,s.jsx)(E,{level:2,children:"No stream is active"}),(0,s.jsx)("p",{children:"You should start one."})]})]})})}),(0,s.jsxs)(o.Z,{gutter:[16,16],className:"offline-content",children:[(0,s.jsx)(c.Z,{span:12,xs:24,sm:24,md:24,lg:12,className:"list-section",children:y.map(e=>(0,s.jsx)(i.Z,{size:"small",bordered:!1,children:(0,s.jsx)(T,{avatar:e.icon,title:e.title,description:e.content})},e.title))}),(0,s.jsx)(c.Z,{span:12,xs:24,sm:24,md:24,lg:12,children:(0,s.jsx)(C,{})})]}),(0,s.jsx)(j.o,{logs:u,pageSize:5})]})};var z=n(53920),B=n(37135),G=n(34261);let F=h()(()=>Promise.all([n.e(2074),n.e(5412)]).then(n.t.bind(n,95412,23)),{loadableGenerated:{webpack:()=>[95412]},ssr:!1}),H=h()(()=>Promise.all([n.e(2074),n.e(9095)]).then(n.t.bind(n,69095,23)),{loadableGenerated:{webpack:()=>[69095]},ssr:!1});function M(e){return(0,s.jsxs)("ul",{className:"statistics-list",children:[(0,s.jsxs)("li",{children:[e.videoCodec||"Unknown"," @ ",e.videoBitrate||"Unknown"," kbps"]}),(0,s.jsxs)("li",{children:[e.framerate||"Unknown"," fps"]}),(0,s.jsxs)("li",{children:[e.width," x ",e.height]})]})}function A(){var e,t;let n=(0,a.useContext)(x.aC),{broadcaster:m,serverConfig:h}=n||{},{remoteAddr:p,streamDetails:f}=m||{},v=(null==f?void 0:f.encoder)||"Unknown encoder",[g,w]=(0,a.useState)([]),b=async()=>{try{let e=await (0,y.rQ)(y.WQ);w(e)}catch(e){console.log("==== error",e)}},Z=()=>{b()};if((0,a.useEffect)(()=>{Z();let e=null;return e=setInterval(Z,y.NE),()=>{clearInterval(e)}},[]),(0,B.Qr)(h)||(0,B.Qr)(n))return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(l.Z,{active:!0}),(0,s.jsx)(l.Z,{active:!0}),(0,s.jsx)(l.Z,{active:!0})]});if(!m)return(0,s.jsx)(L,{logs:g,config:h});let k=null==n?void 0:null===(e=n.currentBroadcast)||void 0===e?void 0:null===(t=e.outputSettings)||void 0===t?void 0:t.map(e=>{let{audioPassthrough:t,videoPassthrough:n,audioBitrate:a,videoBitrate:l,framerate:i}=e,o=t?"".concat(f.audioCodec||"Unknown",", ").concat(f.audioBitrate," kbps"):"".concat(a||"Unknown"," kbps"),c=n?"".concat(f.videoBitrate||"Unknown"," kbps, ").concat(f.framerate," fps ").concat(f.width," x ").concat(f.height):"".concat(l||"Unknown"," kbps, ").concat(i," fps");return(0,s.jsxs)("div",{className:"stream-details-item-container",children:[(0,s.jsx)(r.Z,{className:"stream-details-item",title:"Outbound Video Stream",value:c}),(0,s.jsx)(r.Z,{className:"stream-details-item",title:"Outbound Audio Stream",value:o})]})}),{viewerCount:N,sessionPeakViewerCount:S}=n,_="".concat(f.audioCodec,", ").concat(f.audioBitrate||"Unknown"," kbps"),O=new Date(m.time);return(0,s.jsxs)("div",{className:"home-container",children:[(0,s.jsxs)("div",{className:"sections-container",children:[(0,s.jsx)("div",{className:"online-status-section",children:(0,s.jsxs)(i.Z,{size:"small",type:"inner",className:"online-details-card",children:[(0,s.jsxs)(o.Z,{gutter:[16,16],align:"middle",children:[(0,s.jsx)(c.Z,{span:8,sm:24,md:8,children:(0,s.jsx)(r.Z,{title:"Stream started ".concat((0,d.Z)(O,Date.now())),value:(0,u.Z)(O),prefix:(0,s.jsx)(H,{})})}),(0,s.jsx)(c.Z,{span:8,sm:24,md:8,children:(0,s.jsx)(r.Z,{title:"Viewers",value:N,prefix:(0,s.jsx)(F,{})})}),(0,s.jsx)(c.Z,{span:8,sm:24,md:8,children:(0,s.jsx)(r.Z,{title:"Peak viewer count",value:S,prefix:(0,s.jsx)(F,{})})})]}),(0,s.jsx)(z.j,{})]})}),(0,s.jsxs)(o.Z,{gutter:[16,16],className:"section stream-details-section",children:[(0,s.jsxs)(c.Z,{className:"stream-details",span:12,sm:24,md:24,lg:12,children:[(0,s.jsx)(i.Z,{size:"small",title:"Outbound Stream Details",type:"inner",className:"outbound-details",children:k}),(0,s.jsxs)(i.Z,{size:"small",title:"Inbound Stream Details",type:"inner",children:[(0,s.jsx)(r.Z,{className:"stream-details-item",title:"Input",value:"".concat(v," ").concat((0,B.t5)(p))}),(0,s.jsx)(r.Z,{className:"stream-details-item",title:"Inbound Video Stream",value:f,formatter:M}),(0,s.jsx)(r.Z,{className:"stream-details-item",title:"Inbound Audio Stream",value:_})]})]}),(0,s.jsx)(c.Z,{span:12,xs:24,sm:24,md:24,lg:12,children:(0,s.jsx)(C,{})})]})]}),(0,s.jsx)("br",{}),(0,s.jsx)(j.o,{logs:g,pageSize:5})]})}A.getLayout=function(e){return(0,s.jsx)(G.l,{page:e})}}},function(e){e.O(0,[173,5874,2184,2301,4931,5402,5257,1664,8014,5818,9915,4041,3698,3013,4398,7940,8019,5938,7162,2429,7999,4261,9774,2888,179],function(){return e(e.s=64830)}),_N_E=e.O()}]); |