Compare commits
No commits in common. "1832d77e78f6b5bb821446da407f2297e3845cbf" and "7bb2f405dafff2798f38f415b49241fa474aa9dc" have entirely different histories.
1832d77e78
...
7bb2f405da
10
Cargo.lock
generated
10
Cargo.lock
generated
@ -2995,7 +2995,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "letterbox-notmuch"
|
name = "letterbox-notmuch"
|
||||||
version = "0.15.5"
|
version = "0.15.4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"itertools",
|
"itertools",
|
||||||
"log",
|
"log",
|
||||||
@ -3010,14 +3010,14 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "letterbox-procmail2notmuch"
|
name = "letterbox-procmail2notmuch"
|
||||||
version = "0.15.5"
|
version = "0.15.4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "letterbox-server"
|
name = "letterbox-server"
|
||||||
version = "0.15.5"
|
version = "0.15.4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"ammonia",
|
"ammonia",
|
||||||
"anyhow",
|
"anyhow",
|
||||||
@ -3061,7 +3061,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "letterbox-shared"
|
name = "letterbox-shared"
|
||||||
version = "0.15.5"
|
version = "0.15.4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"build-info",
|
"build-info",
|
||||||
"letterbox-notmuch",
|
"letterbox-notmuch",
|
||||||
@ -3071,7 +3071,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "letterbox-web"
|
name = "letterbox-web"
|
||||||
version = "0.15.5"
|
version = "0.15.4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"build-info",
|
"build-info",
|
||||||
"build-info-build",
|
"build-info-build",
|
||||||
|
|||||||
@ -8,7 +8,7 @@ authors = ["Bill Thiede <git@xinu.tv>"]
|
|||||||
edition = "2021"
|
edition = "2021"
|
||||||
license = "UNLICENSED"
|
license = "UNLICENSED"
|
||||||
publish = ["xinu"]
|
publish = ["xinu"]
|
||||||
version = "0.15.5"
|
version = "0.15.4"
|
||||||
repository = "https://git.z.xinu.tv/wathiede/letterbox"
|
repository = "https://git.z.xinu.tv/wathiede/letterbox"
|
||||||
|
|
||||||
[profile.dev]
|
[profile.dev]
|
||||||
|
|||||||
@ -27,8 +27,8 @@ css-inline = "0.14.0"
|
|||||||
futures = "0.3.31"
|
futures = "0.3.31"
|
||||||
headers = "0.4.0"
|
headers = "0.4.0"
|
||||||
html-escape = "0.2.13"
|
html-escape = "0.2.13"
|
||||||
letterbox-notmuch = { version = "0.15.5", path = "../notmuch", registry = "xinu" }
|
letterbox-notmuch = { version = "0.15.4", path = "../notmuch", registry = "xinu" }
|
||||||
letterbox-shared = { version = "0.15.5", path = "../shared", registry = "xinu" }
|
letterbox-shared = { version = "0.15.4", path = "../shared", registry = "xinu" }
|
||||||
linkify = "0.10.0"
|
linkify = "0.10.0"
|
||||||
log = "0.4.17"
|
log = "0.4.17"
|
||||||
lol_html = "2.0.0"
|
lol_html = "2.0.0"
|
||||||
|
|||||||
@ -12,6 +12,6 @@ version.workspace = true
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
build-info = "0.0.40"
|
build-info = "0.0.40"
|
||||||
letterbox-notmuch = { version = "0.15.5", path = "../notmuch", registry = "xinu" }
|
letterbox-notmuch = { version = "0.15.4", path = "../notmuch", registry = "xinu" }
|
||||||
serde = { version = "1.0.147", features = ["derive"] }
|
serde = { version = "1.0.147", features = ["derive"] }
|
||||||
strum_macros = "0.27.1"
|
strum_macros = "0.27.1"
|
||||||
|
|||||||
@ -33,8 +33,8 @@ wasm-bindgen = "=0.2.100"
|
|||||||
uuid = { version = "1.13.1", features = [
|
uuid = { version = "1.13.1", features = [
|
||||||
"js",
|
"js",
|
||||||
] } # direct dep to set js feature, prevents Rng issues
|
] } # direct dep to set js feature, prevents Rng issues
|
||||||
letterbox-shared = { version = "0.15.5", path = "../shared", registry = "xinu" }
|
letterbox-shared = { version = "0.15.4", path = "../shared", registry = "xinu" }
|
||||||
letterbox-notmuch = { version = "0.15.5", path = "../notmuch", registry = "xinu" }
|
letterbox-notmuch = { version = "0.15.4", path = "../notmuch", registry = "xinu" }
|
||||||
seed_hooks = { version = "0.4.0", registry = "xinu" }
|
seed_hooks = { version = "0.4.0", registry = "xinu" }
|
||||||
strum_macros = "0.27.1"
|
strum_macros = "0.27.1"
|
||||||
gloo-console = "0.3.0"
|
gloo-console = "0.3.0"
|
||||||
|
|||||||
@ -62,7 +62,7 @@ pub fn init(url: Url, orders: &mut impl Orders<Msg>) -> Model {
|
|||||||
},
|
},
|
||||||
catchup: None,
|
catchup: None,
|
||||||
last_url: Url::current(),
|
last_url: Url::current(),
|
||||||
websocket: websocket::init("/api/ws", &mut orders.proxy(Msg::WebSocket)),
|
websocket: websocket::init(&mut orders.proxy(Msg::WebSocket)),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -78,14 +78,13 @@ pub struct ClientMessage {
|
|||||||
|
|
||||||
//const WS_URL: &str = "wss://9000.z.xinu.tv/api/ws";
|
//const WS_URL: &str = "wss://9000.z.xinu.tv/api/ws";
|
||||||
//const WS_URL: &str = "wss://9345.z.xinu.tv/api/graphql/ws";
|
//const WS_URL: &str = "wss://9345.z.xinu.tv/api/graphql/ws";
|
||||||
//const WS_URL: &str = "wss://6758.z.xinu.tv/api/ws";
|
const WS_URL: &str = "wss://6758.z.xinu.tv/api/ws";
|
||||||
|
|
||||||
// ------ ------
|
// ------ ------
|
||||||
// Model
|
// Model
|
||||||
// ------ ------
|
// ------ ------
|
||||||
|
|
||||||
pub struct Model {
|
pub struct Model {
|
||||||
ws_url: String,
|
|
||||||
web_socket: EventClient,
|
web_socket: EventClient,
|
||||||
web_socket_reconnector: Option<StreamHandle>,
|
web_socket_reconnector: Option<StreamHandle>,
|
||||||
pub updates: VecDeque<WebsocketMessage>,
|
pub updates: VecDeque<WebsocketMessage>,
|
||||||
@ -95,10 +94,9 @@ pub struct Model {
|
|||||||
// Init
|
// Init
|
||||||
// ------ ------
|
// ------ ------
|
||||||
|
|
||||||
pub fn init(ws_url: &str, orders: &mut impl Orders<Msg>) -> Model {
|
pub fn init(orders: &mut impl Orders<Msg>) -> Model {
|
||||||
Model {
|
Model {
|
||||||
ws_url: ws_url.to_string(),
|
web_socket: create_websocket(orders).unwrap(),
|
||||||
web_socket: create_websocket(ws_url, orders).unwrap(),
|
|
||||||
web_socket_reconnector: None,
|
web_socket_reconnector: None,
|
||||||
updates: VecDeque::new(),
|
updates: VecDeque::new(),
|
||||||
}
|
}
|
||||||
@ -157,7 +155,7 @@ Reason: {2}
|
|||||||
}
|
}
|
||||||
Msg::ReconnectWebSocket(retries) => {
|
Msg::ReconnectWebSocket(retries) => {
|
||||||
info!("Reconnect attempt: {}", retries);
|
info!("Reconnect attempt: {}", retries);
|
||||||
model.web_socket = create_websocket(&model.ws_url, orders).unwrap();
|
model.web_socket = create_websocket(orders).unwrap();
|
||||||
}
|
}
|
||||||
Msg::SendMessage(msg) => {
|
Msg::SendMessage(msg) => {
|
||||||
let txt = serde_json::to_string(&msg).unwrap();
|
let txt = serde_json::to_string(&msg).unwrap();
|
||||||
@ -166,10 +164,10 @@ Reason: {2}
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn create_websocket(url: &str, orders: &impl Orders<Msg>) -> Result<EventClient, WebSocketError> {
|
fn create_websocket(orders: &impl Orders<Msg>) -> Result<EventClient, WebSocketError> {
|
||||||
let msg_sender = orders.msg_sender();
|
let msg_sender = orders.msg_sender();
|
||||||
|
|
||||||
let mut client = EventClient::new(url)?;
|
let mut client = EventClient::new(WS_URL)?;
|
||||||
|
|
||||||
client.set_on_error(Some(Box::new(|error| {
|
client.set_on_error(Some(Box::new(|error| {
|
||||||
gloo_console::error!("WS: ", error);
|
gloo_console::error!("WS: ", error);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user