fcwd: add tui temp

This commit is contained in:
2025-06-04 01:09:18 +08:00
parent a3fd03d32a
commit 082e08e7f4
7 changed files with 232 additions and 78 deletions

11
apps/dev-tui/Cargo.toml Normal file
View File

@@ -0,0 +1,11 @@
[package]
name = "dev-tui"
version = "0.1.0"
edition = "2024"
[dependencies]
color-eyre = "0.6.5"
ratatui = "0.29"
tokio = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }

26
apps/dev-tui/src/main.rs Normal file
View File

@@ -0,0 +1,26 @@
use ratatui::{ DefaultTerminal, Frame, crossterm::{ event::{self, Event} } };
#[tokio::main]
async fn main() -> color_eyre::Result<()> {
color_eyre::install()?;
let terminal = ratatui::init();
let result = run(terminal);
ratatui::restore();
result
}
fn run(mut terminal: DefaultTerminal) -> color_eyre::Result<()> {
loop {
terminal.draw(render)?;
if matches!(event::read()?, Event::Key(_)) {
break Ok(());
}
}
}
fn render(frame: &mut Frame) {
frame.render_widget("hello world", frame.area());
}

View File

@@ -30,6 +30,7 @@ pub use web::{
extract_mikan_bangumi_index_meta_list_from_season_flow_fragment,
extract_mikan_bangumi_meta_from_expand_subscribed_fragment,
extract_mikan_episode_meta_from_episode_homepage_html,
scrape_mikan_bangumi_index_meta_from_bangumi_homepage_url,
scrape_mikan_bangumi_meta_from_bangumi_homepage_url,
scrape_mikan_bangumi_meta_list_from_season_flow_url,
scrape_mikan_bangumi_meta_stream_from_season_flow_url,