diff --git a/.env b/.env new file mode 100644 index 0000000..d971873 --- /dev/null +++ b/.env @@ -0,0 +1,4 @@ +NODE_ENV=development + +VUE_APP_BASE_SERVER_URL=http://localhost:3000/ +VUE_APP_BASE_SERVER=localhost:3000 \ No newline at end of file diff --git a/gitpush.sh b/gitpush.sh deleted file mode 100755 index 5f71c25..0000000 --- a/gitpush.sh +++ /dev/null @@ -1,3 +0,0 @@ -git add . -git commit -m "layout fix" -git push origin \ No newline at end of file diff --git a/src/components/doclive/AdhocView.vue b/src/components/doclive/AdhocView.vue index 30ba046..4b11367 100644 --- a/src/components/doclive/AdhocView.vue +++ b/src/components/doclive/AdhocView.vue @@ -266,7 +266,7 @@ export default { }, series: [], }, - api_url: "http://localhost:3000/test2", + api_url: process.env.VUE_APP_BASE_SERVER_URL + "test2", fields: [ { name: "message", @@ -470,7 +470,7 @@ export default { methods: { // καλείται στο διάγραμμα για την εμφάνιση των αποτελεσμάτων async callback(params) { - var res = await axios.get("http://localhost:3000/length"); + var res = await axios.get(process.env.VUE_APP_BASE_SERVER_URL + "length"); //new code if (params == 1) { this.chartOptions.series.splice(0, this.chartOptions.series.length); @@ -511,17 +511,19 @@ export default { // ενημέρωση για ποιες υπηρεσίες είναι ενεργές στο δίκτυο async getServices() { this.items.splice(0, this.items.length); - await axios.get("http://localhost:3000/services").then((res) => { - res.data.forEach((val) => { - //console.log(val); - this.items.push({ - name: val, + await axios + .get(process.env.VUE_APP_BASE_SERVER_URL + "services") + .then((res) => { + res.data.forEach((val) => { + //console.log(val); + this.items.push({ + name: val, + }); }); + // this.items.push({ + // name: "All", + // }); }); - // this.items.push({ - // name: "All", - // }); - }); }, // εμφάνιση του πίνακα ευρετηρίασης και rerender σε περίπτωση που αναζητήσει ξανά κάτι ο χρήστης showHistory() { diff --git a/src/components/doclive/runLlo.vue b/src/components/doclive/runLlo.vue index 893fc2f..7eee668 100644 --- a/src/components/doclive/runLlo.vue +++ b/src/components/doclive/runLlo.vue @@ -623,7 +623,7 @@ export default { // ΕΔΩ ΠΡΠΕΕΙ ΝΑ ΑΛΛΑΧΤΕΙ ΤΟ URL ΩΣΤΕ ΝΑ ΚΑΝΕΙ AUTHENTICATION var logintoken = new URL( - "https://api-client.swarmlab.io:8088/?token=4aa3c7987fc487b245d420eda649a53f68296c58" + "https://api-client.swarmlab.io:8088/?token=b0dddc676d2491d8e98632d8afc636b6a28f1234" ).searchParams.get("token"); this.logintoken = logintoken; // === We get the user + check for the token if exists diff --git a/src/main.js b/src/main.js index c7697f4..1c598ae 100644 --- a/src/main.js +++ b/src/main.js @@ -10,7 +10,7 @@ Vue.use(VueSweetalert2); import VueSocketIOExt from "vue-socket.io-extended"; import io from "socket.io-client"; -const socket = io("localhost:3000", { +const socket = io(process.env.VUE_APP_BASE_SERVER, { //const socket = io('http://factory.swarmlab.io:55528', { //autoConnect: false autoConnect: false, @@ -26,6 +26,8 @@ const socket = io("localhost:3000", { rejectUnauthorized: false, }); +// console.log(process.env.VUE_APP_BASE_SERVER); + Vue.use(VueSocketIOExt, socket); Vue.use(BootstrapVue); diff --git a/test-server.js b/test-server.js deleted file mode 100644 index 01848aa..0000000 --- a/test-server.js +++ /dev/null @@ -1,53 +0,0 @@ -var path = require('path'); -var app = require('express')(); -var http = require('http').Server(app); -var io = require('socket.io')(http); - -const socketAuth = require('socketio-auth'); - -socketoptions = { - transports: [ 'websocket', 'polling' ], - secure:true, - reconnect: true, - rejectUnauthorized : false -}; - - -// Client -var io2 = require('socket.io-client'); -//var socket = io2.connect('http://localhost:8084', socketoptions); -//var socket = io2.connect('http://83.212.78.6:55528', socketoptions); -//var socket = io2.connect('http://factory.swarmlab.io:55528', socketoptions); -var socket = io2.connect('https://factory.swarmlab.io:55527', socketoptions); - - - - -socket.on('connection', s => { - console.error('socket2 connection'); - var id = s.id - - - var roomiot = 'iot' - s.emit('subscribe', roomiot); - - s.emit('log', 'Hi from client-n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!1'); - - - s.on('message', function (data) { - console.log('from room1 '+data); - }); -}); - var roomiot = 'iot' - socket.emit('subscribe', roomiot); - - socket.on('message', function (data) { - console.log('from room '+data); - }); - - socket.emit('log', 'Hi from client-n'); - - - - -