inschpektor
Version:
An IOTA neighbor manager for your node.
1 lines • 59.6 kB
JavaScript
(function(e){function t(t){for(var n,o,r=t[0],l=t[1],c=t[2],u=0,h=[];u<r.length;u++)o=r[u],i[o]&&h.push(i[o][0]),i[o]=0;for(n in l)Object.prototype.hasOwnProperty.call(l,n)&&(e[n]=l[n]);d&&d(t);while(h.length)h.shift()();return a.push.apply(a,c||[]),s()}function s(){for(var e,t=0;t<a.length;t++){for(var s=a[t],n=!0,r=1;r<s.length;r++){var l=s[r];0!==i[l]&&(n=!1)}n&&(a.splice(t--,1),e=o(o.s=s[0]))}return e}var n={},i={app:0},a=[];function o(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,o),s.l=!0,s.exports}o.m=e,o.c=n,o.d=function(e,t,s){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:s})},o.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var s=Object.create(null);if(o.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)o.d(s,n,function(t){return e[t]}.bind(null,n));return s},o.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="/";var r=window["webpackJsonp"]=window["webpackJsonp"]||[],l=r.push.bind(r);r.push=t,r=r.slice();for(var c=0;c<r.length;c++)t(r[c]);var d=l;a.push([0,"chunk-vendors"]),s()})({0:function(e,t,s){e.exports=s("56d7")},"01f6":function(e,t,s){"use strict";var n=s("d187"),i=s.n(n);i.a},"026d":function(e,t,s){"use strict";var n=s("6fdb"),i=s.n(n);i.a},"034f":function(e,t,s){"use strict";var n=s("64a9"),i=s.n(n);i.a},"0c59":function(e,t,s){"use strict";var n=s("bd22"),i=s.n(n);i.a},"0e41":function(e,t,s){},1925:function(e,t){e.exports="data:image/png;base64,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"},"1b43":function(e,t,s){"use strict";var n=s("2c26"),i=s.n(n);i.a},"1e77":function(e,t,s){},"220e":function(e,t,s){},2342:function(e,t,s){},"2c26":function(e,t,s){},"308e":function(e,t,s){"use strict";var n=s("4f1d"),i=s.n(n);i.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 i(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}i.keys=function(){return Object.keys(n)},i.resolve=a,e.exports=i,i.id="4678"},"4f1d":function(e,t,s){},"4f7e":function(e,t,s){"use strict";var n=s("5fb2"),i=s.n(n);i.a},5019:function(e,t,s){"use strict";var n=s("220e"),i=s.n(n);i.a},"56d7":function(e,t,s){"use strict";s.r(t);var n=s("2b0e"),i=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{attrs:{id:"app"}},[s("Menu"),s("section",{staticClass:"section"},[s("div",{staticClass:"container"},[s("transition",{attrs:{name:"fade"}},[e.nodeError?s("Error",{attrs:{code:e.nodeError}}):s("router-view")],1)],1)])],1)},a=[],o=s("2f62"),r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("nav",{staticClass:"navbar",attrs:{role:"navigation","aria-label":"main navigation"}},[n("div",{staticClass:"logo"},[n("router-link",{staticClass:"navbar-brand",attrs:{to:"/"}},[n("div",{staticClass:"logo-holder"},[n("div",{staticClass:"logo-item"},[n("img",{staticClass:"logo-img",attrs:{src:s("1925")}})]),n("div",{staticClass:"logo-item"},[n("span",[e._v("inschpektor")])])])]),n("a",{staticClass:"navbar-burger",class:{"is-active":e.burgerOpen},attrs:{role:"button","aria-label":"menu","aria-expanded":"false"},on:{click:function(t){e.burgerOpen=!e.burgerOpen}}},[n("span",{attrs:{"aria-hidden":"true"}}),n("span",{attrs:{"aria-hidden":"true"}}),n("span",{attrs:{"aria-hidden":"true"}})])],1),n("div",{staticClass:"navbar-menu",class:{"is-active":e.burgerOpen}},[n("div",{staticClass:"navbar-start"},[n("router-link",{staticClass:"navbar-item",attrs:{to:"/"}},[e._v("Dashboard")]),n("router-link",{staticClass:"navbar-item",attrs:{to:"/manage"}},[e._v("Manage")]),n("router-link",{staticClass:"navbar-item",attrs:{to:"/node"}},[e._v("Node Info")]),e.authenticated?e._e():n("router-link",{staticClass:"navbar-item",attrs:{to:"/login"}},[e._v("Login")]),n("router-link",{staticClass:"navbar-item",attrs:{to:"/about"}},[e._v("About")])],1)]),n("div",{staticClass:"navbar-end"},[e.nodeInfo?n("span",{staticClass:"navbar-item node-state-badge __online",class:{__offline:e.nodeInfo.latestSolidSubtangleMilestoneIndex<e.nodeInfo.latestMilestoneIndex-1}},[e._v("\n "+e._s(e.nodeInfo.latestSolidSubtangleMilestoneIndex)+" /\n "+e._s(e.nodeInfo.latestMilestoneIndex)+"\n ")]):n("span",{staticClass:"navbar-item node-state-badge __offline"},[e._v("Node seems offline!")])])])},l=[],c={name:"Menu",data(){return{burgerOpen:!1}},computed:{...Object(o["c"])(["nodeInfo","authenticated"])}},d=c,u=(s("e277"),s("2877")),h=Object(u["a"])(d,r,l,!1,null,"5c250f02",null),p=h.exports,m=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",["NODE_NOT_SET"===e.code?s("h1",{staticClass:"title"},[e._v("Hi :)")]):s("h1",{staticClass:"title"},[e._v("Oops 😐")]),"NODE_NOT_SET"===e.code?s("div",[s("h2",{staticClass:"subtitle"},[e._v("\n Looks like you didn't link your node yet. Please provide the IP / Domain\n below.\n ")])]):s("div",[s("h2",{staticClass:"subtitle"},[e._v("\n There seem to be problems reaching your IOTA node. If you just restarted\n it, this message will disappear after the node is back up. If the IP of your node\n changed, please update it down below. Otherwise, you have to fix the\n node itself.\n ")]),s("h2",{staticClass:"subtitle"},[e._v("Currently set node IP: "+e._s(e.iriIp))])]),s("br"),s("nav",{staticClass:"level"},[s("div",{staticClass:"level-item has-text-centered"},[s("div",{staticClass:"columns"},[s("div",{staticClass:"column"},[s("label",{staticClass:"label"},[e._v("IOTA-Node IP / Domain (Port only if non-default):")]),s("div",{staticClass:"columns"},[s("div",{staticClass:"column is-4"},[s("input",{directives:[{name:"model",rawName:"v-model",value:e.isHttps,expression:"isHttps"}],staticClass:"switch is-rounded is-success",attrs:{id:"switchRoundedSuccess",type:"checkbox"},domProps:{checked:Array.isArray(e.isHttps)?e._i(e.isHttps,null)>-1:e.isHttps},on:{change:function(t){var s=e.isHttps,n=t.target,i=!!n.checked;if(Array.isArray(s)){var a=null,o=e._i(s,a);n.checked?o<0&&(e.isHttps=s.concat([a])):o>-1&&(e.isHttps=s.slice(0,o).concat(s.slice(o+1)))}else e.isHttps=i}}}),s("label",{attrs:{for:"switchRoundedSuccess"}},[e._v("https?")])]),s("div",{staticClass:"column is-8"},[s("input",{directives:[{name:"model",rawName:"v-model",value:e.nodeIp,expression:"nodeIp"}],staticClass:"input",class:[!0===e.portValidation?"is-success":!1===e.portValidation?"is-danger":""],attrs:{type:"text",placeholder:"E.g. 192.168.1.111 or my-domain.com:12345"},domProps:{value:e.nodeIp},on:{keyup:[function(t){return t.type.indexOf("key")||13===t.keyCode?e.setHostNode(t):null},e.checkAddressCorrectness],input:function(t){t.target.composing||(e.nodeIp=t.target.value)}}}),this.validationMessage?s("p",{staticClass:"help is-danger"},[e._v(e._s(this.validationMessage))]):e._e()])])])])])]),"NODE_NOT_SET"===e.code?s("nav",{staticClass:"level"},[s("div",{staticClass:"level-item has-text-centered"},[s("div",{staticClass:"field"},[s("label",{staticClass:"label"},[e._v("Define a Password (for node interactions):")]),s("div",{staticClass:"control"},[s("input",{directives:[{name:"model",rawName:"v-model",value:e.password,expression:"password"}],staticClass:"input",attrs:{type:"password",placeholder:"Choose wisely..."},domProps:{value:e.password},on:{keyup:function(t){return t.type.indexOf("key")||13===t.keyCode?e.setHostNode(t):null},input:function(t){t.target.composing||(e.password=t.target.value)}}})])])])]):e._e(),"NODE_NOT_SET"===e.code?s("nav",{staticClass:"level"},[s("div",{staticClass:"level-item has-text-centered"},[s("div",{staticClass:"field"},[s("label",{staticClass:"label"},[e._v("Path to iri config (optional, but recommended):")]),s("div",{staticClass:"control"},[s("input",{directives:[{name:"model",rawName:"v-model",value:e.iriFileLocation,expression:"iriFileLocation"}],staticClass:"input",attrs:{type:"text",placeholder:"E.g. /home/user/iri.txt"},domProps:{value:e.iriFileLocation},on:{keyup:function(t){return t.type.indexOf("key")||13===t.keyCode?e.setHostNode(t):null},input:function(t){t.target.composing||(e.iriFileLocation=t.target.value)}}})])])])]):e._e(),"NODE_NOT_SET"===e.code?s("nav",{staticClass:"level"},[s("div",{staticClass:"level-item has-text-centered"},[s("div",{staticClass:"field"},[s("label",{staticClass:"label"},[e._v("Command to restart node (optional):")]),s("div",{staticClass:"control"},[s("input",{directives:[{name:"model",rawName:"v-model",value:e.restartNodeCommand,expression:"restartNodeCommand"}],staticClass:"input",attrs:{type:"text",placeholder:"E.g. systemctl restart iota"},domProps:{value:e.restartNodeCommand},on:{keyup:function(t){return t.type.indexOf("key")||13===t.keyCode?e.setHostNode(t):null},input:function(t){t.target.composing||(e.restartNodeCommand=t.target.value)}}})])])])]):e._e(),s("nav",{staticClass:"level"},[s("div",{staticClass:"level-item has-text-centered"},[s("div",{staticClass:"control"},[s("RoundedButton",{attrs:{click:e.setHostNode,type:"success",spin:"20000",disabled:"NODE_NOT_SET"===e.code&&!e.password||!e.nodeIp}},[e._v("Submit")])],1)])]),"NODE_NOT_SET"!==e.code&&e.restartNodeCommandAvailable?s("div",[s("div",{staticClass:"is-divider"}),s("h2",{staticClass:"subtitle"},[e._v("You can restart your iota node, if you are logged in, which could solve the issue.")]),e.authenticated?e._e():s("Login"),e.authenticated?s("nav",[s("RoundedButton",{staticClass:"centered",attrs:{click:e.restartNode,type:"danger",spin:"20000","modal-text":"This action will restart your node. This will cause some connection issues from INSCHPEKTOR, but they will resolve automatically after the node is restarted."}},[e._v("Restart Node")])],1):e._e()],1):e._e()])},g=[],v=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",[s("div",{staticClass:"modal",class:{"is-active":e.openModal}},[s("div",{staticClass:"modal-background"}),s("div",{staticClass:"modal-card"},[s("header",{staticClass:"modal-card-head"},[s("p",{staticClass:"modal-card-title"},[e._v("Are you sure?")]),s("button",{staticClass:"delete",attrs:{"aria-label":"close"},on:{click:function(t){e.openModal=!1}}})]),s("section",{staticClass:"modal-card-body"},[e._v("\n "+e._s(e.modalText)+"\n ")]),s("footer",{staticClass:"modal-card-foot"},[s("button",{staticClass:"button is-success",on:{click:function(t){e.click(),e.openModal=!1,e.showSpinner()}}},[e._v("\n Yes\n ")]),s("button",{staticClass:"button",on:{click:function(t){e.openModal=!1}}},[e._v("Cancel")])])])]),s("button",{staticClass:"button is-rounded",class:[e.isLoading?"is-loading":"",e.buttonType],attrs:{disabled:e.disabled},on:{click:function(t){return e.buttonClicked()}}},[e._t("default")],2)])},f=[],b={name:"RoundedButton",props:{click:Function,disabled:Boolean,type:String,spin:String,modalText:String},data:function(){return{isLoading:!1,buttonType:"ok"===this.type?"is-link":"danger"===this.type?"is-danger":"success"===this.type?"is-success":"",openModal:!1}},methods:{buttonClicked(){this.modalText?this.openModal=!0:(this.click(),this.showSpinner())},showSpinner(){this.isLoading=!0,setTimeout(()=>{this.isLoading=!1},this.spin?Number(this.spin):500)}}},_=b,C=(s("4f7e"),Object(u["a"])(_,v,f,!1,null,"5a278005",null)),I=C.exports,y=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",[e._m(0),s("br"),s("nav",{staticClass:"level"},[s("div",{staticClass:"level-item"},[s("div",{staticClass:"field"},[s("label",{staticClass:"label"},[e._v("Password")]),s("div",{staticClass:"control has-icons-right"},[s("input",{directives:[{name:"model",rawName:"v-model",value:e.password,expression:"password"}],staticClass:"input",class:[!1===e.authenticated&&e.loginAttempted?"is-danger":""],attrs:{type:"password",placeholder:"Enter Password..."},domProps:{value:e.password},on:{keyup:function(t){return t.type.indexOf("key")||13===t.keyCode?e.loginClicked(t):null},input:function(t){t.target.composing||(e.password=t.target.value)}}}),!1===e.authenticated&&e.loginAttempted?s("span",{key:1,staticClass:"icon is-small is-right"},[s("font-awesome-icon",{attrs:{icon:"exclamation-triangle"}})],1):e._e()]),!1===e.authenticated&&e.loginAttempted?s("p",{staticClass:"help is-danger"},[e._v("Wrong Password!")]):e._e()])])]),s("RoundedButton",{attrs:{type:"success",click:e.loginClicked,disabled:!e.password,spin:"2000"}},[e._v("Login")])],1)},N=[function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"container"},[s("h1",{staticClass:"title"},[e._v("Login")]),s("h2",{staticClass:"subtitle"},[e._v("\n To manage your neighbors or view the state of your node, you need to\n login first.\n ")])])}],w={name:"Login",components:{RoundedButton:I},methods:{...Object(o["b"])(["login"]),loginClicked:function(){this.password&&(this.login(this.password),setTimeout(()=>this.loginAttempted=!0,2e3))}},data:()=>{return{password:void 0,submitted:!1,loginAttempted:!1}},created(){this.$store.subscribe((e,t)=>{"USER_AUTHENTICATED"===e.type&&!0===e.payload&&this.$router.push("/")})},computed:{...Object(o["c"])(["authenticated"])}},A=w,k=Object(u["a"])(A,y,N,!1,null,"9af78ff4",null),j=k.exports,E={name:"Error",components:{RoundedButton:I,Login:j},props:["code"],data:()=>{return{isHttps:!1,nodeIp:void 0,password:void 0,iriFileLocation:void 0,restartNodeCommand:void 0,submitted:!1,validationMessage:""}},methods:{restartNode(){this.$store.dispatch("restartNode")},setHostNode(){("NODE_NOT_SET"===this.code?this.password&&this.nodeIp:this.nodeIp)&&this.$store.dispatch("setHostNodeIp",{isHttps:this.isHttps,nodeIp:this.nodeIp,password:this.password,iriFileLocation:this.iriFileLocation,restartNodeCommand:this.restartNodeCommand})},checkAddressCorrectness:function(){if(this.validationMessage="",!this.nodeIp)return!0;new RegExp(":[0-9]{2,5}$");/[a-zA-Z]/.test(this.nodeIp)?this.nodeIp.split(":").length>=3?this.validationMessage="Do not include the protocol (http://)":this.nodeIp.split(".").length<2||this.nodeIp.split(".")[1].length<2?this.validationMessage="Must include extension (e.g. '.com')":this.nodeIp.includes("/")&&(this.validationMessage="Slashes (/) not allowed in hostnames"):4!==this.nodeIp.split(".").length?this.validationMessage="An IP address must have 4 dots":this.nodeIp.split(":").length>2?this.validationMessage="Do not include the protocol (http://)":0!==this.nodeIp.split(":")[0].split(".").filter(e=>e.length>3).length&&(this.validationMessage="IPv4 address fragment cannot exceed 3 digits"),this.nodeIp.includes(":")&&(new RegExp(":[0-9]{2,5}$").test(this.nodeIp)?(this.nodeIp.split(":")[1].startsWith("0")||Number(this.nodeIp.split(":")[1])>65535||Number(this.nodeIp.split(":")[1])<1)&&(this.validationMessage="The port is out of range (1 - 65535)"):this.validationMessage="Must include port information, e.g. :15600, 2-5 digits")}},computed:{...Object(o["c"])(["iriIp","authenticated","restartNodeCommandAvailable"])},created(){this.$store.dispatch("fetchIriDetails")}},T=E,O=(s("01f6"),Object(u["a"])(T,m,g,!1,null,"ae950328",null)),S=O.exports,x={name:"app",components:{Error:S,Menu:p},created(){this.$store.dispatch("login"),this.$store.dispatch("checkForVersionUpdate"),this.$store.dispatch("loadPeriodically"),setInterval(()=>{this.$store.dispatch("loadPeriodically")},4e3),setInterval(()=>{this.$store.dispatch("checkForVersionUpdate")},864e5)},computed:{...Object(o["c"])(["nodeError"])}},R=x,P=(s("034f"),Object(u["a"])(R,i,a,!1,null,null,null)),V=P.exports,D=s("9483");Object(D["a"])("/service-worker.js",{ready(){console.log("App is being served from cache by a service worker.\nFor more details, visit https://goo.gl/AFskqB")},cached(){console.log("Content has been cached for offline use.")},updated(){console.log("New content is available; please refresh.")},offline(){console.log("No internet connection found. App is running in offline mode.")},error(e){console.error("Error during service worker registration:",e)}});var M=s("8c4f"),F=s("59ca"),U=s.n(F),W=(s("741f"),s("bc3a")),L=s.n(W);n["a"].use(o["a"]),L.a.defaults.headers.common["Authorization"]=localStorage.getItem("token"),L.a.interceptors.response.use(e=>e,e=>{if(401!==e.response.status)return Promise.reject(e);Y.authenticated=!1});let H=void 0;const Y={hostNode:null,iriFileLocation:null,restartNodeCommandAvailable:null,token:null,loading:!1,nodeInfo:null,iriIp:null,neighbors:null,nodeError:null,authenticated:null,password:null,persistedNeighbors:null,inschpektorVersions:null,systemInfo_cpu:[],systemInfo_runningProcesses:[],systemInfo_diskIO:[],systemInfo_networkIO:[],currentCpuUsage:0,currentUpload:0,currentDownload:0,currentDiskIO:0,currentRunningProcess:0,userIsTyping:!1},q={SET_TOKEN(e,t){L.a.defaults.headers.common["Authorization"]=t,localStorage.setItem("token",t),e.token=t},SET_NODE_INFO(e,t){e.nodeInfo=t},SET_IRI_DETAILS(e,t){e.iriIp=t.nodeIp,e.hostNode=t.nodeIp?`${t.nodeIp}:${t.port}`:null,e.iriFileLocation=t.iriFileLocation,e.restartNodeCommandAvailable=t.restartNodeCommandAvailable},SET_NEIGHBORS(e,t){e.userIsTyping||(e.neighbors=t)},SET_SYSTEM_INFO(e,t){if(!t.length)return e.systemInfo_cpu=null,e.systemInfo_runningProcesses=null,e.systemInfo_diskIO=null,void(e.systemInfo_networkIO=null);e.currentCpuUsage=t[0].cpuLoad,e.systemInfo_cpu=[{data:t.length>=100?t.map(e=>e.cpuLoad).reverse():t.map(e=>Number(e.cpuLoad)).concat(new Array(100-t.length).fill(0)).reverse(),smooth:!0,fill:!0}],e.currentUpload=t[0].networkIO.upload,e.currentDownload=t[0].networkIO.download,e.systemInfo_networkIO=[{data:t.length>=100?t.map(e=>e.networkIO.upload).reverse():t.map(e=>e.networkIO.upload).concat(new Array(100-t.length).fill(0)).reverse(),smooth:!0,fill:!0},{data:t.length>=100?t.map(e=>e.networkIO.download).reverse():t.map(e=>e.networkIO.download).concat(new Array(100-t.length).fill(0)).reverse(),smooth:!0,fill:!0}],e.currentDiskIO=t[0].diskIO,e.systemInfo_diskIO=[{data:t.length>=100?t.map(e=>e.diskIO).reverse():t.map(e=>Number(e.diskIO)).concat(new Array(100-t.length).fill(0)).reverse(),smooth:!0,fill:!0}],e.currentRunningProcess=t[0].runningProcesses,e.systemInfo_runningProcesses=[{data:t.length>=100?t.map(e=>e.runningProcesses).reverse():t.map(e=>Number(e.runningProcesses)).concat(new Array(100-t.length).fill(0)).reverse(),smooth:!0,fill:!0}]},SET_ERROR(e,t){e.nodeError=t},SET_PASSWORD(e,t){e.password=t},USER_AUTHENTICATED(e,t){e.authenticated=t},SET_PERSISTED_IRI_NEIGHBORS(e,t){e.persistedNeighbors=t},DELETE_STATE(e){Object.entries(e).forEach(([t,s])=>e[t]=null)},SET_INSCHPEKTOR_LATEST_VERSION(e,t){e.inschpektorVersions=t},USER_IS_TYPING(e){e.userIsTyping=!0,clearTimeout(H),H=setTimeout(()=>{e.userIsTyping=!1},15e3)}},$={login({commit:e,dispatch:t},s){if(s||(s=localStorage.getItem("token")),s)return L.a.post("/api/login",{passwordOrToken:s}).then(s=>{e("SET_TOKEN",s.data.token),e("USER_AUTHENTICATED",!0),t("checkForVersionUpdate")}).catch(t=>{e("USER_AUTHENTICATED",!1),console.log("Unsuccessful login attempt.",t.message)})},fetchNodeInfo({commit:e}){L()("/api/node-info").then(t=>{e("SET_NODE_INFO",t.data),e("SET_ERROR",null)}).catch(t=>{e("SET_NODE_INFO",null),e("SET_ERROR",t.response.data)})},fetchIriDetails({commit:e}){L()("/api/iri-details").then(t=>{e("SET_IRI_DETAILS",t.data)}).catch(e=>{console.log("Error fetching iri details.")})},fetchNeighbors({commit:e}){L()("/api/neighbors").then(t=>{e("SET_NEIGHBORS",t.data)}).catch(t=>{e("SET_ERROR",t.response.data)})},fetchSystemInfo({commit:e}){L()("/api/system-info").then(t=>{e("SET_SYSTEM_INFO",t.data)}).catch(e=>{console.log("Error fetching system info.")})},setHostNodeIp({dispatch:e,commit:t},s){let n=s.isHttps?"https":"http",i=s.nodeIp,a="14265";i.includes(":")&&(a=i.substring(i.indexOf(":")+1),i=i.substring(0,i.indexOf(":"))),L.a.post("/api/host-node-ip",{protocol:n,nodeIp:i,port:a,password:s.password,iriPath:s.iriFileLocation,restartNodeCommand:s.restartNodeCommand}).then(n=>{Y.iriIp=i,Y.iriPort=a,n.data.token?(t("SET_TOKEN",n.data.token),t("USER_AUTHENTICATED",!0),t("SET_IRI_DETAILS",s)):t("USER_AUTHENTICATED",!1),t("SET_ERROR",null),e("fetchNeighbors"),e("fetchNodeInfo")}).catch(e=>console.log("error setting node ip",e))},addNeighbor({dispatch:e,commit:t},s){L.a.post("/api/neighbor",{name:s.name,domain:s.address,writeToIriConfig:s.writeToIriConfig,port:s.port}).then(t=>{e("fetchNeighbors")}).catch(e=>console.log("Error adding neighbor"))},setNeighborName({commit:e},t){e("USER_IS_TYPING"),L.a.post("/api/neighbor/name",{name:t.name,domainWithConnectionPort:`${t.domain}:${t.address.split(":")[1]}`}).then(e=>{}).catch(e=>console.log("Error when setting nick for neighbor"))},setNeighborPort({commit:e},t){e("USER_IS_TYPING"),L.a.post("/api/neighbor/port",{iriPort:t.port,domainWithConnectionPort:`${t.domain}:${t.address.split(":")[1]}`}).then(e=>{}).catch(e=>console.log("Error when setting port for neighbor"))},removeNeighbor({dispatch:e,commit:t},{domain:s,address:n}){L.a.delete("/api/neighbor",{data:{domainWithConnectionPort:`${s}:${n.split(":")[1]}`}}).then(t=>{e("fetchNeighbors")}).catch(e=>console.log("Error deleting neighbor"))},fetchPersistedIriNeighbors({commit:e}){L()("/api/persisted-neighbors").then(t=>{e("SET_PERSISTED_IRI_NEIGHBORS",t.data)}).catch(e=>{console.log("Error fetching persisted iri neighbors")})},resetDatabase({commit:e}){return L.a.post("/api/reset-database").then(t=>{e("USER_AUTHENTICATED",!1),e("SET_ERROR","NODE_NOT_SET"),e("DELETE_STATE")}).catch(e=>console.log("Unsuccessful reset-database attempt."))},restartNode({commit:e}){return L.a.post("/api/restart-node").catch(e=>console.log("Unsuccessful restart-node attempt."))},loadPeriodically({dispatch:e}){e("fetchNeighbors"),e("fetchNodeInfo"),e("fetchSystemInfo")},saveDatabase({commit:e}){const t=JSON.stringify(Y.neighbors),s=new Blob([t],{type:"text/json"}),n="inschpektor-backup.json",i=document.createElement("a"),a=URL.createObjectURL(s);i.href=a,i.download=n,document.body.appendChild(i),i.click(),setTimeout(function(){document.body.removeChild(i),window.URL.revokeObjectURL(a)})},loadDatabase({commit:e},t){L.a.post("/api/neighbor/additional-data",t).catch(e=>console.log("Error when trying to restore neighbor additional data."))},checkForVersionUpdate({commit:e}){L.a.get("/api/versions").then(t=>{t&&t.data&&e("SET_INSCHPEKTOR_LATEST_VERSION",t.data)}).catch(e=>console.log("Could not receive information about latest inschpektor version."))},async enableNotifications({commit:e}){try{const e=U.a.messaging();await e.requestPermission();const s=await e.getToken();L.a.post("/api/notification",{token:s}).catch(e=>console.log("Error when sending notification permission token."))}catch(t){console.log("Failed to request notification permissions.")}}},K={token:e=>e.token,loading:e=>e.loading,nodeInfo:e=>e.nodeInfo,iriFileLocation:e=>e.iriFileLocation,restartNodeCommandAvailable:e=>e.restartNodeCommandAvailable,iriIp:e=>e.iriIp,hostNode:e=>e.hostNode,neighbors:e=>e.neighbors,nodeError:e=>e.nodeError,authenticated:e=>e.authenticated,persistedNeighbors:e=>e.persistedNeighbors,inschpektorVersions:e=>e.inschpektorVersions,systemInfo_cpu:e=>e.systemInfo_cpu,systemInfo_runningProcesses:e=>e.systemInfo_runningProcesses,systemInfo_diskIO:e=>e.systemInfo_diskIO,systemInfo_networkIO:e=>e.systemInfo_networkIO,currentCpuUsage:e=>e.currentCpuUsage,currentUpload:e=>e.currentUpload,currentDownload:e=>e.currentDownload,currentDiskIO:e=>e.currentDiskIO,currentRunningProcess:e=>e.currentRunningProcess,userIsTyping:e=>e.userIsTyping},B={state:Y,mutations:q,actions:$,getters:K};var Z=new o["a"].Store({modules:{storeModule:B}}),z=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("div",{staticClass:"logo-holder"},[n("div",{staticClass:"logo-item"},[n("img",{class:{animate:e.animated},staticStyle:{width:"150px",height:"150px"},attrs:{src:s("1925")},on:{click:e.animate,animationend:function(t){e.animated=!1}}})]),e._m(0)]),n("p",[n("strong",[e._v("Installed Version:")]),e._v("\n "+e._s(e.inschpektorVersions&&e.inschpektorVersions.installed?e.inschpektorVersions.installed:"N/A")+"\n ")]),e.inschpektorVersions&&e.inschpektorVersions.newest&&e.inschpektorVersions.installed&&e.inschpektorVersions.newest>e.inschpektorVersions.installed?n("p",{staticClass:"update-available"},[n("strong",[e._v("🌟 Update available!")]),e._v("\n Version\n "+e._s(e.inschpektorVersions.newest)+" is ready to download! See here how to\n update:\n "),n("a",{attrs:{href:"https://github.com/codepleb/inschpektor/blob/master/readme.md#update",target:"_blank"}},[e._v("Update manual")]),e._v("\n 🌟\n ")]):e._e(),n("br"),e._m(1),n("p",[e._v("The application is based on Nodejs and Vuejs.")]),n("br"),n("p",[e._v("\n If you would like to contribute: I'd love to get your pullrequests. :)\n ")]),n("p",[e._v("Hit me up on telegram: @codepleb")]),n("br"),n("br"),n("h3",{staticClass:"title is-3"},[e._v("Donations")]),n("p",[e._v("\n If you like this app and you want to support me, use the following IOTA\n address:\n ")]),n("Donation",{attrs:{address:"IZ99FQWJUQJCDLBSUOEDZIVROSARFYLXJWPZNAXQPCCGAHCUWKRE9RNHMGNHZTAIZHPUDV9HMSPNJLYSXPNEPTRHUW"}}),e._m(2)],1)},G=[function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"logo-item"},[s("span",[e._v("inschpektor")])])},function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("p",[e._v("\n This is an open source app, that can be found @\n "),s("a",{attrs:{href:"https://github.com/codepleb/inschpektor"}},[e._v("Github")]),e._v(".\n ")])},function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("section",[s("h5",{staticClass:"title is-5"},[e._v("Other Coins")]),s("p",[s("strong",[e._v("BTC:")]),e._v(" 32o6kbgZqJ9nhT2aRsfEGcMtpThJ2za89T")]),s("p",[s("strong",[e._v("LTC:")]),e._v(" LgfSNjqVpXFj9xN8ZWPR9qTZQJpcRRNXRZ")]),s("p",[s("strong",[e._v("XMR:")]),e._v("\n 4GdoN7NCTi8a5gZug7PrwZNKjvHFmKeV11L6pNJPgj5QNEHsN6eeX3DaAQFwZ1ufD4LYCZKArktt113W7QjWvQ7CWAjwVCr95LATLKqtxr\n ")]),s("p",[s("strong",[e._v("XLM:")]),e._v("\n GA5XIGA5C7QTPTWXQHY6MCJRMTRZDOSHR6EFIBNDQTCQHG262N4GGKTM\n ")]),s("p",[s("strong",[e._v("XRP:")]),e._v(" rLHzPsX6oXkzU2qL12kHCH8G8cnZv1rBJh")])])}],J=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("article",{staticClass:"tile is-child notification"},[s("qrcode-vue",{staticClass:"qr-code",attrs:{value:e.dontationAddress(),size:e.size,level:"L"}}),s("p",[s("strong",[e._v("IOTA:")]),e._v("\n "+e._s(e.donation.address)+"\n ")])],1)},X=[],Q=s("d7b0"),ee={name:"Donation",props:["address"],data(){return{size:200,donation:{address:this.address,amount:1e6,tag:"inschpektor",message:"I LOVE INSCHPEKTOR! <3"}}},methods:{dontationAddress(){return JSON.stringify(this.donation)}},components:{QrcodeVue:Q["a"]}},te=ee,se=(s("791b"),Object(u["a"])(te,J,X,!1,null,null,null)),ne=se.exports,ie={name:"About",data:()=>{return{animated:!1}},computed:{...Object(o["c"])(["inschpektorVersions"])},methods:{animate(){this.animated=!0}},components:{Donation:ne}},ae=ie,oe=(s("b767"),Object(u["a"])(ae,z,G,!1,null,"4a8c7aee",null)),re=oe.exports,le=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",[s("AddNeighbor"),s("NeighborTable"),s("Settings"),s("DangerZone")],1)},ce=[],de=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"tile is-ancestor"},[s("div",{staticClass:"tile is-vertical"},[s("div",{staticClass:"tile"},[s("div",{staticClass:"tile is-parent is-vertical"},[s("article",{staticClass:"tile is-child notification"},[s("h1",{staticClass:"title"},[e._v("Add a neighbor")]),s("div",{staticClass:"media-content"},[s("div",{staticClass:"content"},[s("div",{staticClass:"field"},[s("label",{staticClass:"label"},[e._v("Domain or IP-Address with peering port*")]),s("div",{staticClass:"control has-icons-right"},[s("input",{directives:[{name:"model",rawName:"v-model",value:e.ipAddress,expression:"ipAddress"}],staticClass:"input",class:[e.ipAddress?this.validationMessage?"is-danger":"is-success":""],attrs:{type:"text",placeholder:"E.g. neighbor-domain.net:15600"},domProps:{value:e.ipAddress},on:{keyup:[function(t){return t.type.indexOf("key")||13===t.keyCode?e.addNeighborAndClearFields(t):null},e.checkAddressCorrectness],input:function(t){t.target.composing||(e.ipAddress=t.target.value)}}}),this.ipAddress&&!this.validationMessage?s("span",{key:0,staticClass:"icon is-small is-right"},[s("font-awesome-icon",{attrs:{icon:"check"}})],1):e._e(),this.ipAddress&&this.validationMessage?s("span",{key:1,staticClass:"icon is-small is-right"},[s("font-awesome-icon",{attrs:{icon:"exclamation-triangle"}})],1):e._e()]),this.validationMessage?s("p",{staticClass:"help is-danger"},[e._v(e._s(this.validationMessage))]):e._e()]),s("div",[s("div",{staticClass:"field"},[s("label",{staticClass:"label"},[e._v("Name")]),s("div",{staticClass:"control"},[s("input",{directives:[{name:"model",rawName:"v-model",value:e.name,expression:"name"}],staticClass:"input",attrs:{type:"text",placeholder:"Custom name for this neighbor"},domProps:{value:e.name},on:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.addNeighborAndClearFields(t)},input:function(t){t.target.composing||(e.name=t.target.value)}}})])]),s("div",{staticClass:"field"},[s("label",{staticClass:"label"},[e._v("IRI Api Port")]),s("div",{staticClass:"control has-icons-right"},[s("input",{directives:[{name:"model",rawName:"v-model",value:e.port,expression:"port"}],staticClass:"input",class:[!0===e.portValidation?"is-success":!1===e.portValidation?"is-danger":""],attrs:{type:"text",placeholder:"E.g. 14267"},domProps:{value:e.port},on:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.addNeighborAndClearFields(t)},input:function(t){t.target.composing||(e.port=t.target.value)}}}),e.portValidation?s("span",{key:0,staticClass:"icon is-small is-right"},[s("font-awesome-icon",{attrs:{icon:"check"}})],1):e._e(),!1===e.portValidation?s("span",{key:1,staticClass:"icon is-small is-right"},[s("font-awesome-icon",{attrs:{icon:"exclamation-triangle"}})],1):e._e()]),!1===e.portValidation?s("p",{staticClass:"help is-danger"},[e._v("\n Wrong format! Just write a plain number between 1 and\n 65535\n ")]):e._e()]),e.iriFileLocation?s("div",{staticClass:"field"},[s("label",{staticClass:"checkbox"},[s("input",{directives:[{name:"model",rawName:"v-model",value:e.writeToIriConfig,expression:"writeToIriConfig"}],attrs:{type:"checkbox"},domProps:{checked:Array.isArray(e.writeToIriConfig)?e._i(e.writeToIriConfig,null)>-1:e.writeToIriConfig},on:{change:function(t){var s=e.writeToIriConfig,n=t.target,i=!!n.checked;if(Array.isArray(s)){var a=null,o=e._i(s,a);n.checked?o<0&&(e.writeToIriConfig=s.concat([a])):o>-1&&(e.writeToIriConfig=s.slice(0,o).concat(s.slice(o+1)))}else e.writeToIriConfig=i}}}),e._v("\n Write neighbor to iri config\n ")])]):e._e(),s("label",{staticClass:"info"},[e._v("* required field")]),s("div",{staticClass:"field is-grouped"},[s("div",{staticClass:"control"},[s("RoundedButton",{attrs:{disabled:!this.ipAddress||!!this.validationMessage||!1===e.portValidation,click:e.addNeighborAndClearFields,type:"ok",spin:"10000"}},[e._v("Submit")])],1),s("div",{staticClass:"control"},[s("RoundedButton",{attrs:{click:e.clearFields}},[e._v("Cancel")])],1)])])])])])])])])])},ue=[],he={name:"AddNeighbor",data:()=>{return{name:"",ipAddress:"",writeToIriConfig:!0,port:"14265",validationMessage:""}},created(){this.$store.dispatch("fetchIriDetails")},computed:{...Object(o["c"])(["iriFileLocation"]),portValidation:function(){return""===this.port?null:!isNaN(this.port)&&parseInt(this.port,10)>=1&&parseInt(this.port,10)<=65535}},methods:{...Object(o["b"])(["addNeighbor"]),addNeighborAndClearFields:function(){!this.ipAddress||this.validationMessage||!0!==this.portValidation&&null!==this.portValidation||(this.addNeighbor({name:this.name,address:this.ipAddress,writeToIriConfig:this.writeToIriConfig&&!!this.iriFileLocation,port:this.port}),this.clearFields())},clearFields:function(){this.name="",this.ipAddress="",this.port="14265"},checkAddressCorrectness:function(){if(this.validationMessage="",!this.ipAddress)return!0;new RegExp(":[0-9]{2,5}$");/[a-zA-Z]/.test(this.ipAddress)?this.ipAddress.split(":").length>=3?this.validationMessage="Do not include the protocol (tcp://)":this.ipAddress.split(".").length<2||this.ipAddress.split(".")[1].length<2?this.validationMessage="Must include extension (e.g. '.com')":this.ipAddress.includes("/")?this.validationMessage="Slashes (/) not allowed in hostnames":new RegExp(":[0-9]{2,5}$").test(this.ipAddress)?(this.ipAddress.split(":")[1].startsWith("0")||Number(this.ipAddress.split(":")[1])>65535||Number(this.ipAddress.split(":")[1])<1)&&(this.validationMessage="The port is out of range (1 - 65535)"):this.validationMessage="Must include port information, e.g. :15600, 2-5 digits":4!==this.ipAddress.split(".").length?this.validationMessage="An IPv4 address must have 4 dots":this.ipAddress.split(":").length>2?this.validationMessage="Do not include the protocol (tcp://)":0!==this.ipAddress.split(":")[0].split(".").filter(e=>e.length>3).length?this.validationMessage="IPv4 address fragment cannot exceed 3 digits":new RegExp(":[0-9]{2,5}$").test(this.ipAddress)?(this.ipAddress.split(":")[1].startsWith("0")||Number(this.ipAddress.split(":")[1])>65535||Number(this.ipAddress.split(":")[1])<1)&&(this.validationMessage="The port is out of range (1 - 65535)"):this.validationMessage="Must include port information, e.g. :15600, 2-5 digits"}},components:{RoundedButton:I}},pe=he,me=(s("308e"),Object(u["a"])(pe,de,ue,!1,null,"afdb6214",null)),ge=me.exports,ve=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"bottom-margin"},[e._m(0),e._l(e.neighbors,function(t){return e.neighbors?s("NeighborRow",{key:t.address,attrs:{neighbor:t}}):e._e()}),e.neighbors?e._e():s("NoContent")],2)},fe=[function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"columns header not-on-mobile"},[s("div",{staticClass:"column is-4"},[e._v("Domain or IP")]),s("div",{staticClass:"column is-one-fifth"},[e._v("Username")]),s("div",{staticClass:"column is-2"},[e._v("Main Port")]),s("div",{staticClass:"column"},[e._v("Active")]),s("div",{staticClass:"column"},[e._v("Sync")]),s("div",{staticClass:"column"},[e._v("Remove?")])])}],be=function(){var e=this,t=e.$createElement;e._self._c;return e._m(0)},_e=[function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"show-delayed"},[s("div",{staticClass:"loading-animation"},[s("div"),s("div"),s("div"),s("div")]),s("div",{staticClass:"info-init"},[e._v("... Initializing ...")]),s("div",{staticClass:"info-error"},[e._v("\n There might be a problem getting data from your node. If you access it\n remotely, please do not forget to allow at least the reading commands on\n your IRI.\n ")])])}],Ce={name:"NoContent"},Ie=Ce,ye=(s("c9dd"),Object(u["a"])(Ie,be,_e,!1,null,"7f88218b",null)),Ne=ye.exports,we=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"columns"},[s("div",{staticClass:"column is-4"},[s("strong",{staticClass:"mobile-only"},[e._v("Domain or IP:")]),e._v("\n "+e._s(e.neighbor.domain?e.neighbor.domain:e.neighbor.address)+"\n ")]),s("div",{staticClass:"column is-one-fifth"},[s("strong",{staticClass:"mobile-only"},[e._v("Nickname:")]),s("input",{directives:[{name:"model",rawName:"v-model",value:e.neighbor.name,expression:"neighbor.name"}],staticClass:"input",attrs:{placeholder:"Enter nickname...",type:"text"},domProps:{value:e.neighbor.name},on:{input:[function(t){t.target.composing||e.$set(e.neighbor,"name",t.target.value)},function(t){return e.setNeighborName(e.neighbor)}]}})]),s("div",{staticClass:"column is-2"},[s("strong",{staticClass:"mobile-only"},[e._v("Node Port:")]),s("input",{directives:[{name:"model",rawName:"v-model",value:e.neighbor.port,expression:"neighbor.port"}],staticClass:"input",attrs:{placeholder:"Enter port...",type:"number"},domProps:{value:e.neighbor.port},on:{input:[function(t){t.target.composing||e.$set(e.neighbor,"port",t.target.value)},function(t){return e.setNeighborPort(e.neighbor)}]}})]),s("div",{staticClass:"column"},[s("strong",{staticClass:"mobile-only"},[e._v("Active:")]),e._v("\n "+e._s(null===e.neighbor.isActive?"N/A":e.neighbor.isActive?"✔️":"❌")+"\n ")]),s("div",{staticClass:"column"},[s("strong",{staticClass:"mobile-only"},[e._v("Synced:")]),e._v("\n "+e._s(null===e.neighbor.isSynced?"N/A":e.neighbor.isSynced?"✔":"❌")+"️\n ")]),s("div",{staticClass:"column"},[s("RoundedButton",{attrs:{click:e.remove,type:"danger",spin:"2000","modal-text":"This action will remove the selected neighbor from your node."}},[s("font-awesome-icon",{attrs:{icon:"trash-alt"}})],1)],1)])},Ae=[],ke={name:"NeighborRow",components:{RoundedButton:I},props:["neighbor"],data:()=>{return{submitted:!1}},methods:{...Object(o["b"])(["setNeighborName","setNeighborPort"]),remove(){this.submitted=!0,this.$store.dispatch("removeNeighbor",this.neighbor)}}},je=ke,Ee=(s("b60a"),Object(u["a"])(je,we,Ae,!1,null,"9b2b77a2",null)),Te=Ee.exports,Oe={name:"NeighborTable",components:{NoContent:Ne,NeighborRow:Te},computed:{...Object(o["c"])(["neighbors"])}},Se=Oe,xe=(s("026d"),Object(u["a"])(Se,ve,fe,!1,null,"266a9001",null)),Re=xe.exports,Pe=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"tile is-ancestor"},[s("div",{staticClass:"tile is-vertical"},[s("div",{staticClass:"tile"},[s("div",{staticClass:"tile is-parent is-vertical"},[s("article",{staticClass:"tile is-child notification is-dark"},[s("h1",{staticClass:"title"},[e._v("Danger Zone")]),s("div",{staticClass:"flex-container"},[s("RoundedButton",{staticClass:"centered",attrs:{click:e.restartNode,type:"danger",spin:"99999","modal-text":"This action will restart your node. This will cause some connection issues from INSCHPEKTOR, but they will resolve automatically after the node is restarted."}},[e._v("Restart Node")]),s("RoundedButton",{staticClass:"centered",attrs:{click:e.resetDatabase,type:"danger",spin:"99999","modal-text":"Reset inschpektor to factory default mode. This will not affect your IOTA node, but INSCHPEKTOR needs to be reconfigured and the internal data will vanish. Do not forget to do a backup of your nicknames ('Save Nicknames') first!"}},[e._v("Reset Inschpektor")])],1)])])])])])},Ve=[],De={name:"DangerZone",components:{RoundedButton:I},methods:{restartNode(){this.$store.dispatch("restartNode")},resetDatabase(){this.$store.dispatch("resetDatabase")}}},Me=De,Fe=(s("0c59"),Object(u["a"])(Me,Pe,Ve,!1,null,"71097fb6",null)),Ue=Fe.exports,We=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"tile is-ancestor"},[s("div",{staticClass:"tile is-vertical"},[s("div",{staticClass:"tile"},[s("div",{staticClass:"tile is-parent is-vertical"},[s("article",{staticClass:"tile is-child notification"},[s("h1",{staticClass:"title"},[e._v("Settings")]),s("div",{staticClass:"field button-container"},[s("div",{staticClass:"file is-link"},[s("label",{staticClass:"file-label"},[s("input",{ref:"loadPath",staticClass:"file-input",attrs:{type:"file",name:"resume"},on:{change:e.loadDatabase}}),s("span",{staticClass:"file-cta"},[s("span",{staticClass:"file-icon"},[s("font-awesome-icon",{attrs:{icon:"upload"}})],1),s("span",{staticClass:"file-label"},[e._v("Restore Nicknames")])])])]),s("div",{staticClass:"file is-link"},[s("label",{staticClass:"file-label"},[s("input",{staticClass:"file-input",attrs:{type:"button"},on:{click:e.saveDatabase}}),s("span",{staticClass:"file-cta"},[s("span",{staticClass:"file-icon"},[s("font-awesome-icon",{attrs:{icon:"download"}})],1),s("span",{staticClass:"file-label"},[e._v("Save Nicknames")])])])]),s("RoundedButton",{staticClass:"aligned-button",attrs:{type:"ok",click:e.enableNotifications,disabled:e.notificationButtonDisabled}},[e._v("Enable Notifications")])],1)])])])])])},Le=[],He={name:"Settings",components:{RoundedButton:I},methods:{...Object(o["b"])(["enableNotifications"]),saveDatabase(){this.$store.dispatch("saveDatabase")},loadDatabase(){const e=this.$refs.loadPath.files[0],t=new FileReader,s=this.$store;t.addEventListener("load",function(){const e=JSON.parse(t.result);s.dispatch("loadDatabase",e)},!1),e&&t.readAsText(e)}},computed:{notificationButtonDisabled:()=>{return"https:"!==window.location.protocol&&"localhost"!==window.location.hostname}}},Ye=He,qe=(s("f02e"),Object(u["a"])(Ye,We,Le,!1,null,"16572c1f",null)),$e=qe.exports,Ke={name:"Manage",components:{DangerZone:Ue,AddNeighbor:ge,NeighborTable:Re,Settings:$e}},Be=Ke,Ze=(s("b4ee"),Object(u["a"])(Be,le,ce,!1,null,"64f67ebb",null)),ze=Ze.exports,Ge=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",[e.neighbors?e._e():s("NoContent"),e.neighbors?s("Summary",{attrs:{neighbors:e.neighbors}}):e._e(),e.neighbors?s("div",{staticClass:"tile is-ancestor"},[s("div",{staticClass:"tile is-parent"},e._l(e.neighbors,function(e,t){return s("Neighbor",{key:t,attrs:{neighbor:e}})}),1)]):e._e()],1)},Je=[],Xe=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("article",{ref:"cardToAnimate",staticClass:"tile is-child notification",class:{"is-faulty":!e.neighbor.isFriendlyNode||!1===e.neighbor.isActive||-1===e.neighbor.isActive||!1===e.neighbor.isSynced,"is-premium":e.neighbor.iriVersion},on:{click:function(t){return e.swapCard()}}},[s("h2",{staticClass:"title"},[e.neighbor.iriVersion?s("span",[e._v("👑")]):e._e(),e.isUnpersistedNeighbor?s("span",[e._v("👽")]):e._e(),e._v("\n "+e._s(e.neighbor.name?e.neighbor.name:e.neighbor.domain?e.neighbor.domain:e.neighbor.address)+"\n ")]),s("div",{staticClass:"media-content"},[e.showContent?s("div",{staticClass:"content"},[s("p",[s("strong",[e._v("Active:")]),s("span",{staticClass:"align__right"},[e._v("\n "+e._s(null===e.neighbor.isActive?"N/A":e.neighbor.isActive&&-1!==e.neighbor.isActive?"✔️":"❌")+"\n ")])]),e.neighbor.isActive?s("p",[s("strong",[e._v("Healthy:")]),s("span",{staticClass:"align__right"},[e._v("\n "+e._s(e.neighbor.isFriendlyNode?"✔️":"❌")+"\n ")])]):e._e(),!0===e.neighbor.isSynced||!1===e.neighbor.isSynced?s("p",[s("strong",[e._v("Synced:")]),s("span",{staticClass:"align__right"},[e._v(e._s(e.neighbor.isSynced?"✔":"❌")+"️")])]):e._e(),e.neighbor.iriVersion?s("p",[s("strong",[e._v("IRI Version:")]),s("span",{staticClass:"align__right"},[e._v(e._s(e.neighbor.iriVersion))])]):e._e(),e.neighbor.ping?s("p",[s("strong",[e._v("Ping:")]),s("span",{staticClass:"align__right"},[e._v(e._s(e.neighbor.ping)+" ms")])]):e._e()]):e._e(),e.showContent?e._e():s("div",{staticClass:"content"},[s("p",[s("strong",[e._v("Milestone:")]),s("span",[e._v("\n "+e._s(null===e.neighbor.milestone?"N/A":e.neighbor.milestone)+"\n ")])]),s("p",[s("strong",[e._v("Domain:")]),s("span",[e._v("\n "+e._s(null===e.neighbor.domain?"N/A":e.neighbor.domain)+"\n ")])]),s("p",[s("strong",[e._v("IP:")]),s("span",[e._v("\n "+e._s(null===e.neighbor.address?"N/A":e.neighbor.address)+"\n ")])]),s("p",[s("strong",[e._v("Connected:")]),s("span",[e._v("\n "+e._s(null===e.neighbor.connected?"N/A":e.neighb