From 080d7496a3bb8322e44ead0a88bf247d6676968c Mon Sep 17 00:00:00 2001 From: lefteris Date: Mon, 29 Mar 2021 00:10:25 +0300 Subject: [PATCH] latest --- package-lock.json | 39 ++ package.json | 1 + src/App.vue | 43 +- src/components/docgrep/rungrep.vue | 371 ++++++------- src/components/doclive/AdhocView.vue | 786 ++++++++++++++------------- src/components/doclive/runLlo.vue | 70 ++- 6 files changed, 713 insertions(+), 597 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8c65d1e..a3ce586 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10872,6 +10872,45 @@ "date-format-parse": "^0.2.6" } }, + "vuetable-2": { + "version": "2.0.0-beta.4", + "resolved": "https://registry.npmjs.org/vuetable-2/-/vuetable-2-2.0.0-beta.4.tgz", + "integrity": "sha512-sWSdKIPYiATI9hOuPlQ09iSWEFAfhe6sPovl4hK2SemvqvgxLIF8UjG3LwJJC7idWS9UPpK9fRrSXoFJhRcluQ==", + "requires": { + "axios": "^0.15.3" + }, + "dependencies": { + "axios": { + "version": "0.15.3", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.15.3.tgz", + "integrity": "sha1-LJ1jiy4ZGgjqHWzJiOrda6W9wFM=", + "requires": { + "follow-redirects": "1.0.0" + } + }, + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "requires": { + "ms": "2.0.0" + } + }, + "follow-redirects": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.0.0.tgz", + "integrity": "sha1-jjQpjL0uF28lTv/sdaHHjMhJ/Tc=", + "requires": { + "debug": "^2.2.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + } + } + }, "vuex": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/vuex/-/vuex-3.6.0.tgz", diff --git a/package.json b/package.json index dbd141b..e1cbd27 100644 --- a/package.json +++ b/package.json @@ -32,6 +32,7 @@ "vue-sweetalert2": "^4.1.1", "vue-template-compiler": "^2.6.12", "vue2-datepicker": "^3.8.2", + "vuetable-2": "^2.0.0-beta.4", "vuex": "^3.6.0" }, "devDependencies": { diff --git a/src/App.vue b/src/App.vue index 0c2a997..14d9cc0 100644 --- a/src/App.vue +++ b/src/App.vue @@ -77,6 +77,7 @@ diff --git a/src/components/doclive/AdhocView.vue b/src/components/doclive/AdhocView.vue index 2718698..b89883e 100644 --- a/src/components/doclive/AdhocView.vue +++ b/src/components/doclive/AdhocView.vue @@ -1,15 +1,11 @@ diff --git a/src/components/doclive/runLlo.vue b/src/components/doclive/runLlo.vue index ab59069..c5cff9d 100644 --- a/src/components/doclive/runLlo.vue +++ b/src/components/doclive/runLlo.vue @@ -149,8 +149,26 @@
+ + + +
@@ -195,9 +213,12 @@ import DatePicker from "vue2-datepicker"; import "vue2-datepicker/index.css"; import { DateTime } from "luxon"; import FileSaver from "file-saver"; +import Vuetable from "vuetable-2"; +import axios from "axios"; export default { components: { + Vuetable, DatePicker, }, data() { @@ -225,6 +246,7 @@ export default { logintoken: "", code: [], logdata: [], + localData: [], }; }, methods: { @@ -332,8 +354,7 @@ export default { async socketauthenticate() { var tokentmp = store.getters["pipelineLLO/gettoken"]; // pernaw hardcoded to token - var test = "cd2189ebbef3f0b43c5e73fac1cfb7e8cbe0d47c"; - this.$socket.client.emit("authenticate", test); + this.$socket.client.emit("authenticate", tokentmp); }, async socketreconnect() { var log = await this.socketopen(); @@ -354,11 +375,18 @@ export default { this.$socket.client.close(); }, }, - computed: {}, + computed: { + httpOptions() { + var token = store.getters["pipelineLLO/gettoken"]; + var p = "headers: {Authorization: token}}"; //table props -> :http-options="httpOptions" + return { headers: { Authorization: "Bearer " + token } }; //table props -> :http-options="httpOptions" + }, + }, beforeMount() { this.socketauthenticate(); console.log("send1"); }, + /** * * == Socket subscribe @@ -420,14 +448,16 @@ export default { */ created() { - this.socketopen(); - var logintoken = new URL(location.href).searchParams.get("token"); - // hardcoded token - var hardtoken = "cd2189ebbef3f0b43c5e73fac1cfb7e8cbe0d47c"; + //var logintoken = new URL(location.href).searchParams.get("token"); + var logintoken = new URL( + "https://api-client.swarmlab.io:8088/?token=8ee68923f567ad2fb5835f579c4d74f0cad6b1d1" + ).searchParams.get("token"); + this.logintoken = logintoken; + var log = store.dispatch("pipelineLLO/settoken", { - token: hardtoken, + token: logintoken, }); - + this.socketopen(); //var tokentmp =store.getters['pipelineLLO/gettoken']; //console.log("tokennnn "+tokentmp); }, @@ -443,10 +473,8 @@ export default { */ sockets: { connect() { - //hardtoken - var hardtoken = "cd2189ebbef3f0b43c5e73fac1cfb7e8cbe0d47c"; - this.$socket.client.emit("authenticate", hardtoken); - //this.$socket.client.emit("authenticate", "logintoken"); + var logintoken = store.getters["pipelineLLO/gettoken"]; + this.$socket.client.emit("authenticate", logintoken); this.$socket.client.emit("socket_id_get", "socketdatasend"); //var username = 'username' @@ -665,15 +693,27 @@ export default { console.log(" socket message " + JSON.stringify(val)); }, async logsend(val) { + // ==== LEFOS console.log(" socket message " + JSON.stringify(val)); - var log = val.log; - console.log(" LOG: " + JSON.parse(JSON.stringify(log))); + + // var log = val.log; + // console.log(" LOG: " + JSON.parse(JSON.stringify(log))); + + var log = store.dispatch("pipelineLLO/addlog", { + log: val, + }); + + this.localData.push(val); }, }, };