-
-
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.
+
+
+
+ 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 @@
+
+
+
+
+
+
+
Drop files here to upload
+
+
+
+
+
+
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 @@
+
+
+
+
+
+
+
+
+
+ {{ props.fileType ? props.fileType : "File" }} Uploads
+
+ {{ activeUploads.length > 0 ? ` - ${activeUploads.length} left` : "" }}
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ item.file.name }}
+ {{ item.size }}
+
+
+
+ Done
+
+
+ Failed - File already exists
+
+
+ Failed - Incorrect file type
+
+
+
+ {{ item.progress }}%
+
+
+ Cancel
+
+
+
+ Cancelled
+
+
+ {{ item.progress }}%
+
+
+
+
+
+
+
+
+
+
+
+
+
+
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 @@
-
+
Search
@@ -88,7 +88,7 @@
{ id: 'disabled', action: () => (filterMethod = 'disabled') },
]"
>
-
+
{{ filterMethodLabel }}
@@ -99,196 +99,236 @@
-
-
-
- Add {{ type.toLocaleLowerCase() }}
-
-
+
+
+
+
+ Add file
+
+
+
+
+
+ Add {{ type.toLocaleLowerCase() }}
+
+
+
-
-
-
-
-
-
-
props.server.refresh(['content'])"
+ />
+
+
+
+
+
+
+
-
-
-
-
- {{
- mod.name || mod.filename.replace(".disabled", "")
+
+
+
+
+
+ {{
+ mod.name || mod.filename.replace(".disabled", "")
+ }}
+ Disabled
+
+ {{
+ mod.version_number || "External mod"
}}
- Disabled
-
- {{
- mod.version_number || "External mod"
- }}
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
-
+
-
-
- No {{ type.toLocaleLowerCase() }}s found for your query!
-
-
Try another query, or show everything.
-
-
-
- Show everything
-
-
+
+
+
+ No {{ type.toLocaleLowerCase() }}s found for your query!
+
+
Try another query, or show everything.
+
+
+
+ Show everything
+
+
+
+
+
+
No {{ type.toLocaleLowerCase() }}s found!
+
+ Add some {{ type.toLocaleLowerCase() }}s to your server to manage them here.
+
+
+
+
+
+ Add file
+
+
+
+
+
+ Add {{ type.toLocaleLowerCase() }}
+
+
+
+
-
-
No {{ type.toLocaleLowerCase() }}s found!
+
+
Your server is running Vanilla Minecraft
- Add some {{ type.toLocaleLowerCase() }}s to your server to manage them here.
+ Add content to your server by installing a modpack or choosing a different platform that
+ supports {{ type }}s.
-
-
-
- Add {{ type.toLocaleLowerCase() }}
-
-
-
-
-
-
-
Your server is running Vanilla Minecraft
-
- Add content to your server by installing a modpack or choosing a different platform that
- supports {{ type }}s.
-
-
-
-
-
- Find a modpack
-
-
-
or
-
-
-
- Change platform
-
-
+
+
+
+
+ Find a modpack
+
+
+
or
+
+
+
+ Change platform
+
+
+
-
+
@@ -308,10 +348,14 @@ import {
CompassIcon,
WrenchIcon,
ListIcon,
+ FileIcon,
} from "@modrinth/assets";
import { ButtonStyled, NewModal } from "@modrinth/ui";
import { ref, computed, watch, onMounted, onUnmounted } from "vue";
+import FilesUploadDragAndDrop from "~/components/ui/servers/FilesUploadDragAndDrop.vue";
+import FilesUploadDropdown from "~/components/ui/servers/FilesUploadDropdown.vue";
import type { Server } from "~/composables/pyroServers";
+import { acceptFileFromProjectType } from "~/helpers/fileUtils.js";
const props = defineProps<{
server: Server<["general", "content", "backups", "network", "startup", "ws", "fs"]>;
@@ -346,6 +390,29 @@ const searchInput = ref("");
const modSearchInput = ref("");
const filterMethod = ref("all");
+const uploadDropdownRef = ref();
+
+const handleDroppedFiles = (files: File[]) => {
+ files.forEach((file) => {
+ uploadDropdownRef.value?.uploadFile(file);
+ });
+};
+
+const initiateFileUpload = () => {
+ const input = document.createElement("input");
+ input.type = "file";
+ input.accept = acceptFileFromProjectType(type.value.toLowerCase());
+ input.multiple = true;
+ input.onchange = () => {
+ if (input.files) {
+ Array.from(input.files).forEach((file) => {
+ uploadDropdownRef.value?.uploadFile(file);
+ });
+ }
+ };
+ input.click();
+};
+
const showAll = () => {
searchInput.value = "";
modSearchInput.value = "";
diff --git a/apps/frontend/src/pages/servers/manage/[id]/files.vue b/apps/frontend/src/pages/servers/manage/[id]/files.vue
index de29ffcf5..e61e2d6ac 100644
--- a/apps/frontend/src/pages/servers/manage/[id]/files.vue
+++ b/apps/frontend/src/pages/servers/manage/[id]/files.vue
@@ -25,12 +25,9 @@
@delete="handleDeleteItem"
/>
-
@@ -44,94 +41,14 @@
@upload="initiateFileUpload"
@update:search-query="searchQuery = $event"
/>
-
-
-
-
-
-
-
- File Uploads{{
- activeUploads.length > 0 ? ` - ${activeUploads.length} left` : ""
- }}
-
-
-
-
-
-
-
-
-
-
-
-
- {{ item.file.name }}
- {{ item.size }}
-
-
-
- Done
-
-
- Failed - File already exists
-
-
-
- {{ item.progress }}%
-
-
- Cancel
-
-
-
- Cancelled
-
-
- {{ item.progress }}%
-
-
-
-
-
-
-
-
-
+
Drop files here to upload
-
+
import { useInfiniteScroll } from "@vueuse/core";
-import { UploadIcon, FolderOpenIcon, CheckCircleIcon, XCircleIcon } from "@modrinth/assets";
-import { ButtonStyled } from "@modrinth/ui";
+import { UploadIcon, FolderOpenIcon } from "@modrinth/assets";
import type { DirectoryResponse, DirectoryItem, Server } from "~/composables/pyroServers";
+import FilesUploadDragAndDrop from "~/components/ui/servers/FilesUploadDragAndDrop.vue";
+import FilesUploadDropdown from "~/components/ui/servers/FilesUploadDropdown.vue";
interface BaseOperation {
type: "move" | "rename";
@@ -263,14 +181,6 @@ interface RenameOperation extends BaseOperation {
type Operation = MoveOperation | RenameOperation;
-interface UploadItem {
- file: File;
- progress: number;
- status: "pending" | "uploading" | "completed" | "error" | "cancelled";
- size: string;
- uploader?: any;
-}
-
const props = defineProps<{
server: Server<["general", "content", "backups", "network", "startup", "ws", "fs"]>;
}>();
@@ -312,46 +222,8 @@ const isEditingImage = ref(false);
const imagePreview = ref();
const isDragging = ref(false);
-const dragCounter = ref(0);
-
-const uploadStatusRef = ref(null);
-const isUploading = computed(() => uploadQueue.value.length > 0);
-const uploadQueue = ref([]);
-
-const activeUploads = computed(() =>
- uploadQueue.value.filter((item) => item.status === "pending" || item.status === "uploading"),
-);
-
-const onUploadStatusEnter = (el: Element) => {
- const height = (el as HTMLElement).scrollHeight;
- (el as HTMLElement).style.height = "0";
- // eslint-disable-next-line no-void
- void (el as HTMLElement).offsetHeight;
- (el as HTMLElement).style.height = `${height}px`;
-};
-const onUploadStatusLeave = (el: Element) => {
- const height = (el as HTMLElement).scrollHeight;
- (el as HTMLElement).style.height = `${height}px`;
- // eslint-disable-next-line no-void
- void (el as HTMLElement).offsetHeight;
- (el as HTMLElement).style.height = "0";
-};
-
-watch(
- uploadQueue,
- () => {
- if (!uploadStatusRef.value) return;
- const el = uploadStatusRef.value;
- const itemsHeight = uploadQueue.value.length * 32;
- const headerHeight = 12;
- const gap = 8;
- const padding = 32;
- const totalHeight = padding + headerHeight + gap + itemsHeight;
- el.style.height = `${totalHeight}px`;
- },
- { deep: true },
-);
+const uploadDropdownRef = ref();
const data = computed(() => props.server.general);
@@ -917,135 +789,12 @@ const requestShareLink = async () => {
}
};
-const handleDragEnter = (event: DragEvent) => {
+const handleDroppedFiles = (files: File[]) => {
if (isEditing.value) return;
- event.preventDefault();
- if (!event.dataTransfer?.types.includes("application/pyro-file-move")) {
- dragCounter.value++;
- isDragging.value = true;
- }
-};
-
-const handleDragOver = (event: DragEvent) => {
- if (isEditing.value) return;
- event.preventDefault();
-};
-
-const handleDragLeave = (event: DragEvent) => {
- if (isEditing.value) return;
- event.preventDefault();
- dragCounter.value--;
- if (dragCounter.value === 0) {
- isDragging.value = false;
- }
-};
-
-// eslint-disable-next-line require-await
-const handleDrop = async (event: DragEvent) => {
- if (isEditing.value) return;
- event.preventDefault();
- isDragging.value = false;
- dragCounter.value = 0;
-
- const isInternalMove = event.dataTransfer?.types.includes("application/pyro-file-move");
- if (isInternalMove) return;
-
- const files = event.dataTransfer?.files;
- if (files) {
- Array.from(files).forEach((file) => {
- uploadFile(file);
- });
- }
-};
-
-const formatFileSize = (bytes: number): string => {
- if (bytes < 1024) return bytes + " B";
- if (bytes < 1024 * 1024) return (bytes / 1024).toFixed(1) + " KB";
- return (bytes / (1024 * 1024)).toFixed(1) + " MB";
-};
-const cancelUpload = (item: UploadItem) => {
- if (item.uploader && item.status === "uploading") {
- item.uploader.cancel();
- item.status = "cancelled";
-
- setTimeout(async () => {
- const index = uploadQueue.value.findIndex((qItem) => qItem.file.name === item.file.name);
- if (index !== -1) {
- uploadQueue.value.splice(index, 1);
- await nextTick();
- }
- }, 5000);
- }
-};
-
-const uploadFile = async (file: File) => {
- const uploadItem: UploadItem = {
- file,
- progress: 0,
- status: "pending",
- size: formatFileSize(file.size),
- };
-
- uploadQueue.value.push(uploadItem);
-
- try {
- uploadItem.status = "uploading";
- const filePath = `${currentPath.value}/${file.name}`.replace("//", "/");
- const uploader = await props.server.fs?.uploadFile(filePath, file);
- uploadItem.uploader = uploader;
-
- if (uploader?.onProgress) {
- uploader.onProgress(({ progress }: { progress: number }) => {
- const index = uploadQueue.value.findIndex((item) => item.file.name === file.name);
- if (index !== -1) {
- uploadQueue.value[index].progress = Math.round(progress);
- }
- });
- }
-
- await uploader?.promise;
- const index = uploadQueue.value.findIndex((item) => item.file.name === file.name);
- if (index !== -1 && uploadQueue.value[index].status !== "cancelled") {
- uploadQueue.value[index].status = "completed";
- uploadQueue.value[index].progress = 100;
- }
-
- await nextTick();
-
- setTimeout(async () => {
- const removeIndex = uploadQueue.value.findIndex((item) => item.file.name === file.name);
- if (removeIndex !== -1) {
- uploadQueue.value.splice(removeIndex, 1);
- await nextTick();
- }
- }, 5000);
-
- await refreshList();
- } catch (error) {
- console.error("Error uploading file:", error);
- const index = uploadQueue.value.findIndex((item) => item.file.name === file.name);
- if (index !== -1 && uploadQueue.value[index].status !== "cancelled") {
- uploadQueue.value[index].status = "error";
- }
-
- setTimeout(async () => {
- const removeIndex = uploadQueue.value.findIndex((item) => item.file.name === file.name);
- if (removeIndex !== -1) {
- uploadQueue.value.splice(removeIndex, 1);
- await nextTick();
- }
- }, 5000);
-
- if (error instanceof Error && error.message !== "Upload cancelled") {
- addNotification({
- group: "files",
- title: "Upload failed",
- text: `Failed to upload ${file.name}`,
- type: "error",
- });
- }
- }
+ files.forEach((file) => {
+ uploadDropdownRef.value?.uploadFile(file);
+ });
};
const initiateFileUpload = () => {
@@ -1055,7 +804,7 @@ const initiateFileUpload = () => {
input.onchange = () => {
if (input.files) {
Array.from(input.files).forEach((file) => {
- uploadFile(file);
+ uploadDropdownRef.value?.uploadFile(file);
});
}
};
From 97abefd0d5179393ac5bf3579932b7e2fd2591d5 Mon Sep 17 00:00:00 2001
From: he3als <65787561+he3als@users.noreply.github.com>
Date: Mon, 23 Dec 2024 04:15:14 +0000
Subject: [PATCH 04/17] fix(drag & drop): type of file prop
---
.../src/components/ui/servers/FilesUploadDragAndDrop.vue | 5 ++++-
.../frontend/src/pages/servers/manage/[id]/content/index.vue | 1 +
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/apps/frontend/src/components/ui/servers/FilesUploadDragAndDrop.vue b/apps/frontend/src/components/ui/servers/FilesUploadDragAndDrop.vue
index 4fe728817..68fd5c92e 100644
--- a/apps/frontend/src/components/ui/servers/FilesUploadDragAndDrop.vue
+++ b/apps/frontend/src/components/ui/servers/FilesUploadDragAndDrop.vue
@@ -15,7 +15,9 @@
>
-
Drop files here to upload
+
+ Drop {{ type ? type.toLocaleLowerCase() : "file" }}s here to upload
+
@@ -31,6 +33,7 @@ const emit = defineEmits<{
defineProps<{
overlayClass?: string;
+ type?: string;
}>();
const isDragging = ref(false);
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 01ca5cf11..7109b7356 100644
--- a/apps/frontend/src/pages/servers/manage/[id]/content/index.vue
+++ b/apps/frontend/src/pages/servers/manage/[id]/content/index.vue
@@ -133,6 +133,7 @@
v-if="server.general && localMods"
class="relative min-h-[50vh]"
overlay-class="rounded-xl border-2 border-dashed border-secondary"
+ :type="type"
@files-dropped="handleDroppedFiles"
>
From 140e5f59f8526dc43a5be937c83f588cd9da63c4 Mon Sep 17 00:00:00 2001
From: Evan Song
Date: Sun, 22 Dec 2024 21:44:08 -0700
Subject: [PATCH 05/17] chore: show number of mods in searchbar
Signed-off-by: Evan Song
---
.../src/pages/servers/manage/[id]/content/index.vue | 9 ++++++---
1 file changed, 6 insertions(+), 3 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 7109b7356..f11cc7284 100644
--- a/apps/frontend/src/pages/servers/manage/[id]/content/index.vue
+++ b/apps/frontend/src/pages/servers/manage/[id]/content/index.vue
@@ -73,7 +73,7 @@
type="search"
name="search"
autocomplete="off"
- :placeholder="`Search ${type.toLocaleLowerCase()}s...`"
+ :placeholder="`Search ${localMods.length} ${type.toLocaleLowerCase()}s...`"
@input="debouncedSearch"
/>
@@ -172,9 +172,12 @@
>Disabled
-
{{
+
+
From e08a5c5f8a543c287ff291d18a56f47d9857b9a8 Mon Sep 17 00:00:00 2001
From: Evan Song
Date: Sun, 22 Dec 2024 21:46:29 -0700
Subject: [PATCH 06/17] chore: adjust btn styles
Signed-off-by: Evan Song
---
.../src/pages/servers/manage/[id]/content/index.vue | 12 ++++++------
1 file changed, 6 insertions(+), 6 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 f11cc7284..85e8933b3 100644
--- a/apps/frontend/src/pages/servers/manage/[id]/content/index.vue
+++ b/apps/frontend/src/pages/servers/manage/[id]/content/index.vue
@@ -57,9 +57,9 @@
-
-
-
+
+
+
Search
-
-
+
+
Add file
-
+
Date: Sun, 22 Dec 2024 21:57:49 -0700
Subject: [PATCH 07/17] feat: prepare for mod author in backend response
Signed-off-by: Evan Song
---
.../servers/manage/[id]/content/index.vue | 29 +++++++++++--------
1 file changed, 17 insertions(+), 12 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 85e8933b3..d1fd7f16f 100644
--- a/apps/frontend/src/pages/servers/manage/[id]/content/index.vue
+++ b/apps/frontend/src/pages/servers/manage/[id]/content/index.vue
@@ -88,7 +88,7 @@
{ id: 'disabled', action: () => (filterMethod = 'disabled') },
]"
>
-
+
{{ filterMethodLabel }}
@@ -152,18 +152,18 @@
? `/project/${mod.project_id}/version/${mod.version_id}`
: `files?path=mods`
"
- class="group flex min-w-0 items-center rounded-xl p-2"
+ class="group flex min-w-0 flex-1 items-center rounded-xl p-2"
>
-
-
- {{
+
+
+ {{
mod.name || mod.filename.replace(".disabled", "")
}}
Disabled
-
-
+
+ by Author
+
+
+
+ {{ mod.version_number || "External mod" }}
+
+
+ {{ mod.filename }}
+
+
Date: Mon, 23 Dec 2024 13:36:54 +0000
Subject: [PATCH 08/17] fix: external mods & mobile
---
.../servers/manage/[id]/content/index.vue | 58 +++++++++++--------
1 file changed, 34 insertions(+), 24 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 d1fd7f16f..62846fb54 100644
--- a/apps/frontend/src/pages/servers/manage/[id]/content/index.vue
+++ b/apps/frontend/src/pages/servers/manage/[id]/content/index.vue
@@ -152,33 +152,39 @@
? `/project/${mod.project_id}/version/${mod.version_id}`
: `files?path=mods`
"
- class="group flex min-w-0 flex-1 items-center rounded-xl p-2"
+ class="flex min-w-0 flex-1 items-center gap-2 rounded-xl p-2"
>
-
-
-
-
- {{
- mod.name || mod.filename.replace(".disabled", "")
+
+
+
+ {{
+ mod.name || mod.filename.replace(".disabled", "")
+ }}
+ Disabled
+
+
+
+ by
+ {{
+ mod.version_number ? "Author" : "Unknown"
}}
- Disabled
-
- by Author
+
+ {{ mod.version_number || "External mod" }}
-
+
{{ mod.version_number || "External mod" }}
@@ -186,11 +192,15 @@
{{ mod.filename }}
-
-
+
+
From 17564584bcf5284d9eadfcf95b9f7070e1889f63 Mon Sep 17 00:00:00 2001
From: Evan Song
Date: Mon, 23 Dec 2024 13:58:24 -0700
Subject: [PATCH 09/17] chore: adjust edit mod version modal copy
Signed-off-by: Evan Song
---
.../src/pages/servers/manage/[id]/content/index.vue | 7 +++----
1 file changed, 3 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 62846fb54..546823dd6 100644
--- a/apps/frontend/src/pages/servers/manage/[id]/content/index.vue
+++ b/apps/frontend/src/pages/servers/manage/[id]/content/index.vue
@@ -15,12 +15,11 @@
-
+
- Your server was created from a modpack. Changing the mod version may cause unexpected
- issues. You can update the modpack version in your server's Options > Platform
- settings.
+ Changing the mod version may cause unexpected issues. Because your server was created
+ from a modpack, it is recommended to use the modpack's version of the mod.
From e8ad4c916154c07ff897edfe76bfa604599b9aa3 Mon Sep 17 00:00:00 2001
From: Evan Song
Date: Mon, 23 Dec 2024 14:01:09 -0700
Subject: [PATCH 10/17] chore: add tooltips for version/filename
Signed-off-by: Evan Song
---
apps/frontend/src/pages/servers/manage/[id]/content/index.vue | 4 ++--
1 file changed, 2 insertions(+), 2 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 546823dd6..96cd982ea 100644
--- a/apps/frontend/src/pages/servers/manage/[id]/content/index.vue
+++ b/apps/frontend/src/pages/servers/manage/[id]/content/index.vue
@@ -184,10 +184,10 @@
-
+
{{ mod.version_number || "External mod" }}
-
From ec982d62c3c8855df19691401fff24a5d80727e2 Mon Sep 17 00:00:00 2001
From: Evan Song
Date: Mon, 23 Dec 2024 14:02:09 -0700
Subject: [PATCH 11/17] chore: swap delete/change version btn
Signed-off-by: Evan Song
---
.../servers/manage/[id]/content/index.vue | 20 +++++++++----------
1 file changed, 10 insertions(+), 10 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 96cd982ea..8a8912dd0 100644
--- a/apps/frontend/src/pages/servers/manage/[id]/content/index.vue
+++ b/apps/frontend/src/pages/servers/manage/[id]/content/index.vue
@@ -194,6 +194,16 @@
+
+
+
+
+
-
-
-
-
From 318f5b57c7062e7c8e06788117daa2377547d2b4 Mon Sep 17 00:00:00 2001
From: Evan Song
Date: Mon, 23 Dec 2024 14:12:23 -0700
Subject: [PATCH 12/17] fix: dont allow mod link to be dragged
Signed-off-by: Evan Song
---
apps/frontend/src/pages/servers/manage/[id]/content/index.vue | 1 +
1 file changed, 1 insertion(+)
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 8a8912dd0..82b5b6c1d 100644
--- a/apps/frontend/src/pages/servers/manage/[id]/content/index.vue
+++ b/apps/frontend/src/pages/servers/manage/[id]/content/index.vue
@@ -152,6 +152,7 @@
: `files?path=mods`
"
class="flex min-w-0 flex-1 items-center gap-2 rounded-xl p-2"
+ draggable="false"
>
Date: Mon, 23 Dec 2024 14:14:24 -0700
Subject: [PATCH 13/17] fix: oops
Signed-off-by: Evan Song
---
.../frontend/src/pages/servers/manage/[id]/options/loader.vue | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/apps/frontend/src/pages/servers/manage/[id]/options/loader.vue b/apps/frontend/src/pages/servers/manage/[id]/options/loader.vue
index 6eeba49b2..35a863db3 100644
--- a/apps/frontend/src/pages/servers/manage/[id]/options/loader.vue
+++ b/apps/frontend/src/pages/servers/manage/[id]/options/loader.vue
@@ -330,11 +330,11 @@
Upload .mrpack file
-
+
Update modpack
-
+
From 39a83477bfd89c6c095dec2a09c7de8d1f83d7be Mon Sep 17 00:00:00 2001
From: Evan Song
Date: Mon, 23 Dec 2024 16:07:33 -0700
Subject: [PATCH 14/17] chore: remove author field
Signed-off-by: Evan Song
---
.../src/pages/servers/manage/[id]/content/index.vue | 6 +++---
1 file changed, 3 insertions(+), 3 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 82b5b6c1d..814134609 100644
--- a/apps/frontend/src/pages/servers/manage/[id]/content/index.vue
+++ b/apps/frontend/src/pages/servers/manage/[id]/content/index.vue
@@ -56,7 +56,7 @@
-
+
@@ -172,12 +172,12 @@
>
-
+
{{ mod.version_number || "External mod" }}
From 56742f9bb036dca1600d392e9c8fc4a2b9734c4d Mon Sep 17 00:00:00 2001
From: Evan Song
Date: Mon, 23 Dec 2024 16:10:29 -0700
Subject: [PATCH 15/17] chore: drill down tooltip
Signed-off-by: Evan Song
---
.../src/pages/servers/manage/[id]/content/index.vue | 10 ++++++----
1 file changed, 6 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 814134609..288844501 100644
--- a/apps/frontend/src/pages/servers/manage/[id]/content/index.vue
+++ b/apps/frontend/src/pages/servers/manage/[id]/content/index.vue
@@ -185,11 +185,13 @@
-
- {{ mod.version_number || "External mod" }}
+
+ {{
+ mod.version_number || "External mod"
+ }}
-
- {{ mod.filename }}
+
+ {{ mod.filename }}
Date: Sat, 28 Dec 2024 09:50:13 -0700
Subject: [PATCH 16/17] fix: fighting types
Signed-off-by: Evan Song
---
apps/frontend/src/composables/pyroServers.ts | 13 +++++++------
.../pages/servers/manage/[id]/content/index.vue | 15 ++++-----------
apps/frontend/src/types/servers.ts | 16 ++++++++--------
3 files changed, 19 insertions(+), 25 deletions(-)
diff --git a/apps/frontend/src/composables/pyroServers.ts b/apps/frontend/src/composables/pyroServers.ts
index d5bc3ae01..ebb1ee462 100644
--- a/apps/frontend/src/composables/pyroServers.ts
+++ b/apps/frontend/src/composables/pyroServers.ts
@@ -198,14 +198,15 @@ interface Startup {
jdk_build: "corretto" | "temurin" | "graal";
}
-interface Mod {
+export interface Mod {
filename: string;
- project_id: string;
- version_id: string;
- name: string;
- version_number: string;
- icon_url: string;
+ project_id: string | undefined;
+ version_id: string | undefined;
+ name: string | undefined;
+ version_number: string | undefined;
+ icon_url: string | undefined;
disabled: boolean;
+ installing: boolean;
}
interface Backup {
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 288844501..5a079861c 100644
--- a/apps/frontend/src/pages/servers/manage/[id]/content/index.vue
+++ b/apps/frontend/src/pages/servers/manage/[id]/content/index.vue
@@ -387,14 +387,7 @@ const type = computed(() => {
return loader === "paper" || loader === "purpur" ? "Plugin" : "Mod";
});
-interface Mod {
- name?: string;
- filename: string;
- project_id?: string;
- version_id?: string;
- version_number?: string;
- icon_url?: string;
- disabled: boolean;
+interface ContentItem extends Mod {
changing?: boolean;
}
@@ -405,7 +398,7 @@ const listContainer = ref(null);
const windowScrollY = ref(0);
const windowHeight = ref(0);
-const localMods = ref([]);
+const localMods = ref([]);
const searchInput = ref("");
const modSearchInput = ref("");
@@ -541,7 +534,7 @@ const debouncedSearch = debounce(() => {
}
}, 300);
-async function toggleMod(mod: Mod) {
+async function toggleMod(mod: ContentItem) {
mod.changing = true;
const originalFilename = mod.filename;
@@ -573,7 +566,7 @@ async function toggleMod(mod: Mod) {
mod.changing = false;
}
-async function removeMod(mod: Mod) {
+async function removeMod(mod: ContentItem) {
mod.changing = true;
try {
diff --git a/apps/frontend/src/types/servers.ts b/apps/frontend/src/types/servers.ts
index 7ba96f797..8f76f594f 100644
--- a/apps/frontend/src/types/servers.ts
+++ b/apps/frontend/src/types/servers.ts
@@ -1,11 +1,11 @@
-export interface Mod {
- id: string;
- filename: string;
- modrinth_ids: {
- project_id: string;
- version_id: string;
- };
-}
+// export interface Mod {
+// id: string;
+// filename: string;
+// modrinth_ids: {
+// project_id: string;
+// version_id: string;
+// };
+// }
interface License {
id: string;
From 7fabcb494a1e1bf42a1aa851786deb770046f419 Mon Sep 17 00:00:00 2001
From: Evan Song
Date: Sat, 28 Dec 2024 10:05:29 -0700
Subject: [PATCH 17/17] prepare for owner field
Signed-off-by: Evan Song
---
apps/frontend/src/composables/pyroServers.ts | 1 +
.../src/pages/servers/manage/[id]/content/index.vue | 7 +------
2 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/apps/frontend/src/composables/pyroServers.ts b/apps/frontend/src/composables/pyroServers.ts
index ebb1ee462..943ccb0b2 100644
--- a/apps/frontend/src/composables/pyroServers.ts
+++ b/apps/frontend/src/composables/pyroServers.ts
@@ -205,6 +205,7 @@ export interface Mod {
name: string | undefined;
version_number: string | undefined;
icon_url: string | undefined;
+ owner: string | undefined;
disabled: boolean;
installing: boolean;
}
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 5a079861c..8161fa97c 100644
--- a/apps/frontend/src/pages/servers/manage/[id]/content/index.vue
+++ b/apps/frontend/src/pages/servers/manage/[id]/content/index.vue
@@ -172,12 +172,7 @@
>
-
+ by {{ mod.owner }}
{{ mod.version_number || "External mod" }}