Bundle embedded web app
This commit is contained in:
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7095],{62433:function(e,s,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/chat/messages",function(){return t(57533)}])},57533:function(e,s,t){"use strict";t.r(s),t.d(s,{OUTCOME_TIMEOUT:function(){return N},default:function(){return v}});var a=t(85893),i=t(67294),l=t(84485),n=t(71577),r=t(52206),c=t(89739),d=t(21640),o=t(94184),u=t.n(o),h=t(58091),m=t(64777),p=t(70241),g=t(94199),x=t(99611),w=t(90420);let y=e=>{let{isVisible:s,message:t,setMessage:l}=e;if(!t||(0,p.Qr)(t))return null;let r=null,[o,u]=(0,i.useState)(0),{id:h}=t||{},y=()=>{r=setTimeout(()=>{u(0)},N)};(0,i.useEffect)(()=>()=>{clearTimeout(r)});let f=async()=>{clearTimeout(r),u(0);let e=await (0,m.rQ)(m.hn,{auth:!0,method:"POST",data:{visible:!s,idArray:[h]}});e.success&&"changed"===e.message?(l({...t,visible:!s}),u(1)):(l({...t,visible:s}),u(-1)),y()},j=(0,a.jsx)(c.Z,{style:{color:"transparent"}});return o&&(j=o>0?(0,a.jsx)(c.Z,{style:{color:"var(--ant-success)"}}):(0,a.jsx)(d.Z,{style:{color:"var(--ant-warning)"}})),(0,a.jsxs)("div",{className:"toggle-switch ".concat(s?"":"hidden"),children:[(0,a.jsx)("span",{className:"outcome-icon",children:j}),(0,a.jsx)(g.Z,{title:"Click to ".concat(s?"hide":"show"," this message"),placement:"topRight",children:(0,a.jsx)(n.Z,{shape:"circle",size:"small",type:"text",icon:s?(0,a.jsx)(x.Z,{}):(0,a.jsx)(w.Z,{}),onClick:f})})]})};var f=t(35691);let{Title:j}=l.Z,N=3e3;function v(){let[e,s]=(0,i.useState)([]),[t,l]=(0,i.useState)([]),[o,g]=(0,i.useState)(!1),[x,w]=(0,i.useState)(null),[v,b]=(0,i.useState)(""),T=null,C=null,S=async()=>{try{let e=await (0,m.rQ)(m.WE,{auth:!0});(0,p.Qr)(e)?s([]):s(e)}catch(t){console.log("==== error",t)}};(0,i.useEffect)(()=>(S(),C=setInterval(()=>{S()},m.NE),()=>{clearTimeout(T),clearTimeout(C)}),[]);let Z=function(e){let s=e.reduce((e,s)=>{let t=s.user.id;return e.some(e=>e.text===t)||e.push({text:t,value:t}),e},[]);return s.sort((e,s)=>{let t=e.text.toUpperCase(),a=s.text.toUpperCase();return t<a?-1:t>a?1:0})}(e),_=t=>{let a=e.findIndex(e=>e.id===t.id);e.splice(a,1,t),s([...e])},k=()=>{T=setTimeout(()=>{w(null),b("")},N)},E=async i=>{g(!0);let n=await (0,m.rQ)(m.hn,{auth:!0,method:"POST",data:{visible:i,idArray:t}});if(n.success&&"changed"===n.message){w((0,a.jsx)(c.Z,{})),k();let r=[...e];t.map(s=>{let t=r.findIndex(e=>e.id===s),a={...e[t],visible:i};return r.splice(t,1,a),null}),s(r),l([])}else w((0,a.jsx)(d.Z,{})),k();g(!1)},I=()=>{b("show"),E(!0)},O=()=>{b("hide"),E(!1)},M=u()({"bulk-editor":!0,active:t.length});return(0,a.jsxs)("div",{className:"chat-messages",children:[(0,a.jsx)(j,{children:"Chat Messages"}),(0,a.jsx)("p",{children:"Manage the messages from viewers that show up on your stream."}),(0,a.jsxs)("div",{className:M,children:[(0,a.jsx)("span",{className:"label",children:"Check multiple messages to change their visibility to: "}),(0,a.jsx)(n.Z,{type:"primary",size:"small",shape:"round",className:"button",loading:"show"===v&&o,icon:"show"===v&&x,disabled:!t.length||v&&"show"!==v,onClick:I,children:"Show"}),(0,a.jsx)(n.Z,{type:"primary",size:"small",shape:"round",className:"button",loading:"hide"===v&&o,icon:"hide"===v&&x,disabled:!t.length||v&&"hide"!==v,onClick:O,children:"Hide"})]}),(0,a.jsx)(r.Z,{size:"small",className:"table-container",pagination:{defaultPageSize:100,showSizeChanger:!0},scroll:{y:540},rowClassName:e=>e.hiddenAt?"hidden":"",dataSource:e,columns:[{title:"Time",dataIndex:"timestamp",key:"timestamp",className:"timestamp-col",defaultSortOrder:"descend",render(e){let s=new Date(e);return(0,h.Z)(s,"PP pp")},sorter:(e,s)=>new Date(e.timestamp).getTime()-new Date(s.timestamp).getTime(),width:90},{title:"User",dataIndex:"user",key:"user",className:"name-col",filters:Z,onFilter:(e,s)=>s.user.id===e,sorter:(e,s)=>e.user.displayName.localeCompare(s.user.displayName),sortDirections:["ascend","descend"],ellipsis:!0,render(e){let{displayName:s}=e;return(0,a.jsx)(f.Z,{user:e,children:s})},width:110},{title:"Message",dataIndex:"body",key:"body",className:"message-col",width:320,render:e=>(0,a.jsx)("div",{className:"message-contents",dangerouslySetInnerHTML:{__html:e}})},{title:"",dataIndex:"hiddenAt",key:"hiddenAt",className:"toggle-col",filters:[{text:"Visible messages",value:!0},{text:"Hidden messages",value:!1}],onFilter:(e,s)=>s.visible===e,render:(e,s)=>(0,a.jsx)(y,{isVisible:!e,message:s,setMessage:_}),width:30}],rowKey:e=>e.id,rowSelection:{selectedRowKeys:t,onChange(e){l(e)}}})]})}}},function(e){e.O(0,[3662,8909,3903,4267,2206,8091,5938,8733,1494,9774,2888,179],function(){return e(e.s=62433)}),_N_E=e.O()}]);
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9522],{55583:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/chat/users",function(){return n(46049)}])},46049:function(e,t,n){"use strict";n.r(t),n.d(t,{FETCH_INTERVAL:function(){return A},default:function(){return N}});var a=n(85893),s=n(67294),r=n(84381),c=n(99519),d=n(64777),l=n(55709),o=n(69677),i=n(52206),u=n(68795),h=n(45938),m=n(35691),g=n(37926),p=n(70241);let y=e=>{let{data:t}=e,n=[{title:"Display Name",key:"username",render(e){let{user:t,connectedAt:n,messageCount:s,userAgent:r}=e;return(0,a.jsx)(m.Z,{user:t,connectionInfo:{connectedAt:n,messageCount:s,userAgent:r},children:(0,a.jsx)("span",{className:"display-name",children:t.displayName})})},sorter:(e,t)=>t.user.displayName.localeCompare(e.user.displayName),filterIcon:(0,a.jsx)(u.Z,{}),filterDropdown(e){let{setSelectedKeys:t,selectedKeys:n,confirm:s}=e;return(0,a.jsx)("div",{style:{padding:8},children:(0,a.jsx)(o.Z,{placeholder:"Search display names...",value:n[0],onChange(e){t(e.target.value?[e.target.value]:[]),s({closeDropdown:!1})}})})},onFilter:(e,t)=>t.user.displayName.includes(e),sortDirections:["descend","ascend"]},{title:"Messages sent",dataIndex:"messageCount",key:"messageCount",className:"number-col",width:"12%",sorter:(e,t)=>e.messageCount-t.messageCount,sortDirections:["descend","ascend"],render:e=>(0,a.jsx)("div",{style:{textAlign:"center"},children:e})},{title:"Connected Time",dataIndex:"connectedAt",key:"connectedAt",defaultSortOrder:"ascend",render:e=>(0,h.Z)(new Date(e)),sorter:(e,t)=>new Date(t.connectedAt).getTime()-new Date(e.connectedAt).getTime(),sortDirections:["descend","ascend"]},{title:"User Agent",dataIndex:"userAgent",key:"userAgent",render:e=>(0,p.AB)(e)},{title:"Location",dataIndex:"geo",key:"geo",render:e=>e?"".concat(e.regionName,", ").concat(e.countryCode):"-"},{title:"",key:"block",className:"actions-col",render:(e,t)=>(0,a.jsx)(g.e,{user:t.user,isEnabled:!t.user.disabledAt})}];return(0,a.jsx)(i.Z,{className:"table-container",pagination:{hideOnSinglePage:!0},columns:n,dataSource:t,size:"small",rowKey:"id"})};var x=n(71577),f=n(58091),w=n(84674);async function j(e){try{await (0,d.rQ)(d.RB,{data:{value:e},method:"POST",auth:!0})}catch(t){console.error(t)}}let k=e=>{let{data:t}=e;return(0,a.jsx)(i.Z,{pagination:{hideOnSinglePage:!0},className:"table-container",columns:[{title:"IP Address",dataIndex:"ipAddress",key:"ipAddress"},{title:"Reason",dataIndex:"notes",key:"notes"},{title:"Created",dataIndex:"createdAt",key:"createdAt",render:e=>(0,f.Z)(new Date(e),"MMM d H:mma"),sorter:(e,t)=>new Date(e.createdAt).getTime()-new Date(t.createdAt).getTime(),sortDirections:["descend","ascend"]},{title:"",key:"block",className:"actions-col",render:(e,t)=>(0,a.jsx)(x.Z,{title:"Remove IP Address Ban",onClick:()=>j(t.ipAddress),icon:(0,a.jsx)(w.Z,{twoToneColor:"#ff4d4f"}),className:"block-user-button"})}],dataSource:t,size:"large",rowKey:"ipAddress"})},A=1e4;function N(){let e=(0,s.useContext)(c.aC),{online:t}=e||{},[n,o]=(0,s.useState)([]),[i,u]=(0,s.useState)([]),[h,m]=(0,s.useState)([]),[g,p]=(0,s.useState)([]),x=async()=>{try{let e=await (0,d.rQ)(d.qk);o(e)}catch(t){console.log("==== error",t)}try{let n=await (0,d.rQ)(d.Kp);m(n)}catch(a){console.log("==== error",a)}try{let s=await (0,d.rQ)(d.GC);p(s)}catch(r){console.error("error fetching moderators",r)}try{let c=await (0,d.rQ)(d.Bu);u(c)}catch(l){console.error("error fetching banned ips",l)}};(0,s.useEffect)(()=>{let e=null;return x(),e=setInterval(x,A),()=>{clearInterval(e)}},[t]);let f=t?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(y,{data:h}),(0,a.jsxs)("p",{className:"description",children:["Visit the"," ",(0,a.jsx)("a",{href:"https://owncast.online/docs/viewers/?source=admin",target:"_blank",rel:"noopener noreferrer",children:"documentation"})," ","to configure additional details about your viewers."]})]}):(0,a.jsx)("p",{className:"description",children:"When a stream is active and chat is enabled, connected chat clients will be displayed here."}),w=(0,a.jsxs)("span",{children:["Connected ",t?"(".concat(h.length,")"):"(offline)"]}),j=(0,a.jsxs)("span",{children:["Banned Users (",n.length,")"]}),N=(0,a.jsx)(l.K,{data:n}),b=(0,a.jsxs)("span",{children:["IP Bans (",i.length,")"]}),C=(0,a.jsx)(k,{data:i}),v=(0,a.jsxs)("span",{children:["Moderators (",g.length,")"]}),I=(0,a.jsx)(l.K,{data:g});return(0,a.jsx)(r.Z,{defaultActiveKey:"1",items:[{label:w,key:"1",children:f},{label:j,key:"2",children:N},{label:b,key:"3",children:C},{label:v,key:"4",children:I}]})}}},function(e){e.O(0,[3662,8909,3903,4267,2206,8091,4381,5938,8733,1494,9774,2888,179],function(){return e(e.s=55583)}),_N_E=e.O()}]);
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user