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-26 16:54:18 +00:00
|
|
|
mod services;
|
2019-01-23 12:05:32 +00:00
|
|
|
|
|
|
|
pub fn router() -> Router {
|
|
|
|
|
|
|
|
let route = Router::new()
|
|
|
|
.get(ApiMethod::new(
|
2019-01-26 13:50:37 +00:00
|
|
|
|_,_,_| Ok(json!([
|
2019-01-23 12:05:32 +00:00
|
|
|
{"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-26 16:54:18 +00:00
|
|
|
.subdir("services", services::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
|
|
|
|
}
|