pub mod config;
pub mod admin;
+pub mod node;
mod version;
mod subscription;
.subdir("subdir3", route4);
let nodes = Router::new()
- .match_all("node", nodeinfo);
+ .subdir("localhost", node::router());
let route = Router::new()
let route = Router::new()
.get(ApiMethod::new(
|_,_| Ok(json!([
- {"subdir": "datastore"}
+ {"subdir": "datastore"},
])),
ObjectSchema::new("Directory index.")))
.subdir("datastore", datastore::router());
--- /dev/null
+use crate::api::schema::*;
+use crate::api::router::*;
+use serde_json::{json};
+
+mod time;
+mod network;
+mod dns;
+
+pub fn router() -> Router {
+
+ let route = Router::new()
+ .get(ApiMethod::new(
+ |_,_| Ok(json!([
+ {"subdir": "network"},
+ {"subdir": "time"},
+ ])),
+ ObjectSchema::new("Directory index.")))
+ .subdir("dns", dns::router())
+ .subdir("network", network::router())
+ .subdir("time", time::router());
+
+ route
+}
--- /dev/null
+use failure::*;
+
+use crate::tools;
+use crate::api::schema::*;
+use crate::api::router::*;
+use serde_json::{json, Value};
+
+
+fn get_dns(_param: Value, _info: &ApiMethod) -> Result<Value, Error> {
+
+ Ok(json!({
+ "search": "test.com",
+ "dns1": "1.2.3.4",
+ "dns2": "1.2.3.4",
+ "dns3": "1.2.3.4",
+ }))
+}
+
+pub fn router() -> Router {
+
+ let route = Router::new()
+ .get(ApiMethod::new(
+ get_dns,
+ ObjectSchema::new("Read DNS settings.")));
+
+ route
+}
--- /dev/null
+use failure::*;
+
+use crate::tools;
+use crate::api::schema::*;
+use crate::api::router::*;
+use serde_json::{json, Value};
+
+
+fn get_network_config(_param: Value, _info: &ApiMethod) -> Result<Value, Error> {
+
+ Ok(json!({}))
+}
+
+pub fn router() -> Router {
+
+ let route = Router::new()
+ .get(ApiMethod::new(
+ get_network_config,
+ ObjectSchema::new("Read network configuration.")));
+
+ route
+}
--- /dev/null
+use failure::*;
+
+use crate::tools;
+use crate::api::schema::*;
+use crate::api::router::*;
+use serde_json::{json, Value};
+
+
+fn get_time(_param: Value, _info: &ApiMethod) -> Result<Value, Error> {
+
+ Ok(json!({
+ "timezone": "Europe/Vienna",
+ "time": 1297163644,
+ "localtime": 1297163644,
+ }))
+}
+
+pub fn router() -> Router {
+
+ let route = Router::new()
+ .get(ApiMethod::new(
+ get_time,
+ ObjectSchema::new("Read server time and time zone settings.")));
+
+ route
+}
title: gettext('Interfaces'),
xtype: 'proxmoxNodeNetworkView',
types: ['bond'],
- nodename: Proxmox.NodeName
+ nodename: 'localhost'
},
{
title: gettext('DNS'),
xtype: 'proxmoxNodeDNSView',
- nodename: Proxmox.NodeName
+ nodename: 'localhost'
},
{
title: gettext('Time'),
xtype: 'proxmoxNodeTimeView',
- nodename: Proxmox.NodeName
+ nodename: 'localhost'
}
]
// },
// {
// itemId: 'options',
-// title: gettext('Options'),
+// title: gettext('Options'),
+// html: "TESWT"
// xtype: 'pbsSystemOptions'
}
],