You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 lines
12 KiB
1 lines
12 KiB
{"remainingRequest":"/home/lefos/repos/swarmlab-playground-client/node_modules/vue-loader/lib/index.js??vue-loader-options!/home/lefos/repos/swarmlab-playground-client/src/components/docgrep/rungrep.vue?vue&type=script&lang=js&","dependencies":[{"path":"/home/lefos/repos/swarmlab-playground-client/src/components/docgrep/rungrep.vue","mtime":1615930840866},{"path":"/home/lefos/repos/swarmlab-playground-client/node_modules/cache-loader/dist/cjs.js","mtime":499162500000},{"path":"/home/lefos/repos/swarmlab-playground-client/node_modules/babel-loader/lib/index.js","mtime":315532800000},{"path":"/home/lefos/repos/swarmlab-playground-client/node_modules/cache-loader/dist/cjs.js","mtime":499162500000},{"path":"/home/lefos/repos/swarmlab-playground-client/node_modules/vue-loader/lib/index.js","mtime":499162500000}],"contextDependencies":[],"result":[{"type":"Buffer","data":"base64:Ly8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KCmltcG9ydCB7bWFwU3RhdGUsIG1hcEdldHRlcnMsIG1hcEFjdGlvbnMsZGlzcGF0Y2h9IGZyb20gJ3Z1ZXgnCmltcG9ydCBWdWUgZnJvbSAndnVlJwppbXBvcnQgc3RvcmUgZnJvbSAnQC9zdG9yZS9pbmRleCcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKZXhwb3J0IGRlZmF1bHQgewogICBjb21wb25lbnRzOiB7CiAgIH0sCiAgIGRhdGEgKCkgewogICAgcmV0dXJuIHsKICAgICAgc2VhcmNoOnsKICAgICAgICBsb2c6ICcnLAogICAgICAgIHJlZ2V4OiAnJywKICAgICAgICBkZXNjOiAnJywKICAgICAgICBjYXNlOiB0cnVlCiAgICAgIH0sCiAgICAgIG9iajoxLAogICAgICBsb2c6W10KICAgfQogIH0sCiAgbWV0aG9kczogewogICAgcmVtb3ZlcmVnZXggKGluZGV4KXsKICAgICAgICBsZXQgaW5kID0gdGhpcy5sb2cubWFwKGl0ZW0gPT4gaXRlbS5pZCkuaW5kZXhPZihpbmRleCkgLy8gZmluZCBpbmRleAogICAgICAgIHRoaXMubG9nLnNwbGljZShpbmQsIDEpOwogICAgICAgIC8vY29uc29sZS5sb2coSlNPTi5zdHJpbmdpZnkoaW5kZXgpKQogICAgICAgIC8vY29uc29sZS5sb2coSlNPTi5zdHJpbmdpZnkodGhpcy5sb2cpKQogICAgfSwKICAgIHNldHJlZ2V4ICgpewogICAgICAgIHZhciBvID0ge30KICAgICAgICBvLmlkICAgPSB0aGlzLm9iaisrCiAgICAgICAgby5sb2cgICA9IHRoaXMuc2VhcmNoLmxvZwogICAgICAgIG8ucmVnZXggPSB0aGlzLnNlYXJjaC5yZWdleAogICAgICAgIG8uY2FzZSA9ICB0aGlzLnNlYXJjaC5jYXNlCiAgICAgICAgby5kZXNjICA9IHRoaXMuc2VhcmNoLmRlc2MKICAgICAgICB0aGlzLmxvZy5wdXNoKG8pIAogICAgICAgIC8vY29uc29sZS5sb2coSlNPTi5zdHJpbmdpZnkodGhpcy5sb2cpKQogICAgfQogIH0sCiAgIG1vdW50ZWQoKSB7CiAgICAgdGhpcy4kcm9vdC4kb24oJ0dSRVBfb25fZGF0YScsIChtZXNzYWdlKSA9PiB7CiAgICAgIHRoaXMuJG5leHRUaWNrKGZ1bmN0aW9uICgpIHsKICAgICAgICAgdmFyIHJlZ2V4cGF0aCA9IHRoaXMubG9nLmZpbHRlcigoaXRlbSkgPT4gaXRlbS5sb2cgPT09IG1lc3NhZ2UubG9nLnRhaWxlZF9wYXRoKTsgCgogICAgICAgICAgLy9jb25zb2xlLmxvZygncmVnZXhwYXRoMiAnKyBKU09OLnN0cmluZ2lmeShyZWdleHBhdGgpKQogICAgICAgICAgdmFyIGNvZGUgPSAnJwogICAgICAgICAgdmFyIHJlZ2V4b3V0cHV0ID0gZmFsc2U7IAogICAgICAgICBpZiAoQXJyYXkuaXNBcnJheShyZWdleHBhdGgpICYmIHJlZ2V4cGF0aC5sZW5ndGgpeyAKICAgICAgICAgICAgICAgIHJlZ2V4b3V0cHV0ID0gdHJ1ZTsgCiAgICAgICAgICAgIH1lbHNlewogICAgICAgICAgICAgICAgcmVnZXhvdXRwdXQgPSBmYWxzZTsgCiAgICAgICAgICB9IAogICAgICAgICAgaWYocmVnZXhvdXRwdXQpewoKICAgICAgICAgICAgICAgICAvL3ZhciBsb2d0bXAgPSBzdG9yZS5nZXR0ZXJzWydwaXBlbGluZUxMTy9nZXRsb2cnXTsKICAgICAgICAgICAgICAgICB2YXIgbG9ndG1wID0gbWVzc2FnZS5sb2cubWVzc2FnZQogICAgICAgICAgICAgICAgICAvL3ZhciBpdGVtbG9nID0gJycKICAgICAgICAgICAgICAgICAgY29kZSArPSAnJwogICAgICAgICAgICAgICAgICAgICAvL2l0ZW1sb2cgPSBsb2d0bXAuZmlsdGVyKGl0ZW0xID0+IGl0ZW0xLnRhaWxlZF9wYXRoID09PSBwYXRoKTsKICAgICAgICAgICAgICAgICAgICAgLy9jb25zb2xlLmxvZygnbG9ndG1wMjIgJysgSlNPTi5zdHJpbmdpZnkoaXRlbWxvZykpCiAgICAgICAgICAgICAgICAgICAgZm9yIChsZXQgcmVnZXggb2YgcmVnZXhwYXRoKSB7CiAgICAgICAgICAgICAgICAgICAgICAgLy9jb25zb2xlLmxvZyhyZWdleC5yZWdleCkKICAgICAgICAgICAgICAgICAgICAgICAgaWYoIHJlZ2V4LmNhc2UpewogICAgICAgICAgICAgICAgICAgICAgICAgIHZhciByZSA9IG5ldyBSZWdFeHAocmVnZXgucmVnZXgsICdpJyk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vY29uc29sZS5sb2coInRydWUiKTsKICAgICAgICAgICAgICAgICAgICAgICAgfWVsc2V7CiAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHJlID0gbmV3IFJlZ0V4cChyZWdleC5yZWdleCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vY29uc29sZS5sb2coImZhbHNlIik7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJlLnRlc3QobG9ndG1wKSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2RlICs9IGxvZ3RtcCArICcgJyArIG1lc3NhZ2UubG9nLnRhaWxlZF9wYXRoCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvZGUgKz0gIlxuIgogICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQogICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gc2VuZCB0byBncmVwIHJ1bmdyZXAgdG8gdmlldyAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy4kcm9vdC4kZW1pdCgnR1JFUF92aWV3X2RhdGEnLGNvZGUpCiAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc29sZS5sb2coIk5vdCBmb3VuZCIpOwogICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CgogICAgICAgIH0pCiAgICB9KQogIH0sCiAgIGJlZm9yZURlc3Ryb3kgKCkgewogICAgdGhpcy4kcm9vdC4kb2ZmKCdHUkVQX29uX2RhdGEnKSAKICB9Cn07Cg=="},{"version":3,"sources":["rungrep.vue"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA","file":"rungrep.vue","sourceRoot":"src/components/docgrep","sourcesContent":["<template>\n <div\n class=\"runGrep\" \n >\n\n <div class=\"row\">\n <div class=\"col-12\">\n <div class=\"input-group mb-2\">\n\n <div class=\"input-group-prepend\">\n <div class=\"input-group-text\">/</div>\n </div>\n\n <input type=\"text\" class=\"form-control\" placeholder=\"regex\"\n v-model=\"search.regex\"\n >\n\n <div class=\"input-group-append\">\n <div class=\"input-group-text\">/</div>\n\n <div class=\"form-control custom-switch\">\n <input \n id=\"customSwitch1\"\n type=\"checkbox\" \n class=\"custom-control-input\" \n v-model=\"search.case\"\n >\n <label class=\"custom-control-label\" for=\"customSwitch1\">Ignore case</label>\n </div>\n\n\n </div>\n </div>\n </div>\n </div> <!-- row -->\n\n <div class=\"row\">\n <div class=\"col-9\">\n <div class=\"input-group mb-2\">\n\n <div class=\"input-group-prepend\">\n <div class=\"input-group-text\">Log</div>\n </div>\n <input type=\"text\" class=\"form-control\" placeholder=\"file\"\n v-model=\"search.log\"\n >\n <input type=\"text\" class=\"form-control\" placeholder=\"desc\"\n v-model=\"search.desc\"\n >\n </div>\n </div> <!-- col --> \n\n <div class=\"col-3\">\n <button\n class=\"btn btn-outline-secondary\"\n round\n type=\"button\"\n @click=\"setregex\"\n >\n Search\n </button>\n </div> <!-- col -->\n </div> <!-- row -->\n\n \n <div class=\"row\">\n <div class=\"col-12 viewGrep\">\n\n<table class=\"table table-hover\">\n <thead>\n <tr>\n <th scope=\"col\">Action</th>\n <th scope=\"col\">Log</th>\n <th scope=\"col\">Regex</th>\n <th scope=\"col\">IC</th>\n <th scope=\"col\">Desc</th>\n </tr>\n </thead>\n <tbody\n v-for=\"item in log\"\n >\n <tr>\n <td\n >\n <span class=\"badge badge-danger badge-pill\"\n style=\"cursor: pointer\"\n @click=\"removeregex(item.id)\"\n >Remove</span>\n\n </td>\n <td\n style=\"cursor: pointer\"\n >{{item.log}}</td>\n <td\n style=\"cursor: pointer\"\n >{{item.regex}}</td>\n <td\n style=\"cursor: pointer\"\n >{{item.case}}</td>\n <td\n style=\"cursor: pointer\"\n >{{item.desc}}</td>\n </tr>\n </tbody>\n</table>\n\n </div> <!-- col -->\n </div> <!-- row -->\n\n\n\n\n\n\n </div>\n</template>\n<script>\nimport {mapState, mapGetters, mapActions,dispatch} from 'vuex'\nimport Vue from 'vue'\nimport store from '@/store/index' \nexport default {\n components: {\n },\n data () {\n return {\n search:{\n log: '',\n regex: '',\n desc: '',\n case: true\n },\n obj:1,\n log:[]\n }\n },\n methods: {\n removeregex (index){\n let ind = this.log.map(item => item.id).indexOf(index) // find index\n this.log.splice(ind, 1);\n //console.log(JSON.stringify(index))\n //console.log(JSON.stringify(this.log))\n },\n setregex (){\n var o = {}\n o.id = this.obj++\n o.log = this.search.log\n o.regex = this.search.regex\n o.case = this.search.case\n o.desc = this.search.desc\n this.log.push(o) \n //console.log(JSON.stringify(this.log))\n }\n },\n mounted() {\n this.$root.$on('GREP_on_data', (message) => {\n this.$nextTick(function () {\n var regexpath = this.log.filter((item) => item.log === message.log.tailed_path); \n\n //console.log('regexpath2 '+ JSON.stringify(regexpath))\n var code = ''\n var regexoutput = false; \n if (Array.isArray(regexpath) && regexpath.length){ \n regexoutput = true; \n }else{\n regexoutput = false; \n } \n if(regexoutput){\n\n //var logtmp = store.getters['pipelineLLO/getlog'];\n var logtmp = message.log.message\n //var itemlog = ''\n code += ''\n //itemlog = logtmp.filter(item1 => item1.tailed_path === path);\n //console.log('logtmp22 '+ JSON.stringify(itemlog))\n for (let regex of regexpath) {\n //console.log(regex.regex)\n if( regex.case){\n var re = new RegExp(regex.regex, 'i');\n //console.log(\"true\");\n }else{\n var re = new RegExp(regex.regex);\n //console.log(\"false\");\n }\n if (re.test(logtmp)) {\n code += logtmp + ' ' + message.log.tailed_path\n code += \"\\n\"\n // -------------------------------------\n // send to grep rungrep to view \n // -------------------------------------\n this.$root.$emit('GREP_view_data',code)\n } else {\n console.log(\"Not found\");\n }\n }\n }\n\n })\n })\n },\n beforeDestroy () {\n this.$root.$off('GREP_on_data') \n }\n};\n</script>\n\n<style>\n.runGrep {\n font-family: monospace;\n height: 350px;\n}\n.viewGrep {\n height:300px;\n overflow-y:auto;\n}\n\n</style>\n"]}]}
|