From 6542e06ecdeee74674d9c97fc3aea03e2c31a8b3 Mon Sep 17 00:00:00 2001 From: saber-nyan Date: Fri, 17 May 2019 22:34:39 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A3=D0=B1=D1=80=D0=B0=D0=BB=20=D0=BD=D0=B5?= =?UTF-8?q?=D0=BD=D1=83=D0=B6=D0=BD=D1=8B=D0=B9=20=D0=BE=D1=82=D0=BB=D0=B0?= =?UTF-8?q?=D0=B4=D0=BE=D1=87=D0=BD=D1=8B=D0=B9=20=D0=B2=D1=8B=D0=B2=D0=BE?= =?UTF-8?q?=D0=B4,=20=D0=B8=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=B8=D0=BB=20?= =?UTF-8?q?=D1=81=D0=B1=D1=80=D0=BE=D1=81=20=D0=BF=D1=80=D0=BE=D0=BA=D1=80?= =?UTF-8?q?=D1=83=D1=82=D0=BA=D0=B8=20=D1=81=D0=B0=D0=B9=D0=B4=D0=B1=D0=B0?= =?UTF-8?q?=D1=80=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/AddServiceModal.vue | 1 - src/components/Content.vue | 4 +--- src/components/FlagPattern.vue | 3 +-- src/components/Navbar.vue | 5 +---- src/components/Sidebar.vue | 8 ++------ src/views/Home.vue | 6 ++---- 6 files changed, 7 insertions(+), 20 deletions(-) diff --git a/src/components/AddServiceModal.vue b/src/components/AddServiceModal.vue index fd24416..02139eb 100644 --- a/src/components/AddServiceModal.vue +++ b/src/components/AddServiceModal.vue @@ -47,7 +47,6 @@ export default { }, methods: { sendNewService() { - console.debug(`creating service name: ${this.service.name}, port: ${this.service.port}`); const instance = axios.create({ baseURL: this.$store.state.apiUrl, auth: { diff --git a/src/components/Content.vue b/src/components/Content.vue index 9b6e638..06a8a2d 100644 --- a/src/components/Content.vue +++ b/src/components/Content.vue @@ -27,8 +27,7 @@ export default { } }, watch: { - 'streamId': function (streamId) { - console.debug('Content.vue: streamId changed! new:', streamId); + 'streamId': function () { this.packets = []; this.$refs.infiniteLoading.stateChanger.reset(); }, @@ -36,7 +35,6 @@ export default { methods: { infiniteHandler($state) { if (!this.streamId) return $state.complete(); - console.debug('getting next portion of packets...'); const instance = axios.create({ baseURL: this.$store.state.apiUrl, auth: { diff --git a/src/components/FlagPattern.vue b/src/components/FlagPattern.vue index fc519ec..e57286c 100644 --- a/src/components/FlagPattern.vue +++ b/src/components/FlagPattern.vue @@ -34,8 +34,7 @@ export default { }, }); instance.delete(`/pattern/${this.id}`) - .then(response => { - console.debug('got r', response.data); + .then(() => { this.$destroy(); this.$el.parentNode.removeChild(this.$el); // FIXME: может сломать Vue, лучше бы это убрать... }) diff --git a/src/components/Navbar.vue b/src/components/Navbar.vue index 07b8087..165bae1 100644 --- a/src/components/Navbar.vue +++ b/src/components/Navbar.vue @@ -135,10 +135,7 @@ export default { }, }); instance.post('/pattern/', this.newPattern) - .then(response => { - console.debug('got r', response.data); - this.getPatterns(); - }) + .then(this.getPatterns()) .catch(error => console.error('failed to create pattern', error)); }, }, diff --git a/src/components/Sidebar.vue b/src/components/Sidebar.vue index b84df6e..0efceed 100644 --- a/src/components/Sidebar.vue +++ b/src/components/Sidebar.vue @@ -70,20 +70,17 @@ export default { } }, watch: { - 'servicePort': function (servicePort) { - console.debug('Sidebar.vue: port changed! new:', servicePort); + 'servicePort': function () { this.streams = []; this.$refs.infiniteLoading.stateChanger.reset(); }, - '$route.query': function (query) { - console.debug('Sidebar.vue: query changed! new:', query); + '$route.query.pId': function () { this.streams = []; this.$refs.infiniteLoading.stateChanger.reset(); }, }, methods: { infiniteHandler($state) { - console.debug('getting next portion of streams...'); const instance = axios.create({ baseURL: this.$store.state.apiUrl, auth: { @@ -124,7 +121,6 @@ export default { }); }, onGotNewStream(stream) { - console.debug('got new stream from WS!', stream); this.streams.pop(); this.streams.unshift(stream); }, diff --git a/src/views/Home.vue b/src/views/Home.vue index 3bd84b2..676c936 100644 --- a/src/views/Home.vue +++ b/src/views/Home.vue @@ -52,10 +52,10 @@ export default { // FIXME: (https://groups.google.com/forum/#!topic/sockjs/4gmZy8XZFIY) this.socket = new SockJS(wsUrl); this.socket.onopen = function () { - console.debug('WS connected'); + console.info('WS connected'); }; 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.) console.info('Security timeout, reconnecting...'); this.connectWs(); @@ -63,10 +63,8 @@ export default { }; this.socket.onmessage = ev => { const parsed = JSON.parse(ev.data); - console.debug('WS got message', parsed); const currentPort = parseInt(this.$route.params.servicePort, 10); if (!(currentPort === undefined || currentPort === parsed.service.port)) { - console.debug('not related port, skipping...'); return; } this.$refs.sidebar.onGotNewStream(parsed);