This commit is contained in:
Adrian Woźniak 2021-10-05 14:34:20 +02:00
parent 29fe2f8562
commit a13678d98f
No known key found for this signature in database
GPG Key ID: DE43476F72AD3F6C
229 changed files with 42 additions and 50 deletions

View File

@ -82,9 +82,9 @@ fabric.properties
/tmp/ /tmp/
/jirs-client/target/ /web/target/
/jirs-client/tmp/ /web/tmp/
/jirs-client/build/ /web/build/
/jirs-server/target/ /jirs-server/target/
/jirs-server/tmp/ /jirs-server/tmp/

17
Cargo.lock generated
View File

@ -527,9 +527,9 @@ dependencies = [
[[package]] [[package]]
name = "bitflags" name = "bitflags"
version = "1.3.1" version = "1.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2da1976d75adbe5fbc88130ecd119529cf1cc6a93ae1546d8696ee66f0d21af1" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
[[package]] [[package]]
name = "block-buffer" name = "block-buffer"
@ -857,7 +857,7 @@ dependencies = [
"diesel", "diesel",
"dotenv", "dotenv",
"futures", "futures",
"ipnetwork 0.16.0", "ipnetwork",
"jirs-config", "jirs-config",
"jirs-data", "jirs-data",
"libc", "libc",
@ -924,7 +924,7 @@ dependencies = [
"byteorder", "byteorder",
"chrono", "chrono",
"diesel_derives", "diesel_derives",
"ipnetwork 0.18.0", "ipnetwork",
"libc", "libc",
"num-bigint", "num-bigint",
"num-integer", "num-integer",
@ -1670,15 +1670,6 @@ dependencies = [
"serde", "serde",
] ]
[[package]]
name = "ipnetwork"
version = "0.18.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4088d739b183546b239688ddbc79891831df421773df95e236daf7867866d355"
dependencies = [
"serde",
]
[[package]] [[package]]
name = "itertools" name = "itertools"
version = "0.9.0" version = "0.9.0"

View File

@ -27,5 +27,5 @@ members = [
"./actors/amazon-actor", "./actors/amazon-actor",
"./actors/filesystem-actor", "./actors/filesystem-actor",
# Client # Client
"./jirs-client" "./web"
] ]

View File

@ -16,8 +16,8 @@ path = "./src/lib.rs"
common = { path = "../../shared/common" } common = { path = "../../shared/common" }
actix = { version = "0.10.0" } actix = { version = "0.10.0" }
serde = "*" serde = { version = "*" }
bincode = "*" bincode = { version = "*" }
toml = { version = "*" } toml = { version = "*" }
futures = { version = "0.3.8" } futures = { version = "0.3.8" }
@ -29,12 +29,12 @@ r2d2 = { version = ">= 0.8, < 0.9" }
dotenv = { version = "*" } dotenv = { version = "*" }
byteorder = "1.0" byteorder = { version = "1.0" }
chrono = { version = "0.4", features = ["serde"] } chrono = { version = "0.4", features = ["serde"] }
time = { version = "0.1" } time = { version = "0.1" }
url = { version = "2.1.0" } url = { version = "2.1.0" }
percent-encoding = { version = "2.1.0" } percent-encoding = { version = "2.1.0" }
uuid = { version = "0.8.1", features = ["serde", "v4", "v5"] } uuid = { version = "0.8.2", features = ["serde", "v4", "v5"] }
ipnetwork = { version = ">=0.12.2, <0.17.0" } ipnetwork = { version = ">=0.12.2, <0.17.0" }
num-bigint = { version = ">=0.1.41, <0.3" } num-bigint = { version = ">=0.1.41, <0.3" }
num-traits = { version = "0.2" } num-traits = { version = "0.2" }
@ -54,5 +54,5 @@ features = ["backend"]
path = "../../derive/derive_db_execute" path = "../../derive/derive_db_execute"
[dependencies.diesel] [dependencies.diesel]
version = "*" version = "1.4.7"
features = ["unstable", "postgres", "numeric", "extras", "uuidv07"] features = [ "postgres", "numeric", "uuidv07", "r2d2", "extras" ]

View File

@ -51,7 +51,7 @@ pub fn build_pool() -> DbPool {
dotenv::dotenv().ok(); dotenv::dotenv().ok();
let config = jirs_config::database::Configuration::read(); let config = jirs_config::database::Configuration::read();
let manager = ConnectionManager::<PgConnection>::new(config.database_url); let manager = ConnectionManager::<PgConnection>::new(&config.database_url);
r2d2::Pool::builder() r2d2::Pool::builder()
.max_size(config.concurrency as u32) .max_size(config.concurrency as u32)
.build(manager) .build(manager)

View File

@ -1,16 +0,0 @@
#!/usr/bin/env bash
export NODE_ENV=production
rm -Rf dist
mkdir -p dist
cp -R ./dev/* ./dist
yarn svgo -r -o ./dist/ -f ./static
yarn svgo -r -o ./dist/ -f ./js
yarn svgo -r -o ./dist/ -f ./dev
for f in $(ls {js,static,dev}/*.png); do
yarn optipng -dir ./dist -o7 ${f}
done
NODE_ENV=production RUST_LOG=error yarn webpack

View File

@ -20,16 +20,16 @@ frontend = []
serde = { version = "*" } serde = { version = "*" }
serde_json = { version = "*" } serde_json = { version = "*" }
chrono = { version = "*", features = ["serde"] } chrono = { version = "*", features = ["serde"] }
uuid = { version = ">=0.7.0, <0.9.0", features = ["serde"] } uuid = { version = "0.8.2", features = ["serde"] }
[dependencies.actix] [dependencies.actix]
version = "0.10.0" version = "0.10.0"
optional = true optional = true
[dependencies.diesel] [dependencies.diesel]
version = "1.4.7"
features = [ "postgres", "numeric", "uuidv07", "r2d2" ]
optional = true optional = true
version = "*"
features = ["unstable", "postgres", "numeric", "extras", "uuidv07"]
[dependencies.derive_enum_iter] [dependencies.derive_enum_iter]
path = "../../derive/derive_enum_iter" path = "../../derive/derive_enum_iter"

View File

@ -11,19 +11,22 @@ if [[ "${WASM_PACK_PATH}" == "" ]]; then
fi fi
export PROJECT_ROOT=$(git rev-parse --show-toplevel) export PROJECT_ROOT=$(git rev-parse --show-toplevel)
export CLIENT_ROOT=${PROJECT_ROOT}/jirs-client export CLIENT_ROOT=${PROJECT_ROOT}/web
export HI_ROOT=${PROJECT_ROOT}/highlight/jirs-highlight export HI_ROOT=${PROJECT_ROOT}/highlight/jirs-highlight
export MODE=force export MODE=force
export BUILD_TYPE=--dev export BUILD_TYPE=--dev
echo $PROJECT_ROOT
echo $CLIENT_ROOT
cd ${CLIENT_ROOT} cd ${CLIENT_ROOT}
. .env . .env
cargo watch \ cargo watch \
-i ./jirs-client/src/location.rs \ -i ${CLIENT_ROOT}/src/location.rs \
-s ${CLIENT_ROOT}/scripts/run-wasm-pack.sh \ -s ${CLIENT_ROOT}/scripts/run-wasm-pack.sh \
-w ${CLIENT_ROOT}/src \ -w ${CLIENT_ROOT}/src \
-w ${CLIENT_ROOT}/Cargo.toml \ -w ${CLIENT_ROOT}/Cargo.toml \
-w ./static \ -w ${CLIENT_ROOT}/static \
-w js -w ${CLIENT_ROOT}/js

View File

@ -6,7 +6,7 @@ if [[ "$status" != "0" ]]; then
fi fi
export PROJECT_ROOT=$(git rev-parse --show-toplevel) export PROJECT_ROOT=$(git rev-parse --show-toplevel)
export CLIENT_ROOT=${PROJECT_ROOT}/jirs-client export CLIENT_ROOT=${PROJECT_ROOT}/web
export HI_ROOT=${PROJECT_ROOT}/highlight/jirs-highlight export HI_ROOT=${PROJECT_ROOT}/highlight/jirs-highlight
export MODE=force export MODE=force
export BUILD_TYPE=--release export BUILD_TYPE=--release
@ -24,7 +24,7 @@ wasm-pack build --mode normal --release --out-name hi --out-dir $CLIENT_ROOT/bui
cd $CLIENT_ROOT cd $CLIENT_ROOT
rm -Rf ${CLIENT_ROOT}/build/styles.css rm -Rf ${CLIENT_ROOT}/build/styles.css
rsass -t Compressed ${PROJECT_ROOT}/jirs-client/js/styles.css > ${CLIENT_ROOT}/build/styles.css rsass -t Compressed ${PROJECT_ROOT}/web/js/styles.css > ${CLIENT_ROOT}/build/styles.css
cp -r ./static/* ./build cp -r ./static/* ./build
cat ./static/index.js | cat ./static/index.js |

View File

@ -13,7 +13,7 @@ wasm-pack --verbose build --mode ${MODE} ${BUILD_TYPE} --out-name jirs --out-dir
cd ${CLIENT_ROOT} cd ${CLIENT_ROOT}
rm -Rf ${CLIENT_ROOT}/build/styles.css rm -Rf ${CLIENT_ROOT}/build/styles.css
rsass -t Expanded ${PROJECT_ROOT}/jirs-client/js/styles.css >${CLIENT_ROOT}/tmp/styles.css rsass -t Expanded ${PROJECT_ROOT}/web/js/styles.css >${CLIENT_ROOT}/tmp/styles.css
cp -r ${CLIENT_ROOT}/static/* ${CLIENT_ROOT}/tmp cp -r ${CLIENT_ROOT}/static/* ${CLIENT_ROOT}/tmp

14
web/src/location.rs Normal file
View File

@ -0,0 +1,14 @@
pub fn host_url() -> &'static str {
if cfg!(debug_assertions) {
"http://localhost:5000"
} else {
"https://localhost:5000"
}
}
pub fn ws_url() -> &'static str {
if cfg!(debug_assertions) {
"ws://localhost:5000/ws/"
} else {
"wss://localhost:5000/ws/"
}
}

Some files were not shown because too many files have changed in this diff Show More