Skip to content

Commit e1b864f

Browse files
committed
fix(frontend): fix wave 1
1 parent e84318c commit e1b864f

File tree

5 files changed

+51
-18
lines changed

5 files changed

+51
-18
lines changed

apps/frontend/src/components/ui/servers/ContentItem.vue

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,11 @@
4949
</template>
5050

5151
<script setup lang="ts">
52-
import { Button, Checkbox } from "@modrinth/ui";
52+
import { Button } from "@modrinth/ui";
5353
import { EditIcon, TrashIcon } from "@modrinth/assets";
5454
5555
const emit = defineEmits(["toggle", "delete", "edit"]);
5656
57-
const selected = ref(false);
58-
5957
defineProps<{
6058
data: {
6159
name?: string;

apps/frontend/src/components/ui/servers/ProjectSelect.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<div class="flex h-full w-full flex-col overflow-clip p-2 pb-4">
2+
<div class="flex h-[400px] w-full flex-col overflow-clip p-2 pb-4">
33
<div class="iconified-input w-full">
44
<label class="hidden" for="search">Search</label>
55
<SearchIcon aria-hidden="true" />
@@ -150,6 +150,9 @@ const loadMore = async () => {
150150
const { reset } = useInfiniteScroll(scrollContainer, async () => {
151151
if (page.value <= pages.value) {
152152
await loadMore();
153+
console.log("loading more");
154+
console.log(page.value);
155+
console.log(pages.value);
153156
}
154157
});
155158
Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,39 @@
11
<template>
2-
<div v-if="subdomain" v-tooltip="'Change custom URL'" class="flex flex-row items-center gap-4">
2+
<div
3+
v-if="subdomain"
4+
v-tooltip="'Copy subdomain'"
5+
class="flex flex-row items-center gap-4 hover:cursor-pointer"
6+
>
37
<div class="experimental-styles-within h-6 w-0.5 bg-button-border"></div>
48
<div class="flex flex-row items-center gap-2">
59
<LinkIcon />
6-
<NuxtLink
7-
:to="serverId ? `/servers/manage/${serverId}/options/network` : ''"
10+
<div
811
class="text-sm font-semibold"
912
:class="serverId ? 'hover:underline' : ''"
13+
@click="copySubdomain"
1014
>
1115
{{ subdomain }}.modrinth.gg
12-
</NuxtLink>
16+
</div>
1317
</div>
1418
</div>
1519
</template>
1620

1721
<script setup lang="ts">
1822
import { LinkIcon } from "@modrinth/assets";
19-
defineProps<{
23+
const props = defineProps<{
2024
subdomain: string;
2125
}>();
2226
27+
const copySubdomain = () => {
28+
navigator.clipboard.writeText(props.subdomain + ".modrinth.gg");
29+
addNotification({
30+
group: "servers",
31+
title: "Subdomain copied",
32+
text: "Your subdomain has been copied to your clipboard.",
33+
type: "success",
34+
});
35+
};
36+
2337
const route = useNativeRoute();
2438
const serverId = computed(() => route.params.id as string);
2539
</script>

apps/frontend/src/pages/servers/manage/[id]/options/loader.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
v-tooltip="'Current installed Modpack version'"
8888
class="rounded-full bg-bg-green p-1 px-2 text-sm font-semibold text-brand"
8989
>
90-
v{{ currentVersion?.version_number }}
90+
{{ currentVersion?.version_number }}
9191
</span>
9292
</h1>
9393
<span class="text-md font-semibold text-secondary">

apps/frontend/src/pages/servers/manage/[id]/options/network.vue

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,6 @@
139139
</template>
140140

141141
<script setup lang="ts">
142-
// currently broken, will fix
143-
144142
import { PlusIcon, TrashIcon, EditIcon, VersionIcon, SaveIcon } from "@modrinth/assets";
145143
import { ButtonStyled, Modal, Button } from "@modrinth/ui";
146144
import type { Server } from "~/composables/pyroServers";
@@ -157,7 +155,7 @@ const serverSubdomain = ref(data?.value?.net?.domain ?? "");
157155
const serverPrimaryPort = ref(data?.value?.net?.port ?? 0);
158156
159157
const network = computed(() => props.server.network);
160-
const allocations = ref(network.value?.allocations);
158+
const allocations = computed(() => network.value?.allocations);
161159
162160
const newAllocationModal = ref();
163161
const editAllocationModal = ref();
@@ -172,10 +170,17 @@ const addNewAllocation = async () => {
172170
try {
173171
await props.server.network?.reserveAllocation(newAllocationName.value);
174172
175-
await props.server.refresh();
176-
177173
newAllocationModal.value.hide();
178174
newAllocationName.value = "";
175+
176+
await props.server.refresh();
177+
178+
addNotification({
179+
group: "serverOptions",
180+
type: "success",
181+
title: "Allocation reserved",
182+
text: "Your allocation has been reserved.",
183+
});
179184
} catch (error) {
180185
console.error("Failed to reserve new allocation:", error);
181186
}
@@ -192,18 +197,32 @@ const editAllocation = async () => {
192197
try {
193198
await props.server.network?.updateAllocation(newAllocationPort.value, newAllocationName.value);
194199
195-
await props.server.refresh();
196-
197200
editAllocationModal.value.hide();
198201
newAllocationName.value = "";
202+
203+
await props.server.refresh();
204+
205+
addNotification({
206+
group: "serverOptions",
207+
type: "success",
208+
title: "Allocation updated",
209+
text: "Your allocation has been updated.",
210+
});
199211
} catch (error) {
200212
console.error("Failed to reserve new allocation:", error);
201213
}
202214
};
203215
204216
const removeAllocation = async (port: number) => {
205217
await props.server.network?.deleteAllocation(port);
218+
206219
await props.server.refresh();
220+
addNotification({
221+
group: "serverOptions",
222+
type: "success",
223+
title: "Allocation removed",
224+
text: "Your allocation has been removed.",
225+
});
207226
};
208227
209228
const saveNetwork = async () => {
@@ -251,6 +270,5 @@ const saveNetwork = async () => {
251270
252271
const resetNetwork = () => {
253272
serverSubdomain.value = data?.value?.net?.domain ?? "";
254-
allocations.value = network.value?.allocations ?? [];
255273
};
256274
</script>

0 commit comments

Comments
 (0)