chore: include DNS forward in notifications

This commit is contained in:
2025-03-05 10:33:16 +00:00
parent d54b05e112
commit b5654a533a

View File

@ -160,14 +160,18 @@ impl Worker {
let user = self.db.get_user(vm.user_id).await?; let user = self.db.get_user(vm.user_id).await?;
let msg = format!( let msg = format!(
"VM #{} been created!\n\nOS: {}\nIPs: {}\n\nNPUB: {}", "VM #{} been created!\n\nOS: {}\n{}\n\nNPUB: {}",
vm.id, vm.id,
image, image,
vm_ips vm_ips
.iter() .iter()
.map(|i| i.to_string()) .map(|i| if let Some(fwd) = &i.dns_forward {
format!("IP: {} ({})", i.ip, fwd)
} else {
format!("IP: {}", i.ip)
})
.collect::<Vec<String>>() .collect::<Vec<String>>()
.join(", "), .join("\n "),
PublicKey::from_slice(&user.pubkey)?.to_bech32()? PublicKey::from_slice(&user.pubkey)?.to_bech32()?
); );
self.tx.send(WorkJob::SendNotification { self.tx.send(WorkJob::SendNotification {