Add admin interface to manage interface

This commit is contained in:
Bat
2018-09-08 19:54:09 +01:00
parent 6c80002e43
commit c1e0b6c306
5 changed files with 60 additions and 1 deletions
+8
View File
@@ -52,6 +52,14 @@ impl Instance {
.expect("Error loading remote instances infos")
}
pub fn page(conn: &PgConnection, (min, max): (i32, i32)) -> Vec<Instance> {
instances::table.order(instances::public_domain.asc())
.offset(min.into())
.limit((max - min).into())
.load::<Instance>(conn)
.expect("Error loading a page of instances")
}
pub fn local_id(conn: &PgConnection) -> i32 {
Instance::get_local(conn).unwrap().id
}