Files
owncast/static/web/_next/static/chunks/pages/admin-ddc16abe2a2d997e.js
2022-08-16 02:47:50 +00:00

1 line
11 KiB
JavaScript

(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6964],{64830:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin",function(){return t(69465)}])},824:function(e,n,t){"use strict";t.d(n,{Z:function(){return h}});var s=t(85893),r=(t(67294),t(84485)),i=t(20550),a=t(10355),o=t(53731),l=t(58091),c=r.Z.Title;function d(e,n){var t="black";return"warning"===n.level?t="orange":"error"===n.level&&(t="red"),(0,s.jsx)(i.Z,{color:t,children:e})}function u(e){return(0,s.jsx)(o.Z,{children:e})}function h(e){var n=e.logs,t=e.pageSize;if(!(null===n||void 0===n?void 0:n.length))return null;var r=[{title:"Level",dataIndex:"level",key:"level",filters:[{text:"Info",value:"info"},{text:"Warning",value:"warning"},{text:"Error",value:"Error"}],onFilter:function(e,n){return 0===n.level.indexOf(e)},render:d},{title:"Timestamp",dataIndex:"time",key:"time",render:function(e){var n=new Date(e);return(0,l.Z)(n,"pp P")},sorter:function(e,n){return new Date(e.time).getTime()-new Date(n.time).getTime()},sortDirections:["descend","ascend"],defaultSortOrder:"descend"},{title:"Message",dataIndex:"message",key:"message",render:u}];return(0,s.jsxs)("div",{className:"logs-section",children:[(0,s.jsx)(c,{children:"Logs"}),(0,s.jsx)(a.Z,{size:"middle",dataSource:n,columns:r,rowKey:function(e){return e.time},pagination:{pageSize:t||20}})]})}},14880:function(e,n,t){"use strict";t.d(n,{Z:function(){return v}});var s=t(85893),r=t(8751),i=t(11475),a=t(25968),o=t(6226),l=t(74763),c=t(84485),d=t(14670),u=t(71577),h=t(41664),x=t.n(h),m=t(67294),f=t(35159);function v(e){var n=e.showTroubleshootButton,t=(0,m.useContext)(f.aC).health;if(!t)return null;var h=t.healthy,v=t.healthPercentage,j=t.message,p=t.representation,g="#3f8600",Z="info";return v<80?(g="#cf000f",Z="error"):v<30&&(g="#f0ad4e",Z="error"),(0,s.jsxs)("div",{children:[(0,s.jsxs)(a.Z,{gutter:8,children:[(0,s.jsx)(o.Z,{span:12,children:(0,s.jsx)(l.Z,{title:"Healthy Stream",value:h?"Yes":"No",valueStyle:{color:g},prefix:h?(0,s.jsx)(r.Z,{}):(0,s.jsx)(i.Z,{})})}),(0,s.jsx)(o.Z,{span:12,children:(0,s.jsx)(l.Z,{title:"Playback Health",value:v,valueStyle:{color:g},suffix:"%"})})]}),(0,s.jsx)(a.Z,{style:{display:p<100&&0!==p?"grid":"none"},children:(0,s.jsxs)(c.Z.Text,{type:"secondary",style:{textAlign:"center",fontSize:"0.7em",opacity:"0.3"},children:["Stream health represents ",p,"% of all known players. Other player status is unknown."]})}),(0,s.jsx)(a.Z,{gutter:16,style:{width:"100%",display:j?"grid":"none",marginTop:"10px"},children:(0,s.jsx)(o.Z,{span:24,children:(0,s.jsx)(d.Z,{message:j,type:Z,showIcon:!0,action:n&&(0,s.jsx)(x(),{passHref:!0,href:"/stream-health",children:(0,s.jsx)(u.Z,{size:"small",type:"text",style:{color:"black"},children:"TROUBLESHOOT"})})})})})]})}v.defaultProps={showTroubleshootButton:!0}},69465:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return K}});var s=t(47568),r=t(34051),i=t.n(r),a=t(85893),o=t(67294),l=t(26303),c=t(74763),d=t(59652),u=t(25968),h=t(6226),x=t(24019),m=t(87547),f=t(19642),v=t(45938),j=t(35159),p=t(824),g=t(66567),Z=t(63179),w=t(78346),y=t(27482),b=t(84485),k=t(41664),N=t.n(k),S=t(92932),C=t(26042),T=t(69396),_=t(54907),O=t(58091),E=t(58827),D=_.Z.Panel,P=b.Z.Title,U=b.Z.Link;function I(e){var n=e.title,t=e.url,s=e.content_html,r=e.date_published,i=new Date(r),o=(0,O.Z)(i,"MMM dd, yyyy, HH:mm");return(0,a.jsx)("article",{children:(0,a.jsx)(_.Z,{children:(0,a.jsxs)(D,{header:n,children:[(0,a.jsxs)("p",{className:"timestamp",children:[o," (",(0,a.jsx)(U,{href:"".concat("https://owncast.online").concat(t),target:"_blank",rel:"noopener noreferrer",children:"Link"}),")"]}),(0,a.jsx)("div",{dangerouslySetInnerHTML:{__html:s}})]},t)})})}function z(){var e=(0,o.useState)([]),n=e[0],t=e[1],r=(0,o.useState)(!0),c=r[0],d=r[1],u=function(){var e=(0,s.Z)(i().mark((function e(){var n;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return d(!1),e.prev=1,e.next=4,(0,E.kg)("https://owncast.online/news/index.json");case 4:(null===(n=e.sent)||void 0===n?void 0:n.items.length)>0&&t(n.items),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(1),console.log("==== error",e.t0);case 11:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(){return e.apply(this,arguments)}}();(0,o.useEffect)((function(){u()}),[]);var h=c?(0,a.jsx)(l.Z,{loading:!0,active:!0}):null,x=c||0!==n.length?null:(0,a.jsx)("div",{children:"No news."});return(0,a.jsxs)("section",{className:"news-feed form-module",children:[(0,a.jsx)(P,{level:2,children:"News & Updates from Owncast"}),h,n.map((function(e){return(0,o.createElement)(I,(0,T.Z)((0,C.Z)({},e),{key:e.url}))})),x]})}var B=b.Z.Paragraph,L=b.Z.Text,F=b.Z.Title,H=d.Z.Meta;function M(e){var n,s,r,i,l=e.logs,c=void 0===l?[]:l,x=e.config,m=((0,o.useContext)(j.aC)||{}).serverConfig,f=m.streamKey,v=m.rtmpServerPort,b=(null===(n=t.g.window)||void 0===n?void 0:n.location.hostname)||"";b&&v&&(i=function(e,n){return"rtmp://".concat(e.replace(/(^\w+:|^)\/\//,""),":").concat(n,"/live")}(b,v));var k=[{icon:(0,a.jsx)(g.Z,{twoToneColor:"#6f42c1"}),title:"Use your broadcasting software",content:(0,a.jsxs)("div",{children:[(0,a.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,a.jsxs)("div",{className:"stream-info-container",children:[(0,a.jsx)(L,{strong:!0,className:"stream-info-label",children:"Streaming URL:"}),i&&(0,a.jsx)(B,{className:"stream-info-box",copyable:!0,children:i}),(0,a.jsx)(L,{strong:!0,className:"stream-info-label",children:"Stream Key:"}),(0,a.jsx)(B,{className:"stream-info-box",copyable:{text:f},children:"*********************"})]})]})},{icon:(0,a.jsx)(Z.Z,{twoToneColor:"#f9826c"}),title:"Embed your video onto other sites",content:(0,a.jsx)("div",{children:(0,a.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===x||void 0===x?void 0:x.chatDisabled)||k.push({icon:(0,a.jsx)(w.Z,{twoToneColor:"#0366d6"}),title:"Chat is disabled",content:(0,a.jsx)("span",{children:"Chat will continue to be disabled until you begin a live stream."})}),(null===x||void 0===x||null===(s=x.yp)||void 0===s?void 0:s.enabled)||k.push({icon:(0,a.jsx)(y.Z,{twoToneColor:"#D18BFE"}),title:"Find an audience on the Owncast Directory",content:(0,a.jsxs)("div",{children:["List yourself in the Owncast Directory and show off your stream. Enable it in"," ",(0,a.jsx)(N(),{href:"/config-public-details",children:"settings."})]})}),(null===x||void 0===x||null===(r=x.federation)||void 0===r?void 0:r.enabled)||k.push({icon:(0,a.jsx)("img",{alt:"fediverse",width:"20px",src:"fediverse-white.png"}),title:"Add your Owncast instance to the Fediverse",content:(0,a.jsxs)("div",{children:[(0,a.jsx)(N(),{href:"/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,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(u.Z,{children:(0,a.jsx)(h.Z,{span:12,offset:6,children:(0,a.jsxs)("div",{className:"offline-intro",children:[(0,a.jsx)("span",{className:"logo",children:(0,a.jsx)(S.Z,{variant:"simple"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)(F,{level:2,children:"No stream is active"}),(0,a.jsx)("p",{children:"You should start one."})]})]})})}),(0,a.jsxs)(u.Z,{gutter:[16,16],className:"offline-content",children:[(0,a.jsx)(h.Z,{span:12,xs:24,sm:24,md:24,lg:12,className:"list-section",children:k.map((function(e){return(0,a.jsx)(d.Z,{size:"small",bordered:!1,children:(0,a.jsx)(H,{avatar:e.icon,title:e.title,description:e.content})},e.title)}))}),(0,a.jsx)(h.Z,{span:12,xs:24,sm:24,md:24,lg:12,children:(0,a.jsx)(z,{})})]}),(0,a.jsx)(p.Z,{logs:c,pageSize:5})]})}var A=t(14880),Q=t(2766);function V(e){return(0,a.jsxs)("ul",{className:"statistics-list",children:[(0,a.jsxs)("li",{children:[e.videoCodec||"Unknown"," @ ",e.videoBitrate||"Unknown"," kbps"]}),(0,a.jsxs)("li",{children:[e.framerate||"Unknown"," fps"]}),(0,a.jsxs)("li",{children:[e.width," x ",e.height]})]})}function K(){var e,n,t=(0,o.useContext)(j.aC),r=t||{},g=r.broadcaster,Z=r.serverConfig,w=g||{},y=w.remoteAddr,b=w.streamDetails,k=(null===b||void 0===b?void 0:b.encoder)||"Unknown encoder",N=(0,o.useState)([]),S=N[0],C=N[1],T=function(){var e=(0,s.Z)(i().mark((function e(){var n;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,(0,E.rQ)(E.WQ);case 3:n=e.sent,C(n),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),console.log("==== error",e.t0);case 10:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(){return e.apply(this,arguments)}}(),_=function(){T()};if((0,o.useEffect)((function(){_();var e;return e=setInterval(_,E.NE),function(){clearInterval(e)}}),[]),(0,Q.Qr)(Z)||(0,Q.Qr)(t))return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(l.Z,{active:!0}),(0,a.jsx)(l.Z,{active:!0}),(0,a.jsx)(l.Z,{active:!0})]});if(!g)return(0,a.jsx)(M,{logs:S,config:Z});var O=null===t||void 0===t||null===(e=t.currentBroadcast)||void 0===e||null===(n=e.outputSettings)||void 0===n?void 0:n.map((function(e){var n=e.audioPassthrough,t=e.videoPassthrough,s=e.audioBitrate,r=e.videoBitrate,i=e.framerate,o=n?"".concat(b.audioCodec||"Unknown",", ").concat(b.audioBitrate," kbps"):"".concat(s||"Unknown"," kbps"),l=t?"".concat(b.videoBitrate||"Unknown"," kbps, ").concat(b.framerate," fps ").concat(b.width," x ").concat(b.height):"".concat(r||"Unknown"," kbps, ").concat(i," fps");return(0,a.jsxs)("div",{className:"stream-details-item-container",children:[(0,a.jsx)(c.Z,{className:"stream-details-item",title:"Outbound Video Stream",value:l}),(0,a.jsx)(c.Z,{className:"stream-details-item",title:"Outbound Audio Stream",value:o})]})})),D=t.viewerCount,P=t.sessionPeakViewerCount,U="".concat(b.audioCodec,", ").concat(b.audioBitrate||"Unknown"," kbps"),I=new Date(g.time);return(0,a.jsxs)("div",{className:"home-container",children:[(0,a.jsxs)("div",{className:"sections-container",children:[(0,a.jsx)("div",{className:"online-status-section",children:(0,a.jsxs)(d.Z,{size:"small",type:"inner",className:"online-details-card",children:[(0,a.jsxs)(u.Z,{gutter:[16,16],align:"middle",children:[(0,a.jsx)(h.Z,{span:8,sm:24,md:8,children:(0,a.jsx)(c.Z,{title:"Stream started ".concat((0,f.Z)(I,Date.now())),value:(0,v.Z)(I),prefix:(0,a.jsx)(x.Z,{})})}),(0,a.jsx)(h.Z,{span:8,sm:24,md:8,children:(0,a.jsx)(c.Z,{title:"Viewers",value:D,prefix:(0,a.jsx)(m.Z,{})})}),(0,a.jsx)(h.Z,{span:8,sm:24,md:8,children:(0,a.jsx)(c.Z,{title:"Peak viewer count",value:P,prefix:(0,a.jsx)(m.Z,{})})})]}),(0,a.jsx)(A.Z,{})]})}),(0,a.jsxs)(u.Z,{gutter:[16,16],className:"section stream-details-section",children:[(0,a.jsxs)(h.Z,{className:"stream-details",span:12,sm:24,md:24,lg:12,children:[(0,a.jsx)(d.Z,{size:"small",title:"Outbound Stream Details",type:"inner",className:"outbound-details",children:O}),(0,a.jsxs)(d.Z,{size:"small",title:"Inbound Stream Details",type:"inner",children:[(0,a.jsx)(c.Z,{className:"stream-details-item",title:"Input",value:"".concat(k," ").concat((0,Q.t5)(y))}),(0,a.jsx)(c.Z,{className:"stream-details-item",title:"Inbound Video Stream",value:b,formatter:V}),(0,a.jsx)(c.Z,{className:"stream-details-item",title:"Inbound Audio Stream",value:U})]})]}),(0,a.jsx)(h.Z,{span:12,xs:24,sm:24,md:24,lg:12,children:(0,a.jsx)(z,{})})]})]}),(0,a.jsx)("br",{}),(0,a.jsx)(p.Z,{logs:S,pageSize:5})]})}}},function(e){e.O(0,[384,355,8091,7961,5938,5315,4763,2429,3016,9774,2888,179],(function(){return n=64830,e(e.s=n);var n}));var n=e.O();_N_E=n}]);