diff options
-rw-r--r-- | docker-compose.yml | 2 | ||||
-rw-r--r-- | src/main.rs | 6 | ||||
-rw-r--r-- | src/requests/start.rs | 10 |
3 files changed, 12 insertions, 6 deletions
diff --git a/docker-compose.yml b/docker-compose.yml index f41f4c9..ea10db2 100644 --- a/docker-compose.yml +++ b/docker-compose.yml | |||
@@ -9,7 +9,7 @@ services: | |||
9 | - RUST_LOG=info,webol=trace | 9 | - RUST_LOG=info,webol=trace |
10 | - WEBOL_DATABASE_URL=postgres://postgres:postgres@localhost:5432/webol | 10 | - WEBOL_DATABASE_URL=postgres://postgres:postgres@localhost:5432/webol |
11 | - WEBOL_APIKEY=dev | 11 | - WEBOL_APIKEY=dev |
12 | - WEBOL_SERVERADDR=127.0.0.1:7229 | 12 | - WEBOL_SERVERADDR=0.0.0.0:7229 |
13 | network_mode: host | 13 | network_mode: host |
14 | 14 | ||
15 | db: | 15 | db: |
diff --git a/src/main.rs b/src/main.rs index d76341f..5a0931d 100644 --- a/src/main.rs +++ b/src/main.rs | |||
@@ -16,9 +16,9 @@ mod config; | |||
16 | mod error; | 16 | mod error; |
17 | mod requests; | 17 | mod requests; |
18 | 18 | ||
19 | static OVERVIEW_STYLE: &str = "{spinner:.green} ({elapsed}{wide_msg}"; | 19 | static OVERVIEW_STYLE: &str = "{spinner:.green} ({elapsed_precise}{wide_msg}"; |
20 | static OVERVIEW_ERROR: &str = "✗ ({elapsed}) {wide_msg}"; | 20 | static OVERVIEW_ERROR: &str = "✗ ({elapsed_precise}) {wide_msg}"; |
21 | static OVERVIEW_DONE: &str = "✓ ({elapsed}) {wide_msg}"; | 21 | static OVERVIEW_DONE: &str = "✓ ({elapsed_precise}) {wide_msg}"; |
22 | static DEFAULT_STYLE: &str = " {spinner:.green} {wide_msg}"; | 22 | static DEFAULT_STYLE: &str = " {spinner:.green} {wide_msg}"; |
23 | static DONE_STYLE: &str = " ✓ {wide_msg}"; | 23 | static DONE_STYLE: &str = " ✓ {wide_msg}"; |
24 | static ERROR_STYLE: &str = " ✗ {wide_msg}"; | 24 | static ERROR_STYLE: &str = " ✗ {wide_msg}"; |
diff --git a/src/requests/start.rs b/src/requests/start.rs index d07177e..3afbe3a 100644 --- a/src/requests/start.rs +++ b/src/requests/start.rs | |||
@@ -121,12 +121,18 @@ async fn status_socket( | |||
121 | } | 121 | } |
122 | } | 122 | } |
123 | 123 | ||
124 | fn get_eta(msg: &str, uuid: &str) -> Result<u64, Error> { | 124 | fn get_eta(msg: &str, uuid: &str) -> Result<String, Error> { |
125 | let spl: Vec<&str> = msg.split('_').collect(); | 125 | let spl: Vec<&str> = msg.split('_').collect(); |
126 | if (spl[0] != "eta") || (spl[2] != uuid) { | 126 | if (spl[0] != "eta") || (spl[2] != uuid) { |
127 | return Err(Error::WsResponse); | 127 | return Err(Error::WsResponse); |
128 | }; | 128 | }; |
129 | Ok(spl[1].parse()?) | 129 | let input: u64 = spl[1].parse()?; |
130 | |||
131 | let sec = input % 60; | ||
132 | let min = (input / 60) % 60; | ||
133 | let hou = (input / (60 * 60)) % 60; | ||
134 | |||
135 | Ok(format!("{hou:0>2}:{min:0>2}:{sec:0>2}")) | ||
130 | } | 136 | } |
131 | 137 | ||
132 | fn verify_response(res: &str, org_uuid: &str) -> Result<Verified, Error> { | 138 | fn verify_response(res: &str, org_uuid: &str) -> Result<Verified, Error> { |