-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #53 from LSchallot/development
0.6.0 Development
- Loading branch information
Showing
10 changed files
with
441 additions
and
55 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,21 @@ | ||
[package] | ||
name = "jellyroller" | ||
version = "0.5.0" | ||
edition = "2021" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] | ||
clap = { version = "4.3.19", features = ["derive"] } | ||
confy = "0.6.0" | ||
serde = "1.0.144" | ||
serde_derive = "1.0.144" | ||
serde_json = "1.0.85" | ||
reqwest = { version = "0.12.4", features = ["blocking", "json", "rustls-tls"], default-features = false } | ||
rpassword = "7.3.1" | ||
url = "2.2.2" | ||
comfy-table = "7.0.1" | ||
image = "0.25.1" | ||
base64 = "0.22.1" | ||
[package] | ||
name = "jellyroller" | ||
version = "0.6.0" | ||
edition = "2021" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] | ||
chrono = "0.4.39" | ||
clap = { version = "4.3.19", features = ["derive"] } | ||
confy = "0.6.0" | ||
serde = "1.0.144" | ||
serde_derive = "1.0.144" | ||
serde_json = "1.0.85" | ||
reqwest = { version = "0.12.4", features = ["blocking", "json", "rustls-tls"], default-features = false } | ||
rpassword = "7.3.1" | ||
url = "2.2.2" | ||
comfy-table = "7.0.1" | ||
image = "0.25.1" | ||
base64 = "0.22.1" | ||
csv = "1.3.1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
use comfy_table::{ Table, ContentArrangement }; | ||
pub type PackageDetailsRoot = Vec<PackageDetails>; | ||
|
||
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] | ||
#[serde(rename_all = "camelCase")] | ||
pub struct PackageDetails { | ||
pub name: String, | ||
pub description: String, | ||
pub overview: String, | ||
pub owner: String, | ||
pub category: String, | ||
pub guid: String, | ||
pub versions: Vec<Version>, | ||
#[serde(default)] | ||
pub image_url: String, | ||
} | ||
|
||
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] | ||
#[serde(rename_all = "camelCase")] | ||
pub struct Version { | ||
pub version: String, | ||
#[serde(rename = "VersionNumber")] | ||
pub version_number: String, | ||
pub changelog: String, | ||
pub target_abi: String, | ||
pub source_url: String, | ||
pub checksum: String, | ||
pub timestamp: String, | ||
pub repository_name: String, | ||
pub repository_url: String, | ||
} | ||
|
||
impl PackageDetails { | ||
pub fn json_print(packages: &[PackageDetails]) { | ||
println!("{}", serde_json::to_string_pretty(&packages).unwrap()); | ||
} | ||
|
||
pub fn table_print(packages: Vec<PackageDetails>) { | ||
let mut table = Table::new(); | ||
table | ||
.set_content_arrangement(ContentArrangement::Dynamic) | ||
.set_width(120) | ||
.set_header(vec!["Name", "Description", "Overview", "Owner", "GUID", "Category", "Versions"]); | ||
for package in packages { | ||
let mut version_output: String = "".to_string(); | ||
for version in package.versions { | ||
version_output.push_str(version.version.as_str()); | ||
version_output.push(' '); | ||
} | ||
table.add_row(vec![package.name, package.description, package.overview, package.owner, package.guid, package.category, version_output]); | ||
} | ||
println!("{table}"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
use comfy_table::{ Table, ContentArrangement }; | ||
|
||
pub type RepositoryDetailsRoot = Vec<RepositoryDetails>; | ||
|
||
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] | ||
#[serde(rename_all = "camelCase")] | ||
pub struct RepositoryDetails { | ||
#[serde(rename = "Name")] | ||
pub name: String, | ||
#[serde(rename = "Url")] | ||
pub url: String, | ||
#[serde(rename = "Enabled")] | ||
pub enabled: bool, | ||
} | ||
|
||
impl RepositoryDetails { | ||
pub fn new (name: String, url: String, enabled: bool) -> RepositoryDetails { | ||
RepositoryDetails { | ||
name, | ||
url, | ||
enabled | ||
} | ||
} | ||
|
||
pub fn json_print(repos: &[RepositoryDetails]) { | ||
println!("{}", serde_json::to_string_pretty(&repos).unwrap()); | ||
} | ||
|
||
pub fn table_print(repos: Vec<RepositoryDetails>) { | ||
let mut table = Table::new(); | ||
table | ||
.set_content_arrangement(ContentArrangement::Dynamic) | ||
.set_width(120) | ||
.set_header(vec!["Plugin Name", "Version", "Config Filename", "Description", "Id", "Can Uninstall", "Image", "Status"]); | ||
for repo in repos { | ||
table.add_row(vec![repo.name, repo.url, repo.enabled.to_string()]); | ||
|
||
} | ||
println!("{table}"); | ||
} | ||
} |
Oops, something went wrong.