server from db working

This commit is contained in:
2026-05-31 23:59:51 +02:00
parent 2303f06fea
commit b818f7eaa3
12 changed files with 203 additions and 69 deletions

View File

@ -6,9 +6,10 @@ use serde::Deserialize;
use crate::status::ServerStatus;
use crate::schema;
#[derive(Queryable, Selectable, Debug)]
#[diesel(table_name = dockermcmgr::schema::servers)]
#[diesel(table_name = schema::servers)]
#[diesel(check_for_backend(diesel::pg::Pg))]
pub struct Servers {
pub id: i64,
@ -17,17 +18,17 @@ pub struct Servers {
pub last_login: Option<SystemTime>,
pub container_id: Option<String>,
pub status: ServerStatus,
pub redirect_ip: Option<i32>
pub redirect_ip: Option<String>
}
#[derive(Deserialize, Insertable)]
#[diesel(table_name = dockermcmgr::schema::servers)]
#[diesel(table_name = schema::servers)]
pub struct CreateServer<'a> {
pub name: &'a str,
pub volume_path: &'a str,
pub last_login: Option<SystemTime>,
pub container_id: Option<&'a str>,
pub status: ServerStatus,
pub redirect_ip: Option<i32>
pub redirect_ip: Option<&'a str>
}