diff --git a/.cargo/config.toml b/.cargo/config.toml index ca333857a..a52d5a685 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -1,3 +1,6 @@ # Windows has stack overflows when calling from Tauri, so we increase compiler size [target.'cfg(windows)'] rustflags = ["-C", "link-args=/STACK:16777220"] + +[build] +rustflags = ["--cfg", "tokio_unstable"] \ No newline at end of file diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..6313b56c5 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +* text=auto eol=lf diff --git a/.github/workflows/labrinth-docker.yml b/.github/workflows/labrinth-docker.yml index 6f4080254..1ed8e9685 100644 --- a/.github/workflows/labrinth-docker.yml +++ b/.github/workflows/labrinth-docker.yml @@ -38,8 +38,10 @@ jobs: - name: Build and push id: docker_build uses: docker/build-push-action@v2 + env: + SQLX_OFFLINE: true with: - context: ./apps/labrinth + file: ./apps/labrinth/Dockerfile push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.docker_meta.outputs.tags }} labels: ${{ steps.docker_meta.outputs.labels }} diff --git a/.github/workflows/theseus-release.yml b/.github/workflows/theseus-release.yml index 4cc9a98cd..a34f5ae17 100644 --- a/.github/workflows/theseus-release.yml +++ b/.github/workflows/theseus-release.yml @@ -6,9 +6,11 @@ on: tags: - 'v*' paths: - - .github/workflows/app-release.yml + - .github/workflows/theseus-release.yml - 'apps/app/**' - 'apps/app-frontend/**' + - 'apps/labrinth/src/common/**' + - 'apps/labrinth/Cargo.toml' - 'packages/app-lib/**' - 'packages/app-macros/**' - 'packages/assets/**' diff --git a/.idea/code.iml b/.idea/code.iml index 70105a514..a4489beac 100644 --- a/.idea/code.iml +++ b/.idea/code.iml @@ -10,9 +10,11 @@ + + - + \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index 8dffdfd5a..55f13a32d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -265,9 +265,9 @@ dependencies = [ [[package]] name = "actix-web-prom" -version = "0.8.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76743e67d4e7efa9fc2ac7123de0dd7b2ca592668e19334f1d81a3b077afc6ac" +checksum = "56a34f1825c3ae06567a9d632466809bbf34963c86002e8921b64f32d48d289d" dependencies = [ "actix-web", "futures-core", @@ -393,6 +393,55 @@ dependencies = [ "libc", ] +[[package]] +name = "anstream" +version = "0.6.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8acc5369981196006228e28809f761875c0327210a891e941f4c683b3a99529b" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is_terminal_polyfill", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9" + +[[package]] +name = "anstyle-parse" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b2d16507662817a6a20a9ea92df6652ee4f94f914589377d69f3b21bc5798a9" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79947af37f4177cfead1110013d678905c37501914fba0efea834c3fe9a8d60c" +dependencies = [ + "windows-sys 0.59.0", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2109dbce0e72be3ec00bed26e6a7479ca384ad226efdd66db8fa2e3a38c83125" +dependencies = [ + "anstyle", + "windows-sys 0.59.0", +] + [[package]] name = "anyhow" version = "1.0.89" @@ -426,6 +475,21 @@ dependencies = [ "password-hash 0.5.0", ] +[[package]] +name = "ariadne" +version = "0.1.0" +dependencies = [ + "chrono", + "either", + "rand 0.8.5", + "serde", + "serde_bytes", + "serde_cbor", + "serde_json", + "thiserror 1.0.64", + "uuid 1.12.0", +] + [[package]] name = "arrayvec" version = "0.7.6" @@ -616,6 +680,28 @@ dependencies = [ "windows-sys 0.59.0", ] +[[package]] +name = "async-stream" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b5a71a6f37880a80d1d7f19efd781e4b5de42c88f0722cc13bcb6cc2cfe8476" +dependencies = [ + "async-stream-impl", + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "async-stream-impl" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.90", +] + [[package]] name = "async-stripe" version = "0.39.1" @@ -778,6 +864,53 @@ dependencies = [ "thiserror 1.0.64", ] +[[package]] +name = "axum" +version = "0.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edca88bc138befd0323b20752846e6587272d3b03b0343c8ea28a6f819e6e71f" +dependencies = [ + "async-trait", + "axum-core", + "bytes 1.7.2", + "futures-util", + "http 1.1.0", + "http-body 1.0.1", + "http-body-util", + "itoa 1.0.11", + "matchit", + "memchr", + "mime", + "percent-encoding", + "pin-project-lite", + "rustversion", + "serde", + "sync_wrapper 1.0.1", + "tower 0.5.2", + "tower-layer", + "tower-service", +] + +[[package]] +name = "axum-core" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09f2bd6146b97ae3359fa0cc6d6b376d9539582c7b4220f041a33ec24c226199" +dependencies = [ + "async-trait", + "bytes 1.7.2", + "futures-util", + "http 1.1.0", + "http-body 1.0.1", + "http-body-util", + "mime", + "pin-project-lite", + "rustversion", + "sync_wrapper 1.0.1", + "tower-layer", + "tower-service", +] + [[package]] name = "backtrace" version = "0.3.74" @@ -1204,7 +1337,7 @@ checksum = "d38f2da7a0a2c4ccf0065be06397cc26a81f4e528be095826eee9d4adbb8c60f" dependencies = [ "byteorder", "fnv", - "uuid 1.10.0", + "uuid 1.12.0", ] [[package]] @@ -1270,6 +1403,46 @@ dependencies = [ "inout", ] +[[package]] +name = "clap" +version = "4.5.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "027bb0d98429ae334a8698531da7077bdf906419543a35a55c2cb1b66437d767" +dependencies = [ + "clap_builder", + "clap_derive", +] + +[[package]] +name = "clap_builder" +version = "4.5.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5589e0cba072e0f3d23791efac0fd8627b49c829c196a492e88168e6a669d863" +dependencies = [ + "anstream", + "anstyle", + "clap_lex", + "strsim 0.11.1", +] + +[[package]] +name = "clap_derive" +version = "4.5.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf4ced95c6f4a675af3da73304b9ac4ed991640c36374e4b46795c49e17cf1ed" +dependencies = [ + "heck 0.5.0", + "proc-macro2", + "quote", + "syn 2.0.90", +] + +[[package]] +name = "clap_lex" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6" + [[package]] name = "clickhouse" version = "0.11.6" @@ -1291,7 +1464,7 @@ dependencies = [ "time", "tokio 1.42.0", "url", - "uuid 1.10.0", + "uuid 1.12.0", ] [[package]] @@ -1399,6 +1572,12 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" +[[package]] +name = "colorchoice" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" + [[package]] name = "combine" version = "4.6.7" @@ -1435,6 +1614,45 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "console-api" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8030735ecb0d128428b64cd379809817e620a40e5001c54465b99ec5feec2857" +dependencies = [ + "futures-core", + "prost", + "prost-types", + "tonic", + "tracing-core", +] + +[[package]] +name = "console-subscriber" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6539aa9c6a4cd31f4b1c040f860a1eac9aa80e7df6b05d506a6e7179936d6a01" +dependencies = [ + "console-api", + "crossbeam-channel", + "crossbeam-utils 0.8.20", + "futures-task", + "hdrhistogram", + "humantime", + "hyper-util", + "prost", + "prost-types", + "serde", + "serde_json", + "thread_local", + "tokio 1.42.0", + "tokio-stream", + "tonic", + "tracing", + "tracing-core", + "tracing-subscriber", +] + [[package]] name = "const-oid" version = "0.9.6" @@ -1995,7 +2213,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef552e6f588e446098f6ba40d89ac146c8c7b64aade83c051ee00bb5d2bc18d" dependencies = [ "serde", - "uuid 1.10.0", + "uuid 1.12.0", ] [[package]] @@ -2427,16 +2645,22 @@ dependencies = [ ] [[package]] -name = "env_logger" -version = "0.10.2" +name = "env_filter" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cd405aab171cb85d6735e5c8d9db038c17d3ca007a4d2c25f337935c3d90580" +checksum = "186e05a59d4c50738528153b83b0b0194d3a29507dfec16eccd4b342903397d0" dependencies = [ - "humantime", - "is-terminal", "log", - "regex", - "termcolor", +] + +[[package]] +name = "env_logger" +version = "0.11.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcaee3d8e3cfc3fd92428d477bc97fc29ec8716d180c0d74c643bb26166660e0" +dependencies = [ + "env_filter", + "log", ] [[package]] @@ -2511,7 +2735,7 @@ checksum = "887d93f60543e9a9362ef8a21beedd0a833c5d9610e18c67abe15a5963dcb1a4" dependencies = [ "bit_field", "flume", - "half", + "half 2.4.1", "lebe", "miniz_oxide 0.7.4", "rayon-core", @@ -3242,6 +3466,12 @@ dependencies = [ "tracing", ] +[[package]] +name = "half" +version = "1.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b43ede17f21864e81be2fa654110bf1e793774238d86ef8555c37e6519c0403" + [[package]] name = "half" version = "2.4.1" @@ -3280,6 +3510,19 @@ dependencies = [ "hashbrown 0.14.5", ] +[[package]] +name = "hdrhistogram" +version = "7.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "765c9198f173dd59ce26ff9f95ef0aafd0a0fe01fb9d72841bc5066a4c06511d" +dependencies = [ + "base64 0.21.7", + "byteorder", + "flate2", + "nom", + "num-traits", +] + [[package]] name = "heck" version = "0.3.3" @@ -3519,6 +3762,7 @@ dependencies = [ "http 1.1.0", "http-body 1.0.1", "httparse", + "httpdate", "itoa 1.0.11", "pin-project-lite", "smallvec 1.13.2", @@ -3561,6 +3805,19 @@ dependencies = [ "webpki-roots 0.26.6", ] +[[package]] +name = "hyper-timeout" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b90d566bffbce6a75bd8b09a05aa8c2cb1fabb6cb348f8840c9e4c90a0d83b0" +dependencies = [ + "hyper 1.4.1", + "hyper-util", + "pin-project-lite", + "tokio 1.42.0", + "tower-service", +] + [[package]] name = "hyper-tls" version = "0.5.0" @@ -3592,9 +3849,9 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.9" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41296eb09f183ac68eec06e03cdbea2e759633d4067b2f6552fc2e009bcad08b" +checksum = "df2dcfbe0677734ab2f3ffa7fa7bfd4706bfdc1ef393f2ee30184aed67e631b4" dependencies = [ "bytes 1.7.2", "futures-channel", @@ -3889,6 +4146,28 @@ dependencies = [ "cfb", ] +[[package]] +name = "inferno" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "692eda1cc790750b9f5a5e3921ef9c117fd5498b97cfacbc910693e5b29002dc" +dependencies = [ + "ahash 0.8.11", + "clap", + "crossbeam-channel", + "crossbeam-utils 0.8.20", + "dashmap 6.1.0", + "env_logger", + "indexmap 2.5.0", + "itoa 1.0.11", + "log", + "num-format", + "once_cell", + "quick-xml 0.37.2", + "rgb", + "str_stack", +] + [[package]] name = "inotify" version = "0.9.6" @@ -3981,6 +4260,12 @@ dependencies = [ "once_cell", ] +[[package]] +name = "is_terminal_polyfill" +version = "1.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" + [[package]] name = "iso8601" version = "0.6.1" @@ -4062,23 +4347,20 @@ dependencies = [ ] [[package]] -name = "jemalloc-sys" -version = "0.5.4+5.3.0-patched" +name = "jemalloc_pprof" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac6c1946e1cea1788cbfde01c993b52a10e2da07f4bac608228d1bed20bfebf2" +checksum = "5622af6d21ff86ed7797ef98e11b8f302da25ec69a7db9f6cde8e2e1c8df9992" dependencies = [ - "cc", - "libc", -] - -[[package]] -name = "jemallocator" -version = "0.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0de374a9f8e63150e6f5e8a60cc14c668226d7a347d8aee1a45766e3c4dd3bc" -dependencies = [ - "jemalloc-sys", + "anyhow", "libc", + "mappings", + "once_cell", + "pprof_util", + "tempfile", + "tikv-jemalloc-ctl", + "tokio 1.42.0", + "tracing", ] [[package]] @@ -4232,6 +4514,7 @@ dependencies = [ "actix-web-prom", "actix-ws", "argon2", + "ariadne", "async-stripe", "async-trait", "base64 0.21.7", @@ -4241,11 +4524,12 @@ dependencies = [ "chrono", "clickhouse", "color-thief", + "console-subscriber", "dashmap 5.5.3", "deadpool-redis", "derive-new", "dotenvy", - "env_logger", + "either", "flate2", "futures 0.3.30", "futures-timer", @@ -4257,14 +4541,14 @@ dependencies = [ "hyper-tls 0.5.0", "image 0.24.9", "itertools 0.12.1", - "jemallocator", + "jemalloc_pprof", "json-patch", "lazy_static", "lettre", - "log", "maxminddb", "meilisearch-sdk", "murmur2", + "prometheus", "rand 0.8.5", "rand_chacha 0.3.1", "redis", @@ -4277,6 +4561,8 @@ dependencies = [ "sentry", "sentry-actix", "serde", + "serde_bytes", + "serde_cbor", "serde_json", "serde_with", "sha1 0.6.1", @@ -4285,12 +4571,17 @@ dependencies = [ "sqlx", "tar", "thiserror 1.0.64", + "tikv-jemalloc-ctl", + "tikv-jemallocator", "tokio 1.42.0", "tokio-stream", "totp-rs", + "tracing", + "tracing-actix-web", + "tracing-subscriber", "url", "urlencoding", - "uuid 1.10.0", + "uuid 1.12.0", "validator", "webp", "woothee", @@ -4549,6 +4840,19 @@ dependencies = [ "libc", ] +[[package]] +name = "mappings" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e434981a332777c2b3062652d16a55f8e74fa78e6b1882633f0d77399c84fc2a" +dependencies = [ + "anyhow", + "libc", + "once_cell", + "pprof_util", + "tracing", +] + [[package]] name = "markup5ever" version = "0.11.0" @@ -4578,6 +4882,12 @@ version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5" +[[package]] +name = "matchit" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" + [[package]] name = "maxminddb" version = "0.24.0" @@ -4657,7 +4967,7 @@ dependencies = [ "serde_json", "thiserror 1.0.64", "time", - "uuid 1.10.0", + "uuid 1.12.0", "wasm-bindgen-futures", "web-sys", "yaup", @@ -4836,6 +5146,12 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fb585ade2549a017db2e35978b77c319214fa4b37cede841e27954dd6e8f3ca8" +[[package]] +name = "mutually_exclusive_features" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e94e1e6445d314f972ff7395df2de295fe51b71821694f0b0e1e79c4f12c8577" + [[package]] name = "native-dialog" version = "0.7.0" @@ -5021,6 +5337,20 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "num" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35bd024e8b2ff75562e5f34e7f4905839deb4b22955ef5e73d2fea1b9813cb23" +dependencies = [ + "num-bigint", + "num-complex", + "num-integer", + "num-iter", + "num-rational", + "num-traits", +] + [[package]] name = "num-bigint" version = "0.4.6" @@ -5048,12 +5378,31 @@ dependencies = [ "zeroize", ] +[[package]] +name = "num-complex" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" +dependencies = [ + "num-traits", +] + [[package]] name = "num-conv" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" +[[package]] +name = "num-format" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a652d9771a63711fd3c3deb670acfbe5c30a4072e664d7a3bf5a9e1056ac72c3" +dependencies = [ + "arrayvec", + "itoa 1.0.11", +] + [[package]] name = "num-integer" version = "0.1.46" @@ -5074,6 +5423,17 @@ dependencies = [ "num-traits", ] +[[package]] +name = "num-rational" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" +dependencies = [ + "num-bigint", + "num-integer", + "num-traits", +] + [[package]] name = "num-traits" version = "0.2.19" @@ -5967,6 +6327,21 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" +[[package]] +name = "pprof_util" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fa015c78eed2130951e22c58d2095849391e73817ab2e74f71b0b9f63dd8416" +dependencies = [ + "anyhow", + "backtrace", + "flate2", + "inferno", + "num", + "paste", + "prost", +] + [[package]] name = "ppv-lite86" version = "0.2.20" @@ -6108,9 +6483,48 @@ dependencies = [ "memchr", "parking_lot 0.12.3", "procfs", + "protobuf", "thiserror 1.0.64", ] +[[package]] +name = "prost" +version = "0.13.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2796faa41db3ec313a31f7624d9286acf277b52de526150b7e69f3debf891ee5" +dependencies = [ + "bytes 1.7.2", + "prost-derive", +] + +[[package]] +name = "prost-derive" +version = "0.13.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a56d757972c98b346a9b766e3f02746cde6dd1cd1d1d563472929fdd74bec4d" +dependencies = [ + "anyhow", + "itertools 0.13.0", + "proc-macro2", + "quote", + "syn 2.0.90", +] + +[[package]] +name = "prost-types" +version = "0.13.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52c2c1bf36ddb1a1c396b3601a3cec27c2462e45f07c386894ec3ccf5332bd16" +dependencies = [ + "prost", +] + +[[package]] +name = "protobuf" +version = "2.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "106dd99e98437432fed6519dedecfade6a06a73bb7b2a1e019fdd2bee5778d94" + [[package]] name = "psm" version = "0.1.23" @@ -6207,6 +6621,15 @@ dependencies = [ "memchr", ] +[[package]] +name = "quick-xml" +version = "0.37.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "165859e9e55f79d67b96c5d96f4e88b6f2695a1972849c15a6a3f5c59fc2c003" +dependencies = [ + "memchr", +] + [[package]] name = "quinn" version = "0.11.5" @@ -6724,7 +7147,7 @@ dependencies = [ "rkyv_derive", "seahash", "tinyvec", - "uuid 1.10.0", + "uuid 1.12.0", ] [[package]] @@ -7108,7 +7531,7 @@ dependencies = [ "serde", "serde_json", "url", - "uuid 1.10.0", + "uuid 1.12.0", ] [[package]] @@ -7361,7 +7784,7 @@ dependencies = [ "thiserror 1.0.64", "time", "url", - "uuid 1.10.0", + "uuid 1.12.0", ] [[package]] @@ -7396,6 +7819,25 @@ dependencies = [ "xml-rs", ] +[[package]] +name = "serde_bytes" +version = "0.11.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "387cc504cb06bb40a96c8e04e951fe01854cf6bc921053c954e4a606d9675c6a" +dependencies = [ + "serde", +] + +[[package]] +name = "serde_cbor" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bef2ebfde456fb76bbcf9f59315333decc4fda0b2b44b420243c11e0f5ec1f5" +dependencies = [ + "half 1.8.3", + "serde", +] + [[package]] name = "serde_derive" version = "1.0.210" @@ -8099,6 +8541,12 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" +[[package]] +name = "str_stack" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9091b6114800a5f2141aee1d1b9d6ca3592ac062dc5decb3764ec5895a47b4eb" + [[package]] name = "strfmt" version = "0.2.4" @@ -8536,7 +8984,7 @@ dependencies = [ "thiserror 2.0.7", "time", "url", - "uuid 1.10.0", + "uuid 1.12.0", "walkdir", ] @@ -8629,7 +9077,7 @@ dependencies = [ "thiserror 2.0.7", "toml 0.8.19", "url", - "uuid 1.10.0", + "uuid 1.12.0", ] [[package]] @@ -8810,7 +9258,7 @@ dependencies = [ "toml 0.8.19", "url", "urlpattern", - "uuid 1.10.0", + "uuid 1.12.0", "walkdir", ] @@ -8859,19 +9307,11 @@ dependencies = [ "winapi 0.3.9", ] -[[package]] -name = "termcolor" -version = "1.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" -dependencies = [ - "winapi-util", -] - [[package]] name = "theseus" -version = "0.9.2" +version = "0.9.3" dependencies = [ + "ariadne", "async-recursion", "async-tungstenite", "async_zip", @@ -8884,6 +9324,7 @@ dependencies = [ "dirs 5.0.1", "discord-rich-presence", "dunce", + "either", "flate2", "futures 0.3.30", "indicatif", @@ -8913,7 +9354,7 @@ dependencies = [ "tracing-subscriber", "url", "urlencoding", - "uuid 1.10.0", + "uuid 1.12.0", "whoami", "winreg 0.52.0", "zip 0.6.6", @@ -8921,7 +9362,7 @@ dependencies = [ [[package]] name = "theseus_gui" -version = "0.9.2" +version = "0.9.3" dependencies = [ "chrono", "cocoa 0.25.0", @@ -8955,7 +9396,7 @@ dependencies = [ "tracing", "tracing-error", "url", - "uuid 1.10.0", + "uuid 1.12.0", "window-shadows", ] @@ -8974,7 +9415,7 @@ dependencies = [ "tracing-error", "tracing-subscriber", "url", - "uuid 1.10.0", + "uuid 1.12.0", "webbrowser", ] @@ -9045,6 +9486,37 @@ dependencies = [ "weezl", ] +[[package]] +name = "tikv-jemalloc-ctl" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f21f216790c8df74ce3ab25b534e0718da5a1916719771d3fec23315c99e468b" +dependencies = [ + "libc", + "paste", + "tikv-jemalloc-sys", +] + +[[package]] +name = "tikv-jemalloc-sys" +version = "0.6.0+5.3.0-1-ge13ca993e8ccb9ba9847cc330696e02839f328f7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd3c60906412afa9c2b5b5a48ca6a5abe5736aec9eb48ad05037a677e52e4e2d" +dependencies = [ + "cc", + "libc", +] + +[[package]] +name = "tikv-jemallocator" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cec5ff18518d81584f477e9bfdf957f5bb0979b0bac3af4ca30b5b3ae2d2865" +dependencies = [ + "libc", + "tikv-jemalloc-sys", +] + [[package]] name = "time" version = "0.3.36" @@ -9448,6 +9920,36 @@ dependencies = [ "winnow 0.6.20", ] +[[package]] +name = "tonic" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877c5b330756d856ffcc4553ab34a5684481ade925ecc54bcd1bf02b1d0d4d52" +dependencies = [ + "async-stream", + "async-trait", + "axum", + "base64 0.22.1", + "bytes 1.7.2", + "h2 0.4.6", + "http 1.1.0", + "http-body 1.0.1", + "http-body-util", + "hyper 1.4.1", + "hyper-timeout", + "hyper-util", + "percent-encoding", + "pin-project", + "prost", + "socket2", + "tokio 1.42.0", + "tokio-stream", + "tower 0.4.13", + "tower-layer", + "tower-service", + "tracing", +] + [[package]] name = "totp-rs" version = "5.6.0" @@ -9462,6 +9964,46 @@ dependencies = [ "sha2 0.10.8", ] +[[package]] +name = "tower" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" +dependencies = [ + "futures-core", + "futures-util", + "indexmap 1.9.3", + "pin-project", + "pin-project-lite", + "rand 0.8.5", + "slab", + "tokio 1.42.0", + "tokio-util", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "tower" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d039ad9159c98b70ecfd540b2573b97f7f52c3e8d9f8ad57a24b916a536975f9" +dependencies = [ + "futures-core", + "futures-util", + "pin-project-lite", + "sync_wrapper 1.0.1", + "tower-layer", + "tower-service", +] + +[[package]] +name = "tower-layer" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" + [[package]] name = "tower-service" version = "0.3.3" @@ -9470,9 +10012,9 @@ checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tracing" -version = "0.1.40" +version = "0.1.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" dependencies = [ "log", "pin-project-lite", @@ -9481,10 +10023,23 @@ dependencies = [ ] [[package]] -name = "tracing-attributes" -version = "0.1.27" +name = "tracing-actix-web" +version = "0.7.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +checksum = "332bbdf3bd208d1fe6446f8ffb4e8c2ae66e25da0fb38e0b69545e640ecee6a6" +dependencies = [ + "actix-web", + "mutually_exclusive_features", + "pin-project", + "tracing", + "uuid 1.12.0", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" dependencies = [ "proc-macro2", "quote", @@ -9493,9 +10048,9 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.32" +version = "0.1.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c" dependencies = [ "once_cell", "valuable", @@ -9536,9 +10091,9 @@ dependencies = [ [[package]] name = "tracing-subscriber" -version = "0.3.18" +version = "0.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" +checksum = "e8189decb5ac0fa7bc8b96b7cb9b2701d60d48805aca84a238004d665fcc4008" dependencies = [ "chrono", "matchers", @@ -9808,6 +10363,12 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" +[[package]] +name = "utf8parse" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" + [[package]] name = "uuid" version = "0.8.2" @@ -9819,9 +10380,9 @@ dependencies = [ [[package]] name = "uuid" -version = "1.10.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81dfa00651efa65069b0b6b651f4aaa31ba9e3c3ce0137aaad053604ee7e0314" +checksum = "744018581f9a3454a9e15beb8a33b017183f1e7c0cd170232a2d1453b23a51c4" dependencies = [ "getrandom 0.2.15", "rand 0.8.5", @@ -10780,7 +11341,7 @@ checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" [[package]] name = "wry" version = "0.47.2" -source = "git+https://github.com/modrinth/wry?rev=cdbf938#cdbf9384263db4e692e22dcf9bf6085e334a10f3" +source = "git+https://github.com/modrinth/wry?rev=51907c6#51907c61541f2e389856f07773a32bac04f9a843" dependencies = [ "base64 0.22.1", "block2", diff --git a/Cargo.toml b/Cargo.toml index 06487ac14..97d69a241 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,6 +7,7 @@ members = [ './apps/labrinth', './apps/daedalus_client', './packages/daedalus', + './packages/ariadne', ] # Optimize for speed and reduce size on release builds @@ -21,4 +22,4 @@ strip = true # Remove debug symbols opt-level = 3 [patch.crates-io] -wry = { git = "https://github.com/modrinth/wry", rev ="cdbf938" } \ No newline at end of file +wry = { git = "https://github.com/modrinth/wry", rev = "51907c6" } diff --git a/apps/app-frontend/package.json b/apps/app-frontend/package.json index f39380631..fe9390f97 100644 --- a/apps/app-frontend/package.json +++ b/apps/app-frontend/package.json @@ -1,7 +1,7 @@ { "name": "@modrinth/app-frontend", "private": true, - "version": "0.9.2", + "version": "0.9.3", "type": "module", "scripts": { "dev": "vite", diff --git a/apps/app-frontend/src/components/ui/ErrorModal.vue b/apps/app-frontend/src/components/ui/ErrorModal.vue index d9a71608d..c3beffa9f 100644 --- a/apps/app-frontend/src/components/ui/ErrorModal.vue +++ b/apps/app-frontend/src/components/ui/ErrorModal.vue @@ -1,7 +1,16 @@ - diff --git a/apps/app-frontend/src/components/ui/instance_settings/WindowSettings.vue b/apps/app-frontend/src/components/ui/instance_settings/WindowSettings.vue index 735d6c083..53820da66 100644 --- a/apps/app-frontend/src/components/ui/instance_settings/WindowSettings.vue +++ b/apps/app-frontend/src/components/ui/instance_settings/WindowSettings.vue @@ -5,7 +5,7 @@ import { handleError } from '@/store/notifications' import { defineMessages, useVIntl } from '@vintl/vintl' import { get } from '@/helpers/settings' import { edit } from '@/helpers/profile' -import type { InstanceSettingsTabProps, AppSettings } from '../../../helpers/types' +import type { AppSettings, InstanceSettingsTabProps } from '../../../helpers/types' const { formatMessage } = useVIntl() @@ -114,7 +114,6 @@ const messages = defineMessages({ -import { Toggle, ThemeSelector, TeleportDropdownMenu } from '@modrinth/ui' +import { TeleportDropdownMenu, ThemeSelector, Toggle } from '@modrinth/ui' import { useTheming } from '@/store/state' import { get, set } from '@/helpers/settings' -import { watch, ref } from 'vue' +import { ref, watch } from 'vue' import { getOS } from '@/helpers/utils' const themeStore = useTheming() @@ -46,7 +46,6 @@ watch( Native Decorations

