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

View File

@@ -52,7 +52,7 @@ The official docker images are available on [Dockerhub](https://hub.docker.com/r
### CLI
```
Mango - Manga Server and Web Reader. Version 0.18.2
Mango - Manga Server and Web Reader. Version 0.18.3
Usage:

View File

@@ -4,21 +4,30 @@ const component = () => {
paused: undefined,
loading: false,
toggling: false,
ws: undefined,
init() {
const ws = new WebSocket(`ws://${location.host}${base_url}api/admin/mangadex/queue`);
ws.onmessage = event => {
wsConnect(secure = true) {
const url = `${secure ? 'wss' : 'ws'}://${location.host}${base_url}api/admin/mangadex/queue`;
console.log(`Connecting to ${url}`);
this.ws = new WebSocket(url);
this.ws.onmessage = event => {
const data = JSON.parse(event.data);
this.jobs = data.jobs;
this.paused = data.paused;
};
ws.onerror = err => {
alert('danger', `Socket connection failed. Error: ${err}`);
this.ws.onclose = () => {
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');
};
},
init() {
this.wsConnect();
this.load();
},
load() {

View File

@@ -1,5 +1,5 @@
name: mango
version: 0.18.2
version: 0.18.3
authors:
- Alex Ling <hkalexling@gmail.com>

View File

@@ -8,7 +8,7 @@ require "option_parser"
require "clim"
require "tallboy"
MANGO_VERSION = "0.18.2"
MANGO_VERSION = "0.18.3"
# From http://www.network-science.de/ascii/
BANNER = %{