Change socket implementation for servers
This commit is contained in:
parent
e0fda5865d
commit
dc52e238ac
9 changed files with 242 additions and 17 deletions
|
@ -70,18 +70,19 @@
|
|||
import Navigation from '../core/Navigation';
|
||||
import ProgressBar from './components/ProgressBar';
|
||||
import { mapState } from 'vuex';
|
||||
import VueSocketio from 'vue-socket.io-extended';
|
||||
import io from 'socket.io-client';
|
||||
import Vue from 'vue';
|
||||
import { Socketio } from './../../mixins/socketio';
|
||||
|
||||
import PowerButtons from './components/PowerButtons';
|
||||
import Flash from '../Flash';
|
||||
|
||||
export default {
|
||||
name: 'server',
|
||||
mixins: [Socketio],
|
||||
components: {
|
||||
Flash,
|
||||
PowerButtons, ProgressBar, Navigation,
|
||||
TerminalIcon, FolderIcon, UsersIcon, CalendarIcon, DatabaseIcon, GlobeIcon, SettingsIcon
|
||||
TerminalIcon, FolderIcon, UsersIcon, CalendarIcon, DatabaseIcon, GlobeIcon, SettingsIcon,
|
||||
},
|
||||
|
||||
computed: {
|
||||
|
@ -95,10 +96,20 @@
|
|||
};
|
||||
},
|
||||
|
||||
sockets: {
|
||||
'console': function () {
|
||||
console.log('server CONSOLE');
|
||||
},
|
||||
},
|
||||
|
||||
mounted: function () {
|
||||
this.loadServer();
|
||||
},
|
||||
|
||||
beforeDestroy: function () {
|
||||
this.removeSocket();
|
||||
},
|
||||
|
||||
methods: {
|
||||
/**
|
||||
* Load the core server information needed for these pages to be functional.
|
||||
|
@ -115,7 +126,7 @@
|
|||
query: `token=${this.credentials.key}`,
|
||||
});
|
||||
|
||||
Vue.use(VueSocketio, socket, { store: this.$store });
|
||||
this.$socket().connect(socket);
|
||||
this.loadingServerData = false;
|
||||
})
|
||||
.catch(console.error);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue