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/
/jirs-client/target/
/jirs-client/tmp/
/jirs-client/build/
/web/target/
/web/tmp/
/web/build/
/jirs-server/target/
/jirs-server/tmp/

17
Cargo.lock generated
View File

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

View File

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

View File

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

View File

@ -51,7 +51,7 @@ pub fn build_pool() -> DbPool {
dotenv::dotenv().ok();
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()
.max_size(config.concurrency as u32)
.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_json = { version = "*" }
chrono = { version = "*", features = ["serde"] }
uuid = { version = ">=0.7.0, <0.9.0", features = ["serde"] }
uuid = { version = "0.8.2", features = ["serde"] }
[dependencies.actix]
version = "0.10.0"
optional = true
[dependencies.diesel]
version = "1.4.7"
features = [ "postgres", "numeric", "uuidv07", "r2d2" ]
optional = true
version = "*"
features = ["unstable", "postgres", "numeric", "extras", "uuidv07"]
[dependencies.derive_enum_iter]
path = "../../derive/derive_enum_iter"

View File

@ -11,19 +11,22 @@ if [[ "${WASM_PACK_PATH}" == "" ]]; then
fi
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 MODE=force
export BUILD_TYPE=--dev
echo $PROJECT_ROOT
echo $CLIENT_ROOT
cd ${CLIENT_ROOT}
. .env
cargo watch \
-i ./jirs-client/src/location.rs \
-i ${CLIENT_ROOT}/src/location.rs \
-s ${CLIENT_ROOT}/scripts/run-wasm-pack.sh \
-w ${CLIENT_ROOT}/src \
-w ${CLIENT_ROOT}/Cargo.toml \
-w ./static \
-w js
-w ${CLIENT_ROOT}/static \
-w ${CLIENT_ROOT}/js

View File

@ -6,7 +6,7 @@ if [[ "$status" != "0" ]]; then
fi
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 MODE=force
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
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
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}
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

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