Logs wireup (#116)

* wireup

* Added live logs

* Finish up wireup

* Run linter

* finish most

* Fix most issues

* Finish page

* run lint

---------

Co-authored-by: Jai A <jaiagr+gpg@pm.me>
Co-authored-by: Geometrically <18202329+Geometrically@users.noreply.github.com>
This commit is contained in:
Adrian O.V
2023-05-17 16:05:20 -04:00
committed by GitHub
parent c6e2133e15
commit 0801d7a145
10 changed files with 336 additions and 192 deletions

View File

@@ -14,8 +14,17 @@ pub struct Logs {
/// Get all Logs for a profile, sorted by datetime
#[tauri::command]
pub async fn logs_get_logs(profile_uuid: Uuid) -> Result<Vec<Logs>> {
Ok(logs::get_logs(profile_uuid).await?)
pub async fn logs_get_logs(
profile_uuid: Uuid,
clear_contents: Option<bool>,
) -> Result<Vec<Logs>> {
use std::time::Instant;
let now = Instant::now();
let val = logs::get_logs(profile_uuid, clear_contents).await?;
let elapsed = now.elapsed();
println!("Elapsed: {:.2?}", elapsed);
Ok(val)
}
/// Get a Log struct for a profile by profile id and datetime string