2021-09-12 09:54:47 +00:00
|
|
|
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,
|
2021-09-12 09:54:47 +00:00
|
|
|
#[to = "/user/{user_id}/password"]
|
|
|
|
ChangePassword(String),
|
|
|
|
#[to = "/user/{user_id}"]
|
|
|
|
UserDetails(String),
|
2021-09-28 13:00:39 +00:00
|
|
|
#[to = "/groups"]
|
|
|
|
ListGroups,
|
2021-09-12 09:54:47 +00:00
|
|
|
#[to = "/"]
|
|
|
|
Index,
|
|
|
|
}
|
|
|
|
|
|
|
|
pub type Link = RouterAnchor<AppRoute>;
|
|
|
|
|
|
|
|
pub type NavButton = RouterButton<AppRoute>;
|