SpyGuard/app/backend/dist/js/chunk-2d0cc2b4.6cd43049.js

2 lines
3.3 KiB
JavaScript
Raw Permalink Normal View History

2022-11-06 15:51:33 +01:00
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0cc2b4"],{"4d7e":function(t,s,e){"use strict";e.r(s);var a=function(){var t=this,s=t._self._c;return s("div",{staticClass:"backend-content",attrs:{id:"content"}},[s("div",{staticClass:"column col-12 col-xs-12"},[s("h3",{staticClass:"s-title"},[t._v("Search IOCs")]),s("div",{staticClass:"form-group"},[s("textarea",{directives:[{name:"model",rawName:"v-model",value:t.iocs,expression:"iocs"}],staticClass:"form-input",attrs:{id:"input-example-3",placeholder:"Paste your IOCs here",rows:"3"},domProps:{value:t.iocs},on:{input:function(s){s.target.composing||(t.iocs=s.target.value)}}})]),s("div",{staticClass:"form-group"},[s("button",{staticClass:"btn btn-primary col-12",on:{click:function(s){return t.search_iocs()}}},[t._v("Search")])]),t.results.length>0?s("div",{staticClass:"form-group"},[s("table",{staticClass:"table table-striped table-hover"},[t._m(0),s("tbody",t._l(t.results,(function(e){return s("tr",{key:e.tlp},[s("td",[t._v(t._s(e.value))]),s("td",{staticClass:"upper"},[t._v(t._s(e.tag))]),s("td",[s("label",{class:["tlp-"+e.tlp]},[t._v(t._s(e.tlp))])]),s("td",{staticClass:"capi"},[t._v(t._s(e.source))]),s("td",[s("button",{staticClass:"btn btn-sm",on:{click:function(s){return t.remove(e)}}},[t._v("Delete")])])])})),0)])]):0==t.first_search?s("div",[t.loading?s("div",[t._m(1)]):s("div",[s("div",{staticClass:"empty"},[s("p",{staticClass:"empty-title h5"},[t._v("IOC"),this.iocs.match(/[^\r\n]+/g).length>1?s("span",[t._v("s")]):t._e(),t._v(" not found.")]),s("p",{staticClass:"empty-subtitle"},[t._v("Try wildcard search to expend your search.")])])])]):t._e()])])},i=[function(){var t=this,s=t._self._c;return s("thead",[s("tr",[s("th",[t._v("Indicator")]),s("th",[t._v("Tag")]),s("th",[t._v("TLP")]),s("th",[t._v("Source")]),s("th",[t._v("Action")])])])},function(){var t=this,s=t._self._c;return s("div",{staticClass:"empty"},[s("p",{staticClass:"empty-title h5"},[s("span",{staticClass:"loading loading-lg"})]),s("p",{staticClass:"empty-subtitle"},[t._v("Finding your IOC(s)...")])])}],c=e("bc3a"),o=e.n(c),n={name:"iocs-search",data(){return{results:[],first_search:!0,jwt:"",loading:!1}},props:{},methods:{search_iocs:function(){return this.results=[],this.first_search=!1,this.loading=!0,this.iocs.match(/[^\r\n]+/g).forEach(t=>{t=t.trim(),"alert "!=t.slice(0,6)&&(t=t.replace(" ",""),t=t.replace("[",""),t=t.replace("]",""),t=t.replace("\\",""),t=t.replace("(",""),t=t.replace(")","")),o.a.get("/api/ioc/search/"+t,{timeout:1e4,headers:{"X-Token":this.jwt}}).then(t=>{t.data.results.length>0&&(this.results=[].concat(this.results,t.data.results)),this.loading=!1}).catch(t=>console.log(t))}),!0},remove:function(t){o.a.get("/api/ioc/delete/"+t.id,{timeout:1e4,headers:{"X-Token":this.jwt}}).then(s=>{s.data.status&&(this.results=this.results.filter((function(s){return s!=t})))}).catch(t=>console.log(t))},load_config:function(){o.a.get("/api/config/list",{timeout:1e4,headers:{"X-Token":this.jwt}}).then(t=>{t.data&&(this.config=t.data)}).catch(t=>console.log(t))},async get_jwt(){await o.a.get("/api/get-token",{timeout:1e4}).then(t=>{t.data.token&&(this.jwt=t.data.token)}).catch(t=>console.log(t))}},created:function(){this.get_jwt()}},l=n,r=e("2877"),u=Object(r["a"])(l,a,i,!1,null,null,null);s["default"]=u.exports}}]);
//# sourceMappingURL=chunk-2d0cc2b4.6cd43049.js.map