返回 CodeWhale
dashboard.rs
根目录 / crates / tui / src / commands / groups / core / dashboard.rs
1 use codewhale_command_contract::handler::CommandHandler;
2 use codewhale_command_contract::metadata::{CommandInfo, RegisterCommand};
3 use codewhale_command_contract::outcome::{CoreNavigationAction, CoreNavigationCommandResult};
4
5 pub const COMMAND_INFO: CommandInfo = CommandInfo {
6 name: "dashboard",
7 aliases: &["board"],
8 usage: "/dashboard",
9 description_key: "cmd_dashboard_description",
10 };
11
12 pub struct DashboardCmd;
13
14 impl RegisterCommand<CoreNavigationCommandResult> for DashboardCmd {
15 fn info() -> &'static CommandInfo {
16 &COMMAND_INFO
17 }
18
19 fn handler() -> CommandHandler<CoreNavigationCommandResult> {
20 CommandHandler::Pure(|_| {
21 CoreNavigationCommandResult::action(CoreNavigationAction::OpenAgentBoard)
22 })
23 }
24 }
25
25 lines RUST