diff --git a/public/updates-script.js b/public/updates-script.js index 57a28835e..09e9c25e1 100644 --- a/public/updates-script.js +++ b/public/updates-script.js @@ -52,7 +52,13 @@ $(window).on('load', function () { if (status.type == "Processing") { const id = 'update-' + status.update_id; const content = $(`#${id} .updateStatus.content`); - content.html('processing'); + content.html('processing...'); + } + + if (status.type == "Progressing") { + const id = 'update-' + status.update_id; + const content = $(`#${id} .updateStatus.content`); + content.html('progressing...'); } if (status.type == "Processed") { diff --git a/src/subcommand/serve.rs b/src/subcommand/serve.rs index 64c9edf20..4f795107c 100644 --- a/src/subcommand/serve.rs +++ b/src/subcommand/serve.rs @@ -96,6 +96,7 @@ struct UpdatesTemplate { enum UpdateStatus { Pending { update_id: u64, meta: M }, Processing { update_id: u64, meta: M }, + Progressing { update_id: u64, meta: M }, Processed { update_id: u64, meta: M }, } @@ -132,6 +133,16 @@ pub fn run(opt: Opt) -> anyhow::Result<()> { std::thread::sleep(Duration::from_secs(3)); + let progress = UpdateStatus::Progressing { update_id, meta: meta.clone() }; + let _ = update_status_sender_cloned.send(progress); + + std::thread::sleep(Duration::from_secs(3)); + + let progress = UpdateStatus::Progressing { update_id, meta: meta.clone() }; + let _ = update_status_sender_cloned.send(progress); + + std::thread::sleep(Duration::from_secs(3)); + let processed = UpdateStatus::Processed { update_id, meta: meta.clone() }; let _ = update_status_sender_cloned.send(processed); Ok(meta)