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 line
14 KiB
1 line
14 KiB
2 years ago
|
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[405],{8312:function(e,t,s){(window.__NEXT_P=window.__NEXT_P||[]).push(["/",function(){return s(9937)}])},9937:function(e,t,s){"use strict";s.r(t),s.d(t,{TabEnum:function(){return u},default:function(){return eE}});var n,a,l,r,i,o,c,u,d=s(5893),m=s(9008),h=s.n(m),p=s(1502),x=s.n(p),j=s(7294),g=s(4148),y=s(5405),Z=s(4945),P=s(9602),f=s(6865),b=s(8037),C=s(2141),w=s(3257),S=s(2810),v=s(6851),T=s(7357),k=s(8456),_=s(447),E=s(2474),R=s(2882),O=s(7906),N=s(3184),I=s(3816),A=s(3252),L=s(295),K=s(1458),F=s(3946),H=s(8896),M=s(3321),U=s(657),G=s(1425),D=s(6514),V=s(7645),W=s(7632);function X(e){let{open:t,title:s,agreeCallback:n,modifyCallback:a,closeCallback:l,children:r}=e,i=(0,W.Z)();return(0,d.jsxs)(U.Z,{open:t,onClose:l,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[(0,d.jsx)(V.Z,{children:s}),(0,d.jsx)(D.Z,{children:r}),(0,d.jsxs)(G.Z,{children:[n&&(0,d.jsx)(M.Z,{onClick:()=>n(i),autoFocus:!0,children:"Agree"}),a&&(0,d.jsx)(M.Z,{onClick:a,children:"Modify"}),l&&(0,d.jsx)(M.Z,{onClick:l,children:"Disagree"})]})]})}(n=i||(i={})).GET="GET",n.POST="POST",n.PUT="PUT",n.PATCH="PATCH";let q=e=>i.GET===e;class z{}class B{debouncing(e){return this.grabContext().debouncing=e,this}useMemory(e){let t=this.grabContext();return t.useMemory=!0,t.memoryKey=e,this}async send(e,t){var s;let n=this.context;if(this.context=null,null==n?void 0:n.useMemory){let a=(null==n?void 0:n.memoryKey)||e.url;if(void 0!==this.memory[a])return this.memory[a]}let l="".concat(this.baseUrl).concat(e.url),{url:r,data:i}=this.processAttributes(l,t);q(e.method)&&(r+="?"+new URLSearchParams(i));let o=await fetch(r,{method:e.method.toString(),headers:{...e.contentType?{"Content-Type":e.contentType}:{},"X-Plugin-Token":"passw0rd"},body:q(e.method)?null:JSON.stringify(i)}),c={responseData:(null===(s=o.headers.get("Content-Type"))||void 0===s?void 0:s.toString().includes("application/json"))?await o.json():await o.text(),headers:o.headers};if(null==n?void 0:n.useMemory){let u=(null==n?void 0:n.memoryKey)||e.url;this.memory[u]=c}return c}processAttributes(e,t){for(let s in t)e.indexOf("{"+s+"}")>-1&&(e=e.replace("{"+s+"}",t[s]),delete t[s]);return{url:e,data:t}}grabContext(){return this.context?this.context:this.context=new z}constructor(){this.baseUrl=null,this.context=null,this.memory={}}}let J=new class{constructor(){this.method=i.GET,this.url="/system-monitoring/processes",this.contentType=null}},Q=new class{constructor(){this.method=i.GET,this.url="/system-monitoring/commands",this.contentType=null}},Y=new class{constructor(){this.method=i.POST,this.url="/system-monitoring/commands/{commandName}/run",this.contentType="application/json;charset=utf-8"}},$=new class{constructor(){this.method=i.POST,this.url="/system-monitoring/processes/{id}/repeat",this.contentType=null}},ee=new class{constructor(){this.method=i.GET,this.url="/system-monitoring/processes/{id}/output",this.contentType=null}},et=new class{constructor(){this.method=i.POST,this.url="/system-monitoring/processes/{id}/play",this.contentType=null}},es=new class{constructor(){this.method=i.POST,this.url="/system-monitoring/processes/{id}/pause",this.contentType=null}},en=new class{constructor(){this.method=i.POST,this.url="/system-monitoring/processes/{id}/stop",this.contentType=null}},ea=new class{constructor(){this.method=i.POST,this.url="/system-monitoring/processes/{id}/kill",this.contentType=null}},el=new class{constructor(){this.method=i.GET,this.url="/system-monitoring/commands/{commandName}",this.contentType=null}},er="undefined"!=typeof location&&location.origin.includes(".wallester.")?location.origin:"http://fmw.sipachev.sv",ei=new class extends B{async getCommands(){let{responseData:e,headers:t}=await this.send(Q,{});return{data:e,headers:t}}async getCommand(e){let{responseData:t,headers:s}=await this.send(el,{commandName:e});return{data:t,headers:s}}async runCommand(e){let{headers:t}=await this.send(Y,e);return{data:null,headers:t}}async getProcesses(e){let{responseData:t,headers:s}=await th
|