Bundle embedded web app

This commit is contained in:
gabek
2022-12-12 16:43:53 +00:00
parent dc54dfe363
commit 96edfeaa1f
55 changed files with 52 additions and 49 deletions

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

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

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

View File

@@ -0,0 +1 @@
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6559],{10887:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/chat/emojis",function(){return n(14518)}])},14518:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return y}});var i=n(85893),a=n(48689),o=n(84485),r=n(26713),s=n(71577),l=n(52206),u=n(77916),c=n(67294),d=n(39664),m=n(64777),f=n(60956),j=n(41983),p=n(90745);let{Title:h,Paragraph:g}=o.Z,w=()=>{let[e,t]=(0,c.useState)([]),[n,o]=(0,c.useState)(!1),[w,y]=(0,c.useState)(null),[k,x]=(0,c.useState)(null),E=null,_=()=>{y(null),clearTimeout(E),E=null};async function T(){o(!0);try{let e=await (0,m.rQ)("/api/emoji");t(e)}catch(n){console.error("error fetching emojis",n)}o(!1)}async function v(e){o(!0),y((0,j.kg)(j.Jk,"Deleting emoji..."));try{let t=await (0,m.rQ)(m.Ff,{method:"POST",data:{name:e}});if(t instanceof Error)throw t;y((0,j.kg)(j.zv,"Emoji deleted")),E=setTimeout(_,p.sI)}catch(n){y((0,j.kg)(j.Un,"".concat(n))),o(!1),E=setTimeout(_,p.sI)}T()}async function Z(){o(!0);try{y((0,j.kg)(j.Jk,"Converting emoji..."));let e=await new Promise((e,t)=>{if(!f.d.includes(k.type)){let n="File type is not supported: ".concat(k.type);return t(n)}(0,f.y)(k,t=>e({name:k.name,url:t}))});y((0,j.kg)(j.Jk,"Uploading emoji..."));let t=await (0,m.rQ)(m.Qc,{method:"POST",data:{name:e.name,data:e.url}});if(t instanceof Error)throw t;y((0,j.kg)(j.zv,"Emoji uploaded successfully!")),T()}catch(n){y((0,j.kg)(j.Un,"".concat(n)))}E=setTimeout(_,p.sI),o(!1)}return(0,c.useEffect)(()=>{T()},[]),(0,i.jsxs)("div",{children:[(0,i.jsx)(h,{children:"Emojis"}),(0,i.jsx)(g,{children:"Here you can upload new custom emojis for usage in the chat. When uploading a new emoji, the filename will be used as emoji name."}),(0,i.jsx)(l.Z,{rowKey:e=>e.url,dataSource:e,columns:[{title:"",key:"delete",render:(e,t)=>(0,i.jsx)(r.Z,{size:"middle",children:(0,i.jsx)(s.Z,{onClick:()=>v(t.name),icon:(0,i.jsx)(a.Z,{})})})},{title:"Name",key:"name",dataIndex:"name"},{title:"Emoji",key:"url",render:(e,t)=>(0,i.jsx)("img",{src:t.url,alt:t.name,style:{maxWidth:"2vw"}})}],pagination:!1}),(0,i.jsx)("br",{}),(0,i.jsx)(u.Z,{name:"emoji",listType:"picture",className:"emoji-uploader",showUploadList:!1,accept:f.d.join(","),beforeUpload:x,customRequest:Z,disabled:n,children:(0,i.jsx)(s.Z,{type:"primary",disabled:n,children:"Upload new emoji"})}),(0,i.jsx)(d.Z,{status:w})]})};var y=w},60956:function(e,t,n){"use strict";n.d(t,{d:function(){return i},y:function(){return a}});let i=["image/png","image/jpeg","image/gif"];function a(e,t){let n=new FileReader;n.addEventListener("load",()=>t(n.result)),n.readAsDataURL(e)}}},function(e){e.O(0,[8909,3903,4267,2206,5577,2938,9774,2888,179],function(){return e(e.s=10887)}),_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

View File

@@ -0,0 +1 @@
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1774],{23426:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/logs",function(){return n(87905)}])},19849:function(e,t,n){"use strict";n.d(t,{o:function(){return f}});var r=n(85893);n(67294);var l=n(84485),i=n(20550),a=n(52206),s=n(53731),o=n(58091);let{Title:u}=l.Z;function c(e,t){let n="black";return"warning"===t.level?n="orange":"error"===t.level&&(n="red"),(0,r.jsx)(i.Z,{color:n,children:e})}function d(e){return(0,r.jsx)(s.Z,{children:e})}let f=e=>{let{logs:t,pageSize:n}=e;return(null==t?void 0:t.length)?(0,r.jsxs)("div",{className:"logs-section",children:[(0,r.jsx)(u,{children:"Logs"}),(0,r.jsx)(a.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:c},{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:d}],rowKey:e=>e.time,pagination:{pageSize:n||20}})]}):null}},87905:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return s}});var r=n(85893),l=n(67294),i=n(19849),a=n(64777);function s(){let[e,t]=(0,l.useState)([]),n=async()=>{try{let e=await (0,a.rQ)(a.sG);t(e)}catch(n){console.log("==== error",n)}};return(0,l.useEffect)(()=>{let e=null;return setInterval(n,5e3),n(),e=setInterval(n,5e3),()=>{clearInterval(e)}},[]),(0,r.jsx)(i.o,{logs:e,pageSize:20})}}},function(e){e.O(0,[8909,3903,4267,2206,8091,5360,9774,2888,179],function(){return e(e.s=23426)}),_N_E=e.O()}]);

View File

@@ -1 +0,0 @@
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1774],{27561:function(e,t,n){var r=n(67990),i=/^\s+/;e.exports=function(e){return e?e.slice(0,r(e)+1).replace(i,""):e}},67990:function(e){var t=/\s/;e.exports=function(e){for(var n=e.length;n--&&t.test(e.charAt(n)););return n}},33448:function(e,t,n){var r=n(44239),i=n(37005);e.exports=function(e){return"symbol"==typeof e||i(e)&&"[object Symbol]"==r(e)}},14841:function(e,t,n){var r=n(27561),i=n(13218),l=n(33448),o=0/0,s=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,u=/^0o[0-7]+$/i,c=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(l(e))return o;if(i(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=i(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var n=a.test(e);return n||u.test(e)?c(e.slice(2),n?2:8):s.test(e)?o:+e}},23426:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/logs",function(){return n(87905)}])},19849:function(e,t,n){"use strict";n.d(t,{o:function(){return d}});var r=n(85893);n(67294);var i=n(84485),l=n(20550),o=n(52206),s=n(53731),a=n(58091);let{Title:u}=i.Z;function c(e,t){let n="black";return"warning"===t.level?n="orange":"error"===t.level&&(n="red"),(0,r.jsx)(l.Z,{color:n,children:e})}function f(e){return(0,r.jsx)(s.Z,{children:e})}let d=e=>{let{logs:t,pageSize:n}=e;return(null==t?void 0:t.length)?(0,r.jsxs)("div",{className:"logs-section",children:[(0,r.jsx)(u,{children:"Logs"}),(0,r.jsx)(o.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:c},{title:"Timestamp",dataIndex:"time",key:"time",render(e){let t=new Date(e);return(0,a.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:f}],rowKey:e=>e.time,pagination:{pageSize:n||20}})]}):null}},87905:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return s}});var r=n(85893),i=n(67294),l=n(19849),o=n(64777);function s(){let[e,t]=(0,i.useState)([]),n=async()=>{try{let e=await (0,o.rQ)(o.sG);t(e)}catch(n){console.log("==== error",n)}};return(0,i.useEffect)(()=>{let e=null;return setInterval(n,5e3),n(),e=setInterval(n,5e3),()=>{clearInterval(e)}},[]),(0,r.jsx)(l.o,{logs:e,pageSize:20})}}},function(e){e.O(0,[8909,3903,4267,2206,8091,5360,9774,2888,179],function(){return e(e.s=23426)}),_N_E=e.O()}]);

File diff suppressed because one or more lines are too long