2019-01-23 12:05:32 +00:00
|
|
|
use crate::api::schema::*;
|
|
|
|
use crate::api::router::*;
|
|
|
|
use serde_json::{json};
|
|
|
|
|
|
|
|
mod time;
|
|
|
|
mod network;
|
|
|
|
mod dns;
|
2019-01-25 16:17:30 +00:00
|
|
|
mod syslog;
|
2019-01-23 12:05:32 +00:00
|
|
|
|
|
|
|
pub fn router() -> Router {
|
|
|
|
|
|
|
|
let route = Router::new()
|
|
|
|
.get(ApiMethod::new(
|
|
|
|
|_,_| Ok(json!([
|
|
|
|
{"subdir": "network"},
|
2019-01-25 16:17:30 +00:00
|
|
|
{"subdir": "syslog"},
|
|
|
|
{"subdir": "time"},
|
2019-01-23 12:05:32 +00:00
|
|
|
])),
|
|
|
|
ObjectSchema::new("Directory index.")))
|
|
|
|
.subdir("dns", dns::router())
|
|
|
|
.subdir("network", network::router())
|
2019-01-25 16:17:30 +00:00
|
|
|
.subdir("syslog", syslog::router())
|
2019-01-23 12:05:32 +00:00
|
|
|
.subdir("time", time::router());
|
|
|
|
|
|
|
|
route
|
|
|
|
}
|