Can create VM from UI
This commit is contained in:
@ -16,7 +16,21 @@ struct StaticConfig {
|
||||
local_auth_enabled: bool,
|
||||
oidc_auth_enabled: bool,
|
||||
iso_mimetypes: &'static [&'static str],
|
||||
constraints: ServerConstraints,
|
||||
}
|
||||
|
||||
#[derive(serde::Serialize)]
|
||||
struct LenConstraints {
|
||||
min: usize,
|
||||
max: usize,
|
||||
}
|
||||
|
||||
#[derive(serde::Serialize)]
|
||||
struct ServerConstraints {
|
||||
iso_max_size: usize,
|
||||
name_size: LenConstraints,
|
||||
title_size: LenConstraints,
|
||||
memory_size: LenConstraints,
|
||||
}
|
||||
|
||||
pub async fn static_config(local_auth: LocalAuthEnabled) -> impl Responder {
|
||||
@ -25,7 +39,16 @@ pub async fn static_config(local_auth: LocalAuthEnabled) -> impl Responder {
|
||||
local_auth_enabled: *local_auth,
|
||||
oidc_auth_enabled: !AppConfig::get().disable_oidc,
|
||||
iso_mimetypes: &constants::ALLOWED_ISO_MIME_TYPES,
|
||||
iso_max_size: constants::ISO_MAX_SIZE,
|
||||
constraints: ServerConstraints {
|
||||
iso_max_size: constants::ISO_MAX_SIZE,
|
||||
|
||||
name_size: LenConstraints { min: 2, max: 50 },
|
||||
title_size: LenConstraints { min: 0, max: 50 },
|
||||
memory_size: LenConstraints {
|
||||
min: constants::MIN_VM_MEMORY,
|
||||
max: constants::MAX_VM_MEMORY,
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user