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
13 KiB
1 lines
13 KiB
{"remainingRequest":"/home/lefos/repos/swarmlab-playground-client/node_modules/babel-loader/lib/index.js!/home/lefos/repos/swarmlab-playground-client/node_modules/cache-loader/dist/cjs.js??ref--0-0!/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:Ly8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KaW1wb3J0IHsgbWFwU3RhdGUsIG1hcEdldHRlcnMsIG1hcEFjdGlvbnMsIGRpc3BhdGNoIH0gZnJvbSAndnVleCc7CmltcG9ydCBWdWUgZnJvbSAndnVlJzsKaW1wb3J0IHN0b3JlIGZyb20gJ0Avc3RvcmUvaW5kZXgnOwpleHBvcnQgZGVmYXVsdCB7CiAgY29tcG9uZW50czoge30sCgogIGRhdGEoKSB7CiAgICByZXR1cm4gewogICAgICBzZWFyY2g6IHsKICAgICAgICBsb2c6ICcnLAogICAgICAgIHJlZ2V4OiAnJywKICAgICAgICBkZXNjOiAnJywKICAgICAgICBjYXNlOiB0cnVlCiAgICAgIH0sCiAgICAgIG9iajogMSwKICAgICAgbG9nOiBbXQogICAgfTsKICB9LAoKICBtZXRob2RzOiB7CiAgICByZW1vdmVyZWdleChpbmRleCkgewogICAgICBsZXQgaW5kID0gdGhpcy5sb2cubWFwKGl0ZW0gPT4gaXRlbS5pZCkuaW5kZXhPZihpbmRleCk7IC8vIGZpbmQgaW5kZXgKCiAgICAgIHRoaXMubG9nLnNwbGljZShpbmQsIDEpOyAvL2NvbnNvbGUubG9nKEpTT04uc3RyaW5naWZ5KGluZGV4KSkKICAgICAgLy9jb25zb2xlLmxvZyhKU09OLnN0cmluZ2lmeSh0aGlzLmxvZykpCiAgICB9LAoKICAgIHNldHJlZ2V4KCkgewogICAgICB2YXIgbyA9IHt9OwogICAgICBvLmlkID0gdGhpcy5vYmorKzsKICAgICAgby5sb2cgPSB0aGlzLnNlYXJjaC5sb2c7CiAgICAgIG8ucmVnZXggPSB0aGlzLnNlYXJjaC5yZWdleDsKICAgICAgby5jYXNlID0gdGhpcy5zZWFyY2guY2FzZTsKICAgICAgby5kZXNjID0gdGhpcy5zZWFyY2guZGVzYzsKICAgICAgdGhpcy5sb2cucHVzaChvKTsgLy9jb25zb2xlLmxvZyhKU09OLnN0cmluZ2lmeSh0aGlzLmxvZykpCiAgICB9CgogIH0sCgogIG1vdW50Z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4LmNhc2UpIHsKICAgICAgICAgICAgICB2YXIgcmUgPSBuZXcgUmVnRXhwKHJlZ2V4LnJlZ2V4LCAnaScpOyAvL2NvbnNvbGUubG9nKCJ0cnVlIik7CiAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgdmFyIHJlID0gbmV3IFJlZ0V4cChyZWdleC5yZWdleCk7IC8vY29uc29sZS5sb2coImZhbHNlIik7CiAgICAgICAgICAgIH0KCiAgICAgICAgICAgIGlmIChyZS50ZXN0KGxvZ3RtcCkpIHsKICAgICAgICAgICAgICBjb2RlICs9IGxvZ3RtcCArICcgJyArIG1lc3NhZ2UubG9nLnRhaWxlZF9wYXRoOwogICAgICAgICAgICAgIGNvZGUgKz0gIlxuIjsgLy8gLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQogICAgICAgICAgICAgIC8vIHNlbmQgdG8gZ3JlcCBydW5ncmVwIHRvIHZpZXcgCiAgICAgICAgICAgICAgLy8gLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQoKICAgICAgICAgICAgICB0aGlzLiRyb290LiRlbWl0KCdHUkVQX3ZpZXdfZGF0YScsIGNvZGUpOwogICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgIGNvbnNvbGUubG9nKCJOb3QgZm91bmQiKTsKICAgICAgICAgICAgfQogICAgICAgICAgfQogICAgICAgIH0KICAgICAgfSk7CiAgICB9KTsKICB9LAoKICBiZWZvcmVEZXN0cm95KCkgewogICAgdGhpcy4kcm9vdC4kb2ZmKCdHUkVQX29uX2RhdGEnKTsKICB9Cgp9Ow=="},{"version":3,"sources":["rungrep.vue"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqHA,SAAA,QAAA,EAAA,UA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-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"],"sourceRoot":"src/components/docgrep"}]}
|