lldap/app/src/components/router.rs

29 lines
575 B
Rust
Raw Normal View History

use yew_router::{
components::{RouterAnchor, RouterButton},
Switch,
};
#[derive(Switch, Debug, Clone)]
pub enum AppRoute {
#[to = "/login"]
Login,
#[to = "/users/create"]
CreateUser,
2021-09-19 17:44:53 +00:00
#[to = "/users"]
ListUsers,
#[to = "/user/{user_id}/password"]
ChangePassword(String),
#[to = "/user/{user_id}"]
UserDetails(String),
#[to = "/groups"]
ListGroups,
#[to = "/group/{group_id}"]
GroupDetails(i64),
#[to = "/"]
Index,
}
pub type Link = RouterAnchor<AppRoute>;
pub type NavButton = RouterButton<AppRoute>;