text: (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([[9],{"31c4":function(e,t,o){"use strict";var s=o("ded3"),n=o.n(s),r=o("2f62");t["a"]={data(){return{pipelinesLoading:!1,collectorsLoading:!1}},computed:n()(n()({},Object(r["c"])("mainStore",["openCollectors","pipelines"])),{},{dataLoading(){return this.collectorsLoading||this.pipelinesLoading}}),methods:n()(n()({},Object(r["b"])("mainStore",["getOpenCollectors","getPipelines"])),{},{loadOpenCollectors(){this.getOpenCollectors({loadingVariableName:"collectorsLoading",caller:this})},loadPipelines(){this.getPipelines({loadingVariableName:"pipelinesLoading",caller:this})},loadOpenCollectorsAndPipelines(){this.loadOpenCollectors(),this.loadPipelines()}}),mounted(){0===this.openCollectors.length&&this.loadOpenCollectors(),this.pipelines&&0===this.pipelines.length&&this.loadPipelines()}}},"5d0b":function(e,t,o){"use strict";o.d(t,"a",(function(){return a}));var s=o("ded3"),n=o.n(s),r=(o("ddb0"),o("ac1f"),o("651e"));function l(e,t,o){if(e&&"object"===typeof e&&t&&Array.isArray(t)&&o&&"object"===typeof o)for(const[s,n]of Object.entries(e)){let e,r="",l="";const a=String(n).split("👉");a&&a.length>=2&&(r=a.shift(),l=a.join("👉"));const i=String(l).split("👈___default___");i&&i.length>=2&&(e=i.pop(),l=i.join("👈___default___"));const c=t.find((e=>e.tag===r));if(r=c&&c.transform&&c.transform.length?c.transform:"","🚫"===e&&(e=void 0),null!==e&&""!==e&&+e===+e&&(e=Number(e)),s&&s.length&&r&&r.length){const t={};Object.defineProperty(t,r,{enumerable:!0,value:{target:s,value:l,default:e}}),"delete"===r&&(delete t[r].value,delete t[r].default),o.push(t)}}}function a(e){try{const s=Object.assign({},e);let a=s.collectionMethod||"";if("syslog_udp"===a&&(a="syslog"),"syslog_tcp"===a&&(a="syslog"),void 0===s.request&&(s.request={}),void 0===s.request.transforms&&(s.request.transforms=[]),void 0===s.response&&(s.response={}),void 0===s.response.transforms&&(s.response.transforms=[]),void 0===s.response.pagination&&(s.response.pagination=[]),s.EZ__Auth_Basic__enable&&!0===s.EZ__Auth_Basic__enable){let e;try{e=btoa((s.EZ__Auth_Basic__username||"")+":"+(s.EZ__Auth_Basic__password||""))}catch(t){e=btoa(":")}s.request.transforms.push({set:{target:"header.Authorization",value:e}})}if(s["request.body"]&&s["request.body"].length)try{s["request.body"]=JSON.parse(s["request.body"])}catch(o){delete s["request.body"]}const i=[{tag:"___set___",transform:"set"},{tag:"___append___",transform:"append"},{tag:"___delete___",transform:"delete"}];if(l(s["request.transforms"],i,s.request.transforms),l(s["response.transforms"],i,s.response.transforms),l(s["response.pagination"],i,s.response.pagination),s.cursor){const e={};for(const[t,o]of Object.entries(s.cursor)){let s,n=o;const r=String(n).split("👈___default___");r&&r.length>=2&&(s=r.pop(),n=r.join("👈___default___")),"🚫"===s&&(s=void 0),null!==s&&""!==s&&+s===+s&&(s=Number(s));const l={};Object.defineProperty(l,t,{enumerable:!0,value:{value:n,default:s}}),Object.assign(e,l)}s.cursor=e}delete s.collectionShipper,delete s.collectionMethod,delete s.EZ__Auth_Basic__enable,delete s.EZ__Auth_Basic__username,delete s.EZ__Auth_Basic__password,delete s["request.transforms"],delete s["response.transforms"],delete s["response.pagination"],0===s.request.transforms.length&&delete s.request.transforms,0===s.response.transforms.length&&delete s.response.transforms,0===s.response.pagination.length&&delete s.response.pagination,0===Object.keys(s.request).length&&delete s.request,0===Object.keys(s.response).length&&delete s.response;const c=JSON.parse(JSON.stringify(s,((e,t)=>null===t?void 0:t))),p="log"===a||"syslog"===a||"httpjson"===a;return Object(r["dump"])(p?[n()({type:a},c)]:{[a]:c})}catch(s){return s}}},"9fa1":function(e,t,o){"use strict";var s=o("ded3"),n=o.n(s),r=o("2f62");t["a"]={data(){return{socket:this.$socket}},computed:n()({},Object(r["d"])("mainStore",["jwtToken"])),methods:{connectSocket(){this.socket&&this.socket.connected&&this.socket.disconnect(),this.socket.auth.token=this.jwtToken,this.socket.connect()},disconnectSocket(){this.socket&&this.socket.connected&&this.socket.disconnect()}}}},c1dc:function(e,t,o){"use strict";var s=o("ded3"),n=o.n(s),r=o("2f62"),l=o("5d0b");function a(e){try{const t=Object.assign({},e),o=t.collectionMethod||"";delete t.collectionShipper,delete t.collectionMethod;const s=JSON.parse(JSON.stringify(t,((e,t)=>null===t?void 0:t)));return JSON.stringify(n()({log_source_type:o},s),null,"  ")}catch(t){return t}}t["a"]={computed:n()({},Object(r["d"])("mainStore",["collectionShippersOptions","openCollectorBeats"])),methods:{collectionShipperDetails(e){const t={value:"unknown",label:"Unknown or not set",icon:"unknown",outputFormat:"json"};if(e&&e.length){const o=e.toLowerCase();return this.collectionShippersOptions.find((e=>e.value&&e.value.toLowerCase()===o))||this.collectionShippersOptions.find((e=>e.label&&e.label.toLowerCase()===o))||this.openCollectorBeats.find((e=>e.label&&e.label.toLowerCase()===o))||t}return t},collectionConfigOutputFor(e,t){return"yaml"===e||"yml"===e?Object(l["a"])(t):"json"===e?a(t):""}}}},e956:function(e,t,o){"use strict";o.r(t);var s=function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("q-page",{staticClass:"q-pa-md"},[o("q-table",{attrs:{title:"OpenCollectors",data:e.tableData,columns:e.columns,"row-key":"uid",dense:"","no-data-label":"No OpenCollector to display.",filter:e.searchFilter,loading:e.tableLoading,"rows-per-page-label":"OpenCollectors per page:",pagination:e.pagination},on:{"update:pagination":function(t){e.pagination=t}},scopedSlots:e._u([{key:"top",fn:function(){return[o("div",{staticClass:"full-width row wrap justify-between"},[o("div",{staticClass:"q-table__title"},[e._v("\n            OpenCollectors\n          ")]),o("div",{staticClass:"row q-gutter-md"},[o("div",{staticClass:"col"},[o("q-btn",{staticStyle:{"min-width":"15rem"},attrs:{rounded:"",dense:"",color:"primary",icon:"add",label:"Add New OpenCollector"},on:{click:function(t){return e.doPromptForOpenCollectorDetails()}}},[o("q-tooltip",{attrs:{"content-style":"font-size: 1em"}},[e._v("\n                  Create a new OpenCollector.\n                ")])],1)],1)]),o("div",{staticClass:"row q-gutter-md"},[o("div",{staticStyle:{width:"300px"}},[o("q-input",{attrs:{outlined:"",dense:"",debounce:"300",placeholder:"Search"},scopedSlots:e._u([{key:"append",fn:function(){return[e.searchFilter.length?o("q-btn",{attrs:{dense:"",flat:"",icon:"close"},on:{click:function(t){e.searchFilter=""}}}):e._e(),o("q-icon",{attrs:{name:"search"}})]},proxy:!0}]),model:{value:e.searchFilter,callback:function(t){e.searchFilter=t},expression:"searchFilter"}})],1),o("q-btn",{attrs:{dense:"",outline:"",icon:"refresh"},on:{click:function(t){return e.loadOpenCollectors()}}},[o("q-tooltip",{attrs:{"content-style":"font-size: 1em"}},[e._v("\n                Reload the list of OpenCollectors.\n              ")])],1)],1)])]},proxy:!0},{key:"body-cell-actions",fn:function(t){return[o("q-td",{attrs:{props:t}},[o("q-btn",{attrs:{flat:"",dense:"",icon:"refresh"},on:{click:function(o){return e.refreshOpenCollector(t.row.uid)}}},[o("q-tooltip",{attrs:{"content-style":"font-size: 1em"}},[e._v("\n              "+e._s(e.$t("Refresh stats for this OpenCollector"))+"\n            ")])],1),o("q-btn",{attrs:{flat:"",dense:"",icon:"edit"},on:{click:function(o){return e.doPromptForOpenCollectorDetails(t.row)}}},[o("q-tooltip",{attrs:{"content-style":"font-size: 1em"}},[e._v("\n              "+e._s(e.$t("Edit OpenCollector details"))+"\n            ")])],1),o("q-btn",{attrs:{flat:"",dense:"",icon:"delete",color:"negative"},on:{click:function(o){return e.deleteOpenCollectorPrompt(t.row)}}},[o("q-tooltip",{attrs:{"content-style":"font-size: 1em"}},[e._v("\n              "+e._s(e.$t("Delete OpenCollector"))+"\n            ")])],1)],1)]}},{key:"body-cell-authenticationMethod",fn:function(t){return[o("q-td",{attrs:{props:t}},["password"===t.value?o("q-icon",{attrs:{name:"password",size:"sm"}}):"private_key"===t.value?o("q-icon",{attrs:{name:"vpn_key",size:"sm"}}):o("q-icon",{attrs:{name:"help_center",color:"grey",size:"md"}}),o("q-tooltip",{attrs:{"content-style":"font-size: 1em"}},[e._v("\n            "+e._s(t.value)+"\n          ")])],1)]}},{key:"body-cell-ocVersion",fn:function(t){return[o("q-td",{attrs:{props:t}},[e._v("\n          "+e._s(t.value)+"\n          "),e.ocVersionCheck&&e.ocVersionCheck[t.row.uid]&&e.ocVersionCheck[t.row.uid].checking?o("q-spinner-dots",{staticClass:"q-ml-sm",attrs:{color:"primary",size:"2em"}}):e._e()],1)]}},{key:"body-cell-osVersion",fn:function(t){return[o("q-td",{attrs:{props:t}},[e._v("\n          "+e._s(t.value)+"\n          "),e.osVersionCheck&&e.osVersionCheck[t.row.uid]&&e.osVersionCheck[t.row.uid].checking?o("q-spinner-dots",{staticClass:"q-ml-sm",attrs:{color:"primary",size:"2em"}}):e._e()],1)]}},{key:"body-cell-installedShippers",fn:function(t){return[o("q-td",{attrs:{props:t}},[e._l(t.value,(function(t,s){return o("div",{key:s},[o("q-tooltip",{attrs:{"content-style":"font-size: 1em;"}},[e._v(e._s(t.name))]),o("q-avatar",{staticClass:"q-mr-xs",attrs:{square:"",size:"24px"}},[o("img",{attrs:{src:"/shippers/"+e.collectionShipperDetails(t.name).icon+".svg"}})]),o("q-badge",{attrs:{outline:"",color:"grey"}},[e._v("v"+e._s(t.version))])],1)})),e.fbVersionCheck&&e.fbVersionCheck[t.row.uid]&&e.fbVersionCheck[t.row.uid].checking?o("q-spinner-dots",{staticClass:"q-ml-sm",attrs:{color:"primary",size:"2em"}}):e._e(),e.jsBeatVersionCheck&&e.jsBeatVersionCheck[t.row.uid]&&e.jsBeatVersionCheck[t.row.uid].checking?o("q-spinner-dots",{staticClass:"q-ml-sm",attrs:{color:"primary",size:"2em"}}):e._e(),e.activeOcBeatsVersionCheck&&e.activeOcBeatsVersionCheck[t.row.uid]&&e.activeOcBeatsVersionCheck[t.row.uid].checking?o("q-spinner-dots",{staticClass:"q-ml-sm",attrs:{color:"primary",size:"2em"}}):e._e(),o("q-btn",{attrs:{dense:"",icon:"add",color:"primary",flat:""}},[o("q-tooltip",{attrs:{"content-style":"font-size: 1em;"}},[e._v("Add another Shipper")]),o("q-menu",[o("q-list",e._l(e.shippersUrls,(function(s,n){return o("q-item",{directives:[{name:"close-popup",rawName:"v-close-popup"}],key:n,attrs:{clickable:""},on:{click:function(o){return e.installFilebeat(t.row.uid,s)}}},[o("q-item-section",{staticClass:"items-center",staticStyle:{"min-width":"5em"},attrs:{side:""}},[o("q-badge",{attrs:{color:"primary"}},[e._v("v"+e._s(s.version))])],1),o("q-item-section",[o("q-item-label",[e._v(e._s(s.name))]),o("q-item-label",{attrs:{caption:""}},[e._v(e._s(s.filename))])],1)],1)})),1)],1)],1)],2)]}}])}),o("q-dialog",{attrs:{persistent:""},model:{value:e.promptForNewOpenCollectorDetails,callback:function(t){e.promptForNewOpenCollectorDetails=t},expression:"promptForNewOpenCollectorDetails"}},[o("q-card",{staticStyle:{"min-width":"350px"}},[o("q-card-section",[e.newOpenCollectorUid&&e.newOpenCollectorUid.length?o("div",{staticClass:"text-h6"},[e._v(e._s(e.$t("OpenCollector Details")))]):o("div",{staticClass:"text-h6"},[e._v(e._s(e.$t("New OpenCollector")))])]),o("q-card-section",{staticClass:"q-pt-none"},[o("q-input",{attrs:{dense:"",autofocus:"",label:"OpenCollector Name",rules:[function(t){return!!t||e.$t("OpenCollector name cannot be empty")}]},on:{keyup:function(t){if(!t.type.indexOf("key")&&e._k(t.keyCode,"esc",27,t.key,["Esc","Escape"]))return null;e.promptForNewOpenCollectorDetails=!1}},model:{value:e.newOpenCollectorName,callback:function(t){e.newOpenCollectorName=t},expression:"newOpenCollectorName"}})],1),o("q-separator"),o("q-card-section",{staticClass:"q-pt-none"},[o("div",{staticClass:"text-overline"},[e._v("Host")]),o("q-input",{attrs:{dense:"",label:"Host name",rules:[function(t){return!!t||e.$t("OpenCollector Host name cannot be empty")}]},on:{keyup:function(t){if(!t.type.indexOf("key")&&e._k(t.keyCode,"esc",27,t.key,["Esc","Escape"]))return null;e.promptForNewOpenCollectorDetails=!1}},model:{value:e.newOpenCollectorHostname,callback:function(t){e.newOpenCollectorHostname=t},expression:"newOpenCollectorHostname"}})],1),o("q-card-section",{staticClass:"q-pt-none"},[o("q-input",{attrs:{dense:"",type:"number",label:"SSH Port",rules:[function(t){return!!t||e.$t("OpenCollector port cannot be empty")}]},on:{keyup:function(t){if(!t.type.indexOf("key")&&e._k(t.keyCode,"esc",27,t.key,["Esc","Escape"]))return null;e.promptForNewOpenCollectorDetails=!1}},model:{value:e.newOpenCollectorPort,callback:function(t){e.newOpenCollectorPort=t},expression:"newOpenCollectorPort"}})],1),o("q-separator"),o("q-card-section",{staticClass:"q-pt-none"},[o("div",{staticClass:"text-overline"},[e._v("Authentication")]),o("q-input",{attrs:{dense:"",label:"SSH User name",hint:""},on:{keyup:function(t){if(!t.type.indexOf("key")&&e._k(t.keyCode,"esc",27,t.key,["Esc","Escape"]))return null;e.promptForNewOpenCollectorDetails=!1}},model:{value:e.newOpenCollectorUsername,callback:function(t){e.newOpenCollectorUsername=t},expression:"newOpenCollectorUsername"}}),o("q-tabs",{attrs:{"active-color":"primary","indicator-color":"primary",align:"justify","narrow-indicator":""},model:{value:e.newOpenCollectorAuthMethod,callback:function(t){e.newOpenCollectorAuthMethod=t},expression:"newOpenCollectorAuthMethod"}},[o("q-tab",{attrs:{name:"password",label:"Password"}}),o("q-tab",{attrs:{name:"private_key",label:"Private Key"}})],1),o("q-separator"),o("q-tab-panels",{attrs:{animated:""},model:{value:e.newOpenCollectorAuthMethod,callback:function(t){e.newOpenCollectorAuthMethod=t},expression:"newOpenCollectorAuthMethod"}},[o("q-tab-panel",{attrs:{name:"password"}},[o("q-input",{attrs:{dense:"",type:"password",label:"SSH Password",hint:""},on:{keyup:function(t){if(!t.type.indexOf("key")&&e._k(t.keyCode,"esc",27,t.key,["Esc","Escape"]))return null;e.promptForNewOpenCollectorDetails=!1}},model:{value:e.newOpenCollectorPassword,callback:function(t){e.newOpenCollectorPassword=t},expression:"newOpenCollectorPassword"}})],1),o("q-tab-panel",{attrs:{name:"private_key"}},[o("q-input",{attrs:{dense:"",type:"textarea",label:"SSH Private Key",hint:""},on:{keyup:function(t){if(!t.type.indexOf("key")&&e._k(t.keyCode,"esc",27,t.key,["Esc","Escape"]))return null;e.promptForNewOpenCollectorDetails=!1}},model:{value:e.newOpenCollectorPrivateKey,callback:function(t){e.newOpenCollectorPrivateKey=t},expression:"newOpenCollectorPrivateKey"}})],1)],1)],1),o("q-card-actions",{staticClass:"text-primary",attrs:{align:"right"}},[o("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],attrs:{flat:"",label:e.$t("Cancel")}}),e.newOpenCollectorUid&&e.newOpenCollectorUid.length?o("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],attrs:{flat:"",label:e.$t("Update OpenCollector"),disabled:!e.newOpenCollectorName||!e.newOpenCollectorName.length||!e.newOpenCollectorHostname||!e.newOpenCollectorHostname.length||!e.newOpenCollectorPort||e.newOpenCollectorPort<0||e.newOpenCollectorPort>65535||!e.newOpenCollectorUsername||!e.newOpenCollectorUsername.length||(!e.newOpenCollectorPassword||!e.newOpenCollectorPassword.length)&&(!e.newOpenCollectorPrivateKey||!e.newOpenCollectorPrivateKey.length)},on:{click:function(t){return e.addNewOrUpdateOpenCollector()}}}):o("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],attrs:{flat:"",label:e.$t("Add new OpenCollector"),disabled:!e.newOpenCollectorName||!e.newOpenCollectorName.length||!e.newOpenCollectorHostname||!e.newOpenCollectorHostname.length||!e.newOpenCollectorPort||e.newOpenCollectorPort<0||e.newOpenCollectorPort>65535||!e.newOpenCollectorUsername||!e.newOpenCollectorUsername.length||(!e.newOpenCollectorPassword||!e.newOpenCollectorPassword.length)&&(!e.newOpenCollectorPrivateKey||!e.newOpenCollectorPrivateKey.length)},on:{click:function(t){return e.addNewOrUpdateOpenCollector()}}})],1)],1)],1),Object.keys(e.shipperInstall).length?o("q-card",{staticClass:"q-mt-sm"},[o("q-card-section",[o("div",{staticClass:"text-h6"},[e._v("Installation Logs")])]),e._l(e.shipperInstall,(function(t,s){return o("q-card-section",{key:s},[t.collector?o("div",{staticClass:"row q-gutter-x-md items-center"},[o("q-spinner-gears",{directives:[{name:"show",rawName:"v-show",value:!0===t.onGoing,expression:"job.onGoing === true"}],attrs:{size:"2em",color:"teal"}}),o("q-icon",{directives:[{name:"show",rawName:"v-show",value:!1===t.onGoing&&!1===t.failed,expression:"job.onGoing === false && job.failed === false"}],attrs:{name:"thumb_up",size:"2em",color:"positive"}},[o("q-tooltip",{attrs:{"content-style":"font-size: 1em;"}},[e._v("Job completed successfuly")])],1),o("q-icon",{directives:[{name:"show",rawName:"v-show",value:!1===t.onGoing&&!0===t.failed,expression:"job.onGoing === false && job.failed === true"}],attrs:{name:"thumb_down",size:"2em",color:"negative"}},[o("q-tooltip",{attrs:{"content-style":"font-size: 1em;"}},[e._v("Job failed to complete")])],1),o("q-separator",{attrs:{vertical:""}}),o("div",{staticClass:"text-bold"},[e._v(e._s(t.collector.name))]),o("q-separator",{attrs:{vertical:""}}),o("div",{staticClass:"text-italic"},[e._v(e._s(t.collector.hostname)+":"+e._s(t.collector.port))]),o("q-separator",{attrs:{vertical:""}}),o("q-linear-progress",{staticClass:"col",attrs:{rounded:"",size:"1em",value:t.step>0?t.totalSteps/t.step:0,color:!1===t.onGoing?!1===t.failed?"green-8":"deep-orange-8":""}},[o("q-tooltip",{attrs:{"content-style":"font-size: 1em;"}},[e._v("Completed steps: "+e._s(t.step)+" / "+e._s(t.totalSteps))])],1)],1):e._e(),o("div",{staticClass:"row q-my-sm"},[o("q-separator",{attrs:{vertical:"",size:"2px",color:"teal"}}),o("div",{staticClass:"q-ml-sm col"},e._l(t.console,(function(t,s){return o("div",{key:s},["finished"===t.type?o("q-icon",{staticClass:"q-mr-sm",attrs:{name:"subdirectory_arrow_right",color:"primary"}}):e._e(),"error"===t.type&&"ERROR"===t.msgCode?o("q-icon",{staticClass:"q-mr-sm",attrs:{name:"error",color:"orange"}}):e._e(),"error"===t.type&&"EXIT"===t.msgCode?o("q-icon",{staticClass:"q-mr-sm",attrs:{name:"error",color:"orange"}}):e._e(),o("span",{class:("stdout"===t.type?"fixed-font-console":"")+" "+("finished"===t.type?"text-positive":"")+("error"===t.type?"text-negative":"")},[e._v(e._s(t.value))]),"finished"===t.type?o("q-separator",{attrs:{color:""}}):e._e()],1)})),0)],1)])}))],2):e._e()],1)},n=[],r=o("ded3"),l=o.n(r),a=(o("13d5"),o("ac1f"),o("2f62")),i=o("31c4"),c=o("9fa1"),p=o("c1dc"),d=o("1732"),h={name:"PageOpenCollectorsList",mixins:[i["a"],c["a"],p["a"]],data(){return{searchFilter:"",columns:[{name:"actions",align:"center",label:"Actions",field:"actions",sortable:!1},{name:"name",align:"center",label:"Name",field:"name",sortable:!0},{name:"hostname",align:"center",label:"Hostname",field:"hostname",sortable:!0},{name:"authenticationMethod",align:"center",label:"Authentication Method",field:"authenticationMethod",sortable:!0},{name:"osVersion",align:"center",label:"OS version",field:"osVersion",sortable:!0},{name:"ocVersion",align:"center",label:"OpenCollector version",field:"ocVersion",sortable:!0},{name:"installedShippers",align:"center",label:"Installed Shippers",field:"installedShippers",sortable:!0}],pagination:{sortBy:"name",descending:!1,rowsPerPage:25},promptForNewOpenCollectorDetails:!1,newOpenCollectorUid:"",newOpenCollectorName:"",newOpenCollectorHostname:"",newOpenCollectorPort:22,newOpenCollectorAuthMethod:"password",newOpenCollectorUsername:"",newOpenCollectorPassword:"",newOpenCollectorPrivateKey:"",newOpenCollectorPipelines:[],newOpenCollectorOsVersion:"",newOpenCollectorOcInstalled:!1,newOpenCollectorOcVersion:"",newOpenCollectorFbInstalled:!1,newOpenCollectorFbVersion:"",osVersionCheck:{},ocVersionCheck:{},fbVersionCheck:{},jsBeatVersionCheck:{},activeOcBeatsVersionCheck:{},shipperInstall:{}}},computed:l()(l()(l()({},Object(a["d"])("mainStore",["collectionShippersOptions","openCollectorBeats"])),Object(a["c"])("mainStore",["openCollectors","pipelines","shippersUrls"])),{},{tableData(){const e=[];return this.openCollectors.forEach((t=>{e.push(Object.assign({},t,{pipelinesCount:t.pipelines&&t.pipelines.length>0?t.pipelines.length:"-"}))})),e},openCollectorsOptions(){const e=[];return this.openCollectors.forEach((t=>{e.push({value:t.uid,label:t.name+" ("+t.hostname+")"})})),e},tableLoading(){return this.dataLoading}}),methods:l()(l()(l()({},Object(a["b"])("mainStore",["upsertOpenCollector","deleteOpenCollector","loadShippersUrls"])),Object(a["b"])("mainStore",["getOpenCollectorsOsVersion","getOpenCollectorsOcVersion","getOpenCollectorsFilebeatVersion","getOpenCollectorsOcAndActiveBeatsVersion","getOpenCollectorsjsBeatVersion"])),{},{openOpenCollector(e){this.$router.push({path:"/OpenCollectors/"+e.uid+"/View"})},refreshOpenCollector(e){if(e&&e.length){this.ocVersionCheck[e]||(this.ocVersionCheck[e]={apiData:{},error:!1}),this.ocVersionCheck[e].checking=!0,this.ocVersionCheck=JSON.parse(JSON.stringify(this.ocVersionCheck)),this.osVersionCheck[e]||(this.osVersionCheck[e]={apiData:{}}),this.osVersionCheck[e].checking=!0,this.osVersionCheck=JSON.parse(JSON.stringify(this.osVersionCheck)),this.getOpenCollectorsOsVersion({caller:this,apiCallParams:{uid:e},onSuccessCallBack:this.osVersionReceive,onErrorCallBack:this.osVersionReceive,debug:!1});const t=JSON.parse(JSON.stringify(this.openCollectors.find((t=>t.uid===e))));t.installedShippers=[],this.upsertOpenCollector({pushToApi:!1,caller:this,openCollector:t}),this.fbVersionCheck[e]||(this.fbVersionCheck[e]={apiData:{}}),this.fbVersionCheck[e].checking=!0,this.fbVersionCheck=JSON.parse(JSON.stringify(this.fbVersionCheck)),this.getOpenCollectorsFilebeatVersion({caller:this,apiCallParams:{uid:e},onSuccessCallBack:this.fbVersionReceive,onErrorCallBack:this.fbVersionReceive,debug:!1}),this.jsBeatVersionCheck[e]||(this.jsBeatVersionCheck[e]={apiData:{}}),this.jsBeatVersionCheck[e].checking=!0,this.jsBeatVersionCheck=JSON.parse(JSON.stringify(this.jsBeatVersionCheck)),this.getOpenCollectorsjsBeatVersion({caller:this,apiCallParams:{uid:e},onSuccessCallBack:this.jsBeatVersionReceive,onErrorCallBack:this.jsBeatVersionReceive,debug:!1}),this.activeOcBeatsVersionCheck[e]||(this.activeOcBeatsVersionCheck[e]={apiData:{}}),this.activeOcBeatsVersionCheck[e].checking=!0,this.activeOcBeatsVersionCheck=JSON.parse(JSON.stringify(this.activeOcBeatsVersionCheck)),this.getOpenCollectorsOcAndActiveBeatsVersion({caller:this,apiCallParams:{uid:e},onSuccessCallBack:this.ocAndBeatsVersionReceive,onErrorCallBack:this.ocAndBeatsVersionReceive,debug:!1})}},ocVersionReceive(e){if(console.log("ocVersionReceive - 🔺- SHOULD NOT BE USED ANYMORE"),e){const t=e.params&&e.params.apiCallParams&&e.params.apiCallParams.uid?e.params.apiCallParams.uid:null;if(t&&this.ocVersionCheck&&this.ocVersionCheck[t]){if(this.ocVersionCheck[t].checking=!1,e.success){this.ocVersionCheck[t].error=!1;const o=JSON.parse(JSON.stringify(this.openCollectors.find((e=>e.uid===t))));o.ocVersion=e.data&&e.data.payload&&e.data.payload.version&&e.data.payload.version.full?e.data.payload.version.full:o.ocVersion,o.ocVersion=o.ocVersion||"",this.upsertOpenCollector({pushToApi:!0,caller:this,openCollector:o})}else this.ocVersionCheck[t].error=!0,this.ocVersionCheck[t].apiData={};this.ocVersionCheck=JSON.parse(JSON.stringify(this.ocVersionCheck))}}},osVersionReceive(e){if(e){const t=e.params&&e.params.apiCallParams&&e.params.apiCallParams.uid?e.params.apiCallParams.uid:null;if(t&&this.osVersionCheck&&this.osVersionCheck[t]){if(this.osVersionCheck[t].checking=!1,e.success){this.osVersionCheck[t].error=!1;const o=JSON.parse(JSON.stringify(this.openCollectors.find((e=>e.uid===t))));o.osVersion=e.data&&e.data.payload&&e.data.payload.version&&e.data.payload.version.full?e.data.payload.version.full:o.osVersion,o.osVersion=o.osVersion||"",this.upsertOpenCollector({pushToApi:!0,caller:this,openCollector:o})}else this.osVersionCheck[t].error=!0,this.osVersionCheck[t].apiData={};this.osVersionCheck=JSON.parse(JSON.stringify(this.osVersionCheck))}}},fbVersionReceive(e){if(e){const t=e.params&&e.params.apiCallParams&&e.params.apiCallParams.uid?e.params.apiCallParams.uid:null;if(t&&this.fbVersionCheck&&this.fbVersionCheck[t]){this.fbVersionCheck[t].checking=!1;const o=JSON.parse(JSON.stringify(this.openCollectors.find((e=>e.uid===t))));e.success?(this.fbVersionCheck[t].error=!1,e.data&&e.data.payload&&e.data.payload.version&&e.data.payload.version.full&&(o.fbVersion=e.data.payload.version.full,o.installedShippers.push({name:"Filebeat",version:e.data.payload.version.full}))):(this.fbVersionCheck[t].error=!0,o.fbVersion="",e.data.errors&&Array.isArray(e.data.errors)&&e.data.errors.forEach((e=>{String(e).includes("command not found")&&(o.fbVersion="Not Installed")})),this.fbVersionCheck[t].apiData={}),this.upsertOpenCollector({pushToApi:!0,caller:this,openCollector:o}),this.fbVersionCheck=JSON.parse(JSON.stringify(this.fbVersionCheck))}}},jsBeatVersionReceive(e){if(e){const t=e.params&&e.params.apiCallParams&&e.params.apiCallParams.uid?e.params.apiCallParams.uid:null;if(t&&this.jsBeatVersionCheck&&this.jsBeatVersionCheck[t]){this.jsBeatVersionCheck[t].checking=!1;const o=JSON.parse(JSON.stringify(this.openCollectors.find((e=>e.uid===t))));e.success?(this.jsBeatVersionCheck[t].error=!1,e.data&&e.data.payload&&e.data.payload.version&&e.data.payload.version.full&&(o.jsBeatVersion=e.data.payload.version.full,o.installedShippers.push({name:"jsBeat",version:e.data.payload.version.full}))):(this.jsBeatVersionCheck[t].error=!0,o.jsBeatVersion="",e.data.errors&&Array.isArray(e.data.errors)&&e.data.errors.forEach((e=>{String(e).includes("command not found")&&(o.jsBeatVersion="Not Installed")})),this.jsBeatVersionCheck[t].apiData={}),this.upsertOpenCollector({pushToApi:!0,caller:this,openCollector:o}),this.jsBeatVersionCheck=JSON.parse(JSON.stringify(this.jsBeatVersionCheck))}}},ocAndBeatsVersionReceive(e){if(e){const t=e.params&&e.params.apiCallParams&&e.params.apiCallParams.uid?e.params.apiCallParams.uid:null;if(t){const o=JSON.parse(JSON.stringify(this.openCollectors.find((e=>e.uid===t))));if(this.ocVersionCheck&&this.ocVersionCheck[t]){if(this.ocVersionCheck[t].checking=!1,e.success){this.ocVersionCheck[t].error=!1;const s=e.data&&e.data.payload&&e.data.payload.length?e.data.payload.find((e=>"open_collector"===e.name)):null;o.ocVersion=s&&s.version&&s.version.full?s.version.full:o.ocVersion,o.ocVersion=o.ocVersion||"",this.upsertOpenCollector({pushToApi:!0,caller:this,openCollector:o})}else this.ocVersionCheck[t].error=!0,this.ocVersionCheck[t].apiData={};this.ocVersionCheck=JSON.parse(JSON.stringify(this.ocVersionCheck))}if(this.activeOcBeatsVersionCheck&&this.activeOcBeatsVersionCheck[t]){if(this.activeOcBeatsVersionCheck[t].checking=!1,e.success){this.activeOcBeatsVersionCheck[t].error=!1;const s=e.data&&e.data.payload&&e.data.payload.length?e.data.payload.filter((e=>"open_collector"!==e.name)):null;o.installedShippers=o.installedShippers.concat(s&&Array.isArray(s)?s.reduce(((e,t)=>(e.push({name:t.name,version:t&&t.version&&t.version.full?t.version.full:null}),e)),[]):[])}else this.activeOcBeatsVersionCheck[t].error=!0,this.activeOcBeatsVersionCheck[t].apiData={};this.upsertOpenCollector({pushToApi:!0,caller:this,openCollector:o}),this.activeOcBeatsVersionCheck=JSON.parse(JSON.stringify(this.activeOcBeatsVersionCheck))}}}},deleteOpenCollectorPrompt(e){"undefined"!==typeof e&&this.$q.dialog({title:"Confirm",message:"Do you REALLY want to delete this OpenCollector?",ok:{push:!0,color:"negative"},cancel:{push:!0,color:"positive"},persistent:!0}).onOk((()=>{this.deleteOpenCollector({pushToApi:!0,caller:this,openCollector:e})}))},doPromptForOpenCollectorDetails(e){this.newOpenCollectorUid=e&&e.uid?e.uid:null,this.newOpenCollectorName=e&&e.name?e.name:"",this.newOpenCollectorHostname=e&&e.hostname?e.hostname:"",this.newOpenCollectorPort=e&&e.port?e.port:22,this.newOpenCollectorAuthMethod=e&&e.authenticationMethod?e.authenticationMethod:"password",this.newOpenCollectorUsername=e&&e.username?e.username:null,this.newOpenCollectorPassword=e&&e.password?e.password:null,this.newOpenCollectorPrivateKey=e&&e.privateKey?e.privateKey:null,this.newOpenCollectorPipelines=e&&e.pipelines?e.pipelines:[],this.newOpenCollectorOsVersion=e&&e.osVersion?e.osVersion:"",this.newOpenCollectorOcInstalled=!(!e||!e.ocInstalled)&&e.ocInstalled,this.newOpenCollectorOcVersion=e&&e.ocVersion?e.ocVersion:"",this.newOpenCollectorFbInstalled=!(!e||!e.fbInstalled)&&e.fbInstalled,this.newOpenCollectorFbVersion=e&&e.fbVersion?e.fbVersion:"",this.promptForNewOpenCollectorDetails=!0},addNewOrUpdateOpenCollector(){this.promptForNewOpenCollectorDetails=!1;const e=this.newOpenCollectorUid||Object(d["a"])();this.upsertOpenCollector({pushToApi:!0,caller:this,openCollector:{uid:e,name:this.newOpenCollectorName,hostname:this.newOpenCollectorHostname,port:this.newOpenCollectorPort,authenticationMethod:this.newOpenCollectorAuthMethod,username:this.newOpenCollectorUsername,password:this.newOpenCollectorPassword,privateKey:this.newOpenCollectorPrivateKey,pipelines:this.newOpenCollectorPipelines,osVersion:this.newOpenCollectorOsVersion,ocInstalled:this.newOpenCollectorOcInstalled,ocVersion:this.newOpenCollectorOcVersion,fbInstalled:this.newOpenCollectorFbInstalled,fbVersion:this.newOpenCollectorFbVersion}}),setTimeout((()=>{console.log("timeout - refreshOpenCollector - "+e),this.refreshOpenCollector(e)}),1e3)},installFilebeat(e,t){console.log("installFilebeat:"),console.log(e),console.log(t),this.shipperInstall[e]={collector:this.tableData.find((t=>t.uid===e)),onGoing:!0,console:[],bufferStdOut:"",failed:!1,step:0,totalSteps:1},this.shipperInstall=JSON.parse(JSON.stringify(this.shipperInstall)),this.socket&&this.socket.connected&&this.socket.emit("shipper.install",{jobId:e,uid:e,installerSource:t})},addLineToShipperInstallConsole(e,t="stdout"){e&&e.jobId&&e.payload&&(Array.isArray(this.shipperInstall[e.jobId].console)||(this.shipperInstall[e.jobId].console=[]),"string"===typeof e.payload?e.payload.split("\n").forEach((o=>{this.shipperInstall[e.jobId].console.push({type:t,value:o,msgCode:e.code||""})})):this.shipperInstall[e.jobId].console.push({type:t,value:JSON.stringify(e.payload),msgCode:e.code||""}),this.shipperInstall=JSON.parse(JSON.stringify(this.shipperInstall)))},handleSocketOnShipperInstall(e){if(console.log(e),e.payload&&e.jobId&&e.jobId.length>0&&e.code){if(this.shipperInstall[e.jobId]||(this.shipperInstall[e.jobId]={collector:this.tableData.find((t=>t.uid===e.jobId)),onGoing:!0,console:[],bufferStdOut:"",failed:!1,step:0,totalSteps:1}),"STDOUT"===e.code)if("string"===typeof e.payload){if(this.shipperInstall[e.jobId].bufferStdOut+=e.payload,this.shipperInstall[e.jobId].bufferStdOut.indexOf("\n")>-1){const t=[];this.shipperInstall[e.jobId].bufferStdOut.split("\n").forEach((e=>{t.push(e)})),this.shipperInstall[e.jobId].bufferStdOut="",t.length>0&&0!==t[t.length-1].length&&(this.shipperInstall[e.jobId].bufferStdOut=t.pop()),t.forEach((t=>{this.addLineToShipperInstallConsole({jobId:e.jobId,code:e.code,payload:t},"stdout")}))}}else this.addLineToShipperInstallConsole(e,"stdout");"FINISHED"===e.code&&(this.shipperInstall[e.jobId].step=e.step||this.shipperInstall[e.jobId].step,this.shipperInstall[e.jobId].totalSteps=e.totalSteps||this.shipperInstall[e.jobId].totalSteps,this.addLineToShipperInstallConsole(e,"finished")),"STDERR"!==e.code&&"ERROR"!==e.code||this.addLineToShipperInstallConsole(e,"error"),"EXIT"!==e.code&&"FAILURE"!==e.code||(this.addLineToShipperInstallConsole(e,"error"),this.shipperInstall[e.jobId].failed=!0,this.shipperInstall[e.jobId].onGoing=!1,setTimeout((()=>{this.refreshOpenCollector(e.jobId)}),1e3)),"END"===e.code&&(e.payload&&"SUCCESS"!==e.payload&&this.addLineToShipperInstallConsole(e,"error"),this.shipperInstall[e.jobId].onGoing=!1,setTimeout((()=>{this.refreshOpenCollector(e.jobId)}),1e3),console.log("*** END ***")),this.shipperInstall=JSON.parse(JSON.stringify(this.shipperInstall))}}}),mounted(){this.loadShippersUrls({caller:this}),this.socket.on("shipper.install",this.handleSocketOnShipperInstall)},beforeDestroy(){this.socket.offAny(this.handleSocketOnShipperInstall)}},u=h,C=o("2877"),m=o("9989"),f=o("eaac"),O=o("9c40"),b=o("05c0"),y=o("27f9"),k=o("0016"),g=o("db86"),v=o("8380"),w=o("f20b"),_=o("1c1c"),V=o("66e5"),S=o("4074"),q=o("58a81"),N=o("0170"),j=o("cb32"),I=o("4e73"),P=o("24e8"),B=o("f09f"),A=o("a370"),J=o("eb85"),D=o("429b"),E=o("7460"),x=o("adad"),F=o("823b"),T=o("4b7e"),U=o("cf57"),L=o("6b1d"),Q=o("7f67"),R=o("eebe"),z=o.n(R),M=Object(C["a"])(u,s,n,!1,null,null,null);t["default"]=M.exports;z()(M,"components",{QPage:m["a"],QTable:f["a"],QBtn:O["a"],QTooltip:b["a"],QInput:y["a"],QIcon:k["a"],QTd:g["a"],QSpinnerDots:v["a"],QBtnDropdown:w["a"],QList:_["a"],QItem:V["a"],QItemSection:S["a"],QBadge:q["a"],QItemLabel:N["a"],QAvatar:j["a"],QMenu:I["a"],QDialog:P["a"],QCard:B["a"],QCardSection:A["a"],QSeparator:J["a"],QTabs:D["a"],QTab:E["a"],QTabPanels:x["a"],QTabPanel:F["a"],QCardActions:T["a"],QSpinnerGears:U["a"],QLinearProgress:L["a"]}),z()(M,"directives",{ClosePopup:Q["a"]})}}]);