1 line
9.1 KiB
Plaintext
1 line
9.1 KiB
Plaintext
{"version":3,"sources":["webpack:///./src/views/whitelist-search.vue","webpack:///src/views/whitelist-search.vue","webpack:///./src/views/whitelist-search.vue?52ac","webpack:///./src/views/whitelist-search.vue?d43f"],"names":["render","_vm","this","_c","_self","staticClass","attrs","_v","directives","name","rawName","value","elements","expression","domProps","on","$event","target","composing","search_elements","results","length","_m","_l","r","key","element","_s","type","remove","first_search","match","_e","staticRenderFns","data","jwt","props","methods","axios","timeout","headers","catch","then","created","component"],"mappings":"uHAAA,IAAIA,EAAS,WAAkB,IAAIC,EAAIC,KAAKC,EAAGF,EAAIG,MAAMD,GAAG,OAAOA,EAAG,MAAM,CAACE,YAAY,kBAAkBC,MAAM,CAAC,GAAK,YAAY,CAACH,EAAG,MAAM,CAACE,YAAY,2BAA2B,CAACF,EAAG,KAAK,CAACE,YAAY,WAAW,CAACJ,EAAIM,GAAG,iCAAiCJ,EAAG,MAAM,CAACE,YAAY,cAAc,CAACF,EAAG,WAAW,CAACK,WAAW,CAAC,CAACC,KAAK,QAAQC,QAAQ,UAAUC,MAAOV,EAAIW,SAAUC,WAAW,aAAaR,YAAY,aAAaC,MAAM,CAAC,GAAK,kBAAkB,YAAc,0BAA0B,KAAO,KAAKQ,SAAS,CAAC,MAASb,EAAIW,UAAWG,GAAG,CAAC,MAAQ,SAASC,GAAWA,EAAOC,OAAOC,YAAiBjB,EAAIW,SAASI,EAAOC,OAAON,aAAYR,EAAG,MAAM,CAACE,YAAY,cAAc,CAACF,EAAG,SAAS,CAACE,YAAY,yBAAyBU,GAAG,CAAC,MAAQ,SAASC,GAAQ,OAAOf,EAAIkB,qBAAqB,CAAClB,EAAIM,GAAG,cAAeN,EAAImB,QAAQC,OAAO,EAAIlB,EAAG,MAAM,CAACE,YAAY,cAAc,CAACF,EAAG,QAAQ,CAACE,YAAY,mCAAmC,CAACJ,EAAIqB,GAAG,GAAGnB,EAAG,QAAQF,EAAIsB,GAAItB,EAAImB,SAA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a,aAAAW,E","file":"js/chunk-2d2245cf.ea4d33bd.js","sourcesContent":["var render = function render(){var _vm=this,_c=_vm._self._c;return _c('div',{staticClass:\"backend-content\",attrs:{\"id\":\"content\"}},[_c('div',{staticClass:\"column col-12 col-xs-12\"},[_c('h3',{staticClass:\"s-title\"},[_vm._v(\"Search whitelisted elements\")]),_c('div',{staticClass:\"form-group\"},[_c('textarea',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.elements),expression:\"elements\"}],staticClass:\"form-input\",attrs:{\"id\":\"input-example-3\",\"placeholder\":\"Paste the elements here\",\"rows\":\"3\"},domProps:{\"value\":(_vm.elements)},on:{\"input\":function($event){if($event.target.composing)return;_vm.elements=$event.target.value}}})]),_c('div',{staticClass:\"form-group\"},[_c('button',{staticClass:\"btn btn-primary col-12\",on:{\"click\":function($event){return _vm.search_elements()}}},[_vm._v(\"Search\")])]),(_vm.results.length>0 )?_c('div',{staticClass:\"form-group\"},[_c('table',{staticClass:\"table table-striped table-hover\"},[_vm._m(0),_c('tbody',_vm._l((_vm.results),function(r){return _c('tr',{key:r.element},[_c('td',[_vm._v(_vm._s(r.element))]),_c('td',[_vm._v(_vm._s(r.type))]),_c('td',[_c('button',{staticClass:\"btn btn-sm\",on:{\"click\":function($event){return _vm.remove(r)}}},[_vm._v(\"Delete\")])])])}),0)])]):(_vm.first_search==false)?_c('div',[_c('div',{staticClass:\"empty\"},[_c('p',{staticClass:\"empty-title h5\"},[_vm._v(\"Element\"),(this.elements.match(/[^\\r\\n]+/g).length>1)?_c('span',[_vm._v(\"s\")]):_vm._e(),_vm._v(\" not found.\")]),_c('p',{staticClass:\"empty-subtitle\"},[_vm._v(\"Try wildcard search to expend your search.\")])])]):_vm._e()])])\n}\nvar staticRenderFns = [function (){var _vm=this,_c=_vm._self._c;return _c('thead',[_c('tr',[_c('th',[_vm._v(\"Element\")]),_c('th',[_vm._v(\"Element type\")]),_c('th')])])\n}]\n\nexport { render, staticRenderFns }","<template>\r\n <div class=\"backend-content\" id=\"content\">\r\n <div class=\"column col-12 col-xs-12\">\r\n <h3 class=\"s-title\">Search whitelisted elements</h3>\r\n <div class=\"form-group\">\r\n <textarea class=\"form-input\" id=\"input-example-3\" placeholder=\"Paste the elements here\" rows=\"3\" v-model=\"elements\"></textarea>\r\n </div>\r\n <div class=\"form-group\">\r\n <button class=\"btn btn-primary col-12\" v-on:click=\"search_elements()\">Search</button>\r\n </div>\r\n <div class=\"form-group\" v-if=\"results.length>0 \">\r\n <table class=\"table table-striped table-hover\">\r\n <thead>\r\n <tr>\r\n <th>Element</th>\r\n <th>Element type</th>\r\n <th> </th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n <tr v-for=\"r in results\" :key=\"r.element\">\r\n <td>{{ r.element }}</td>\r\n <td>{{ r.type }}</td>\r\n <td><button class=\"btn btn-sm\" v-on:click=\"remove(r)\">Delete</button></td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </div>\r\n <div v-else-if=\"first_search==false\">\r\n <div class=\"empty\">\r\n <p class=\"empty-title h5\">Element<span v-if=\"this.elements.match(/[^\\r\\n]+/g).length>1\">s</span> not found.</p>\r\n <p class=\"empty-subtitle\">Try wildcard search to expend your search.</p>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nimport axios from 'axios'\r\n\r\nexport default {\r\n name: 'elements-search', \r\n data() {\r\n return { \r\n results: [],\r\n first_search: true,\r\n jwt:\"\"\r\n }\r\n },\r\n props: { },\r\n methods: {\r\n search_elements: function() {\r\n this.results = []\r\n this.first_search = false\r\n this.elements.match(/[^\\r\\n]+/g).forEach(elem => {\r\n axios.get(`/api/whitelist/search/${elem.trim()}`, { \r\n timeout: 10000, \r\n headers: {'X-Token': this.jwt} \r\n }).then(response => {\r\n if(response.data.results.length>0){\r\n this.results = [].concat(this.results, response.data.results);\r\n }\r\n })\r\n .catch(err => (console.log(err)))\r\n });\r\n return true;\r\n },\r\n remove: function(elem){\r\n axios.get(`/api/whitelist/delete/${elem.id}`, { \r\n timeout: 10000, \r\n headers: {'X-Token': this.jwt} \r\n }).then(response => {\r\n if(response.data.status){\r\n this.results = this.results.filter(function(el) { return el != elem; }); \r\n }\r\n })\r\n .catch(err => (console.log(err)))\r\n },\r\n async get_jwt(){\r\n await axios.get(`/api/get-token`, { timeout: 10000 })\r\n .then(response => {\r\n if(response.data.token){\r\n this.jwt = response.data.token\r\n }\r\n })\r\n .catch(err => (console.log(err)))\r\n }\r\n },\r\n created: function() {\r\n this.get_jwt()\r\n }\r\n}\r\n</script>","import mod from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./whitelist-search.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./whitelist-search.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./whitelist-search.vue?vue&type=template&id=f3d90054&\"\nimport script from \"./whitelist-search.vue?vue&type=script&lang=js&\"\nexport * from \"./whitelist-search.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports"],"sourceRoot":""} |