text: webpackJsonp([1],{"+7C8":function(t,e){},"0r5P":function(t,e){},"9mMh":function(t,e){},AgqQ:function(t,e){},KTI3:function(t,e){},NHnr:function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=a("7+uW"),s={render:function(){var t=this.$createElement,e=this._self._c||t;return e("div",{attrs:{id:"app"}},[e("div",{staticClass:"container app-content"},[e("router-view")],1)])},staticRenderFns:[]};var o=a("VU/8")({name:"App"},s,!1,function(t){a("rV00")},null,null).exports,n=a("/ocq"),l=a("mtWM"),r=a.n(l);const d="http://148.100.108.170:3000";function c(t){var e=RegExp(t+"[^;]+").exec(document.cookie);return decodeURIComponent(e?e.toString().replace(/^[^=]+./,""):"")}function u(){return r.a.get(d+"/getGroups",{params:{authString:c("auth")}})}function v(){return r.a.get(d+"/isAuthed",{params:{auth:c("auth")}})}var p={render:function(){var t=this.$createElement,e=this._self._c||t;return e("transition",{attrs:{name:"modal"}},[e("div",{staticClass:"modal",staticStyle:{display:"block"}},[e("div",{staticClass:"modal-dialog",attrs:{role:"document"}},[e("div",{staticClass:"modal-content"},[e("div",{staticClass:"modal-body"},[this._t("body")],2),this._v(" "),e("div",{staticClass:"modal-footer"},[this._t("footer")],2)])])])])},staticRenderFns:[]},m=a("VU/8")(null,p,!1,null,null,null).exports,h={name:"services",data:function(){return{showModal:!1,services:[],search:"",modalService:"",groups:""}},components:{Modal:m},methods:{closeModal:function(){this.showModal=!1},addGroup:function(t){for(var e="Groups:\n",a=0;a<this.groups.length;a++){e+=this.groups[a].name+"\n"}e+="-----\n",e+="Pick a group:";var i,s=prompt(e),o=-1;for(a=0;a<this.groups.length;a++)s===this.groups[a].name&&(o=this.groups[a].ID);-1!=o?((i={group_id:o,service_id:t.ID}).auth=c("auth"),r.a.post(d+"/addToGroup",i),alert("Added!"),setTimeout(location.reload.bind(location),1e3)):alert("No such group.")},deleteService:function(t){confirm("Are you sure you want to delete this service?")&&(!function(t){t.auth=c("auth"),alert("Service removed!"),r.a.post(d+"/removeService",t)}(t),setTimeout(location.reload.bind(location),1e3))},populateModal:function(t){var e=JSON.parse(t.fields);"[object Object]"===Object.prototype.toString.call(e)?t.fields=[e]:t.fields=e,this.modalService=t,this.showModal=!0},submitAndClose:function(){var t;(t=this.modalService).auth=c("auth"),alert("Your service is currently launching."),r.a.post(d+"/startService",t),this.showModal=!1,this.modalService="",setTimeout(location.reload.bind(location),1e3)},getServ:function(){var t=this;r.a.get(d+"/getServices",{params:{authString:c("auth")}}).then(function(e){t.services=e.data})},getGr:function(){var t=this;u().then(function(e){t.groups=e.data})}},mounted:function(){this.getServ(),this.getGr()},computed:{filteredList:function(){var t=this;return this.services.filter(function(e){return(e.name.toLowerCase()+" "+e.description.toLowerCase()).includes(t.search.toLowerCase())})}}},f={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[t.showModal?a("modal",[a("div",{attrs:{slot:"body"},slot:"body"},[a("div",{staticClass:"panel panel-default"},[a("div",{staticClass:"panel-heading"},[a("h3",{staticClass:"panel-title"},[t._v(" "+t._s(t.modalService.name)+" ")])]),t._v(" "),a("div",{staticClass:"panel-body"},[a("p",[a("span",{staticClass:"badge alert-info"},[t._v(" Description: ")]),t._v(" "+t._s(t.modalService.description)+" ")]),t._v(" "),a("hr"),t._v(" "),t._l(t.modalService.fields,function(e){return a("div",[a("div",{staticStyle:{display:"block",height:"3rem"},attrs:{id:"container"}},[a("label",{staticStyle:{display:"inline",float:"left"}},[t._v(" "+t._s(e.label)+" ")]),t._v(" "),a("input",{directives:[{name:"model",rawName:"v-model",value:e.value,expression:"field.value"}],staticStyle:{display:"inline",float:"right"},attrs:{type:"input",placeholder:e.placeholder,name:e.name},domProps:{value:e.value},on:{input:function(a){a.target.composing||t.$set(e,"value",a.target.value)}}})])])})],2)])]),t._v(" "),a("div",{attrs:{slot:"footer"},slot:"footer"},[a("button",{staticClass:"btn btn-outline-info",attrs:{type:"button"},on:{click:function(e){t.closeModal()}}},[t._v(" Close ")]),t._v(" "),a("button",{staticClass:"btn btn-primary",attrs:{type:"button","data-dismiss":"modal"},on:{click:function(e){t.submitAndClose()}}},[t._v("\n       Submit\n     ")])])]):t._e(),t._v(" "),a("h3",{staticClass:"text-center"},[t._v("Services Available")]),t._v(" "),a("div",{staticClass:"search-wrapper"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.search,expression:"search"}],staticStyle:{"text-align":"center","border-radius":"10px"},attrs:{type:"text",placeholder:"Search services..."},domProps:{value:t.search},on:{input:function(e){e.target.composing||(t.search=e.target.value)}}})]),t._v(" "),a("hr"),t._v(" "),t._l(t.filteredList.slice(0,6),function(e){return a("div",{staticClass:"col-sm-4"},[a("div",{staticClass:"panel panel-default"},[a("div",{staticClass:"panel-heading"},[a("h3",{staticClass:"panel-title"},[t._v(" "+t._s(e.name)+" ")])]),t._v(" "),a("div",{staticClass:"panel-body"},[a("p",[a("span",{staticClass:"badge alert-info"},[t._v(" Description: ")]),t._v(" "+t._s(e.description)+" ")]),t._v(" "),a("p",[a("span",{staticClass:"badge alert-info"},[t._v(" Version: ")]),t._v(" "+t._s(e.version)+" ")]),t._v(" "),a("hr"),t._v(" "),a("p",[a("button",{staticClass:"btn btn-info log",staticStyle:{width:"100%"},on:{click:function(a){t.populateModal(e)}}},[t._v("Launch Service")])]),t._v(" "),a("p",[a("button",{staticClass:"btn btn-info log",staticStyle:{float:"right"},on:{click:function(a){t.addGroup(e)}}},[t._v("Add to Group")])]),t._v(" "),a("p",[a("button",{staticClass:"btn btn-info log",staticStyle:{float:"left"},on:{click:function(a){t.deleteService(e)}}},[t._v("Delete Service")])])])])])})],2)},staticRenderFns:[]};var _=a("VU/8")(h,f,!1,function(t){a("+7C8")},"data-v-0fcc38b6",null).exports,g={name:"activeServices",data:function(){return{showModal:!1,services:[],displayFields:{},search:"",modalService:{}}},components:{Modal:m},methods:{sService:function(t){confirm("Are you sure you want to stop the service?")&&(!function(t){t.auth=c("auth"),alert("Your service is currently terminating."),r.a.post(d+"/endService",t)}(t),setTimeout(location.reload.bind(location),1e3))},details:function(t){this.modalService=t,this.displayFields=t.fields,this.showModal=!0},closeModal:function(){this.showModal=!1},getAServices:function(){var t=this;r.a.get(d+"/getActiveServices",{params:{authString:c("auth")}}).then(function(e){for(var a=0;a<e.data.length;a++){var i=JSON.parse(e.data[a].fields);"[object Object]"===Object.prototype.toString.call(i)?(e.data[a].fieldsOld=e.data[a].fields,e.data[a].fields=[i]):"[object Array]"===Object.prototype.toString.call(i)?(e.data[a].fieldsOld=e.data[a].fields,e.data[a].fields=i):e.data[a].fields=null}t.services=e.data,console.log(e.data)})}},computed:{filteredList:function(){var t=this;return this.services.filter(function(e){return null!=e.fields?(e.name.toLowerCase()+" "+e.description.toLowerCase()+" "+e.fieldsOld).includes(t.search.toLowerCase()):(e.name.toLowerCase()+" "+e.description.toLowerCase()).includes(t.search.toLowerCase())})}},mounted:function(){this.getAServices()}},b={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticStyle:{width:"100%",display:"inline-block"}},[t.showModal?a("modal",[a("div",{attrs:{slot:"body"},slot:"body"},[a("div",{staticClass:"panel panel-default"},[a("div",{staticClass:"panel-heading"},[a("h3",{staticClass:"panel-title"},[t._v(" "+t._s(t.modalService.name)+" ")])]),t._v(" "),a("div",{staticClass:"panel-body"},[a("p",[a("span",{staticClass:"badge alert-info"},[t._v(" Description: ")]),t._v(" "+t._s(t.modalService.description)+" ")]),t._v(" "),a("hr"),t._v(" "),t._l(t.modalService.fields,function(e){return a("div",[a("div",{staticStyle:{display:"block",height:"3rem"}},[a("label",{staticStyle:{display:"inline",float:"left"}},[t._v(" "+t._s(e.label)+" ")]),t._v(" "),a("input",{staticStyle:{display:"inline",float:"right"},attrs:{type:"input",disabled:"",placeholder:e.placeholder,name:e.name},domProps:{value:e.value}})])])})],2)])]),t._v(" "),a("div",{attrs:{slot:"footer"},slot:"footer"},[a("button",{staticClass:"btn btn-outline-info",attrs:{type:"button"},on:{click:function(e){t.closeModal()}}},[t._v(" Close ")])])]):t._e(),t._v(" "),a("h3",{staticClass:"text-center"},[t._v("Active Services")]),t._v(" "),a("div",{staticClass:"search-wrapper"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.search,expression:"search"}],staticStyle:{"text-align":"center","border-radius":"10px"},attrs:{type:"text",placeholder:"Search services..."},domProps:{value:t.search},on:{input:function(e){e.target.composing||(t.search=e.target.value)}}})]),t._v(" "),a("hr"),t._v(" "),t._l(t.filteredList,function(e){return a("div",{staticClass:"col-sm-4"},[a("div",{staticClass:"panel panel-default"},[a("div",{staticClass:"panel-heading"},[a("h3",{staticClass:"panel-title"},[t._v(" "+t._s(e.name)+" ")])]),t._v(" "),a("div",{staticClass:"panel-body"},[a("p",[a("span",{staticClass:"badge alert-info"},[t._v(" ID: ")]),t._v(" "+t._s(e.ID)+" ")]),t._v(" "),"Running"===e.status?a("div",[a("p",[a("span",{staticClass:"badge alert-success"},[t._v(" Status: ")]),t._v(" "+t._s(e.status)+" ")])]):"Down"===e.status?a("div",[a("p",[a("span",{staticClass:"badge alert-danger"},[t._v(" Status: ")]),t._v(" "+t._s(e.status)+" ")])]):a("div",[a("p",[a("span",{staticClass:"badge alert-info"},[t._v(" Status: ")]),t._v(" "+t._s(e.status)+" ")])]),t._v(" "),a("p",[a("span",{staticClass:"badge alert-info"},[t._v(" Uptime: ")]),t._v(" "+t._s(e.uptime)+" ")]),t._v(" "),a("p",[a("span",{staticClass:"badge alert-info"},[t._v(" Version: ")]),t._v(" "+t._s(e.version)+" ")]),t._v(" "),t._l(e.fields,function(e){return a("div",[a("div",{directives:[{name:"show",rawName:"v-show",value:e.display,expression:"field.display"}],staticStyle:{display:"block",height:"3rem"},attrs:{id:"container"}},[a("p",[a("span",{staticClass:"badge alert-info"},[t._v(t._s(e.label)+" ")]),t._v(" "+t._s(e.value)+" ")])])])}),t._v(" "),a("hr"),t._v(" "),a("p",[a("button",{staticClass:"btn btn-info log",staticStyle:{float:"left"},on:{click:function(a){t.sService(e)}}},[t._v("Stop Service")])]),t._v(" "),a("p",[a("button",{staticClass:"btn btn-info log",staticStyle:{float:"right"},on:{click:function(a){t.details(e)}}},[t._v("Details")])])],2)])])})],2)},staticRenderFns:[]};var y=a("VU/8")(g,b,!1,function(t){a("KTI3")},"data-v-8b5aaa08",null).exports,S={name:"app-nav",data:function(){return{isLogged:!1}},methods:{handleLogout:function(){document.cookie="auth=;",window.location.href="/"},handleLogin:function(){window.location.href="/"},dashboard:function(){window.location.href="/dashboard"},admin:function(){window.location.href="/admin"},isLoggedIn:function(){var t=this;v().then(function(e){t.isLogged=e.data.auth})}},mounted:function(){this.isLoggedIn()}},C={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("nav",{staticClass:"navbar navbar-default"},[a("div",{staticClass:"navbar-header"},[a("router-link",{staticClass:"navbar-brand",attrs:{to:"/"}},[t._v(" MicroServices Controller")])],1),t._v(" "),a("ul",{staticClass:"nav navbar-nav navbar-right"},[a("li",[a("span",{attrs:{id:"dynamicButtons"}}),t._v(" "),a("button",{directives:[{name:"show",rawName:"v-show",value:t.isLogged,expression:"isLogged"}],staticClass:"btn btn-danger log",on:{click:function(e){t.admin()}}},[t._v("Admin")]),t._v(" "),a("button",{directives:[{name:"show",rawName:"v-show",value:t.isLogged,expression:"isLogged"}],staticClass:"btn btn-danger log",on:{click:function(e){t.dashboard()}}},[t._v("Dashboard")]),t._v(" "),a("button",{directives:[{name:"show",rawName:"v-show",value:t.isLogged,expression:"isLogged"}],staticClass:"btn btn-danger log",on:{click:function(e){t.handleLogout()}}},[t._v("Log out")]),t._v(" "),a("button",{directives:[{name:"show",rawName:"v-show",value:!t.isLogged,expression:"!isLogged"}],staticClass:"btn btn-info log",on:{click:function(e){t.handleLogin()}}},[t._v("Log In")])])])])},staticRenderFns:[]};var w=a("VU/8")(S,C,!1,function(t){a("eicF")},"data-v-0efedeee",null).exports,k={name:"groups",data:function(){return{showModal:!1,groups:[],search:"",modalGroup:"",iterCounter:0,modalService:"",isDone:!0,isAdmin:!1}},components:{Modal:m},methods:{closeModal:function(){this.showModal=!1},isAd:function(){this.isAdmin=document.location.href.indexOf("admin")>0},populateModal:function(t){for(var e=0;e<t.services.length;e++)t.services[e].fields=JSON.parse(t.services[e].fields);this.modalGroup=t,this.showModal=!0},submitAndClose:function(){var t;(t=this.modalGroup).auth=c("auth"),alert("Group Launched!"),r.a.post(d+"/startGroup",t),this.showGroupModal=!1,this.modalGroup=""},delGroup:function(t){!function(t){t.auth=c("auth"),alert("Your group is currently terminating."),r.a.post(d+"/deleteGroup",t)}(t),setTimeout(location.reload.bind(location),500)},removeFromG:function(t,e){var a;(a={group_id:e.ID,service_id:t.ID}).auth=c("auth"),r.a.post(d+"/removeFromGroup",a),alert("Removed!"),setTimeout(location.reload.bind(location),500)},getGroup:function(){var t=this;u().then(function(e){t.groups=e.data})}},mounted:function(){this.getGroup(),this.isAd()},computed:{filteredList:function(){var t=this;return this.groups.filter(function(e){return(e.name.toLowerCase()+" "+e.description.toLowerCase()).includes(t.search.toLowerCase())})}}},U={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[t.showModal?a("modal",[t._l(t.modalGroup.services,function(e){return a("div",{attrs:{slot:"body"},slot:"body"},[a("div",{staticClass:"panel panel-default"},[a("div",{staticClass:"panel-heading"},[a("h3",{staticClass:"panel-title"},[t._v(" "+t._s(e.name)+" ")])]),t._v(" "),a("div",{staticClass:"panel-body"},[a("p",[a("span",{staticClass:"badge alert-info"},[t._v(" Description: ")]),t._v(" "+t._s(e.description)+" ")]),t._v(" "),a("hr"),t._v(" "),t._l(e.fields,function(e){return a("div",[a("div",{staticStyle:{display:"block",height:"3rem"},attrs:{id:"container"}},[a("label",{staticStyle:{display:"inline",float:"left"}},[t._v(" "+t._s(e.label)+" ")]),t._v(" "),a("input",{directives:[{name:"model",rawName:"v-model",value:e.value,expression:"field.value"}],staticStyle:{display:"inline",float:"right"},attrs:{type:"input",placeholder:e.placeholder,name:e.name},domProps:{value:e.value},on:{input:function(a){a.target.composing||t.$set(e,"value",a.target.value)}}})])])})],2)])])}),t._v(" "),a("div",{attrs:{slot:"footer"},slot:"footer"},[a("button",{staticClass:"btn btn-outline-info",attrs:{type:"button"},on:{click:function(e){t.closeModal()}}},[t._v(" Close ")]),t._v(" "),a("button",{staticClass:"btn btn-primary",attrs:{type:"button","data-dismiss":"modal"},on:{click:function(e){t.submitAndClose()}}},[t._v("\n       Submit\n     ")])])],2):t._e(),t._v(" "),a("h3",{staticClass:"text-center"},[t._v("Groups")]),t._v(" "),a("div",{staticClass:"search-wrapper"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.search,expression:"search"}],staticStyle:{"text-align":"center","border-radius":"10px"},attrs:{type:"text",placeholder:"Search groups..."},domProps:{value:t.search},on:{input:function(e){e.target.composing||(t.search=e.target.value)}}})]),t._v(" "),a("hr"),t._v(" "),t._l(t.filteredList.slice(0,6),function(e){return a("div",{staticClass:"col-sm-12"},[a("div",{staticClass:"panel panel-default"},[a("div",{staticClass:"panel-heading"},[a("h3",{staticClass:"panel-title"},[t._v(" "+t._s(e.name)+" ")])]),t._v(" "),a("div",{staticClass:"panel-body"},[a("p",[a("span",{staticClass:"badge alert-info"},[t._v(" Description: ")]),t._v(" "+t._s(e.description)+" ")]),t._v(" "),a("hr"),t._v(" "),a("div",{staticClass:"col-sm-12"},[a("span",{staticStyle:{margin:"auto"}},t._l(e.services.slice(0,3),function(i){return a("div",{staticClass:"col-sm-4"},[a("div",{staticClass:"panel panel-default"},[a("div",{staticClass:"panel-heading"},[a("h3",{staticClass:"panel-title"},[t._v(" "+t._s(i.name)+" ")])]),t._v(" "),a("div",{staticClass:"panel-body"},[a("p",[a("span",{staticClass:"badge alert-info"},[t._v(" Description: ")]),t._v(" "+t._s(i.description)+" ")]),t._v(" "),a("p",[a("span",{staticClass:"badge alert-info"},[t._v(" Version: ")]),t._v(" "+t._s(i.version)+" ")]),t._v(" "),a("hr"),t._v(" "),a("p",{staticStyle:{"text-align":"center",margin:"auto"}},[a("button",{staticClass:"btn btn-info log",on:{click:function(a){t.removeFromG(i,e)}}},[t._v("Remove From Group")])])])])])}))]),t._v(" "),a("hr"),t._v(" "),a("p",[a("button",{staticClass:"btn btn-info log",staticStyle:{float:"left"},on:{click:function(a){t.populateModal(e)}}},[t._v("Launch Group")])]),t._v(" "),a("p",[a("button",{directives:[{name:"show",rawName:"v-show",value:t.isAdmin,expression:"isAdmin"}],staticClass:"btn btn-info log",staticStyle:{float:"right"},on:{click:function(a){t.delGroup(e)}}},[t._v("Delete Group")])])])])])})],2)},staticRenderFns:[]};var M=a("VU/8")(k,U,!1,function(t){a("juhF")},"data-v-194121c5",null).exports,A={name:"homepage",components:{AppNav:w,Services:_,activeServices:y,groups:M},data:function(){},methods:{isLoggedIn:function(){v().then(function(t){t.data.auth||(window.location.href="/")})}},created:function(){this.isLoggedIn()}},G={render:function(){var t=this.$createElement,e=this._self._c||t;return e("div",[e("app-nav"),this._v(" "),e("modal"),this._v(" "),e("div",{staticStyle:{overflow:"hidden"}},[e("activeServices")],1),e("div",{staticStyle:{overflow:"hidden"}},[e("services")],1),e("div",{staticStyle:{overflow:"hidden"}},[e("groups")],1)],1)},staticRenderFns:[]};var x=a("VU/8")(A,G,!1,function(t){a("9mMh")},"data-v-409b80c9",null).exports,L={name:"login",data:function(){return{username:"",password:"",auth:!1}},components:{AppNav:w},methods:{login:function(){document.cookie="auth="+btoa(this.username+":"+this.password)+";";var t=this;v().then(function(e){t.auth=e.data.auth}).then(function(){t.auth?window.location.href="/dashboard":(alert("Invalid Auth Attempt"),window.location.href="/")})}}},N={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("app-nav"),t._v(" "),a("div",{staticClass:"panel panel-default"},[t._m(0),t._v(" "),a("div",{staticClass:"panel-body"},[a("label",{staticStyle:{display:"block",margin:"1em"}},[t._v("Username:  "),a("input",{directives:[{name:"model",rawName:"v-model",value:t.username,expression:"username"}],staticStyle:{"border-radius":"10px"},attrs:{type:"input",name:"username"},domProps:{value:t.username},on:{input:function(e){e.target.composing||(t.username=e.target.value)}}})]),t._v(" "),a("label",{staticStyle:{display:"block",margin:"1em"}},[t._v("Password:  "),a("input",{directives:[{name:"model",rawName:"v-model",value:t.password,expression:"password"}],staticStyle:{"border-radius":"10px"},attrs:{type:"password",name:"password"},domProps:{value:t.password},on:{input:function(e){e.target.composing||(t.password=e.target.value)}}})]),t._v(" "),a("hr"),t._v(" "),a("p",[a("button",{staticClass:"btn btn-info log",staticStyle:{float:"right"},on:{click:function(e){t.login()}}},[t._v("Login")])])])])],1)},staticRenderFns:[function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"panel-heading"},[e("h3",{staticClass:"panel-title"},[this._v(" Login ")])])}]};var F=a("VU/8")(L,N,!1,function(t){a("0r5P")},"data-v-d906c97e",null).exports,P={name:"admin",components:{AppNav:w,Services:_,activeServices:y,groups:M,Modal:m},data:function(){return{modalGroup:{name:"",description:""},modalUser:{username:"",password:"",admin:!1},modalService:{name:"",description:"",fields:[],version:"",image:"","service port":"",composeFile:""},showServiceModal:!1,showUserModal:!1,users:null,showGroupModal:!1}},methods:{closeServiceModal:function(){this.showServiceModal=!1,this.modalService={name:"",description:"",fields:[],version:"",image:"","service port":"",composeFile:""}},populateServiceModal:function(){this.modalService.fields.push({label:"port",value:"",display:!0}),this.modalService.fields.push({label:"service port",value:"",display:!1}),this.modalService.fields.push({label:"image",value:"",display:!1}),this.showServiceModal=!0},submitAndCloseService:function(){var t;(t=this.modalService).auth=c("auth"),alert("Service Added!"),r.a.post(d+"/addService",t),this.showServiceModal=!1,this.modalService={name:"",description:"",fields:[],version:"",image:"","service port":"",composeFile:""},setTimeout(location.reload.bind(location),1e3)},closeUserModal:function(){this.showUserModal=!1,this.modalUser={username:"",password:"",admin:!1}},populateUserModal:function(){this.showUserModal=!0},removeUser:function(){for(var t="",e=0;e<this.users.length;e++){t+=this.users[e].username+"\n"}t+="Pick a user to remove:";var a=prompt(t);a&&(!function(t){t.auth=c("auth"),alert("User removed!"),r.a.post(d+"/removeUser",t)}({username:a}),setTimeout(location.reload.bind(location),1e3))},submitAndCloseUser:function(){var t;(t=this.modalUser).auth=c("auth"),alert("User Added!"),r.a.post(d+"/addUser",t),this.showUserModal=!1,this.modalUser={username:"",password:"",admin:!1},setTimeout(location.reload.bind(location),1e3)},closeGroupModal:function(){this.showGroupModal=!1,this.modalGroup={name:"",description:""}},processFile:function(t){var e=this,a=t.target;if(a.files&&a.files[0]){var i=new FileReader;i.onload=function(t){e.modalService.composeFile=t.target.result},i.readAsDataURL(a.files[0])}},addAnother:function(){this.modalService.fields.push({label:"",value:"",display:!1})},populateGroupModal:function(){this.showGroupModal=!0},submitAndCloseGroup:function(){var t;(t=this.modalGroup).auth=c("auth"),alert("Group added!"),r.a.post(d+"/addGroup",t),this.showGroupModal=!1,this.modalGroup={name:"",description:""},setTimeout(location.reload.bind(location),1e3)},getUs:function(){var t=this;r.a.get(d+"/getUsers",{params:{authString:c("auth")}}).then(function(e){t.users=e.data})},isAdmin:function(){r.a.get(d+"/isAdmin",{params:{auth:c("auth")}}).then(function(t){t.data.auth||(alert("You're not an admin!"),window.location.href="/dashboard")})},isLoggedIn:function(){v().then(function(t){t.data.auth||(window.location.href="/")})}},created:function(){this.isLoggedIn(),this.isAdmin(),this.getUs()}},D={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("app-nav"),t._v(" "),a("button",{staticClass:"btn btn-danger log",on:{click:function(e){t.populateGroupModal()}}},[t._v("Add Group")]),t._v(" "),a("button",{staticClass:"btn btn-danger log",on:{click:function(e){t.populateServiceModal()}}},[t._v("Add Service")]),t._v(" "),a("button",{staticClass:"btn btn-danger log",on:{click:function(e){t.populateUserModal()}}},[t._v("Add User")]),t._v(" "),a("button",{staticClass:"btn btn-danger log",on:{click:function(e){t.removeUser()}}},[t._v("Remove User")]),t._v(" "),t.showUserModal?a("modal",[a("div",{attrs:{slot:"body"},slot:"body"},[a("div",{staticClass:"panel panel-default"},[a("div",{staticClass:"panel-heading"},[a("h3",{staticClass:"panel-title"},[t._v(" New User ")])]),t._v(" "),a("div",{staticClass:"panel-body"},[a("div",{staticStyle:{display:"block",height:"3rem"},attrs:{id:"container"}},[a("label",{staticStyle:{display:"inline",float:"left"}},[t._v(" Username ")]),t._v(" "),a("input",{directives:[{name:"model",rawName:"v-model",value:t.modalUser.username,expression:"modalUser.username"}],staticStyle:{display:"inline",float:"right"},attrs:{type:"input",placeholder:t.Name,name:t.modalUser.username},domProps:{value:t.modalUser.username},on:{input:function(e){e.target.composing||t.$set(t.modalUser,"username",e.target.value)}}})]),t._v(" "),a("div",{staticStyle:{display:"block",height:"3rem"},attrs:{id:"container"}},[a("label",{staticStyle:{display:"inline",float:"left"}},[t._v(" Password ")]),t._v(" "),a("input",{directives:[{name:"model",rawName:"v-model",value:t.modalUser.password,expression:"modalUser.password"}],staticStyle:{display:"inline",float:"right"},attrs:{type:"password",placeholder:t.Description,name:t.modalUser.password},domProps:{value:t.modalUser.password},on:{input:function(e){e.target.composing||t.$set(t.modalUser,"password",e.target.value)}}})]),t._v(" "),a("div",{staticStyle:{display:"block",height:"3rem"},attrs:{id:"container"}},[a("label",{staticStyle:{display:"inline",float:"left"}},[t._v(" Admin? ")]),t._v(" "),a("input",{directives:[{name:"model",rawName:"v-model",value:t.modalUser.admin,expression:"modalUser.admin"}],staticStyle:{display:"inline",float:"right"},attrs:{type:"checkbox",name:t.modalUser.admin},domProps:{checked:Array.isArray(t.modalUser.admin)?t._i(t.modalUser.admin,null)>-1:t.modalUser.admin},on:{change:function(e){var a=t.modalUser.admin,i=e.target,s=!!i.checked;if(Array.isArray(a)){var o=t._i(a,null);i.checked?o<0&&(t.modalUser.admin=a.concat([null])):o>-1&&(t.modalUser.admin=a.slice(0,o).concat(a.slice(o+1)))}else t.$set(t.modalUser,"admin",s)}}})])])])]),t._v(" "),a("div",{attrs:{slot:"footer"},slot:"footer"},[a("button",{staticClass:"btn btn-outline-info",attrs:{type:"button"},on:{click:function(e){t.closeUserModal()}}},[t._v(" Close ")]),t._v(" "),a("button",{staticClass:"btn btn-primary",attrs:{type:"button","data-dismiss":"modal"},on:{click:function(e){t.submitAndCloseUser()}}},[t._v("\n         Submit\n       ")])])]):t._e(),t._v(" "),t.showServiceModal?a("modal",[a("div",{attrs:{slot:"body"},slot:"body"},[a("div",{staticClass:"panel panel-default"},[a("div",{staticClass:"panel-heading"},[a("h3",{staticClass:"panel-title"},[t._v(" New Service ")])]),t._v(" "),a("div",{staticClass:"panel-body"},[a("div",{staticStyle:{display:"block",height:"3rem"},attrs:{id:"container"}},[a("label",{staticStyle:{display:"inline",float:"left"}},[t._v(" Name ")]),t._v(" "),a("input",{directives:[{name:"model",rawName:"v-model",value:t.modalService.name,expression:"modalService.name"}],staticStyle:{display:"inline",float:"right"},attrs:{type:"input",placeholder:t.Name,name:t.modalService.name},domProps:{value:t.modalService.name},on:{input:function(e){e.target.composing||t.$set(t.modalService,"name",e.target.value)}}})]),t._v(" "),a("div",{staticStyle:{display:"block",height:"3rem"},attrs:{id:"container"}},[a("label",{staticStyle:{display:"inline",float:"left"}},[t._v(" Description ")]),t._v(" "),a("input",{directives:[{name:"model",rawName:"v-model",value:t.modalService.description,expression:"modalService.description"}],staticStyle:{display:"inline",float:"right"},attrs:{type:"input",placeholder:t.Description,name:t.modalService.description},domProps:{value:t.modalService.description},on:{input:function(e){e.target.composing||t.$set(t.modalService,"description",e.target.value)}}})]),t._v(" "),a("div",{staticStyle:{display:"block",height:"3rem"},attrs:{id:"container"}},[a("label",{staticStyle:{display:"inline",float:"left"}},[t._v(" Version ")]),t._v(" "),a("input",{directives:[{name:"model",rawName:"v-model",value:t.modalService.version,expression:"modalService.version"}],staticStyle:{display:"inline",float:"right"},attrs:{type:"input",placeholder:t.Version,name:t.modalService.version},domProps:{value:t.modalService.version},on:{input:function(e){e.target.composing||t.$set(t.modalService,"version",e.target.value)}}})]),t._v(" "),a("div",{staticStyle:{display:"block",height:"3rem"},attrs:{id:"container"}},[a("label",{staticStyle:{display:"inline",float:"left"}},[t._v(" Docker Compose File ")]),t._v(" "),a("input",{staticStyle:{float:"right"},attrs:{type:"file",accept:"application/x-yaml"},on:{change:t.processFile}})]),t._v(" "),a("strong",{staticStyle:{"text-align":"center"}},[t._v("Fields")]),t._v(" "),a("div",[a("span",{staticStyle:{float:"left"}},[t._v("ParamName")]),a("span",{staticStyle:{float:"right","padding-left":"2rem"}},[t._v("Visible?")]),a("span",{staticStyle:{float:"right"}},[t._v("ParamValue")])]),t._v(" "),a("hr"),t._v(" "),a("div",t._l(t.modalService.fields,function(e){return a("div",{staticStyle:{display:"block",height:"3rem"},attrs:{id:"container"}},[a("input",{directives:[{name:"model",rawName:"v-model",value:e.label,expression:"field.label"}],staticStyle:{display:"inline",float:"left"},attrs:{disabled:"port"==e.label||"image"==e.label||"service port"==e.label,type:"input"},domProps:{value:e.label},on:{input:function(a){a.target.composing||t.$set(e,"label",a.target.value)}}}),t._v(" "),a("input",{directives:[{name:"model",rawName:"v-model",value:e.display,expression:"field.display"}],staticStyle:{display:"inline",float:"right","margin-left":"2rem"},attrs:{type:"checkbox"},domProps:{checked:Array.isArray(e.display)?t._i(e.display,null)>-1:e.display},on:{change:function(a){var i=e.display,s=a.target,o=!!s.checked;if(Array.isArray(i)){var n=t._i(i,null);s.checked?n<0&&(e.display=i.concat([null])):n>-1&&(e.display=i.slice(0,n).concat(i.slice(n+1)))}else t.$set(e,"display",o)}}}),t._v(" "),a("input",{directives:[{name:"model",rawName:"v-model",value:e.value,expression:"field.value"}],staticStyle:{display:"inline",float:"right"},attrs:{type:"input"},domProps:{value:e.value},on:{input:function(a){a.target.composing||t.$set(e,"value",a.target.value)}}})])})),t._v(" "),a("button",{staticStyle:{float:"left","margin-right":".5rem"},on:{click:function(e){t.addAnother()}}},[t._v("+ Add Field")])])])]),t._v(" "),a("div",{attrs:{slot:"footer"},slot:"footer"},[a("button",{staticClass:"btn btn-outline-info",attrs:{type:"button"},on:{click:function(e){t.closeServiceModal()}}},[t._v(" Close ")]),t._v(" "),a("button",{staticClass:"btn btn-primary",attrs:{type:"button","data-dismiss":"modal"},on:{click:function(e){t.submitAndCloseService()}}},[t._v("\n         Submit\n       ")])])]):t._e(),t._v(" "),t.showGroupModal?a("modal",[a("div",{attrs:{slot:"body"},slot:"body"},[a("div",{staticClass:"panel panel-default"},[a("div",{staticClass:"panel-heading"},[a("h3",{staticClass:"panel-title"},[t._v(" New Group ")])]),t._v(" "),a("div",{staticClass:"panel-body"},[a("div",{staticStyle:{display:"block",height:"3rem"},attrs:{id:"container"}},[a("label",{staticStyle:{display:"inline",float:"left"}},[t._v(" Name ")]),t._v(" "),a("input",{directives:[{name:"model",rawName:"v-model",value:t.modalGroup.name,expression:"modalGroup.name"}],staticStyle:{display:"inline",float:"right"},attrs:{type:"input",placeholder:t.Name,name:t.modalGroup.name},domProps:{value:t.modalGroup.name},on:{input:function(e){e.target.composing||t.$set(t.modalGroup,"name",e.target.value)}}})]),t._v(" "),a("div",{staticStyle:{display:"block",height:"3rem"},attrs:{id:"container"}},[a("label",{staticStyle:{display:"inline",float:"left"}},[t._v(" Description ")]),t._v(" "),a("input",{directives:[{name:"model",rawName:"v-model",value:t.modalGroup.description,expression:"modalGroup.description"}],staticStyle:{display:"inline",float:"right"},attrs:{type:"input",placeholder:t.Description,name:t.modalGroup.description},domProps:{value:t.modalGroup.description},on:{input:function(e){e.target.composing||t.$set(t.modalGroup,"description",e.target.value)}}})])])])]),t._v(" "),a("div",{attrs:{slot:"footer"},slot:"footer"},[a("button",{staticClass:"btn btn-outline-info",attrs:{type:"button"},on:{click:function(e){t.closeGroupModal()}}},[t._v(" Close ")]),t._v(" "),a("button",{staticClass:"btn btn-primary",attrs:{type:"button","data-dismiss":"modal"},on:{click:function(e){t.submitAndCloseGroup()}}},[t._v("\n         Submit\n       ")])])]):t._e(),t._v(" "),a("div",{staticStyle:{overflow:"hidden"},attrs:{id:"activeServices"}},[a("activeServices")],1),t._v(" "),a("div",{staticStyle:{overflow:"hidden"},attrs:{id:"Services"}},[a("services")],1),t._v(" "),a("div",{staticStyle:{overflow:"hidden"},attrs:{id:"Groups"}},[a("groups",{staticStyle:{width:"100%"}})],1)],1)},staticRenderFns:[]};var $=a("VU/8")(P,D,!1,function(t){a("AgqQ")},"data-v-1f2a8f30",null).exports;i.a.use(n.a);var V=new n.a({mode:"history",routes:[{path:"/dashboard",name:"homepage",component:x},{path:"/",name:"login",component:F},{path:"/admin",name:"admin",component:$}]});i.a.config.productionTip=!1,new i.a({el:"#app",router:V,components:{App:o},template:"<App/>"})},eicF:function(t,e){},juhF:function(t,e){},rV00:function(t,e){}},["NHnr"]);
  //# sourceMappingURL=app.c9c37d51ff183cdfb1e6.js.map