Use system window frame (app restart required).

- +
@@ -78,16 +68,7 @@ watch(

Minimize launcher

Minimize the launcher when a Minecraft process starts.

- +
@@ -111,7 +92,6 @@ watch( +
diff --git a/apps/app-frontend/src/components/ui/settings/FeatureFlagSettings.vue b/apps/app-frontend/src/components/ui/settings/FeatureFlagSettings.vue index fde4a5c1c..24d27feb6 100644 --- a/apps/app-frontend/src/components/ui/settings/FeatureFlagSettings.vue +++ b/apps/app-frontend/src/components/ui/settings/FeatureFlagSettings.vue @@ -37,7 +37,6 @@ watch(
diff --git a/apps/app-frontend/src/components/ui/settings/PrivacySettings.vue b/apps/app-frontend/src/components/ui/settings/PrivacySettings.vue index 5bb4deac0..69eea98fd 100644 --- a/apps/app-frontend/src/components/ui/settings/PrivacySettings.vue +++ b/apps/app-frontend/src/components/ui/settings/PrivacySettings.vue @@ -30,16 +30,7 @@ watch( option, you opt out and ads will no longer be shown based on your interests.

- +
@@ -51,16 +42,7 @@ watch( longer be collected.

- +
@@ -75,10 +57,6 @@ watch( as those added by mods. (app restart required to take effect)

- + diff --git a/apps/app-frontend/src/locales/en-US/index.json b/apps/app-frontend/src/locales/en-US/index.json index a46dbe60e..515e4e71a 100644 --- a/apps/app-frontend/src/locales/en-US/index.json +++ b/apps/app-frontend/src/locales/en-US/index.json @@ -20,6 +20,9 @@ "app.settings.tabs.resource-management": { "message": "Resource management" }, + "instance.filter.disabled": { + "message": "Disabled projects" + }, "instance.filter.updates-available": { "message": "Updates available" }, diff --git a/apps/app-frontend/src/pages/instance/Mods.vue b/apps/app-frontend/src/pages/instance/Mods.vue index 45ef23722..e49f2d9c7 100644 --- a/apps/app-frontend/src/pages/instance/Mods.vue +++ b/apps/app-frontend/src/pages/instance/Mods.vue @@ -179,7 +179,6 @@ diff --git a/apps/app-playground/.cargo/config.toml b/apps/app-playground/.cargo/config.toml new file mode 100644 index 000000000..19f0a3a5a --- /dev/null +++ b/apps/app-playground/.cargo/config.toml @@ -0,0 +1,2 @@ +[env] +SQLX_OFFLINE = "true" diff --git a/apps/app-playground/src/main.rs b/apps/app-playground/src/main.rs index a50002dc7..f8d943938 100644 --- a/apps/app-playground/src/main.rs +++ b/apps/app-playground/src/main.rs @@ -3,9 +3,9 @@ windows_subsystem = "windows" )] +use std::time::Duration; use theseus::prelude::*; - -use theseus::profile::create::profile_create; +use tokio::signal::ctrl_c; // A simple Rust implementation of the authentication run // 1) call the authenticate_begin_flow() function to get the URL to open (like you would in the frontend) @@ -41,54 +41,21 @@ async fn main() -> theseus::Result<()> { // Initialize state State::init().await?; - if minecraft_auth::users().await?.is_empty() { - println!("No users found, authenticating."); - authenticate_run().await?; // could take credentials from here direct, but also deposited in state users - } - // - // st.settings - // .write() - // .await - // .java_globals - // .insert(JAVA_8_KEY.to_string(), check_jre(path).await?.unwrap()); - // Clear profiles - println!("Clearing profiles."); - { - let h = profile::list().await?; - for profile in h.into_iter() { - profile::remove(&profile.path).await?; + loop { + if State::get().await?.friends_socket.is_connected().await { + break; } + tokio::time::sleep(Duration::from_millis(500)).await; } - println!("Creating/adding profile."); + tracing::info!("Starting host"); - let name = "Example".to_string(); - let game_version = "1.16.1".to_string(); - let modloader = ModLoader::Forge; - let loader_version = "stable".to_string(); + let socket = State::get().await?.friends_socket.open_port(25565).await?; + tracing::info!("Running host on socket {}", socket.socket_id()); - let profile_path = profile_create( - name, - game_version, - modloader, - Some(loader_version), - None, - None, - None, - ) - .await?; - - println!("running"); - // Run a profile, running minecraft and store the RwLock to the process - let process = profile::run(&profile_path).await?; - - println!("Minecraft UUID: {}", process.uuid); - - println!("All running process UUID {:?}", process::get_all().await?); - - // hold the lock to the process until it ends - println!("Waiting for process to end..."); - process::wait_for(process.uuid).await?; + ctrl_c().await?; + tracing::info!("Stopping host"); + socket.shutdown().await?; Ok(()) } diff --git a/apps/app/.cargo/config.toml b/apps/app/.cargo/config.toml new file mode 100644 index 000000000..19f0a3a5a --- /dev/null +++ b/apps/app/.cargo/config.toml @@ -0,0 +1,2 @@ +[env] +SQLX_OFFLINE = "true" diff --git a/apps/app/Cargo.toml b/apps/app/Cargo.toml index d4c4d1e92..0e3bc20b3 100644 --- a/apps/app/Cargo.toml +++ b/apps/app/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "theseus_gui" -version = "0.9.2" +version = "0.9.3" description = "The Modrinth App is a desktop application for managing your Minecraft mods" license = "GPL-3.0-only" repository = "https://github.com/modrinth/code/apps/app/" diff --git a/apps/app/tauri.conf.json b/apps/app/tauri.conf.json index 37c5c20e5..24eb3bd41 100644 --- a/apps/app/tauri.conf.json +++ b/apps/app/tauri.conf.json @@ -44,7 +44,7 @@ ] }, "productName": "Modrinth App", - "version": "0.9.2", + "version": "0.9.3", "mainBinaryName": "Modrinth App", "identifier": "ModrinthApp", "plugins": { diff --git a/apps/docs/package.json b/apps/docs/package.json index 5b2266277..8ce3806e6 100644 --- a/apps/docs/package.json +++ b/apps/docs/package.json @@ -10,12 +10,12 @@ "astro": "astro" }, "dependencies": { - "@astrojs/check": "^0.9.3", - "@astrojs/starlight": "^0.26.3", + "@astrojs/check": "^0.9.4", + "@astrojs/starlight": "^0.32.2", "@modrinth/assets": "workspace:*", - "astro": "^4.10.2", - "sharp": "^0.32.5", - "starlight-openapi": "^0.7.0", - "typescript": "^5.5.4" + "astro": "^5.4.1", + "sharp": "^0.33.5", + "starlight-openapi": "^0.14.0", + "typescript": "^5.8.2" } -} +} \ No newline at end of file diff --git a/apps/docs/src/content.config.ts b/apps/docs/src/content.config.ts new file mode 100644 index 000000000..6a7b7a02b --- /dev/null +++ b/apps/docs/src/content.config.ts @@ -0,0 +1,7 @@ +import { defineCollection } from 'astro:content'; +import { docsLoader } from '@astrojs/starlight/loaders'; +import { docsSchema } from '@astrojs/starlight/schema'; + +export const collections = { + docs: defineCollection({ loader: docsLoader(), schema: docsSchema() }), +}; diff --git a/apps/docs/src/content/config.ts b/apps/docs/src/content/config.ts deleted file mode 100644 index 90ad769ec..000000000 --- a/apps/docs/src/content/config.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { defineCollection } from 'astro:content' -import { docsSchema } from '@astrojs/starlight/schema' - -export const collections = { - docs: defineCollection({ schema: docsSchema() }), -} diff --git a/apps/frontend/package.json b/apps/frontend/package.json index 52faf1324..64b7a31cf 100644 --- a/apps/frontend/package.json +++ b/apps/frontend/package.json @@ -57,6 +57,8 @@ "pinia": "^2.1.7", "qrcode.vue": "^3.4.0", "semver": "^7.5.4", + "three": "^0.172.0", + "@types/three": "^0.172.0", "vue-multiselect": "3.0.0-alpha.2", "vue-typed-virtual-list": "^1.0.10", "vue3-ace-editor": "^2.2.4", diff --git a/apps/frontend/src/assets/styles/layout.scss b/apps/frontend/src/assets/styles/layout.scss index d9924ac1f..41be6710e 100644 --- a/apps/frontend/src/assets/styles/layout.scss +++ b/apps/frontend/src/assets/styles/layout.scss @@ -133,6 +133,21 @@ "sidebar" / 100%; + .normal-page__ultimate-sidebar { + grid-area: ultimate-sidebar; + position: fixed; + bottom: 1rem; + right: 1rem; + z-index: 100; + max-width: calc(100% - 2rem); + max-height: calc(100vh - 2rem); + overflow-y: auto; + + > div { + box-shadow: 0 0 15px rgba(0, 0, 0, 0.3); + } + } + @media screen and (min-width: 1024px) { &.sidebar { grid-template: @@ -156,6 +171,45 @@ } } + @media screen and (min-width: 1400px) { + &.ultimate-sidebar { + max-width: calc(80rem + 0.75rem + 600px); + + grid-template: + "header header ultimate-sidebar" auto + "content sidebar ultimate-sidebar" auto + "content dummy ultimate-sidebar" 1fr + / 1fr 18.75rem auto; + + .normal-page__header { + max-width: 80rem; + } + + .normal-page__ultimate-sidebar { + position: sticky; + top: 4.5rem; + bottom: unset; + right: unset; + z-index: unset; + align-self: start; + display: flex; + height: calc(100vh - 4.5rem * 2); + + > div { + box-shadow: none; + } + } + + &.alt-layout { + grid-template: + "ultimate-sidebar header header" auto + "ultimate-sidebar sidebar content" auto + "ultimate-sidebar dummy content" 1fr + / auto 18.75rem 1fr; + } + } + } + .normal-page__sidebar { grid-area: sidebar; } diff --git a/apps/frontend/src/components/ui/CollectionCreateModal.vue b/apps/frontend/src/components/ui/CollectionCreateModal.vue index e74934fe5..02b075607 100644 --- a/apps/frontend/src/components/ui/CollectionCreateModal.vue +++ b/apps/frontend/src/components/ui/CollectionCreateModal.vue @@ -19,10 +19,7 @@
@@ -52,8 +49,8 @@ diff --git a/apps/frontend/src/components/ui/charts/ChartDisplay.vue b/apps/frontend/src/components/ui/charts/ChartDisplay.vue index f60edd474..a6ca889c1 100644 --- a/apps/frontend/src/components/ui/charts/ChartDisplay.vue +++ b/apps/frontend/src/components/ui/charts/ChartDisplay.vue @@ -14,7 +14,7 @@ {{ formatCategoryHeader(selectedChart) }} + + {{ formattedCategorySubtitle }} +
@@ -322,7 +326,7 @@ const props = withDefaults( * @deprecated Use `ranges` instead */ resoloutions?: Record; - ranges?: Record; + ranges?: RangeObject[]; personal?: boolean; }>(), { @@ -335,12 +339,6 @@ const props = withDefaults( const projects = ref(props.projects || []); -const selectableRanges = Object.entries(props.ranges).map(([duration, extra]) => ({ - label: typeof extra === "string" ? extra : extra[0], - value: Number(duration), - res: typeof extra === "string" ? Number(duration) : extra[1], -})); - // const selectedChart = ref('downloads') const selectedChart = computed({ get: () => { @@ -413,33 +411,78 @@ const isUsingProjectColors = computed({ }, }); +const startDate = ref(dayjs().startOf("day")); +const endDate = ref(dayjs().endOf("day")); +const timeResolution = ref(30); + +onBeforeMount(() => { + // Load cached data and range from localStorage - cache. + if (import.meta.client) { + const rangeLabel = localStorage.getItem("analyticsSelectedRange"); + if (rangeLabel) { + const range = props.ranges.find((r) => r.getLabel([dayjs(), dayjs()]) === rangeLabel)!; + + if (range !== undefined) { + internalRange.value = range; + const ranges = range.getDates(dayjs()); + timeResolution.value = range.timeResolution; + startDate.value = ranges.startDate; + endDate.value = ranges.endDate; + } + } + } +}); + +onMounted(() => { + if (internalRange.value === null) { + internalRange.value = props.ranges.find( + (r) => r.getLabel([dayjs(), dayjs()]) === "Previous 30 days", + )!; + } + + const ranges = selectedRange.value.getDates(dayjs()); + startDate.value = ranges.startDate; + endDate.value = ranges.endDate; + timeResolution.value = selectedRange.value.timeResolution; +}); + +const internalRange: Ref = ref(null as unknown as RangeObject); + +const selectedRange = computed({ + get: () => { + return internalRange.value; + }, + set: (newRange) => { + const ranges = newRange.getDates(dayjs()); + startDate.value = ranges.startDate; + endDate.value = ranges.endDate; + timeResolution.value = newRange.timeResolution; + + internalRange.value = newRange; + + if (import.meta.client) { + localStorage.setItem( + "analyticsSelectedRange", + internalRange.value?.getLabel([dayjs(), dayjs()]) ?? "Previous 30 days", + ); + } + }, +}); + const analytics = useFetchAllAnalytics( resetCharts, projects, selectedDisplayProjects, props.personal, + startDate, + endDate, + timeResolution, ); -const { startDate, endDate, timeRange, timeResolution } = analytics; - -const selectedRange = computed({ - get: () => { - return ( - selectableRanges.find((option) => option.value === timeRange.value) || { - label: "Custom", - value: timeRange.value, - } - ); - }, - set: (newRange: { label: string; value: number; res?: number }) => { - timeRange.value = newRange.value; - startDate.value = Date.now() - timeRange.value * 60 * 1000; - endDate.value = Date.now(); - - if (newRange?.res) { - timeResolution.value = newRange.res; - } - }, +const formattedCategorySubtitle = computed(() => { + return ( + selectedRange.value?.getLabel([dayjs(startDate.value), dayjs(endDate.value)]) ?? "Loading..." + ); }); const selectedDataSet = computed(() => { @@ -484,6 +527,9 @@ const onToggleColors = () => { diff --git a/apps/frontend/src/components/ui/servers/FileItem.vue b/apps/frontend/src/components/ui/servers/FileItem.vue index 06db4103e..6d269d8f7 100644 --- a/apps/frontend/src/components/ui/servers/FileItem.vue +++ b/apps/frontend/src/components/ui/servers/FileItem.vue @@ -75,7 +75,7 @@ import { RightArrowIcon, } from "@modrinth/assets"; import { computed, shallowRef, ref } from "vue"; -import { renderToString } from "@vue/server-renderer"; +import { renderToString } from "vue/server-renderer"; import { useRouter, useRoute } from "vue-router"; import { UiServersIconsCogFolderIcon, diff --git a/apps/frontend/src/components/ui/servers/FilesBrowseNavbar.vue b/apps/frontend/src/components/ui/servers/FilesBrowseNavbar.vue index 5cf62b213..c2e5e70a4 100644 --- a/apps/frontend/src/components/ui/servers/FilesBrowseNavbar.vue +++ b/apps/frontend/src/components/ui/servers/FilesBrowseNavbar.vue @@ -2,7 +2,7 @@
- -
- @@ -52,6 +52,7 @@ interface Props { loader: LoaderInfo; currentLoader: string | null; loaderVersion: string | null; + isInstalling?: boolean; } const props = defineProps(); diff --git a/apps/frontend/src/components/ui/servers/LogLine.vue b/apps/frontend/src/components/ui/servers/LogLine.vue new file mode 100644 index 000000000..1e8f4e02b --- /dev/null +++ b/apps/frontend/src/components/ui/servers/LogLine.vue @@ -0,0 +1,91 @@ + + + + + diff --git a/apps/frontend/src/components/ui/servers/LogParser.vue b/apps/frontend/src/components/ui/servers/LogParser.vue deleted file mode 100644 index efea31712..000000000 --- a/apps/frontend/src/components/ui/servers/LogParser.vue +++ /dev/null @@ -1,107 +0,0 @@ - - - - - diff --git a/apps/frontend/src/components/ui/servers/PanelOverviewLoading.vue b/apps/frontend/src/components/ui/servers/OverviewLoading.vue similarity index 85% rename from apps/frontend/src/components/ui/servers/PanelOverviewLoading.vue rename to apps/frontend/src/components/ui/servers/OverviewLoading.vue index 7fbe45a37..a3d5135f1 100644 --- a/apps/frontend/src/components/ui/servers/PanelOverviewLoading.vue +++ b/apps/frontend/src/components/ui/servers/OverviewLoading.vue @@ -34,8 +34,7 @@ class="relative isolate min-h-[156px] w-full overflow-hidden rounded-2xl bg-bg-raised p-8 transition-transform duration-100 hover:scale-105 active:scale-100" >
-

0 Bytes

-

/ 0 Bytes

+

0 B

Storage usage

@@ -50,8 +49,12 @@

Console

+
+ + +
@@ -59,7 +62,7 @@ diff --git a/apps/frontend/src/components/ui/servers/PlatformChangeModpackVersionModal.vue b/apps/frontend/src/components/ui/servers/PlatformChangeModpackVersionModal.vue new file mode 100644 index 000000000..ed15a3b5c --- /dev/null +++ b/apps/frontend/src/components/ui/servers/PlatformChangeModpackVersionModal.vue @@ -0,0 +1,164 @@ + + + + + diff --git a/apps/frontend/src/components/ui/servers/PlatformMrpackModal.vue b/apps/frontend/src/components/ui/servers/PlatformMrpackModal.vue new file mode 100644 index 000000000..df5bdb964 --- /dev/null +++ b/apps/frontend/src/components/ui/servers/PlatformMrpackModal.vue @@ -0,0 +1,281 @@ + + + + + diff --git a/apps/frontend/src/components/ui/servers/PlatformVersionSelectModal.vue b/apps/frontend/src/components/ui/servers/PlatformVersionSelectModal.vue new file mode 100644 index 000000000..a7dc1083a --- /dev/null +++ b/apps/frontend/src/components/ui/servers/PlatformVersionSelectModal.vue @@ -0,0 +1,551 @@ + + + + + diff --git a/apps/frontend/src/components/ui/servers/ProjectSelect.vue b/apps/frontend/src/components/ui/servers/ProjectSelect.vue deleted file mode 100644 index bdc2e2ebd..000000000 --- a/apps/frontend/src/components/ui/servers/ProjectSelect.vue +++ /dev/null @@ -1,167 +0,0 @@ - - - diff --git a/apps/frontend/src/components/ui/servers/PyroLoading.vue b/apps/frontend/src/components/ui/servers/PyroLoading.vue deleted file mode 100644 index 3c72d239b..000000000 --- a/apps/frontend/src/components/ui/servers/PyroLoading.vue +++ /dev/null @@ -1,94 +0,0 @@ - - - - - diff --git a/apps/frontend/src/components/ui/servers/PyroModal.vue b/apps/frontend/src/components/ui/servers/PyroModal.vue deleted file mode 100644 index 67ea4f17d..000000000 --- a/apps/frontend/src/components/ui/servers/PyroModal.vue +++ /dev/null @@ -1,60 +0,0 @@ - - - diff --git a/apps/frontend/src/components/ui/servers/SaveBanner.vue b/apps/frontend/src/components/ui/servers/SaveBanner.vue index be754f733..65508267e 100644 --- a/apps/frontend/src/components/ui/servers/SaveBanner.vue +++ b/apps/frontend/src/components/ui/servers/SaveBanner.vue @@ -39,7 +39,7 @@ const props = defineProps<{ save: () => void; reset: () => void; isVisible: boolean; - server: Server<["general", "mods", "backups", "network", "startup", "ws", "fs"]>; + server: Server<["general", "content", "backups", "network", "startup", "ws", "fs"]>; }>(); const saveAndRestart = async () => { diff --git a/apps/frontend/src/components/ui/servers/ServerGameLabel.vue b/apps/frontend/src/components/ui/servers/ServerGameLabel.vue index bef037812..6c7fd043d 100644 --- a/apps/frontend/src/components/ui/servers/ServerGameLabel.vue +++ b/apps/frontend/src/components/ui/servers/ServerGameLabel.vue @@ -8,13 +8,19 @@ - {{ game[0].toUpperCase() + game.slice(1) }} {{ mcVersion }} +
+ {{ game[0].toUpperCase() + game.slice(1) }} + {{ mcVersion }} + +
-
- {{ game[0].toUpperCase() + game.slice(1) }} {{ mcVersion }} +
+ {{ game[0].toUpperCase() + game.slice(1) }} + {{ mcVersion }} +
diff --git a/apps/frontend/src/components/ui/servers/ServerInfoLabels.vue b/apps/frontend/src/components/ui/servers/ServerInfoLabels.vue index a23430e78..56f257d32 100644 --- a/apps/frontend/src/components/ui/servers/ServerInfoLabels.vue +++ b/apps/frontend/src/components/ui/servers/ServerInfoLabels.vue @@ -2,19 +2,18 @@
@@ -70,11 +69,13 @@
- - Your server has been suspended due to a billing issue. Please visit your billing settings or - contact Modrinth Support for more information. +
+ Your server has been suspended. Please + update your billing information or contact Modrinth Support for more information. +
+
@@ -85,9 +86,12 @@ import type { Project, Server } from "~/types/servers"; const props = defineProps>(); +if (props.server_id) { + await usePyroServer(props.server_id, ["general"]); +} + const showGameLabel = computed(() => !!props.game); const showLoaderLabel = computed(() => !!props.loader); -const showSubdomainLabel = computed(() => !!props.net?.domain); let projectData: Ref; if (props.upstream) { @@ -103,39 +107,11 @@ if (props.upstream) { projectData = ref(null); } -const image = ref(); +const image = useState(`server-icon-${props.server_id}`, () => undefined); -onMounted(async () => { - const auth = (await usePyroFetch(`servers/${props.server_id}/fs`)) as any; - try { - const fileData = await usePyroFetch(`/download?path=/server-icon-original.png`, { - override: auth, - }); - - if (fileData instanceof Blob) { - const canvas = document.createElement("canvas"); - const ctx = canvas.getContext("2d"); - const img = new Image(); - img.src = URL.createObjectURL(fileData); - await new Promise((resolve) => { - img.onload = () => { - canvas.width = 512; - canvas.height = 512; - ctx?.drawImage(img, 0, 0, 512, 512); - const dataURL = canvas.toDataURL("image/png"); - image.value = dataURL; - resolve(); - }; - }); - } - } catch (error) { - if (error instanceof PyroFetchError && error.statusCode === 404) { - image.value = undefined; - } else { - console.error(error); - } - } -}); +if (import.meta.server && projectData.value?.icon_url) { + await usePyroServer(props.server_id!, ["general"]); +} const iconUrl = computed(() => projectData.value?.icon_url || undefined); diff --git a/apps/frontend/src/components/ui/servers/ServerLoaderLabel.vue b/apps/frontend/src/components/ui/servers/ServerLoaderLabel.vue index 13e8694f8..c9920099e 100644 --- a/apps/frontend/src/components/ui/servers/ServerLoaderLabel.vue +++ b/apps/frontend/src/components/ui/servers/ServerLoaderLabel.vue @@ -1,22 +1,33 @@ diff --git a/apps/frontend/src/components/ui/servers/ServerSubdomainLabel.vue b/apps/frontend/src/components/ui/servers/ServerSubdomainLabel.vue index 8f88d1938..d27d44b9f 100644 --- a/apps/frontend/src/components/ui/servers/ServerSubdomainLabel.vue +++ b/apps/frontend/src/components/ui/servers/ServerSubdomainLabel.vue @@ -1,6 +1,6 @@ - + - - - - +
@@ -371,7 +436,7 @@ class="iconified-button" to="/moderation" > -