mirror of
https://github.com/kristoferssolo/traxor.git
synced 2026-01-14 20:46:14 +00:00
feat: add more default tabs (Seeding, Queued) with focused columns
This commit is contained in:
parent
dabb434011
commit
c8b7d0ccbe
@ -18,6 +18,8 @@ next_tab = "l"
|
|||||||
switch_tab_1 = "1"
|
switch_tab_1 = "1"
|
||||||
switch_tab_2 = "2"
|
switch_tab_2 = "2"
|
||||||
switch_tab_3 = "3"
|
switch_tab_3 = "3"
|
||||||
|
switch_tab_4 = "4"
|
||||||
|
switch_tab_5 = "5"
|
||||||
|
|
||||||
# Torrent actions
|
# Torrent actions
|
||||||
toggle_torrent = "enter"
|
toggle_torrent = "enter"
|
||||||
@ -70,24 +72,20 @@ transmission_rpc = "warn"
|
|||||||
|
|
||||||
[[tabs]]
|
[[tabs]]
|
||||||
name = "All"
|
name = "All"
|
||||||
columns = ["status", "leeches", "ratio", "size", "uploaded", "path", "name"]
|
columns = ["status", "progress", "size", "ratio", "seeds", "leeches", "added", "name"]
|
||||||
|
|
||||||
[[tabs]]
|
|
||||||
name = "Active"
|
|
||||||
columns = [
|
|
||||||
"size",
|
|
||||||
"uploaded",
|
|
||||||
"ratio",
|
|
||||||
"leeches",
|
|
||||||
"seeds",
|
|
||||||
"status",
|
|
||||||
"eta",
|
|
||||||
"progress",
|
|
||||||
"downspeed",
|
|
||||||
"upspeed",
|
|
||||||
"name",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[tabs]]
|
[[tabs]]
|
||||||
name = "Downloading"
|
name = "Downloading"
|
||||||
columns = ["size", "left", "progress", "downspeed", "eta", "path", "name"]
|
columns = ["progress", "size", "left", "downspeed", "eta", "seeds", "name"]
|
||||||
|
|
||||||
|
[[tabs]]
|
||||||
|
name = "Seeding"
|
||||||
|
columns = ["ratio", "uploaded", "upspeed", "leeches", "size", "added", "name"]
|
||||||
|
|
||||||
|
[[tabs]]
|
||||||
|
name = "Active"
|
||||||
|
columns = ["status", "progress", "downspeed", "upspeed", "eta", "seeds", "leeches", "name"]
|
||||||
|
|
||||||
|
[[tabs]]
|
||||||
|
name = "Queued"
|
||||||
|
columns = ["status", "queue", "size", "progress", "added", "name"]
|
||||||
|
|||||||
@ -10,6 +10,8 @@ pub struct KeybindsConfig {
|
|||||||
pub switch_tab_1: String,
|
pub switch_tab_1: String,
|
||||||
pub switch_tab_2: String,
|
pub switch_tab_2: String,
|
||||||
pub switch_tab_3: String,
|
pub switch_tab_3: String,
|
||||||
|
pub switch_tab_4: String,
|
||||||
|
pub switch_tab_5: String,
|
||||||
pub toggle_torrent: String,
|
pub toggle_torrent: String,
|
||||||
pub toggle_all: String,
|
pub toggle_all: String,
|
||||||
pub delete: String,
|
pub delete: String,
|
||||||
|
|||||||
@ -58,6 +58,8 @@ pub async fn get_action(key_event: KeyEvent, app: &mut App) -> Result<Option<Act
|
|||||||
(Action::SwitchTab(0), &keybinds.switch_tab_1),
|
(Action::SwitchTab(0), &keybinds.switch_tab_1),
|
||||||
(Action::SwitchTab(1), &keybinds.switch_tab_2),
|
(Action::SwitchTab(1), &keybinds.switch_tab_2),
|
||||||
(Action::SwitchTab(2), &keybinds.switch_tab_3),
|
(Action::SwitchTab(2), &keybinds.switch_tab_3),
|
||||||
|
(Action::SwitchTab(3), &keybinds.switch_tab_4),
|
||||||
|
(Action::SwitchTab(4), &keybinds.switch_tab_5),
|
||||||
(Action::ToggleTorrent, &keybinds.toggle_torrent),
|
(Action::ToggleTorrent, &keybinds.toggle_torrent),
|
||||||
(Action::ToggleAll, &keybinds.toggle_all),
|
(Action::ToggleAll, &keybinds.toggle_all),
|
||||||
(Action::Delete(false), &keybinds.delete),
|
(Action::Delete(false), &keybinds.delete),
|
||||||
|
|||||||
10
tests/app.rs
10
tests/app.rs
@ -4,7 +4,7 @@ use traxor::{app::App, config::Config};
|
|||||||
fn test_app_creation() {
|
fn test_app_creation() {
|
||||||
let config = Config::load().unwrap();
|
let config = Config::load().unwrap();
|
||||||
let app = App::new(config).unwrap();
|
let app = App::new(config).unwrap();
|
||||||
assert_eq!(app.tabs().len(), 3);
|
assert_eq!(app.tabs().len(), 5);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@ -25,6 +25,10 @@ fn test_app_next_tab() {
|
|||||||
app.next_tab();
|
app.next_tab();
|
||||||
assert_eq!(app.index(), 2);
|
assert_eq!(app.index(), 2);
|
||||||
app.next_tab();
|
app.next_tab();
|
||||||
|
assert_eq!(app.index(), 3);
|
||||||
|
app.next_tab();
|
||||||
|
assert_eq!(app.index(), 4);
|
||||||
|
app.next_tab();
|
||||||
assert_eq!(app.index(), 0); // Wraps around
|
assert_eq!(app.index(), 0); // Wraps around
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -34,9 +38,9 @@ fn test_app_prev_tab() {
|
|||||||
let mut app = App::new(config).unwrap();
|
let mut app = App::new(config).unwrap();
|
||||||
assert_eq!(app.index(), 0);
|
assert_eq!(app.index(), 0);
|
||||||
app.prev_tab();
|
app.prev_tab();
|
||||||
assert_eq!(app.index(), 2); // Wraps around
|
assert_eq!(app.index(), 4); // Wraps around
|
||||||
app.prev_tab();
|
app.prev_tab();
|
||||||
assert_eq!(app.index(), 1);
|
assert_eq!(app.index(), 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user