From 884c05919697eb4b1fedb9e87cb2f1f9d04084f2 Mon Sep 17 00:00:00 2001 From: DIDIRUS4 Date: Sat, 3 Feb 2024 22:46:37 +0300 Subject: [PATCH] [beta] Translation improvements in Logs.vue. "Delete" Button in instance logs fix --- Cargo.lock | 62 ++++++++++++++----------- theseus/src/api/logs.rs | 3 +- theseus_gui/package.json | 2 +- theseus_gui/pnpm-lock.yaml | 50 ++++++++++---------- theseus_gui/src/languages/en_us.json | 4 +- theseus_gui/src/languages/ru_ru.json | 4 +- theseus_gui/src/pages/instance/Logs.vue | 5 +- 7 files changed, 72 insertions(+), 58 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index fbaed9817..c4c76cba7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -212,7 +212,7 @@ dependencies = [ "futures-lite 2.2.0", "parking", "polling 3.3.2", - "rustix 0.38.30", + "rustix 0.38.31", "slab", "tracing", "windows-sys 0.52.0", @@ -251,7 +251,7 @@ dependencies = [ "cfg-if", "event-listener 3.1.0", "futures-lite 1.13.0", - "rustix 0.38.30", + "rustix 0.38.31", "windows-sys 0.48.0", ] @@ -278,7 +278,7 @@ dependencies = [ "cfg-if", "futures-core", "futures-io", - "rustix 0.38.30", + "rustix 0.38.31", "signal-hook-registry", "slab", "windows-sys 0.48.0", @@ -1955,7 +1955,7 @@ dependencies = [ "futures-sink", "futures-util", "http", - "indexmap 2.2.1", + "indexmap 2.2.2", "slab", "tokio", "tokio-util", @@ -2114,9 +2114,9 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.59" +version = "0.1.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6a67363e2aa4443928ce15e57ebae94fd8949958fd1223c4cfc0cd473ad7539" +checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" dependencies = [ "android_system_properties", "core-foundation-sys", @@ -2208,9 +2208,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.2.1" +version = "2.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "433de089bd45971eecf4668ee0ee8f4cec17db4f8bd8f7bc3197a6ce37aa7d9b" +checksum = "824b2ae422412366ba479e8111fd301f7b5faece8149317bb81925979a53f520" dependencies = [ "equivalent", "hashbrown 0.14.3", @@ -2877,6 +2877,12 @@ dependencies = [ "winapi", ] +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + [[package]] name = "num-derive" version = "0.4.1" @@ -3415,7 +3421,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5699cc8a63d1aa2b1ee8e12b9ad70ac790d65788cd36101fa37f87ea46c4cef" dependencies = [ "base64 0.21.7", - "indexmap 2.2.1", + "indexmap 2.2.2", "line-wrap", "quick-xml", "serde", @@ -3460,7 +3466,7 @@ dependencies = [ "cfg-if", "concurrent-queue", "pin-project-lite", - "rustix 0.38.30", + "rustix 0.38.31", "tracing", "windows-sys 0.52.0", ] @@ -3849,9 +3855,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.30" +version = "0.38.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "322394588aaf33c24007e8bb3238ee3e4c5c09c084ab32bc73890b99ff326bca" +checksum = "6ea3e1a662af26cd7a3ba09c0297a31af215563ecf42817c98df621387f4e949" dependencies = [ "bitflags 2.4.2", "errno", @@ -4192,7 +4198,7 @@ dependencies = [ "chrono", "hex", "indexmap 1.9.3", - "indexmap 2.2.1", + "indexmap 2.2.2", "serde", "serde_json", "serde_with_macros", @@ -4914,7 +4920,7 @@ dependencies = [ "cfg-if", "fastrand 2.0.1", "redox_syscall", - "rustix 0.38.30", + "rustix 0.38.31", "windows-sys 0.52.0", ] @@ -5107,12 +5113,13 @@ dependencies = [ [[package]] name = "time" -version = "0.3.31" +version = "0.3.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f657ba42c3f86e7680e53c8cd3af8abbe56b5491790b46e22e19c0d57463583e" +checksum = "00b24b79b7a07f10209f19e683ca1e289d80b1e76ffa8c2b779718566a083679" dependencies = [ "deranged", "itoa 1.0.10", + "num-conv", "powerfmt", "serde", "time-core", @@ -5127,10 +5134,11 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.16" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26197e33420244aeb70c3e8c78376ca46571bc4e701e4791c2cd9f57dcb3a43f" +checksum = "7ba3a3ef41e6672a2f0f001392bb5dcd3ff0a9992d618ca761a11c3121547774" dependencies = [ + "num-conv", "time-core", ] @@ -5157,9 +5165,9 @@ checksum = "c7c4ceeeca15c8384bbc3e011dbd8fccb7f068a440b752b7d9b32ceb0ca0e2e8" [[package]] name = "tokio" -version = "1.35.1" +version = "1.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c89b4efa943be685f629b149f53829423f8f5531ea21249408e8e2f8671ec104" +checksum = "61285f6515fa018fb2d1e46eb21223fff441ee8db5d0f1435e8ab4f5cdb80931" dependencies = [ "backtrace", "bytes", @@ -5269,7 +5277,7 @@ version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 2.2.1", + "indexmap 2.2.2", "serde", "serde_spanned", "toml_datetime", @@ -5282,7 +5290,7 @@ version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" dependencies = [ - "indexmap 2.2.1", + "indexmap 2.2.2", "serde", "serde_spanned", "toml_datetime", @@ -5442,9 +5450,9 @@ dependencies = [ [[package]] name = "treediff" -version = "4.0.2" +version = "4.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52984d277bdf2a751072b5df30ec0377febdb02f7696d64c2d7d54630bac4303" +checksum = "4d127780145176e2b5d16611cc25a900150e86e9fd79d3bde6ff3a37359c9cb5" dependencies = [ "serde_json", ] @@ -6306,9 +6314,9 @@ checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "winnow" -version = "0.5.36" +version = "0.5.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "818ce546a11a9986bc24f93d0cdf38a8a1a400f1473ea8c82e59f6e0ffab9249" +checksum = "a7cad8365489051ae9f054164e459304af2e7e9bb407c958076c8bf4aef52da5" dependencies = [ "memchr", ] @@ -6410,7 +6418,7 @@ checksum = "8da84f1a25939b27f6820d92aed108f83ff920fdf11a7b19366c27c4cda81d4f" dependencies = [ "libc", "linux-raw-sys 0.4.13", - "rustix 0.38.30", + "rustix 0.38.31", ] [[package]] diff --git a/theseus/src/api/logs.rs b/theseus/src/api/logs.rs index 6a1aa492c..410f269bf 100644 --- a/theseus/src/api/logs.rs +++ b/theseus/src/api/logs.rs @@ -229,7 +229,8 @@ pub async fn delete_logs_by_filename( let logs_folder = DirectoryInfo::profile_logs_dir(&profile_path).await?; let path = logs_folder.join(filename); - io::remove_dir_all(&path).await?; + io::remove_file(&path).await?; + tracing::info!("Removed {:?}", &path); Ok(()) } diff --git a/theseus_gui/package.json b/theseus_gui/package.json index 5a3d2468e..c5a649d0f 100644 --- a/theseus_gui/package.json +++ b/theseus_gui/package.json @@ -38,7 +38,7 @@ "@vitejs/plugin-vue": "^4.6.2", "eslint": "^8.56.0", "eslint-config-prettier": "^8.10.0", - "eslint-plugin-vue": "^9.21.0", + "eslint-plugin-vue": "^9.21.1", "prettier": "^2.8.8", "sass": "^1.70.0", "vite": "^4.5.2", diff --git a/theseus_gui/pnpm-lock.yaml b/theseus_gui/pnpm-lock.yaml index 1613bbc1e..926a879a2 100644 --- a/theseus_gui/pnpm-lock.yaml +++ b/theseus_gui/pnpm-lock.yaml @@ -71,8 +71,8 @@ devDependencies: specifier: ^8.10.0 version: 8.10.0(eslint@8.56.0) eslint-plugin-vue: - specifier: ^9.21.0 - version: 9.21.0(eslint@8.56.0) + specifier: ^9.21.1 + version: 9.21.1(eslint@8.56.0) prettier: specifier: ^2.8.8 version: 2.8.8 @@ -124,7 +124,7 @@ packages: vue: 3.4.15 dev: false - /@codemirror/autocomplete@6.12.0(@codemirror/language@6.10.0)(@codemirror/state@6.4.0)(@codemirror/view@6.23.1)(@lezer/common@1.2.1): + /@codemirror/autocomplete@6.12.0(@codemirror/language@6.10.1)(@codemirror/state@6.4.0)(@codemirror/view@6.23.1)(@lezer/common@1.2.1): resolution: {integrity: sha512-r4IjdYFthwbCQyvqnSlx0WBHRHi8nBvU+WjJxFUij81qsBfhNudf/XKKmmC2j3m0LaOYUQTf3qiEK1J8lO1sdg==} peerDependencies: '@codemirror/language': ^6.0.0 @@ -132,7 +132,7 @@ packages: '@codemirror/view': ^6.0.0 '@lezer/common': ^1.0.0 dependencies: - '@codemirror/language': 6.10.0 + '@codemirror/language': 6.10.1 '@codemirror/state': 6.4.0 '@codemirror/view': 6.23.1 '@lezer/common': 1.2.1 @@ -141,7 +141,7 @@ packages: /@codemirror/commands@6.3.3: resolution: {integrity: sha512-dO4hcF0fGT9tu1Pj1D2PvGvxjeGkbC6RGcZw6Qs74TH+Ed1gw98jmUgd2axWvIZEqTeTuFrg1lEB1KV6cK9h1A==} dependencies: - '@codemirror/language': 6.10.0 + '@codemirror/language': 6.10.1 '@codemirror/state': 6.4.0 '@codemirror/view': 6.23.1 '@lezer/common': 1.2.1 @@ -150,8 +150,8 @@ packages: /@codemirror/lang-css@6.2.1(@codemirror/view@6.23.1): resolution: {integrity: sha512-/UNWDNV5Viwi/1lpr/dIXJNWiwDxpw13I4pTUAsNxZdg6E0mI2kTQb0P2iHczg1Tu+H4EBgJR+hYhKiHKko7qg==} dependencies: - '@codemirror/autocomplete': 6.12.0(@codemirror/language@6.10.0)(@codemirror/state@6.4.0)(@codemirror/view@6.23.1)(@lezer/common@1.2.1) - '@codemirror/language': 6.10.0 + '@codemirror/autocomplete': 6.12.0(@codemirror/language@6.10.1)(@codemirror/state@6.4.0)(@codemirror/view@6.23.1)(@lezer/common@1.2.1) + '@codemirror/language': 6.10.1 '@codemirror/state': 6.4.0 '@lezer/common': 1.2.1 '@lezer/css': 1.1.7 @@ -162,10 +162,10 @@ packages: /@codemirror/lang-html@6.4.8: resolution: {integrity: sha512-tE2YK7wDlb9ZpAH6mpTPiYm6rhfdQKVDa5r9IwIFlwwgvVaKsCfuKKZoJGWsmMZIf3FQAuJ5CHMPLymOtg1hXw==} dependencies: - '@codemirror/autocomplete': 6.12.0(@codemirror/language@6.10.0)(@codemirror/state@6.4.0)(@codemirror/view@6.23.1)(@lezer/common@1.2.1) + '@codemirror/autocomplete': 6.12.0(@codemirror/language@6.10.1)(@codemirror/state@6.4.0)(@codemirror/view@6.23.1)(@lezer/common@1.2.1) '@codemirror/lang-css': 6.2.1(@codemirror/view@6.23.1) '@codemirror/lang-javascript': 6.2.1 - '@codemirror/language': 6.10.0 + '@codemirror/language': 6.10.1 '@codemirror/state': 6.4.0 '@codemirror/view': 6.23.1 '@lezer/common': 1.2.1 @@ -176,8 +176,8 @@ packages: /@codemirror/lang-javascript@6.2.1: resolution: {integrity: sha512-jlFOXTejVyiQCW3EQwvKH0m99bUYIw40oPmFjSX2VS78yzfe0HELZ+NEo9Yfo1MkGRpGlj3Gnu4rdxV1EnAs5A==} dependencies: - '@codemirror/autocomplete': 6.12.0(@codemirror/language@6.10.0)(@codemirror/state@6.4.0)(@codemirror/view@6.23.1)(@lezer/common@1.2.1) - '@codemirror/language': 6.10.0 + '@codemirror/autocomplete': 6.12.0(@codemirror/language@6.10.1)(@codemirror/state@6.4.0)(@codemirror/view@6.23.1)(@lezer/common@1.2.1) + '@codemirror/language': 6.10.1 '@codemirror/lint': 6.5.0 '@codemirror/state': 6.4.0 '@codemirror/view': 6.23.1 @@ -188,17 +188,17 @@ packages: /@codemirror/lang-markdown@6.2.4: resolution: {integrity: sha512-UghkA1vSMs8bT7RSZM6vsIocigyah2bV00eRQuZy76401UmFZdsTsbQNBGdyxRQDOLeEvF5iFwap0BM8LKyd+g==} dependencies: - '@codemirror/autocomplete': 6.12.0(@codemirror/language@6.10.0)(@codemirror/state@6.4.0)(@codemirror/view@6.23.1)(@lezer/common@1.2.1) + '@codemirror/autocomplete': 6.12.0(@codemirror/language@6.10.1)(@codemirror/state@6.4.0)(@codemirror/view@6.23.1)(@lezer/common@1.2.1) '@codemirror/lang-html': 6.4.8 - '@codemirror/language': 6.10.0 + '@codemirror/language': 6.10.1 '@codemirror/state': 6.4.0 '@codemirror/view': 6.23.1 '@lezer/common': 1.2.1 '@lezer/markdown': 1.2.0 dev: false - /@codemirror/language@6.10.0: - resolution: {integrity: sha512-2vaNn9aPGCRFKWcHPFksctzJ8yS5p7YoaT+jHpc0UGKzNuAIx4qy6R5wiqbP+heEEdyaABA582mNqSHzSoYdmg==} + /@codemirror/language@6.10.1: + resolution: {integrity: sha512-5GrXzrhq6k+gL5fjkAwt90nYDmjlzTIJV8THnxNFtNKWotMIlzzN+CpqxqwXOECnUdOndmSeWntVrVcv5axWRQ==} dependencies: '@codemirror/state': 6.4.0 '@codemirror/view': 6.23.1 @@ -449,7 +449,7 @@ packages: debug: 4.3.4 espree: 9.6.1 globals: 13.24.0 - ignore: 5.3.0 + ignore: 5.3.1 import-fresh: 3.3.0 js-yaml: 4.1.0 minimatch: 3.1.2 @@ -1229,8 +1229,8 @@ packages: eslint: 8.56.0 dev: true - /eslint-plugin-vue@9.21.0(eslint@8.56.0): - resolution: {integrity: sha512-B3NgZRtbi9kSl7M0x/PqhSMk7ULJUwWxQpTvM8b2Z6gNTORK0YSt5v1vzwY84oMs/2+3BWH5XmTepaQebcJwfA==} + /eslint-plugin-vue@9.21.1(eslint@8.56.0): + resolution: {integrity: sha512-XVtI7z39yOVBFJyi8Ljbn7kY9yHzznKXL02qQYn+ta63Iy4A9JFBw6o4OSB9hyD2++tVT+su9kQqetUyCCwhjw==} engines: {node: ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.2.0 || ^7.0.0 || ^8.0.0 @@ -1290,7 +1290,7 @@ packages: glob-parent: 6.0.2 globals: 13.24.0 graphemer: 1.4.0 - ignore: 5.3.0 + ignore: 5.3.1 imurmurhash: 0.1.4 is-glob: 4.0.3 is-path-inside: 3.0.3 @@ -1468,8 +1468,8 @@ packages: engines: {node: '>=12.0.0'} dev: false - /ignore@5.3.0: - resolution: {integrity: sha512-g7dmpshy+gD7mh88OC9NwSGTKoc3kyLAZQRU1mt53Aw/vnvfXnbC+F/7F7QoYVKbV+KNvJx8wArewKy1vXMtlg==} + /ignore@5.3.1: + resolution: {integrity: sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==} engines: {node: '>= 4'} dev: true @@ -1689,7 +1689,7 @@ packages: dependencies: '@codemirror/commands': 6.3.3 '@codemirror/lang-markdown': 6.2.4 - '@codemirror/language': 6.10.0 + '@codemirror/language': 6.10.1 '@codemirror/state': 6.4.0 '@codemirror/view': 6.23.1 apexcharts: 3.45.2 @@ -1783,7 +1783,7 @@ packages: dependencies: '@vue/devtools-api': 6.5.1 vue: 3.4.15 - vue-demi: 0.14.6(vue@3.4.15) + vue-demi: 0.14.7(vue@3.4.15) dev: false /postcss-selector-parser@6.0.15: @@ -2111,8 +2111,8 @@ packages: fsevents: 2.3.3 dev: true - /vue-demi@0.14.6(vue@3.4.15): - resolution: {integrity: sha512-8QA7wrYSHKaYgUxDA5ZC24w+eHm3sYCbp0EzcDwKqN3p6HqtTCGR/GVsPyZW92unff4UlcSh++lmqDWN3ZIq4w==} + /vue-demi@0.14.7(vue@3.4.15): + resolution: {integrity: sha512-EOG8KXDQNwkJILkx/gPcoL/7vH+hORoBaKgGe+6W7VFMvCYJfmF2dGbvgDroVnI8LU7/kTu8mbjRZGBU1z9NTA==} engines: {node: '>=12'} hasBin: true requiresBuild: true diff --git a/theseus_gui/src/languages/en_us.json b/theseus_gui/src/languages/en_us.json index 231817881..7ad646bf9 100644 --- a/theseus_gui/src/languages/en_us.json +++ b/theseus_gui/src/languages/en_us.json @@ -314,7 +314,9 @@ "TypeLogFilter": "Type to filter logs...", "ShareLog": "Share Log", "InstanceLog": "Instance Log", - "ShareText": "Check out this log from an instance on the AstralRinth App" + "ShareText": "Check out this log from an instance on the AstralRinth App", + "NoLiveGame": "No live game detected.", + "StartYourGame": "Start your game to proceed." } }, "RowDisplay": { diff --git a/theseus_gui/src/languages/ru_ru.json b/theseus_gui/src/languages/ru_ru.json index 557cbaf7f..284a747a9 100644 --- a/theseus_gui/src/languages/ru_ru.json +++ b/theseus_gui/src/languages/ru_ru.json @@ -314,7 +314,9 @@ "TypeLogFilter": "Введите для фильтрации логов...", "ShareLog": "Поделиться логом", "InstanceLog": "Лог экземпляра", - "ShareText": "Проверьте этот лог из экземпляра в приложении Modrinth" + "ShareText": "Проверьте этот лог из экземпляра в приложении Modrinth", + "NoLiveGame": "Не обнаружен процесс игры.", + "StartYourGame": "Для начала запустите игру, чтобы просматривать консоль в реальном времени." } }, "RowDisplay": { diff --git a/theseus_gui/src/pages/instance/Logs.vue b/theseus_gui/src/pages/instance/Logs.vue index 09f924c75..a09311fd9 100644 --- a/theseus_gui/src/pages/instance/Logs.vue +++ b/theseus_gui/src/pages/instance/Logs.vue @@ -116,7 +116,8 @@ import { ofetch } from 'ofetch' import { RecycleScroller } from 'vue-virtual-scroller' import 'vue-virtual-scroller/dist/vue-virtual-scroller.css' - +import { i18n } from '@/main.js'; +const t = i18n.global.t; dayjs.extend(isToday) dayjs.extend(isYesterday) @@ -139,7 +140,7 @@ const props = defineProps({ const currentLiveLog = ref(null) const currentLiveLogCursor = ref(0) -const emptyText = ['No live game detected.', 'Start your game to proceed.'] +const emptyText = [t('Instance.Logs.NoLiveGame'), t('Instance.Logs.StartYourGame')] const logs = ref([]) await setLogs()