Compare commits

...

2 Commits

Author SHA1 Message Date
Alex Ling 44336c546a Bump version to v0.18.3 2021-01-12 10:14:12 +00:00
Alex Ling a4c6e6611c Try WSS first, and fallback to WS (#144) 2021-01-12 10:13:06 +00:00
4 changed files with 19 additions and 10 deletions
+1 -1
View File
@@ -52,7 +52,7 @@ The official docker images are available on [Dockerhub](https://hub.docker.com/r
### CLI ### CLI
``` ```
Mango - Manga Server and Web Reader. Version 0.18.2 Mango - Manga Server and Web Reader. Version 0.18.3
Usage: Usage:
+16 -7
View File
@@ -4,21 +4,30 @@ const component = () => {
paused: undefined, paused: undefined,
loading: false, loading: false,
toggling: false, toggling: false,
ws: undefined,
init() { wsConnect(secure = true) {
const ws = new WebSocket(`ws://${location.host}${base_url}api/admin/mangadex/queue`); const url = `${secure ? 'wss' : 'ws'}://${location.host}${base_url}api/admin/mangadex/queue`;
ws.onmessage = event => { console.log(`Connecting to ${url}`);
this.ws = new WebSocket(url);
this.ws.onmessage = event => {
const data = JSON.parse(event.data); const data = JSON.parse(event.data);
this.jobs = data.jobs; this.jobs = data.jobs;
this.paused = data.paused; this.paused = data.paused;
}; };
ws.onerror = err => { this.ws.onclose = () => {
alert('danger', `Socket connection failed. Error: ${err}`); if (this.ws.failed)
return this.wsConnect(false);
alert('danger', 'Socket connection closed');
}; };
ws.onclose = err => { this.ws.onerror = () => {
if (secure)
return this.ws.failed = true;
alert('danger', 'Socket connection failed'); alert('danger', 'Socket connection failed');
}; };
},
init() {
this.wsConnect();
this.load(); this.load();
}, },
load() { load() {
+1 -1
View File
@@ -1,5 +1,5 @@
name: mango name: mango
version: 0.18.2 version: 0.18.3
authors: authors:
- Alex Ling <hkalexling@gmail.com> - Alex Ling <hkalexling@gmail.com>
+1 -1
View File
@@ -8,7 +8,7 @@ require "option_parser"
require "clim" require "clim"
require "tallboy" require "tallboy"
MANGO_VERSION = "0.18.2" MANGO_VERSION = "0.18.3"
# From http://www.network-science.de/ascii/ # From http://www.network-science.de/ascii/
BANNER = %{ BANNER = %{