UNPKG

miakinager

Version:

Manage PM2 processes

2 lines 23.4 kB
(function(e){function t(t){for(var n,c,o=t[0],i=t[1],u=t[2],f=0,d=[];f<o.length;f++)c=o[f],r[c]&&d.push(r[c][0]),r[c]=0;for(n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n]);l&&l(t);while(d.length)d.shift()();return a.push.apply(a,u||[]),s()}function s(){for(var e,t=0;t<a.length;t++){for(var s=a[t],n=!0,o=1;o<s.length;o++){var i=s[o];0!==r[i]&&(n=!1)}n&&(a.splice(t--,1),e=c(c.s=s[0]))}return e}var n={},r={app:0},a=[];function c(t){if(n[t])return n[t].exports;var s=n[t]={i:t,l:!1,exports:{}};return e[t].call(s.exports,s,s.exports,c),s.l=!0,s.exports}c.m=e,c.c=n,c.d=function(e,t,s){c.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:s})},c.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},c.t=function(e,t){if(1&t&&(e=c(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var s=Object.create(null);if(c.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)c.d(s,n,function(t){return e[t]}.bind(null,n));return s},c.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return c.d(t,"a",t),t},c.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},c.p="/";var o=window["webpackJsonp"]=window["webpackJsonp"]||[],i=o.push.bind(o);o.push=t,o=o.slice();for(var u=0;u<o.length;u++)t(o[u]);var l=i;a.push([0,"chunk-vendors"]),s()})({0:function(e,t,s){e.exports=s("56d7")},"0113":function(e,t,s){"use strict";var n=s("576f"),r=s.n(n);r.a},"034f":function(e,t,s){"use strict";var n=s("64a9"),r=s.n(n);r.a},"03fa":function(e,t,s){"use strict";var n=s("e13a"),r=s.n(n);r.a},4678:function(e,t,s){var n={"./af":"2bfb","./af.js":"2bfb","./ar":"8e73","./ar-dz":"a356","./ar-dz.js":"a356","./ar-kw":"423e","./ar-kw.js":"423e","./ar-ly":"1cfd","./ar-ly.js":"1cfd","./ar-ma":"0a84","./ar-ma.js":"0a84","./ar-sa":"8230","./ar-sa.js":"8230","./ar-tn":"6d83","./ar-tn.js":"6d83","./ar.js":"8e73","./az":"485c","./az.js":"485c","./be":"1fc1","./be.js":"1fc1","./bg":"84aa","./bg.js":"84aa","./bm":"a7fa","./bm.js":"a7fa","./bn":"9043","./bn.js":"9043","./bo":"d26a","./bo.js":"d26a","./br":"6887","./br.js":"6887","./bs":"2554","./bs.js":"2554","./ca":"d716","./ca.js":"d716","./cs":"3c0d","./cs.js":"3c0d","./cv":"03ec","./cv.js":"03ec","./cy":"9797","./cy.js":"9797","./da":"0f14","./da.js":"0f14","./de":"b469","./de-at":"b3eb","./de-at.js":"b3eb","./de-ch":"bb71","./de-ch.js":"bb71","./de.js":"b469","./dv":"598a","./dv.js":"598a","./el":"8d47","./el.js":"8d47","./en-SG":"cdab","./en-SG.js":"cdab","./en-au":"0e6b","./en-au.js":"0e6b","./en-ca":"3886","./en-ca.js":"3886","./en-gb":"39a6","./en-gb.js":"39a6","./en-ie":"e1d3","./en-ie.js":"e1d3","./en-il":"7333","./en-il.js":"7333","./en-nz":"6f50","./en-nz.js":"6f50","./eo":"65db","./eo.js":"65db","./es":"898b","./es-do":"0a3c","./es-do.js":"0a3c","./es-us":"55c9","./es-us.js":"55c9","./es.js":"898b","./et":"ec18","./et.js":"ec18","./eu":"0ff2","./eu.js":"0ff2","./fa":"8df4","./fa.js":"8df4","./fi":"81e9","./fi.js":"81e9","./fo":"0721","./fo.js":"0721","./fr":"9f26","./fr-ca":"d9f8","./fr-ca.js":"d9f8","./fr-ch":"0e49","./fr-ch.js":"0e49","./fr.js":"9f26","./fy":"7118","./fy.js":"7118","./ga":"5120","./ga.js":"5120","./gd":"f6b4","./gd.js":"f6b4","./gl":"8840","./gl.js":"8840","./gom-latn":"0caa","./gom-latn.js":"0caa","./gu":"e0c5","./gu.js":"e0c5","./he":"c7aa","./he.js":"c7aa","./hi":"dc4d","./hi.js":"dc4d","./hr":"4ba9","./hr.js":"4ba9","./hu":"5b14","./hu.js":"5b14","./hy-am":"d6b6","./hy-am.js":"d6b6","./id":"5038","./id.js":"5038","./is":"0558","./is.js":"0558","./it":"6e98","./it-ch":"6f12","./it-ch.js":"6f12","./it.js":"6e98","./ja":"079e","./ja.js":"079e","./jv":"b540","./jv.js":"b540","./ka":"201b","./ka.js":"201b","./kk":"6d79","./kk.js":"6d79","./km":"e81d","./km.js":"e81d","./kn":"3e92","./kn.js":"3e92","./ko":"22f8","./ko.js":"22f8","./ku":"2421","./ku.js":"2421","./ky":"9609","./ky.js":"9609","./lb":"440c","./lb.js":"440c","./lo":"b29d","./lo.js":"b29d","./lt":"26f9","./lt.js":"26f9","./lv":"b97c","./lv.js":"b97c","./me":"293c","./me.js":"293c","./mi":"688b","./mi.js":"688b","./mk":"6909","./mk.js":"6909","./ml":"02fb","./ml.js":"02fb","./mn":"958b","./mn.js":"958b","./mr":"39bd","./mr.js":"39bd","./ms":"ebe4","./ms-my":"6403","./ms-my.js":"6403","./ms.js":"ebe4","./mt":"1b45","./mt.js":"1b45","./my":"8689","./my.js":"8689","./nb":"6ce3","./nb.js":"6ce3","./ne":"3a39","./ne.js":"3a39","./nl":"facd","./nl-be":"db29","./nl-be.js":"db29","./nl.js":"facd","./nn":"b84c","./nn.js":"b84c","./pa-in":"f3ff","./pa-in.js":"f3ff","./pl":"8d57","./pl.js":"8d57","./pt":"f260","./pt-br":"d2d4","./pt-br.js":"d2d4","./pt.js":"f260","./ro":"972c","./ro.js":"972c","./ru":"957c","./ru.js":"957c","./sd":"6784","./sd.js":"6784","./se":"ffff","./se.js":"ffff","./si":"eda5","./si.js":"eda5","./sk":"7be6","./sk.js":"7be6","./sl":"8155","./sl.js":"8155","./sq":"c8f3","./sq.js":"c8f3","./sr":"cf1e","./sr-cyrl":"13e9","./sr-cyrl.js":"13e9","./sr.js":"cf1e","./ss":"52bd","./ss.js":"52bd","./sv":"5fbd","./sv.js":"5fbd","./sw":"74dc","./sw.js":"74dc","./ta":"3de5","./ta.js":"3de5","./te":"5cbb","./te.js":"5cbb","./tet":"576c","./tet.js":"576c","./tg":"3b1b","./tg.js":"3b1b","./th":"10e8","./th.js":"10e8","./tl-ph":"0f38","./tl-ph.js":"0f38","./tlh":"cf75","./tlh.js":"cf75","./tr":"0e81","./tr.js":"0e81","./tzl":"cf51","./tzl.js":"cf51","./tzm":"c109","./tzm-latn":"b53d","./tzm-latn.js":"b53d","./tzm.js":"c109","./ug-cn":"6117","./ug-cn.js":"6117","./uk":"ada2","./uk.js":"ada2","./ur":"5294","./ur.js":"5294","./uz":"2e8c","./uz-latn":"010e","./uz-latn.js":"010e","./uz.js":"2e8c","./vi":"2921","./vi.js":"2921","./x-pseudo":"fd7e","./x-pseudo.js":"fd7e","./yo":"7f33","./yo.js":"7f33","./zh-cn":"5c3a","./zh-cn.js":"5c3a","./zh-hk":"49ab","./zh-hk.js":"49ab","./zh-tw":"90ea","./zh-tw.js":"90ea"};function r(e){var t=a(e);return s(t)}function a(e){var t=n[e];if(!(t+1)){var s=new Error("Cannot find module '"+e+"'");throw s.code="MODULE_NOT_FOUND",s}return t}r.keys=function(){return Object.keys(n)},r.resolve=a,e.exports=r,r.id="4678"},"56d7":function(e,t,s){"use strict";s.r(t);s("cadf"),s("551c"),s("f751"),s("097d");var n,r=s("2b0e"),a=s("8c4f"),c=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{attrs:{id:"app"}},[s("miak-header"),s("transition",{attrs:{name:e.transitionName}},[s("router-view")],1),s("miak-footer")],1)},o=[],i=(s("6762"),s("2fdb"),function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("header",[s("svg",{staticClass:"homebutton",class:{turn:"/"==e.$route.path},attrs:{viewBox:"0 0 24 24"},on:{click:e.navigate}},[s("g",[s("path",{attrs:{d:"M8.92893219,12 L16.7071068,19.7781746 C17.0976311,20.1686989 17.0976311,20.8018639 16.7071068,21.1923882 C16.3165825,21.5829124 15.6834175,21.5829124 15.2928932,21.1923882 L6.80761184,12.7071068 C6.41708755,12.3165825 6.41708755,11.6834175 6.80761184,11.2928932 L15.2928932,2.80761184 C15.6834175,2.41708755 16.3165825,2.41708755 16.7071068,2.80761184 C17.0976311,3.19813614 17.0976311,3.83130112 16.7071068,4.22182541 L8.92893219,12 Z"}})])]),s("div",{staticClass:"title"},[e._v(e._s(e.$route.name))]),s("svg",{staticClass:"logoutbutton",attrs:{viewBox:"0 0 100 100"},on:{click:e.logout}},[s("path",{attrs:{d:"M58.63,96.86A8.85,8.85,0,0,0,63,98a9,9,0,0,0,4.76-1.36L88.36,83.74A11.93,11.93,0,0,0,94,73.57V26.43a11.92,11.92,0,0,0-5.64-10.17L67.74,3.37A9,9,0,0,0,54,11v3H26A12,12,0,0,0,14,26v8a4,4,0,0,0,8,0V26a4,4,0,0,1,4-4H54V78H26a4,4,0,0,1-4-4V66a4,4,0,0,0-8,0v8A12,12,0,0,0,26,86H54v3A9,9,0,0,0,58.63,96.86ZM62,11a.94.94,0,0,1,.51-.86A1,1,0,0,1,63,10a.92.92,0,0,1,.51.16L84.12,23A4,4,0,0,1,86,26.43V73.57A4,4,0,0,1,84.12,77L63.5,89.84a.91.91,0,0,1-1,0A.94.94,0,0,1,62,89V11Z"}}),s("path",{attrs:{d:"M74,58a4,4,0,0,0,4-4V46a4,4,0,0,0-8,0v8A4,4,0,0,0,74,58Z"}}),s("path",{attrs:{d:"M32.47,61.69A3.88,3.88,0,0,0,34,62a4,4,0,0,0,2.83-1.17l8-8a4,4,0,0,0,0-5.66l-8-8A4,4,0,0,0,30,42v4H10a4,4,0,0,0,0,8H30v4A4,4,0,0,0,32.47,61.69Z"}})])])}),u=[],l={methods:{navigate:function(){"/"!=this.$route.path?this.$router.push("/"):this.$router.go(-1)},logout:function(){localStorage.removeItem("auth")}}},f=l,d=(s("6ae0"),s("2877")),p=Object(d["a"])(f,i,u,!1,null,null,null),v=p.exports,h=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div")},m=[],b={},j=b,g=Object(d["a"])(j,h,m,!1,null,null,null),_=g.exports,y=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("svg",{staticClass:"loader",attrs:{width:"57",height:"57",viewBox:"0 0 57 57",stroke:"#42b983"}},[s("g",{attrs:{fill:"none","fill-rule":"evenodd"}},[s("g",{attrs:{transform:"translate(1 1)","stroke-width":"2"}},[s("circle",{attrs:{cx:"5",cy:"50",r:"5"}},[s("animate",{attrs:{attributeName:"cy",begin:"0s",dur:"2.2s",values:"50;5;50;50",calcMode:"linear",repeatCount:"indefinite"}}),s("animate",{attrs:{attributeName:"cx",begin:"0s",dur:"2.2s",values:"5;27;49;5",calcMode:"linear",repeatCount:"indefinite"}})]),s("circle",{attrs:{cx:"27",cy:"5",r:"5"}},[s("animate",{attrs:{attributeName:"cy",begin:"0s",dur:"2.2s",from:"5",to:"5",values:"5;50;50;5",calcMode:"linear",repeatCount:"indefinite"}}),s("animate",{attrs:{attributeName:"cx",begin:"0s",dur:"2.2s",from:"27",to:"27",values:"27;49;5;27",calcMode:"linear",repeatCount:"indefinite"}})]),s("circle",{attrs:{cx:"49",cy:"50",r:"5"}},[s("animate",{attrs:{attributeName:"cy",begin:"0s",dur:"2.2s",values:"50;50;5;50",calcMode:"linear",repeatCount:"indefinite"}}),s("animate",{attrs:{attributeName:"cx",from:"49",to:"49",begin:"0s",dur:"2.2s",values:"49;5;27;49",calcMode:"linear",repeatCount:"indefinite"}})])])])])},C=[],k=(s("7724"),{}),w=Object(d["a"])(k,y,C,!1,null,null,null),O=w.exports,x={"miak-header":v,"miak-footer":_,loader:O},S={memory:function(e){return Math.round(e/1e5)/10},uppercasefirst:function(e){return e[0].toUpperCase()+e.slice(1)}},R={components:x,computed:{transitionName:function(){return"slide-"+(["/","/login"].includes(this.$route.path)?"right":"left")}}},M=R,A=(s("034f"),Object(d["a"])(M,c,o,!1,null,null,null)),$=A.exports,E=(s("6b54"),s("f576"),s("34ef"),s("75fc")),T=(s("a481"),s("6705"),s("2685")),P=s.n(T),z=(s("4917"),s("d225")),N=s("b0b4"),L=function(){function e(){Object(z["a"])(this,e)}return Object(N["a"])(e,null,[{key:"hash",value:function(t,s){var n={msgFormat:"string",outFormat:"hex"},r=Object.assign(n,s);switch(r.msgFormat){default:case"string":t=$(t);break;case"hex-bytes":t=E(t);break}var a=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],c=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225];t+=String.fromCharCode(128);for(var o=t.length/4+2,i=Math.ceil(o/16),u=new Array(i),l=0;l<i;l++){u[l]=new Array(16);for(var f=0;f<16;f++)u[l][f]=t.charCodeAt(64*l+4*f+0)<<24|t.charCodeAt(64*l+4*f+1)<<16|t.charCodeAt(64*l+4*f+2)<<8|t.charCodeAt(64*l+4*f+3)<<0}var d=8*(t.length-1)/Math.pow(2,32),p=8*(t.length-1)>>>0;u[i-1][14]=Math.floor(d),u[i-1][15]=p;for(var v=0;v<i;v++){for(var h=new Array(64),m=0;m<16;m++)h[m]=u[v][m];for(var b=16;b<64;b++)h[b]=e.σ1(h[b-2])+h[b-7]+e.σ0(h[b-15])+h[b-16]>>>0;for(var j=c[0],g=c[1],_=c[2],y=c[3],C=c[4],k=c[5],w=c[6],O=c[7],x=0;x<64;x++){var S=O+e.Σ1(C)+e.Ch(C,k,w)+a[x]+h[x],R=e.Σ0(j)+e.Maj(j,g,_);O=w,w=k,k=C,C=y+S>>>0,y=_,_=g,g=j,j=S+R>>>0}c[0]=c[0]+j>>>0,c[1]=c[1]+g>>>0,c[2]=c[2]+_>>>0,c[3]=c[3]+y>>>0,c[4]=c[4]+C>>>0,c[5]=c[5]+k>>>0,c[6]=c[6]+w>>>0,c[7]=c[7]+O>>>0}for(var M=0;M<c.length;M++)c[M]=("00000000"+c[M].toString(16)).slice(-8);var A="hex-w"==r.outFormat?" ":"";return c.join(A);function $(e){try{return(new TextEncoder).encode(e,"utf-8").reduce(function(e,t){return e+String.fromCharCode(t)},"")}catch(C){return unescape(encodeURIComponent(e))}}function E(e){var t=e.replace(" ","");return""==t?"":t.match(/.{2}/g).map(function(e){return String.fromCharCode(parseInt(e,16))}).join("")}}},{key:"ROTR",value:function(e,t){return t>>>e|t<<32-e}},{key:"Σ0",value:function(t){return e.ROTR(2,t)^e.ROTR(13,t)^e.ROTR(22,t)}},{key:"Σ1",value:function(t){return e.ROTR(6,t)^e.ROTR(11,t)^e.ROTR(25,t)}},{key:"σ0",value:function(t){return e.ROTR(7,t)^e.ROTR(18,t)^t>>>3}},{key:"σ1",value:function(t){return e.ROTR(17,t)^e.ROTR(19,t)^t>>>10}},{key:"Ch",value:function(e,t,s){return e&t^~e&s}},{key:"Maj",value:function(e,t,s){return e&t^e&s^t&s}}]),e}();function U(){return"".concat(location.protocol,"//").concat(location.hostname,"/api/").concat(localStorage.getItem("auth"))}var I=function(e){return n=e,{event:{process:!1,onprocess:function(e){},onlist:function(e){}},login:function(e){e=L.hash(e),D.post("".concat(location.protocol,"//").concat(location.hostname,"/api/").concat(e,"/login"),function(t){t.error||(localStorage.setItem("auth",e),P.a.success({title:"Success !",message:t.message}),n.push("/"))})},getList:function(e){D.get("".concat(U(),"/list"),function(t){return e(t.processes)})},getUnactive:function(e){D.get("".concat(U(),"/unactive"),function(t){return e(t.unactive)})},setActive:function(e,t){D.post("".concat(U(),"/unactive/").concat(e),function(e){return t(e)})},process:function(e){return{getInfos:function(t){D.get("".concat(U(),"/").concat(e),t)},action:function(t){var s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(e){return e};D.post("".concat(U(),"/").concat(e,"/").concat(t),s)}}}}},D={request:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(e){},s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"GET",r=new XMLHttpRequest;r.open(s,e,!0),r.onreadystatechange=function(){if(this.readyState===XMLHttpRequest.DONE){var e;try{e=JSON.parse(r.responseText)}catch(a){return console.log(r.responseText),void P.a.error({title:"Error",message:"Can't parse server response"})}if(e.error)switch(e.error.code){case"NO_AUTH":n.replace("/login"),localStorage.removeItem("auth");break;case"WRONG_AUTH":P.a.error({title:"Error",message:e.error.message});break;default:var s="Unknown error";try{s=e.error.message}catch(a){}P.a.error({title:"Error",message:s});break}else t(e)}},r.send()},get:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(e){return e};this.request(e,t,"GET")},post:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(e){return e};this.request(e,t,"POST")},hexString:function(e){return Object(E["a"])(new Uint8Array(e)).map(function(e){return e.toString(16).padStart(2,"0")}).join("")},encrypt:function(e,t){var s=this;window.crypto.subtle.digest("SHA-512",(new TextEncoder).encode(e)).then(function(e){return t(s.hexString(e))})}},H=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"middle"},[e.loaded?s("div",[s("table",[e._m(0),e._l(e.processes,function(t){return s("tr",{key:t.id,staticClass:"selectable",on:{click:function(s){return e.select(t)}}},[s("td",{staticClass:"center"},[e._v(e._s(t.name))]),s("td",{staticClass:"center"},[e._v(e._s(t.version))]),s("td",{staticClass:"center"},[e._v(e._s(t.cpu)+"%")]),s("td",{staticClass:"center"},[e._v(e._s(e._f("memory")(t.memory))+" Mo")]),s("td",{staticClass:"center negligible"},[e._v(e._s(t.instances))]),s("td",{staticClass:"center negligible"},[e._v(e._s(t.restarts))]),s("td",{staticClass:"center negligible"},[e._v(e._s(t.username))]),s("td",[s("div",{staticClass:"status",class:{online:"online"==t.status,offline:"online"!=t.status}},[e._v(e._s(e._f("uppercasefirst")(t.status)))])])])})],2),s("div",{staticClass:"add_process",on:{click:e.add_process}},[e._v("+")])]):s("loader")],1)},V=[function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("tr",[s("th",{staticClass:"center"},[e._v("Name")]),s("th",{staticClass:"center"},[e._v("Version")]),s("th",{staticClass:"center"},[e._v("CPU")]),s("th",{staticClass:"center"},[e._v("Memory")]),s("th",{staticClass:"center negligible"},[e._v("Instances")]),s("th",{staticClass:"center negligible"},[e._v("Restarts")]),s("th",{staticClass:"center negligible"},[e._v("Username")]),s("th")])}],q=(s("7f7f"),{components:x,filters:S,data:function(){return{loaded:!1,processes:[]}},created:function(){var e=this;this.api.event.onlist=function(t){e.processes=t,e.loaded=!0}},methods:{select:function(e){this.$router.push("/p/"+e.name)},add_process:function(){this.$router.replace("/active")}}}),F=q,G=Object(d["a"])(F,H,V,!1,null,"c15aeb1c",null),Z=G.exports,B=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"process"},[e.loaded?s("div",{staticClass:"two-column"},[s("div",[s("h2",[e._v("Actions")]),s("div",{staticClass:"actions"},["online"==e.infos.status?s("a",{staticClass:"action red",on:{click:function(t){return e.action("stop")}}},[e._v("Stop")]):s("a",{staticClass:"action green",on:{click:function(t){return e.action("restart")}}},[e._v("Start")]),s("a",{staticClass:"action green",on:{click:function(t){return e.action("reload")}}},[e._v("Reload")]),s("a",{staticClass:"action green",on:{click:function(t){return e.action("restart")}}},[e._v("Restart")]),s("a",{staticClass:"action red",on:{click:function(t){return e.action("delete")}}},[e._v("Delete")])]),s("div",{staticClass:"separator"}),s("h2",[e._v("PM2 infos")]),s("table",[e._m(0),e._l(e.infos,function(t,n){return s("tr",{key:n},[s("td",[e._v(e._s(e._f("naming")(n)))]),s("td",[s("div",{class:{status:"status"==n,online:"online"==t,offline:"online"!=t}},[e._v(e._s(e._f("parse")(t,n)))])])])})],2)]),s("div",[s("div",[s("h2",[e._v("Logs")]),s("ul",{staticClass:"logs"},e._l(e.logs,function(t,n){return s("li",{key:n},[e._v(e._s(t))])}),0)]),s("div",[s("h2",[e._v("Errors")]),s("ul",{staticClass:"logs errlogs"},e._l(e.err_logs,function(t,n){return s("li",{key:n},[e._v(e._s(t))])}),0)])])]):s("loader")],1)},J=[function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("tr",[s("th",[e._v("Key")]),s("th",[e._v("Value")])])}],X=(s("8e6e"),s("ac6a"),s("456d"),s("bd86")),K=s("c1df"),W=s.n(K);function Q(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),s.push.apply(s,n)}return s}function Y(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};t%2?Q(s,!0).forEach(function(t){Object(X["a"])(e,t,s[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):Q(s).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))})}return e}var ee={components:x,data:function(){return{loaded:!1,infos:{},logs:[],err_logs:[]}},created:function(){var e=this;this.api.event.process=this.$route.params.id,this.api.event.onprocess=function(t){t&&t.infos?(e.infos=t.infos,e.logs=t.logs,e.err_logs=t.err_logs,e.loaded=!0):(e.$route.params.id&&P.a.error({message:"The process ".concat(e.$route.params.id," doesn't exists")}),e.$router.replace("/"))}},methods:{action:function(e){var t=this;this.api.process(this.$route.params.id).action(e,function(s){s.success?P.a.success({title:"Success",message:s.message}):P.a.error({title:"Error",message:s.error.message}),"delete"==e&&t.$router.replace("/")})}},filters:Y({},S,{naming:function(e){return{id:"Process ID",name:"Process name",username:"Username",version:"Version",memory:"Memory usage",cpu:"CPU usage",restarts:"Restarts",unstable_restarts:"Unstable restarts",interpreter:"Interpreter",instances:"Instance number",uptime:"Started",status:"Status"}[e]},parse:function(e,t){switch(t){case"interpreter":return S.uppercasefirst(e);case"memory":return S.memory(e)+" Mo";case"cpu":return e+"%";case"status":return S.uppercasefirst(e);case"uptime":return W()(e).fromNow();default:return e}}})},te=ee,se=(s("03fa"),Object(d["a"])(te,B,J,!1,null,"4b67dc9e",null)),ne=se.exports,re=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("form",{on:{submit:e.login}},[s("input",{attrs:{type:"text",value:"admin",disabled:""}}),s("input",{directives:[{name:"model",rawName:"v-model",value:e.password,expression:"password"}],attrs:{type:"password",placeholder:"Password"},domProps:{value:e.password},on:{input:function(t){t.target.composing||(e.password=t.target.value)}}}),s("input",{attrs:{type:"submit",value:"Login"}})])},ae=[],ce={data:function(){return{password:""}},methods:{login:function(e){e.preventDefault(),this.password.length>3&&(this.api.login(this.password),this.password="")}}},oe=ce,ie=(s("0113"),Object(d["a"])(oe,re,ae,!1,null,null,null)),ue=ie.exports,le=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"middle"},[e.loaded?s("div",[s("table",[e._m(0),e._l(e.unactive_processes,function(t,n){return s("tr",{key:t.id,staticClass:"selectable",on:{click:function(t){return e.active(n)}}},[s("td",{staticClass:"center"},[e._v(e._s(n))]),s("td",{staticClass:"center"},[e._v(e._s(t.name))]),s("td",{staticClass:"center"},[e._v(e._s(t.version))]),t.description?s("td",{staticClass:"center"},[e._v(e._s(t.description))]):s("td",{staticClass:"center grey"},[e._v("No description")])])})],2)]):s("loader")],1)},fe=[function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("tr",[s("th",{staticClass:"center"},[e._v("ID")]),s("th",{staticClass:"center"},[e._v("Name")]),s("th",{staticClass:"center"},[e._v("Version")]),s("th",{staticClass:"center"},[e._v("Description")])])}],de={components:x,data:function(){return{loaded:!1,unactive_processes:{}}},mounted:function(){this.load()},methods:{active:function(e){var t=this;this.api.setActive(e,function(e){e.success&&(t.load(),t.$router.push("/"),P.a.success({title:"Success",message:e.message}))})},load:function(){var e=this;this.api.getUnactive(function(t){e.unactive_processes=t,e.loaded=!0})}}},pe=de,ve=Object(d["a"])(pe,le,fe,!1,null,"9d050e08",null),he=ve.exports;r["a"].config.productionTip=!1,r["a"].use(a["a"]);var me=new a["a"]({mode:"hash",routes:[{path:"/",name:"PM2 Active process",component:Z},{path:"/login",name:"Login",component:ue},{path:"/active",name:"Start process",component:he},{path:"/p/:id",name:"Process",component:ne},{path:"*",redirect:"/"}]});r["a"].prototype.api=I(me),setInterval(function(){"/login"!=me.currentRoute.path&&(r["a"].prototype.api.getList(r["a"].prototype.api.event.onlist),r["a"].prototype.api.event.process&&r["a"].prototype.api.process(r["a"].prototype.api.event.process).getInfos(r["a"].prototype.api.event.onprocess))},1e3),new r["a"]({router:me,render:function(e){return e($)}}).$mount("#app")},"576f":function(e,t,s){},"64a9":function(e,t,s){},"6ae0":function(e,t,s){"use strict";var n=s("fd46"),r=s.n(n);r.a},7724:function(e,t,s){"use strict";var n=s("fe62"),r=s.n(n);r.a},e13a:function(e,t,s){},fd46:function(e,t,s){},fe62:function(e,t,s){}}); //# sourceMappingURL=app.65522bb2.js.map