From 399dc6c202bbf74609102398ff1ebbc46b675324 Mon Sep 17 00:00:00 2001 From: Vignesh Rao Date: Thu, 26 Sep 2024 11:39:03 -0500 Subject: [PATCH] Remove dead code and update project description --- Cargo.toml | 12 +++++------- README.md | 2 +- src/templates/mod.rs | 28 ---------------------------- 3 files changed, 6 insertions(+), 36 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index b59b516..47d0653 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,16 +1,16 @@ [package] name = "SysMonk" version = "0.0.1" -description = "Sytem Monitor is a Rust based CLI tool to monitor system resources." +description = "SysMonk is a highly efficient, lightweight API for resource monitoring that uses WebSockets for real-time streaming." license = "MIT" documentation = "https://docs.rs/SysMonk" homepage = "https://github.com/thevickypedia/SysMonk" repository = "https://github.com/thevickypedia/SysMonk" rust-version = "1.81.0" -keywords = ["asynchronous-server", "SysMonk", "cli-tool", "system-resources"] -categories = ["web-programming::http-server", "asynchronous", "algorithms", "authentication"] -include = ["/src", "LICENSE"] -exclude = [".github", ".gitignore", "README.md"] +keywords = ["asynchronous-server", "SysMonk", "system-resources", "monitoring", "websockets"] +categories = ["web-programming::http-server", "web-programming::websocket", "asynchronous", "algorithms", "authentication"] +include = ["/src", "LICENSE", "README.md"] +exclude = [".github", ".gitignore"] edition = "2021" authors = ["Vignesh Rao"] @@ -30,9 +30,7 @@ actix = "0.13.5" actix-rt = "2.10.0" actix-web = { version = "4.9.0", features = ["openssl"] } actix-ws = "0.3.0" -actix-files = "0.6.6" actix-cors = "0.7.0" -actix-multipart = "0.7.2" serde = { version = "1.0.210", features = ["derive"] } serde_json = "1.0.128" chrono = { version = "0.4.38", features = ["serde"] } diff --git a/README.md b/README.md index 2f67c1e..d3c5ee5 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ [![none-shall-pass][nsp-logo]][nsp] #### Summary -[`SysMonk`][repo] is a system monitoring tool that provides a simple and easy-to-use interface to monitor system resources. It is designed to be lightweight and fast. +[`SysMonk`][repo] is a highly efficient, lightweight API for resource monitoring that uses WebSockets for real-time streaming. ### Installation diff --git a/src/templates/mod.rs b/src/templates/mod.rs index 904b359..7d78b77 100644 --- a/src/templates/mod.rs +++ b/src/templates/mod.rs @@ -1,5 +1,3 @@ -use crate::squire; -use minijinja::value::Value; use std::sync::Arc; /// Index page template that is served as HTML response for the root endpoint. @@ -23,7 +21,6 @@ mod error; /// It is also the container for all loaded templates. pub fn environment() -> Arc> { let mut env = minijinja::Environment::new(); - // env.add_filter("capwords", capwords_filter); env.add_template_owned("index", index::get_content()).unwrap(); env.add_template_owned("monitor", monitor::get_content()).unwrap(); env.add_template_owned("logout", logout::get_content()).unwrap(); @@ -32,28 +29,3 @@ pub fn environment() -> Arc> { env.add_template_owned("unauthorized", unauthorized::get_content()).unwrap(); Arc::new(env) } - -/// Capitalizes the first character of each word in a string. -/// -/// # Arguments -/// -/// * `value` - A `Value` object that holds the string to be capitalized. -/// -/// # Returns -/// -/// Returns the `Value` object with the capitalized string. -#[allow(dead_code)] -fn capwords_filter(value: Value) -> Result { - if let Some(val) = value.as_str() { - if val.ends_with("_raw") { - let parts: Vec<&str> = val.split('_').collect(); - let result = parts[..parts.len() - 1].join(" "); - Ok(Value::from(result)) - } else { - let result = val.replace("_", " "); - Ok(Value::from(squire::util::capwords(&result, None))) - } - } else { - panic!("capwords filter only works with strings"); - } -}