fix: enhance code content display with syntax highlighting and improve logging structure

This commit is contained in:
2026-01-12 16:14:47 +01:00
parent 1b295aa843
commit 0685de8ffa
5 changed files with 86 additions and 21 deletions

View File

@@ -7,7 +7,6 @@ use futures::lock::Mutex;
use serde::{Deserialize, Serialize};
use serde_json::Value;
use crate::DATA_STORAGE;
use crate::logs::{LogEventType, log_event};
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
@@ -87,13 +86,13 @@ impl Asset {
serde_json::to_value(self).unwrap_or(Value::Null)
}
pub fn save(&self) -> Result<String> {
let id = self.id.clone();
let path = format!("{}{}", DATA_STORAGE, self.id);
std::fs::create_dir_all(DATA_STORAGE)?;
std::fs::write(&path, self.to_bytes()?)?;
Ok(id)
}
// pub fn save(&self) -> Result<String> {
// let id = self.id.clone();
// let path = format!("{}{}", DATA_STORAGE, self.id);
// std::fs::create_dir_all(DATA_STORAGE)?;
// std::fs::write(&path, self.to_bytes()?)?;
// Ok(id)
// }
}
#[derive(Clone)]