Skip to content

Commit

Permalink
Release 0.14.1
Browse files Browse the repository at this point in the history
  • Loading branch information
photino committed Oct 14, 2023
1 parent d338229 commit 0c8c6e2
Show file tree
Hide file tree
Showing 14 changed files with 37 additions and 90 deletions.
2 changes: 1 addition & 1 deletion examples/actix-app/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "actix-app"
description = "An example for actix-web integration."
version = "0.3.1"
version = "0.3.2"
rust-version = "1.72"
edition = "2021"
publish = false
Expand Down
4 changes: 2 additions & 2 deletions examples/actix-app/config/config.dev.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# --env=dev

name = "data-cube"
version = "0.6.3"
version = "0.6.4"

[dirs]
uploads = "local/uploads"
Expand Down Expand Up @@ -33,7 +33,7 @@ host = "127.0.0.1"
port = 5432
database = "data_cube"
username = "postgres"
password = "7KlQXgPKdf1pII200zf/0lsod6gOJfrUhiRxCErYvnOyZBHE"
password = "smcddNr2mrpwgYvO6ICRLPFfLFd27WySGN9a7a9JrsYP3tIP"

[[sqlite]]
database = "local/data/main.db"
Expand Down
4 changes: 2 additions & 2 deletions examples/actix-app/config/config.prod.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# --env=prod

name = "data-cube"
version = "0.6.3"
version = "0.6.4"

[dirs]
uploads = "local/uploads"
Expand Down Expand Up @@ -33,7 +33,7 @@ host = "127.0.0.1"
port = 5432
database = "data_cube"
username = "postgres"
password = "nNRimGdBSlhiyiz30LYRKUfawlbfAilO0nuZFw+l3cpKsVUZ"
password = "uzU7eGgSw6HLp63qbjpMQMnl4Kk0SrDDp9bIXkRmcjqwRFRf"

[[sqlite]]
database = "local/data/main.db"
Expand Down
2 changes: 1 addition & 1 deletion examples/axum-app/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "axum-app"
description = "An example for axum integration."
version = "0.9.1"
version = "0.9.2"
rust-version = "1.72"
edition = "2021"
publish = false
Expand Down
4 changes: 2 additions & 2 deletions examples/axum-app/config/config.dev.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# --env=dev

name = "data-cube"
version = "0.6.3"
version = "0.6.4"

[dirs]
uploads = "local/uploads"
Expand Down Expand Up @@ -38,7 +38,7 @@ host = "127.0.0.1"
port = 3306
database = "data_cube"
username = "root"
password = "Wuf4gbfL1R0DRyUbXsMUDm3lwaA"
password = "GCILxF2OoLWjLKgqnSXSFErrmUU"

[[sqlite]]
database = "local/data/main.db"
Expand Down
4 changes: 2 additions & 2 deletions examples/axum-app/config/config.prod.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# --env=prod

name = "data-cube"
version = "0.6.3"
version = "0.6.4"

[dirs]
uploads = "local/uploads"
Expand Down Expand Up @@ -38,7 +38,7 @@ host = "127.0.0.1"
port = 3306
database = "data_cube"
username = "root"
password = "DHdS3+1IR6bLQjLI7pFu3Pu4XGs"
password = "DI9IDtF0Le2ppYzflOaPpL4DvWo"

[[sqlite]]
database = "local/data/main.db"
Expand Down
4 changes: 2 additions & 2 deletions examples/dioxus-desktop/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "dioxus-desktop"
description = "An example for Dioxus desktop integration."
version = "0.0.3"
version = "0.0.4"
rust-version = "1.72"
edition = "2021"
publish = false
Expand All @@ -17,7 +17,7 @@ features = ["derive"]

[dependencies.zino]
path = "../../zino"
version = "0.13.0"
version = "0.13.1"
features = ["dioxus"]

[dependencies.zino-core]
Expand Down
36 changes: 1 addition & 35 deletions examples/dioxus-desktop/config/config.dev.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# --env=dev

name = "data-cube"
version = "0.1.2"
version = "0.1.3"

[dirs]
uploads = "local/uploads"
Expand All @@ -20,37 +20,3 @@ database = "local/data/main.db"

[tracing]
filter = "info,sqlx=info,zino=trace,zino_core=trace"

[metrics]
exporter = "prometheus"
host = "127.0.0.1"
port = 9000

[jwt]
max-age = "20m"
refresh-interval = "7d"

[[connector]]
type = "arrow"
name = "mock"
root = "local/data/mock/"

[[connector.tables]]
type = "csv"
name = "users"
path = "users.csv"

[[connector.tables]]
type = "ndjson"
name = "logs"
url = "http://localhost:6080/public/data/logs.ndjson"

