2 Commits

Author SHA1 Message Date
4bd6f58b1d Update dependency @mui/x-charts to ^8.6.0
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-07-04 00:12:27 +00:00
1dd86807fd Fix cargo clippy issues
All checks were successful
continuous-integration/drone/push Build is passing
2025-07-03 08:01:36 +02:00
10 changed files with 34 additions and 37 deletions

View File

@ -27,10 +27,7 @@ impl LibVirtActor {
/// Connect to hypervisor /// Connect to hypervisor
pub async fn connect() -> anyhow::Result<Self> { pub async fn connect() -> anyhow::Result<Self> {
let hypervisor_uri = AppConfig::get().hypervisor_uri.as_deref().unwrap_or(""); let hypervisor_uri = AppConfig::get().hypervisor_uri.as_deref().unwrap_or("");
log::info!( log::info!("Will connect to hypvervisor at address '{hypervisor_uri}'",);
"Will connect to hypvervisor at address '{}'",
hypervisor_uri
);
let conn = Connect::open(Some(hypervisor_uri))?; let conn = Connect::open(Some(hypervisor_uri))?;
Ok(Self { m: conn }) Ok(Self { m: conn })
@ -102,7 +99,7 @@ impl Handler<GetDomainXMLReq> for LibVirtActor {
log::debug!("Get domain XML:\n{}", msg.0.as_string()); log::debug!("Get domain XML:\n{}", msg.0.as_string());
let domain = Domain::lookup_by_uuid_string(&self.m, &msg.0.as_string())?; let domain = Domain::lookup_by_uuid_string(&self.m, &msg.0.as_string())?;
let xml = domain.get_xml_desc(VIR_DOMAIN_XML_SECURE)?; let xml = domain.get_xml_desc(VIR_DOMAIN_XML_SECURE)?;
log::debug!("XML = {}", xml); log::debug!("XML = {xml}");
DomainXML::parse_xml(&xml) DomainXML::parse_xml(&xml)
} }
} }
@ -131,7 +128,7 @@ impl Handler<DefineDomainReq> for LibVirtActor {
fn handle(&mut self, mut msg: DefineDomainReq, _ctx: &mut Self::Context) -> Self::Result { fn handle(&mut self, mut msg: DefineDomainReq, _ctx: &mut Self::Context) -> Self::Result {
let xml = msg.1.as_xml()?; let xml = msg.1.as_xml()?;
log::debug!("Define domain:\n{}", xml); log::debug!("Define domain:\n{xml}");
let domain = Domain::define_xml(&self.m, &xml)?; let domain = Domain::define_xml(&self.m, &xml)?;
let uuid = XMLUuid::parse_from_str(&domain.get_uuid_string()?)?; let uuid = XMLUuid::parse_from_str(&domain.get_uuid_string()?)?;
@ -446,7 +443,7 @@ impl Handler<GetNetworkXMLReq> for LibVirtActor {
log::debug!("Get network XML:\n{}", msg.0.as_string()); log::debug!("Get network XML:\n{}", msg.0.as_string());
let network = Network::lookup_by_uuid_string(&self.m, &msg.0.as_string())?; let network = Network::lookup_by_uuid_string(&self.m, &msg.0.as_string())?;
let xml = network.get_xml_desc(0)?; let xml = network.get_xml_desc(0)?;
log::debug!("XML = {}", xml); log::debug!("XML = {xml}");
NetworkXML::parse_xml(&xml) NetworkXML::parse_xml(&xml)
} }
} }
@ -602,7 +599,7 @@ impl Handler<GetNWFilterXMLReq> for LibVirtActor {
log::debug!("Get network filter XML:\n{}", msg.0.as_string()); log::debug!("Get network filter XML:\n{}", msg.0.as_string());
let filter = NWFilter::lookup_by_uuid_string(&self.m, &msg.0.as_string())?; let filter = NWFilter::lookup_by_uuid_string(&self.m, &msg.0.as_string())?;
let xml = filter.get_xml_desc(0)?; let xml = filter.get_xml_desc(0)?;
log::debug!("XML = {}", xml); log::debug!("XML = {xml}");
NetworkFilterXML::parse_xml(xml) NetworkFilterXML::parse_xml(xml)
} }
} }
@ -617,7 +614,7 @@ impl Handler<DefineNWFilterReq> for LibVirtActor {
fn handle(&mut self, mut msg: DefineNWFilterReq, _ctx: &mut Self::Context) -> Self::Result { fn handle(&mut self, mut msg: DefineNWFilterReq, _ctx: &mut Self::Context) -> Self::Result {
let xml = msg.1.into_xml()?; let xml = msg.1.into_xml()?;
log::debug!("Define network filter:\n{}", xml); log::debug!("Define network filter:\n{xml}");
let filter = NWFilter::define_xml(&self.m, &xml)?; let filter = NWFilter::define_xml(&self.m, &xml)?;
let uuid = XMLUuid::parse_from_str(&filter.get_uuid_string()?)?; let uuid = XMLUuid::parse_from_str(&filter.get_uuid_string()?)?;

View File

@ -280,7 +280,7 @@ impl AppConfig {
/// Get VM vnc sockets path for domain /// Get VM vnc sockets path for domain
pub fn vnc_socket_for_domain(&self, name: &str) -> PathBuf { pub fn vnc_socket_for_domain(&self, name: &str) -> PathBuf {
self.vnc_sockets_path().join(format!("vnc-{}", name)) self.vnc_sockets_path().join(format!("vnc-{name}"))
} }
/// Get VM root disks storage directory /// Get VM root disks storage directory

View File

@ -34,8 +34,7 @@ pub async fn upload(MultipartForm(mut form): MultipartForm<UploadDiskImageForm>)
if let Some(mime_type) = file.content_type { if let Some(mime_type) = file.content_type {
if !constants::ALLOWED_DISK_IMAGES_MIME_TYPES.contains(&mime_type.as_ref()) { if !constants::ALLOWED_DISK_IMAGES_MIME_TYPES.contains(&mime_type.as_ref()) {
return Ok(HttpResponse::BadRequest().json(format!( return Ok(HttpResponse::BadRequest().json(format!(
"Unsupported file type for disk upload: {}", "Unsupported file type for disk upload: {mime_type}"
mime_type
))); )));
} }
} }

View File

@ -52,7 +52,7 @@ pub async fn upload_file(MultipartForm(mut form): MultipartForm<UploadIsoForm>)
} }
let dest_file = AppConfig::get().iso_storage_path().join(file_name); let dest_file = AppConfig::get().iso_storage_path().join(file_name);
log::info!("Will save ISO file {:?}", dest_file); log::info!("Will save ISO file {dest_file:?}");
if dest_file.exists() { if dest_file.exists() {
log::error!("Conflict with uploaded iso file name!"); log::error!("Conflict with uploaded iso file name!");

View File

@ -43,7 +43,7 @@ impl actix_web::error::ResponseError for HttpErr {
} }
} }
fn error_response(&self) -> HttpResponse<BoxBody> { fn error_response(&self) -> HttpResponse<BoxBody> {
log::error!("Error while processing request! {}", self); log::error!("Error while processing request! {self}");
HttpResponse::InternalServerError().body("Failed to execute request!") HttpResponse::InternalServerError().body("Failed to execute request!")
} }

View File

@ -109,7 +109,7 @@ fn extract_ip_mask<const V: usize>(n: Option<u8>) -> anyhow::Result<Option<u8>>
fn extract_nw_filter_comment(n: &Option<String>) -> anyhow::Result<Option<String>> { fn extract_nw_filter_comment(n: &Option<String>) -> anyhow::Result<Option<String>> {
if let Some(comment) = n { if let Some(comment) = n {
if comment.len() > 256 || comment.contains('\"') || comment.contains('\n') { if comment.len() > 256 || comment.contains('\"') || comment.contains('\n') {
return Err(NetworkFilterExtraction(format!("Invalid comment! {}", comment)).into()); return Err(NetworkFilterExtraction(format!("Invalid comment! {comment}")).into());
} }
} }

View File

@ -69,8 +69,7 @@ where
if !AppConfig::get().is_allowed_ip(remote_ip.0) { if !AppConfig::get().is_allowed_ip(remote_ip.0) {
log::error!( log::error!(
"An attempt to access VirtWeb from an unauthorized network has been intercepted! {:?}", "An attempt to access VirtWeb from an unauthorized network has been intercepted! {remote_ip:?}"
remote_ip
); );
return Ok(req return Ok(req
.into_response( .into_response(

View File

@ -81,10 +81,10 @@ impl CloudInitConfig {
// Process metadata // Process metadata
let mut metadatas = vec![]; let mut metadatas = vec![];
if let Some(inst_id) = &self.instance_id { if let Some(inst_id) = &self.instance_id {
metadatas.push(format!("instance-id: {}", inst_id)); metadatas.push(format!("instance-id: {inst_id}"));
} }
if let Some(local_hostname) = &self.local_hostname { if let Some(local_hostname) = &self.local_hostname {
metadatas.push(format!("local-hostname: {}", local_hostname)); metadatas.push(format!("local-hostname: {local_hostname}"));
} }
if let Some(dsmode) = &self.dsmode { if let Some(dsmode) = &self.dsmode {
metadatas.push(format!( metadatas.push(format!(

View File

@ -16,7 +16,7 @@
"@monaco-editor/react": "^4.7.0", "@monaco-editor/react": "^4.7.0",
"@mui/icons-material": "^7.1.2", "@mui/icons-material": "^7.1.2",
"@mui/material": "^7.1.2", "@mui/material": "^7.1.2",
"@mui/x-charts": "^8.3.1", "@mui/x-charts": "^8.6.0",
"@mui/x-data-grid": "^8.5.3", "@mui/x-data-grid": "^8.5.3",
"date-and-time": "^3.6.0", "date-and-time": "^3.6.0",
"filesize": "^10.1.6", "filesize": "^10.1.6",
@ -1953,15 +1953,15 @@
} }
}, },
"node_modules/@mui/x-charts": { "node_modules/@mui/x-charts": {
"version": "8.3.1", "version": "8.6.0",
"resolved": "https://registry.npmjs.org/@mui/x-charts/-/x-charts-8.3.1.tgz", "resolved": "https://registry.npmjs.org/@mui/x-charts/-/x-charts-8.6.0.tgz",
"integrity": "sha512-jZClK40++ftcMwCeHKudGKmazd0MsgnrIP6RhYi2lH1kg0jK2upueokyxVIIxqquwWsQYE3WsflJBP61DvYXOQ==", "integrity": "sha512-rhgmy6nVfnCLiEarUlwTvjBPmlbV4EoLVV3985OqCoZrAvtr3u4IzqRzrF2hhjO9fCH+SsFejt/0hC9+ZFNTuA==",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@babel/runtime": "^7.27.1", "@babel/runtime": "^7.27.6",
"@mui/utils": "^7.0.2", "@mui/utils": "^7.1.1",
"@mui/x-charts-vendor": "8.3.1", "@mui/x-charts-vendor": "8.5.3",
"@mui/x-internals": "8.3.1", "@mui/x-internals": "8.6.0",
"bezier-easing": "^2.1.0", "bezier-easing": "^2.1.0",
"clsx": "^2.1.1", "clsx": "^2.1.1",
"prop-types": "^15.8.1", "prop-types": "^15.8.1",
@ -1989,12 +1989,12 @@
} }
}, },
"node_modules/@mui/x-charts-vendor": { "node_modules/@mui/x-charts-vendor": {
"version": "8.3.1", "version": "8.5.3",
"resolved": "https://registry.npmjs.org/@mui/x-charts-vendor/-/x-charts-vendor-8.3.1.tgz", "resolved": "https://registry.npmjs.org/@mui/x-charts-vendor/-/x-charts-vendor-8.5.3.tgz",
"integrity": "sha512-UcUa7HDIpSfeVBYgeHewWoVALcB4Gg9we53l78j2cyadYBZOWdtLj8fezo9zAhxfZ5s9T+1yIyuD+CCnYJnUpQ==", "integrity": "sha512-H05cb0c2qfRhWLPcwtiIU8BOcKTrMNvhgmRAvJJXpmlirOA1km8dUlR71VeUvJiCthhVIHKyFkPPzFYKgHAfng==",
"license": "MIT AND ISC", "license": "MIT AND ISC",
"dependencies": { "dependencies": {
"@babel/runtime": "^7.27.1", "@babel/runtime": "^7.27.6",
"@types/d3-color": "^3.1.3", "@types/d3-color": "^3.1.3",
"@types/d3-delaunay": "^6.0.4", "@types/d3-delaunay": "^6.0.4",
"@types/d3-interpolate": "^3.0.4", "@types/d3-interpolate": "^3.0.4",
@ -2073,13 +2073,14 @@
} }
}, },
"node_modules/@mui/x-internals": { "node_modules/@mui/x-internals": {
"version": "8.3.1", "version": "8.6.0",
"resolved": "https://registry.npmjs.org/@mui/x-internals/-/x-internals-8.3.1.tgz", "resolved": "https://registry.npmjs.org/@mui/x-internals/-/x-internals-8.6.0.tgz",
"integrity": "sha512-8kIxT66cea63iEseEIHSWzKju2Wzl7MsWFoAUQEyRvYqOFa2j9Un2Vn/EH2vy9nm/MtMAYpwOE/nt68/KTIA2w==", "integrity": "sha512-ed6IOmnUpm18b607JRTJS+xya731CrQtJKX35l/4TlH8Df1SpkSJsmoyBBmZ09DNX8YNEFpYt5EyfXI28iyM2A==",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@babel/runtime": "^7.27.1", "@babel/runtime": "^7.27.6",
"@mui/utils": "^7.0.2" "@mui/utils": "^7.1.1",
"reselect": "^5.1.1"
}, },
"engines": { "engines": {
"node": ">=14.0.0" "node": ">=14.0.0"
@ -2089,6 +2090,7 @@
"url": "https://opencollective.com/mui-org" "url": "https://opencollective.com/mui-org"
}, },
"peerDependencies": { "peerDependencies": {
"@mui/system": "^5.15.14 || ^6.0.0 || ^7.0.0",
"react": "^17.0.0 || ^18.0.0 || ^19.0.0" "react": "^17.0.0 || ^18.0.0 || ^19.0.0"
} }
}, },

View File

@ -18,7 +18,7 @@
"@monaco-editor/react": "^4.7.0", "@monaco-editor/react": "^4.7.0",
"@mui/icons-material": "^7.1.2", "@mui/icons-material": "^7.1.2",
"@mui/material": "^7.1.2", "@mui/material": "^7.1.2",
"@mui/x-charts": "^8.3.1", "@mui/x-charts": "^8.6.0",
"@mui/x-data-grid": "^8.5.3", "@mui/x-data-grid": "^8.5.3",
"date-and-time": "^3.6.0", "date-and-time": "^3.6.0",
"filesize": "^10.1.6", "filesize": "^10.1.6",