Browse Source

.env

master
lefteris 3 years ago
parent
commit
3b32a00f03
  1. 4
      .env
  2. 3
      gitpush.sh
  3. 24
      src/components/doclive/AdhocView.vue
  4. 2
      src/components/doclive/runLlo.vue
  5. 4
      src/main.js
  6. 53
      test-server.js

4
.env

@ -0,0 +1,4 @@
NODE_ENV=development
VUE_APP_BASE_SERVER_URL=http://localhost:3000/
VUE_APP_BASE_SERVER=localhost:3000

3
gitpush.sh

@ -1,3 +0,0 @@
git add .
git commit -m "layout fix"
git push origin

24
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() {

2
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

4
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);

53
test-server.js

@ -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');
Loading…
Cancel
Save