Implement basic support for connecting to wings console via websocket rather than socketio

This commit is contained in:
Dane Everitt 2019-05-01 20:12:20 -07:00
parent 0757d8856b
commit e87c5f6657
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
12 changed files with 122 additions and 117 deletions

View file

@ -34,6 +34,11 @@
Databases
</router-link>
</li>
<li>
<router-link :to="{ name: 'server-network' }">
Networking
</router-link>
</li>
</ul>
</div>
</div>
@ -54,7 +59,6 @@
import Vue from 'vue';
import Navigation from '@/components/core/Navigation.vue';
import {mapState} from 'vuex';
import * as io from 'socket.io-client';
import {Socketio} from "@/mixins/socketio";
import PowerButtons from "@/components/server/components/PowerButtons.vue";
import Flash from "@/components/Flash.vue";
@ -105,13 +109,12 @@
this.$store.dispatch('server/getCredentials', {server: this.$route.params.id})
])
.then(() => {
// Configure the socket.io implementation. This is a really ghetto way of handling things
// but all of these plugins assume you have some constant connection, which we don't.
const socket = io(`${this.credentials.node}/v1/ws/${this.server.uuid}`, {
query: `token=${this.credentials.key}`,
});
// Configure the websocket implementation and assign it to the mixin.
this.$socket().connect(
`ws://192.168.50.3:8080/api/servers/${this.server.uuid}/ws`,
'CC8kHCuMkXPosgzGO6d37wvhNcksWxG6kTrA',
);
this.$socket().connect(socket);
this.loadingServerData = false;
})
.catch(err => {