Take control over your live stream video by running it yourself. Streaming + chat out of the box.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

1 lines
13 KiB

(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1234],{48689:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1413),o=n(67294),c={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"}}]},name:"delete",theme:"outlined"},a=n(42135),i=function(e,t){return o.createElement(a.Z,(0,r.Z)((0,r.Z)({},e),{},{ref:t,icon:c}))};i.displayName="DeleteOutlined";var l=o.forwardRef(i)},15746:function(e,t,n){"use strict";var r=n(21584);t.Z=r.Z},99134:function(e,t,n){"use strict";var r=(0,n(67294).createContext)({});t.Z=r},21584:function(e,t,n){"use strict";var r=n(4942),o=n(87462),c=n(71002),a=n(94184),i=n.n(a),l=n(67294),s=n(53124),u=n(99134),f=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n},d=["xs","sm","md","lg","xl","xxl"],p=l.forwardRef(function(e,t){var n,a=l.useContext(s.E_),p=a.getPrefixCls,h=a.direction,v=l.useContext(u.Z),m=v.gutter,y=v.wrap,b=v.supportFlexGap,x=e.prefixCls,Z=e.span,g=e.order,j=e.offset,O=e.push,w=e.pull,E=e.className,C=e.children,k=e.flex,S=e.style,P=f(e,["prefixCls","span","order","offset","push","pull","className","children","flex","style"]),N=p("col",x),T={};d.forEach(function(t){var n,a={},i=e[t];"number"==typeof i?a.span=i:"object"===(0,c.Z)(i)&&(a=i||{}),delete P[t],T=(0,o.Z)((0,o.Z)({},T),(n={},(0,r.Z)(n,"".concat(N,"-").concat(t,"-").concat(a.span),void 0!==a.span),(0,r.Z)(n,"".concat(N,"-").concat(t,"-order-").concat(a.order),a.order||0===a.order),(0,r.Z)(n,"".concat(N,"-").concat(t,"-offset-").concat(a.offset),a.offset||0===a.offset),(0,r.Z)(n,"".concat(N,"-").concat(t,"-push-").concat(a.push),a.push||0===a.push),(0,r.Z)(n,"".concat(N,"-").concat(t,"-pull-").concat(a.pull),a.pull||0===a.pull),(0,r.Z)(n,"".concat(N,"-rtl"),"rtl"===h),n))});var _=i()(N,(n={},(0,r.Z)(n,"".concat(N,"-").concat(Z),void 0!==Z),(0,r.Z)(n,"".concat(N,"-order-").concat(g),g),(0,r.Z)(n,"".concat(N,"-offset-").concat(j),j),(0,r.Z)(n,"".concat(N,"-push-").concat(O),O),(0,r.Z)(n,"".concat(N,"-pull-").concat(w),w),n),E,T),A={};if(m&&m[0]>0){var I=m[0]/2;A.paddingLeft=I,A.paddingRight=I}if(m&&m[1]>0&&!b){var R=m[1]/2;A.paddingTop=R,A.paddingBottom=R}return k&&(A.flex="number"==typeof k?"".concat(k," ").concat(k," auto"):/^\d+(\.\d+)?(px|em|rem|%)$/.test(k)?"0 0 ".concat(k):k,!1!==y||A.minWidth||(A.minWidth=0)),l.createElement("div",(0,o.Z)({},P,{style:(0,o.Z)((0,o.Z)({},A),S),className:_,ref:t}),C)});t.Z=p},92820:function(e,t,n){"use strict";var r=n(87462),o=n(4942),c=n(71002),a=n(97685),i=n(94184),l=n.n(i),s=n(67294),u=n(53124),f=n(98082),d=n(24308),p=n(93355),h=n(99134),v=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};function m(e,t){var n=s.useState("string"==typeof e?e:""),r=(0,a.Z)(n,2),o=r[0],i=r[1],l=function(){if("object"===(0,c.Z)(e))for(var n=0;n<d.c4.length;n++){var r=d.c4[n];if(t[r]){var o=e[r];if(void 0!==o){i(o);return}}}};return s.useEffect(function(){l()},[JSON.stringify(e),t]),o}(0,p.b)("top","middle","bottom","stretch"),(0,p.b)("start","end","center","space-around","space-between","space-evenly");var y=s.forwardRef(function(e,t){var n,i,p=e.prefixCls,y=e.justify,b=e.align,x=e.className,Z=e.style,g=e.children,j=e.gutter,O=void 0===j?0:j,w=e.wrap,E=v(e,["prefixCls","justify","align","className","style","children","gutter","wrap"]),C=s.useContext(u.E_),k=C.getPrefixCls,S=C.direction,P=s.useState({xs:!0,sm:!0,md:!0,lg:!0,xl:!0,xxl:!0}),N=(0,a.Z)(P,2),T=N[0],_=N[1],A=s.useState({xs:!1,sm:!1,md:!1,lg:!1,xl:!1,xxl:!1}),I=(0,a.Z)(A,2),R=I[0],W=I[1],M=m(b,R),D=m(y,R),G=(0,f.Z)(),H=s.useRef(O);s.useEffect(function(){var e=d.ZP.subscribe(function(e){W(e);var t=H.current||0;(!Array.isArray(t)&&"object"===(0,c.Z)(t)||Array.isArray(t)&&("object"===(0,c.Z)(t[0])||"object"===(0,c.Z)(t[1])))&&_(e)});return function(){return d.ZP.unsubscribe(e)}},[]);var $=k("row",p),B=(n=[void 0,void 0],(Array.isArray(O)?O:[O,void 0]).forEach(function(e,t){if("object"===(0,c.Z)(e))for(var r=0;r<d.c4.length;r++){var o=d.c4[r];if(T[o]&&void 0!==e[o]){n[t]=e[o];break}}else n[t]=e}),n),U=l()($,(i={},(0,o.Z)(i,"".concat($,"-no-wrap"),!1===w),(0,o.Z)(i,"".concat($,"-").concat(D),D),(0,o.Z)(i,"".concat($,"-").concat(M),M),(0,o.Z)(i,"".concat($,"-rtl"),"rtl"===S),i),x),z={},F=null!=B[0]&&B[0]>0?-(B[0]/2):void 0,L=null!=B[1]&&B[1]>0?-(B[1]/2):void 0;if(F&&(z.marginLeft=F,z.marginRight=F),G){var Q=(0,a.Z)(B,2);z.rowGap=Q[1]}else L&&(z.marginTop=L,z.marginBottom=L);var X=(0,a.Z)(B,2),J=X[0],Y=X[1],K=s.useMemo(function(){return{gutter:[J,Y],wrap:w,supportFlexGap:G}},[J,Y,w,G]);return s.createElement(h.Z.Provider,{value:K},s.createElement("div",(0,r.Z)({},E,{className:U,style:(0,r.Z)((0,r.Z)({},z),Z),ref:t}),g))});t.Z=y},71230:function(e,t,n){"use strict";var r=n(92820);t.Z=r.Z},20550:function(e,t,n){"use strict";n.d(t,{Z:function(){return x}});var r=n(4942),o=n(87462),c=n(97685),a=n(97937),i=n(94184),l=n.n(i),s=n(98423),u=n(67294),f=n(53124),d=n(98787),p=n(68349),h=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n},v=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n},m=RegExp("^(".concat(d.Y.join("|"),")(-inverse)?$")),y=RegExp("^(".concat(d.E.join("|"),")$")),b=u.forwardRef(function(e,t){var n,i=e.prefixCls,d=e.className,h=e.style,b=e.children,x=e.icon,Z=e.color,g=e.onClose,j=e.closeIcon,O=e.closable,w=v(e,["prefixCls","className","style","children","icon","color","onClose","closeIcon","closable"]),E=u.useContext(f.E_),C=E.getPrefixCls,k=E.direction,S=u.useState(!0),P=(0,c.Z)(S,2),N=P[0],T=P[1];u.useEffect(function(){"visible"in w&&T(w.visible)},[w.visible]);var _=function(){return!!Z&&(m.test(Z)||y.test(Z))},A=(0,o.Z)({backgroundColor:Z&&!_()?Z:void 0},h),I=_(),R=C("tag",i),W=l()(R,(n={},(0,r.Z)(n,"".concat(R,"-").concat(Z),I),(0,r.Z)(n,"".concat(R,"-has-color"),Z&&!I),(0,r.Z)(n,"".concat(R,"-hidden"),!N),(0,r.Z)(n,"".concat(R,"-rtl"),"rtl"===k),n),d),M=function(e){e.stopPropagation(),null==g||g(e),!e.defaultPrevented&&("visible"in w||T(!1))},D="onClick"in w||b&&"a"===b.type,G=(0,s.Z)(w,["visible"]),H=x||null,$=H?u.createElement(u.Fragment,null,H,u.createElement("span",null,b)):b,B=u.createElement("span",(0,o.Z)({},G,{ref:t,className:W,style:A}),$,void 0!==O&&O?j?u.createElement("span",{className:"".concat(R,"-close-icon"),onClick:M},j):u.createElement(a.Z,{className:"".concat(R,"-close-icon"),onClick:M}):null);return D?u.createElement(p.Z,null,B):B});b.CheckableTag=function(e){var t,n=e.prefixCls,c=e.className,a=e.checked,i=e.onChange,s=e.onClick,d=h(e,["prefixCls","className","checked","onChange","onClick"]),p=(0,u.useContext(f.E_).getPrefixCls)("tag",n),v=l()(p,(t={},(0,r.Z)(t,"".concat(p,"-checkable"),!0),(0,r.Z)(t,"".concat(p,"-checkable-checked"),a),t),c);return u.createElement("span",(0,o.Z)({},d,{className:v,onClick:function(e){null==i||i(!a),null==s||s(e)}}))};var x=b},27561:function(e,t,n){var r=n(67990),o=/^\s+/;e.exports=function(e){return e?e.slice(0,r(e)+1).replace(o,""):e}},67990:function(e){var t=/\s/;e.exports=function(e){for(var n=e.length;n--&&t.test(e.charAt(n)););return n}},23279:function(e,t,n){var r=n(13218),o=n(7771),c=n(14841),a=Math.max,i=Math.min;e.exports=function(e,t,n){var l,s,u,f,d,p,h=0,v=!1,m=!1,y=!0;if("function"!=typeof e)throw TypeError("Expected a function");function b(t){var n=l,r=s;return l=s=void 0,h=t,f=e.apply(r,n)}function x(e){var n=e-p,r=e-h;return void 0===p||n>=t||n<0||m&&r>=u}function Z(){var e,n,r,c=o();if(x(c))return g(c);d=setTimeout(Z,(e=c-p,n=c-h,r=t-e,m?i(r,u-n):r))}function g(e){return(d=void 0,y&&l)?b(e):(l=s=void 0,f)}function j(){var e,n=o(),r=x(n);if(l=arguments,s=this,p=n,r){if(void 0===d)return h=e=p,d=setTimeout(Z,t),v?b(e):f;if(m)return clearTimeout(d),d=setTimeout(Z,t),b(p)}return void 0===d&&(d=setTimeout(Z,t)),f}return t=c(t)||0,r(n)&&(v=!!n.leading,u=(m="maxWait"in n)?a(c(n.maxWait)||0,t):u,y="trailing"in n?!!n.trailing:y),j.cancel=function(){void 0!==d&&clearTimeout(d),h=0,l=p=s=d=void 0},j.flush=function(){return void 0===d?f:g(o())},j}},33448:function(e,t,n){var r=n(44239),o=n(37005);e.exports=function(e){return"symbol"==typeof e||o(e)&&"[object Symbol]"==r(e)}},7771:function(e,t,n){var r=n(55639);e.exports=function(){return r.Date.now()}},14841:function(e,t,n){var r=n(27561),o=n(13218),c=n(33448),a=0/0,i=/^[-+]0x[0-9a-f]+$/i,l=/^0b[01]+$/i,s=/^0o[0-7]+$/i,u=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(c(e))return a;if(o(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=o(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var n=l.test(e);return n||s.test(e)?u(e.slice(2),n?2:8):i.test(e)?a:+e}},67742:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/webhooks",function(){return n(72118)}])},72118:function(e,t,n){"use strict";n.r(t);var r=n(85893),o=n(48689),c=n(84485),a=n(94199),i=n(20550),l=n(15746),s=n(32808),u=n(85402),f=n(69677),d=n(71230),p=n(71577),h=n(26713),v=n(52206),m=n(67294),y=n(64777),b=n(37174);let{Title:x,Paragraph:Z}=c.Z,g={CHAT:{name:"Chat messages",description:"When a user sends a chat message",color:"purple"},USER_JOINED:{name:"User joined",description:"When a user joins the chat",color:"green"},NAME_CHANGE:{name:"User name changed",description:"When a user changes their name",color:"blue"},"VISIBILITY-UPDATE":{name:"Message visibility changed",description:"When a message visibility changes, likely due to moderation",color:"red"},STREAM_STARTED:{name:"Stream started",description:"When a stream starts",color:"orange"},STREAM_STOPPED:{name:"Stream stopped",description:"When a stream stops",color:"cyan"}},j=e=>{let{onOk:t,onCancel:n,open:o}=e,[c,a]=(0,m.useState)([]),[i,h]=(0,m.useState)(""),v=Object.keys(g).map(e=>({value:e,label:g[e].description})),y={disabled:(null==c?void 0:c.length)===0||!(0,b.Z)(i)},x=v.map(e=>(0,r.jsx)(l.Z,{span:8,children:(0,r.jsx)(s.Z,{value:e.value,children:e.label})},e.value));return(0,r.jsxs)(u.Z,{title:"Create New Webhook",open:o,onOk:function(){t(i,c),h(""),a(null)},onCancel:n,okButtonProps:y,children:[(0,r.jsx)("div",{children:(0,r.jsx)(f.Z,{value:i,placeholder:"https://myserver.com/webhook",onChange:e=>h(e.currentTarget.value.trim()),type:"url",pattern:b.a})}),(0,r.jsx)("p",{children:"Select the events that will be sent to this webhook."}),(0,r.jsx)(s.Z.Group,{style:{width:"100%"},value:c,onChange:function(e){a(e)},children:(0,r.jsx)(d.Z,{children:x})}),(0,r.jsx)("p",{children:(0,r.jsx)(p.Z,{type:"primary",onClick:function(){a(Object.keys(g))},children:"Select all"})})]})},O=()=>{let[e,t]=(0,m.useState)([]),[n,c]=(0,m.useState)(!1);function l(e){console.error("error",e)}async function s(){try{let e=await (0,y.rQ)(y.XA);t(e)}catch(n){l(n)}}async function u(e){try{await (0,y.rQ)(y.M_,{method:"POST",data:{id:e}}),s()}catch(t){l(t)}}async function f(n,r){try{let o=await (0,y.rQ)(y.iG,{method:"POST",data:{url:n,events:r}});t(e.concat(o))}catch(c){l(c)}}(0,m.useEffect)(()=>{s()},[]);let d=()=>{c(!0)},b=(e,t)=>{c(!1),f(e,t)},O=()=>{c(!1)};return(0,r.jsxs)("div",{children:[(0,r.jsx)(x,{children:"Webhooks"}),(0,r.jsx)(Z,{children:"A webhook is a callback made to an external API in response to an event that takes place within Owncast. This can be used to build chat bots or sending automatic notifications that you've started streaming."}),(0,r.jsxs)(Z,{children:["Read more about how to use webhooks, with examples, at"," ",(0,r.jsx)("a",{href:"https://owncast.online/docs/integrations/?source=admin",target:"_blank",rel:"noopener noreferrer",children:"our documentation"}),"."]}),(0,r.jsx)(v.Z,{rowKey:e=>e.id,columns:[{title:"",key:"delete",render:(e,t)=>(0,r.jsx)(h.Z,{size:"middle",children:(0,r.jsx)(p.Z,{onClick:()=>u(t.id),icon:(0,r.jsx)(o.Z,{})})})},{title:"URL",dataIndex:"url",key:"url"},{title:"Events",dataIndex:"events",key:"events",render:e=>(0,r.jsx)(r.Fragment,{children:e.map(e=>(function(e){if(!e||!g[e])return null;let t=g[e];return(0,r.jsx)(a.Z,{title:t.description,children:(0,r.jsx)(i.Z,{color:t.color,children:t.name})},e)})(e))})}],dataSource:e,pagination:!1}),(0,r.jsx)("br",{}),(0,r.jsx)(p.Z,{type:"primary",onClick:d,children:"Create Webhook"}),(0,r.jsx)(j,{open:n,onOk:b,onCancel:O})]})};t.default=O}},function(e){e.O(0,[8909,3903,4267,2206,9774,2888,179],function(){return e(e.s=67742)}),_N_E=e.O()}]);