Skip to content

Commit

Permalink
Remove dead code and update project description
Browse files Browse the repository at this point in the history
  • Loading branch information
dormant-user committed Sep 26, 2024
1 parent 81bccac commit 399dc6c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 36 deletions.
12 changes: 5 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"]

Expand All @@ -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"] }
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
28 changes: 0 additions & 28 deletions src/templates/mod.rs
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -23,7 +21,6 @@ mod error;
/// It is also the container for all loaded templates.
pub fn environment() -> Arc<minijinja::Environment<'static>> {
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();
Expand All @@ -32,28 +29,3 @@ pub fn environment() -> Arc<minijinja::Environment<'static>> {
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<Value, minijinja::Error> {
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");
}
}

0 comments on commit 399dc6c

Please sign in to comment.