Убрал ненужный отладочный вывод, исправил сброс прокрутки сайдбара

This commit is contained in:
saber-nyan 2019-05-17 22:34:39 +03:00
parent 595dc3b20f
commit 6542e06ecd
No known key found for this signature in database
GPG Key ID: 7B069E9C295E6B4A
6 changed files with 7 additions and 20 deletions

View File

@ -47,7 +47,6 @@ export default {
}, },
methods: { methods: {
sendNewService() { sendNewService() {
console.debug(`creating service name: ${this.service.name}, port: ${this.service.port}`);
const instance = axios.create({ const instance = axios.create({
baseURL: this.$store.state.apiUrl, baseURL: this.$store.state.apiUrl,
auth: { auth: {

View File

@ -27,8 +27,7 @@ export default {
} }
}, },
watch: { watch: {
'streamId': function (streamId) { 'streamId': function () {
console.debug('Content.vue: streamId changed! new:', streamId);
this.packets = []; this.packets = [];
this.$refs.infiniteLoading.stateChanger.reset(); this.$refs.infiniteLoading.stateChanger.reset();
}, },
@ -36,7 +35,6 @@ export default {
methods: { methods: {
infiniteHandler($state) { infiniteHandler($state) {
if (!this.streamId) return $state.complete(); if (!this.streamId) return $state.complete();
console.debug('getting next portion of packets...');
const instance = axios.create({ const instance = axios.create({
baseURL: this.$store.state.apiUrl, baseURL: this.$store.state.apiUrl,
auth: { auth: {

View File

@ -34,8 +34,7 @@ export default {
}, },
}); });
instance.delete(`/pattern/${this.id}`) instance.delete(`/pattern/${this.id}`)
.then(response => { .then(() => {
console.debug('got r', response.data);
this.$destroy(); this.$destroy();
this.$el.parentNode.removeChild(this.$el); // FIXME: может сломать Vue, лучше бы это убрать... this.$el.parentNode.removeChild(this.$el); // FIXME: может сломать Vue, лучше бы это убрать...
}) })

View File

@ -135,10 +135,7 @@ export default {
}, },
}); });
instance.post('/pattern/', this.newPattern) instance.post('/pattern/', this.newPattern)
.then(response => { .then(this.getPatterns())
console.debug('got r', response.data);
this.getPatterns();
})
.catch(error => console.error('failed to create pattern', error)); .catch(error => console.error('failed to create pattern', error));
}, },
}, },

View File

@ -70,20 +70,17 @@ export default {
} }
}, },
watch: { watch: {
'servicePort': function (servicePort) { 'servicePort': function () {
console.debug('Sidebar.vue: port changed! new:', servicePort);
this.streams = []; this.streams = [];
this.$refs.infiniteLoading.stateChanger.reset(); this.$refs.infiniteLoading.stateChanger.reset();
}, },
'$route.query': function (query) { '$route.query.pId': function () {
console.debug('Sidebar.vue: query changed! new:', query);
this.streams = []; this.streams = [];
this.$refs.infiniteLoading.stateChanger.reset(); this.$refs.infiniteLoading.stateChanger.reset();
}, },
}, },
methods: { methods: {
infiniteHandler($state) { infiniteHandler($state) {
console.debug('getting next portion of streams...');
const instance = axios.create({ const instance = axios.create({
baseURL: this.$store.state.apiUrl, baseURL: this.$store.state.apiUrl,
auth: { auth: {
@ -124,7 +121,6 @@ export default {
}); });
}, },
onGotNewStream(stream) { onGotNewStream(stream) {
console.debug('got new stream from WS!', stream);
this.streams.pop(); this.streams.pop();
this.streams.unshift(stream); this.streams.unshift(stream);
}, },

View File

@ -52,10 +52,10 @@ export default {
// FIXME: (https://groups.google.com/forum/#!topic/sockjs/4gmZy8XZFIY) // FIXME: (https://groups.google.com/forum/#!topic/sockjs/4gmZy8XZFIY)
this.socket = new SockJS(wsUrl); this.socket = new SockJS(wsUrl);
this.socket.onopen = function () { this.socket.onopen = function () {
console.debug('WS connected'); console.info('WS connected');
}; };
this.socket.onclose = function (ev) { this.socket.onclose = function (ev) {
console.debug('WS disconnected', ev.code, ev.reason); console.info('WS disconnected', ev.code, ev.reason);
if (ev.code === 1008) { // FIXME: выключить security timeout (This connection was established under an authenticated HTTP session that has ended.) if (ev.code === 1008) { // FIXME: выключить security timeout (This connection was established under an authenticated HTTP session that has ended.)
console.info('Security timeout, reconnecting...'); console.info('Security timeout, reconnecting...');
this.connectWs(); this.connectWs();
@ -63,10 +63,8 @@ export default {
}; };
this.socket.onmessage = ev => { this.socket.onmessage = ev => {
const parsed = JSON.parse(ev.data); const parsed = JSON.parse(ev.data);
console.debug('WS got message', parsed);
const currentPort = parseInt(this.$route.params.servicePort, 10); const currentPort = parseInt(this.$route.params.servicePort, 10);
if (!(currentPort === undefined || currentPort === parsed.service.port)) { if (!(currentPort === undefined || currentPort === parsed.service.port)) {
console.debug('not related port, skipping...');
return; return;
} }
this.$refs.sidebar.onGotNewStream(parsed); this.$refs.sidebar.onGotNewStream(parsed);