[connector.tables.schema]
timestamp = "string"
level = "string"
fields = { message = "string" }
target = "string"
span = { "http.method" = "string", "http.target" = "string", "http.status_code" = "int" }

[connector.variables]
app-name = "data-cube"
32 changes: 1 addition & 31 deletions examples/dioxus-desktop/config/config.prod.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# --env=prod

name = "data-cube"
version = "0.1.2"
version = "0.1.3"

[dirs]
uploads = "local/uploads"
Expand All @@ -19,33 +19,3 @@ database = "local/data/main.db"

[tracing]
filter = "warn"

[metrics]
exporter = "prometheus"
host = "127.0.0.1"
port = 9000

[[connector]]
type = "arrow"
name = "mock"
root = "local/data/mock/"

[[connector.tables]]
type = "csv"
name = "users"
path = "users.csv"

[[connector.tables]]
type = "ndjson"
name = "logs"
url = "http://localhost:6080/public/data/logs.ndjson"

[connector.tables.schema]
timestamp = "string"
level = "string"
fields = { message = "string" }
target = "string"
span = { "http.method" = "string", "http.target" = "string", "http.status_code" = "int" }

[connector.variables]
app-name = "data-cube"
5 changes: 4 additions & 1 deletion zino-core/src/application/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,10 @@ pub(crate) static PROJECT_DIR: LazyLock<PathBuf> = LazyLock::new(|| {
env::var("CARGO_MANIFEST_DIR")
.map(PathBuf::from)
.unwrap_or_else(|err| {
tracing::warn!("fail to get the environment variable `CARGO_MANIFEST_DIR`: {err}");
tracing::warn!(
"fail to get the environment variable `CARGO_MANIFEST_DIR`: {err}; \
the current directory will be used as the project directory"
);
env::current_dir()
.expect("the project directory does not exist or permissions are insufficient")
})
Expand Down
12 changes: 5 additions & 7 deletions zino-core/src/application/secret_key.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use super::Application;
use crate::{crypto, extension::TomlTableExt};
use std::{env, sync::OnceLock};
use std::{sync::OnceLock};

/// Initializes the secret key.
pub(super) fn init<APP: Application + ?Sized>() {
Expand All @@ -10,12 +10,10 @@ pub(super) fn init<APP: Application + ?Sized>() {
.unwrap_or_else(|| {
tracing::warn!("the `checksum` is not set properly for deriving a secret key");

let pkg_name = env::var("CARGO_PKG_NAME")
.expect("fail to get the environment variable `CARGO_PKG_NAME`");
let pkg_version = env::var("CARGO_PKG_VERSION")
.expect("fail to get the environment variable `CARGO_PKG_VERSION`");
let pkg_key = format!("{pkg_name}@{pkg_version}");
crypto::digest(pkg_key.as_bytes())
let app_name = APP::name();
let app_version = APP::version();
let app_key = format!("{app_name}@{app_version}");
crypto::digest(app_key.as_bytes())
});

let secret_key = crypto::derive_key("ZINO:APPLICATION", &checksum);
Expand Down
4 changes: 2 additions & 2 deletions zino-core/src/helper/str_array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ mod tests {
#[test]
fn it_parses_str_array() {
assert_eq!(
parse_str_array("id,name,array_length(roles,1)->roles_count"),
vec!["id", "name", "array_length(roles,1)->roles_count"],
parse_str_array("id,name,roles_count:array_length(roles,1)"),
vec!["id", "name", "roles_count:array_length(roles,1)"],
);
}
}
1 change: 0 additions & 1 deletion zino-model/src/user/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ pub struct User {
avatar: String,
website: String,
email: String,
gender: String,
location: String,
locale: String,
mobile: String,
Expand Down
13 changes: 12 additions & 1 deletion zino/src/application/dioxus_desktop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,18 @@ where
}
});

let app_env = Self::env();
let app_name = Self::name();
let app_version = Self::version();
let mut window_title = app_name;
let mut app_window = WindowBuilder::new()
.with_title(Self::name())
.with_title(app_name)
.with_maximized(true)
.with_decorations(true);
if let Some(config) = Self::shared_state().get_config("window") {
if let Some(title) = config.get_str("title") {
app_window = app_window.with_title(title);
window_title = title;
}
if let Some(maximizable) = config.get_bool("maximizable") {
app_window = app_window.with_maximizable(maximizable);
Expand All @@ -90,6 +95,12 @@ where
app_window = app_window.with_transparent(transparent);
}
}
tracing::warn!(
app_env,
app_name,
app_version,
"launch a window named `{window_title}`",
);

let app_config = Config::new().with_window(app_window);
dioxus_desktop::launch_with_props(Self::app_root, Self::state_data(), app_config);
Expand Down

0 comments on commit 0c8c6e2

Please sign in to comment.