From d2643e8df6ccf33209eae6ae64819a603e147503 Mon Sep 17 00:00:00 2001 From: he3als <65787561+he3als@users.noreply.github.com> Date: Sun, 22 Dec 2024 18:28:26 +0000 Subject: [PATCH 01/17] feat: only scroll up if scrolled down --- .../src/pages/servers/manage/[id]/content/index.vue | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/apps/frontend/src/pages/servers/manage/[id]/content/index.vue b/apps/frontend/src/pages/servers/manage/[id]/content/index.vue index d2f24957b..0ae307c57 100644 --- a/apps/frontend/src/pages/servers/manage/[id]/content/index.vue +++ b/apps/frontend/src/pages/servers/manage/[id]/content/index.vue @@ -419,10 +419,13 @@ const debouncedSearch = debounce(() => { modSearchInput.value = searchInput.value; if (pyroContentSentinel.value) { - pyroContentSentinel.value.scrollIntoView({ - behavior: "smooth", - block: "start", - }); + const sentinelRect = pyroContentSentinel.value.getBoundingClientRect(); + if (sentinelRect.top < 0 || sentinelRect.bottom > window.innerHeight) { + pyroContentSentinel.value.scrollIntoView({ + // behavior: "smooth", + block: "start", + }); + } } }, 300); From 0e629e8a3b30b48bd2536feeeb7dec42aad75ca6 Mon Sep 17 00:00:00 2001 From: he3als <65787561+he3als@users.noreply.github.com> Date: Sun, 22 Dec 2024 23:53:13 +0000 Subject: [PATCH 02/17] feat: no query results message --- .../servers/manage/[id]/content/index.vue | 54 ++++++++++++++----- 1 file changed, 41 insertions(+), 13 deletions(-) diff --git a/apps/frontend/src/pages/servers/manage/[id]/content/index.vue b/apps/frontend/src/pages/servers/manage/[id]/content/index.vue index 0ae307c57..dd8bedd89 100644 --- a/apps/frontend/src/pages/servers/manage/[id]/content/index.vue +++ b/apps/frontend/src/pages/servers/manage/[id]/content/index.vue @@ -110,7 +110,7 @@ -
+
@@ -231,23 +231,40 @@
- -

No {{ type.toLocaleLowerCase() }}s found!

-

- Add some {{ type.toLocaleLowerCase() }}s to your server to manage them here. -

- - - - Add {{ type.toLocaleLowerCase() }} - - +
+ +

+ No {{ type.toLocaleLowerCase() }}s found for your query! +

+

Try another query, or show everything.

+ + + +
+
+ +

No {{ type.toLocaleLowerCase() }}s found!

+

+ Add some {{ type.toLocaleLowerCase() }}s to your server to manage them here. +

+ + + + Add {{ type.toLocaleLowerCase() }} + + +
@@ -290,6 +307,7 @@ import { MoreVerticalIcon, CompassIcon, WrenchIcon, + ListIcon, } from "@modrinth/assets"; import { ButtonStyled, NewModal } from "@modrinth/ui"; import { ref, computed, watch, onMounted, onUnmounted } from "vue"; @@ -328,6 +346,12 @@ const searchInput = ref(""); const modSearchInput = ref(""); const filterMethod = ref("all"); +const showAll = () => { + searchInput.value = ""; + modSearchInput.value = ""; + filterMethod.value = "all"; +}; + const filterMethodLabel = computed(() => { switch (filterMethod.value) { case "disabled": @@ -518,6 +542,10 @@ async function changeModVersion() { } const hasMods = computed(() => { + return localMods.value?.length > 0; +}); + +const hasFilteredMods = computed(() => { return filteredMods.value?.length > 0; }); From 7419b08fa929ec7b7e482bb86220c548e2a0989d Mon Sep 17 00:00:00 2001 From: he3als <65787561+he3als@users.noreply.github.com> Date: Mon, 23 Dec 2024 04:10:14 +0000 Subject: [PATCH 03/17] feat: content files support, mobile fixes --- .../ui/servers/FilesUploadDragAndDrop.vue | 72 ++++ .../ui/servers/FilesUploadDropdown.vue | 306 +++++++++++++ apps/frontend/src/composables/pyroServers.ts | 2 +- .../servers/manage/[id]/content/index.vue | 407 ++++++++++-------- .../src/pages/servers/manage/[id]/files.vue | 291 +------------ 5 files changed, 636 insertions(+), 442 deletions(-) create mode 100644 apps/frontend/src/components/ui/servers/FilesUploadDragAndDrop.vue create mode 100644 apps/frontend/src/components/ui/servers/FilesUploadDropdown.vue diff --git a/apps/frontend/src/components/ui/servers/FilesUploadDragAndDrop.vue b/apps/frontend/src/components/ui/servers/FilesUploadDragAndDrop.vue new file mode 100644 index 000000000..4fe728817 --- /dev/null +++ b/apps/frontend/src/components/ui/servers/FilesUploadDragAndDrop.vue @@ -0,0 +1,72 @@ + + + diff --git a/apps/frontend/src/components/ui/servers/FilesUploadDropdown.vue b/apps/frontend/src/components/ui/servers/FilesUploadDropdown.vue new file mode 100644 index 000000000..4841ea53c --- /dev/null +++ b/apps/frontend/src/components/ui/servers/FilesUploadDropdown.vue @@ -0,0 +1,306 @@ + + + + + diff --git a/apps/frontend/src/composables/pyroServers.ts b/apps/frontend/src/composables/pyroServers.ts index 95ca9d5b1..d5bc3ae01 100644 --- a/apps/frontend/src/composables/pyroServers.ts +++ b/apps/frontend/src/composables/pyroServers.ts @@ -1364,7 +1364,7 @@ type ContentModule = { data: Mod[] } & ContentFunctions; type BackupsModule = { data: Backup[] } & BackupFunctions; type NetworkModule = { allocations: Allocation[] } & NetworkFunctions; type StartupModule = Startup & StartupFunctions; -type FSModule = { auth: JWTAuth } & FSFunctions; +export type FSModule = { auth: JWTAuth } & FSFunctions; type ModulesMap = { general: GeneralModule; diff --git a/apps/frontend/src/pages/servers/manage/[id]/content/index.vue b/apps/frontend/src/pages/servers/manage/[id]/content/index.vue index dd8bedd89..01ca5cf11 100644 --- a/apps/frontend/src/pages/servers/manage/[id]/content/index.vue +++ b/apps/frontend/src/pages/servers/manage/[id]/content/index.vue @@ -58,7 +58,7 @@
-
+
@@ -88,7 +88,7 @@ { id: 'disabled', action: () => (filterMethod = 'disabled') }, ]" > - +
- - - - Add {{ type.toLocaleLowerCase() }} - - +
+ + + + + + + Add {{ type.toLocaleLowerCase() }} + + +
-
-
-
-
-