(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[811],{95822:function(e,t,n){Promise.resolve().then(n.bind(n,80710))},80710:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return x}});var r=n(57437),i=n(48936),o=n(57726),a=n(46671),s=n(91617),l=n(30695),d=n(2265);n(20104);var c=n(58782),u=n(35852),h=e=>{let{url:t}=e;return(0,d.useEffect)(()=>{let e=new c.Z({id:"mse",url:t,height:"100%",plugins:[u.C],width:"100%"});return()=>{null==e||e.destroy(),e=null}},[t]),(0,r.jsx)("div",{id:"mse"})},f=n(44623),m=n(20357);function x(){var e;let{Header:t,Footer:n,Sider:c,Content:u}=i.Layout,{data:x,error:v,isLoading:g}=(0,s.ZP)("/v1/videos",l._i),{Text:E}=i.Typography,[p,w]=(0,d.useState)(),y=[{title:"标题",dataIndex:"name",render:(e,t,n)=>(0,r.jsx)(E,{strong:!0,children:e})},{title:"大小",dataIndex:"size"},{title:"更新日期",dataIndex:"updateTime",sorter:(e,t)=>e.updateTime-t.updateTime>0?1:-1},{title:"",dataIndex:"operate",render:(e,t,n)=>(0,r.jsx)(o.Z,{style:{cursor:"pointer"},onClick:()=>b(t.name)})}],[_,j]=(0,d.useState)(!1),b=e=>{j(!0),w(e)};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(t,{style:{backgroundColor:"var(--semi-color-bg-1)"},children:(0,r.jsx)(i.JL,{style:{border:"none"},header:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{style:{backgroundColor:"rgba(var(--semi-green-4), 1)",borderRadius:"var(--semi-border-radius-large)",color:"var(--semi-color-bg-0)",display:"flex",padding:"6px"},children:(0,r.jsx)(a.Z,{size:"large"})}),(0,r.jsx)("h4",{style:{marginLeft:"12px"},children:"历史记录"})]}),mode:"horizontal"})}),(0,r.jsxs)(u,{style:{paddingLeft:12,paddingRight:12,backgroundColor:"var(--semi-color-bg-0)"},children:[(0,r.jsx)("main",{children:(0,r.jsx)(i.iA,{size:"small",columns:y,dataSource:null==x?void 0:x.map(e=>({...e,size:(e.size/1024/1024).toFixed(2)+" MB",updateTime:(0,f.cE)(e.updateTime)}))})}),(0,r.jsxs)(i.u_,{visible:_,onCancel:()=>{j(!1),console.log("Cancel button clicked")},closeOnEsc:!0,size:"large",bodyStyle:{height:500},footer:null,children:[(0,r.jsx)(h,{url:(null!==(e=m.env.NEXT_PUBLIC_API_SERVER)&&void 0!==e?e:"")+"/static/"+p}),(0,r.jsx)("div",{id:"mse"})]})]})]})}},30695:function(e,t,n){"use strict";n.d(t,{_i:function(){return o},gz:function(){return l},hw:function(){return s},sj:function(){return a},wG:function(){return i}});var r=n(20357);async function i(e,t){var n;let{arg:i}=t,o=await fetch((null!==(n=r.env.NEXT_PUBLIC_API_SERVER)&&void 0!==n?n:"")+e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});if(!(o.status>=200&&o.status<300))throw Error(await o.text());let a=await o.json();if(!o.ok)throw Error(a.message);return a}let o=async function(){for(var e,t=arguments.length,n=Array(t),i=0;i<t;i++)n[i]=arguments[i];let o=await fetch((null!==(e=r.env.NEXT_PUBLIC_API_SERVER)&&void 0!==e?e:"")+n[0],n[1]);if(!o.ok)throw Error(await o.text());return o.json()},a=async(e,t)=>{var n;let i=await fetch((null!==(n=r.env.NEXT_PUBLIC_API_SERVER)&&void 0!==n?n:"")+e,t);if(!i.ok)throw Error(await i.text());return i};async function s(e,t){var n;let{arg:i}=t,o=await fetch("".concat(null!==(n=r.env.NEXT_PUBLIC_API_SERVER)&&void 0!==n?n:"").concat(e,"/").concat(i),{method:"DELETE"});if(!o.ok)throw Error(await o.text());return o}async function l(e,t){var n;let{arg:i}=t,o=await fetch("".concat(null!==(n=r.env.NEXT_PUBLIC_API_SERVER)&&void 0!==n?n:"").concat(e),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});if(!o.ok)throw Error(await o.text());return o}},44623:function(e,t,n){"use strict";n.d(t,{cE:function(){return o},f:function(){return r},ql:function(){return i}});let r={xs:"(max-width: 575px)",sm:"(min-width: 576px)",md:"(min-width: 768px)",lg:"(min-width: 992px)",xl:"(min-width: 1200px)",xxl:"(min-width: 1600px)"},i=(e,t)=>{let{match:n,unmatch:r,callInInit:i=!0}=t;{let t=window.matchMedia(e),o=function(e){e.matches?n&&n(e):r&&r(e)};return(i&&o(t),Object.prototype.hasOwnProperty.call(t,"addEventListener"))?(t.addEventListener("change",o),()=>t.removeEventListener("change",o)):(t.addListener(o),()=>t.removeListener(o))}},o=e=>new Date(1e3*e).toLocaleString("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).replaceAll("/","-")}},function(e){e.O(0,[798,674,86,949,753,293,406,862,256,936,617,444,971,23,744],function(){return e(e.s=95822)}),_N_E=e.O()}]);