Skip to content

Commit a75538c

Browse files
authored
Modrinth Servers Mega Features & Bug Fix-a-thon (#3222)
* fix(content): changing mod versions works again * chore(assets): update pyro logo * fix(properties): deprecate fetchconfigfile * Revert "fix(content): changing mod versions works again" This reverts commit d7c0d11. * feat(files): ability to sort via column click * chore(startup): update clunky wording * feat(serverListing): server icons SSR friendly * fix(servers): if archon fails, display err in listing * chore(serverlisting): use pyroserver hook to init icon * chore(servers): much more graceful reinstall * fix(servers): tw warn * fix(platform): correctly react when pack reinstalled * fix(serversroot): explicitly import navigateTo Signed-off-by: Evan Song <theevansong@gmail.com> * chore(serverlabels): show skeleton instead of hiding Signed-off-by: Evan Song <theevansong@gmail.com> * feat(platform): install-aware controls Signed-off-by: Evan Song <theevansong@gmail.com> * refactor!(platform): rewrite platform page * fix(platform): regression in autoselecting loader * chore(platform): prefer version over project modification date * fix(platform): permanent hang after initial mount * chore(platform): do not silently fail and hang if modpack fails loading * oops: remove hardcoded error causer * fix(platform): switch modpack btn while installing doesnt need class Signed-off-by: Evan Song <theevansong@gmail.com> * chore(platform): adjust styling in version modal Signed-off-by: Evan Song <theevansong@gmail.com> * chore(platform): prevent changing project card style Signed-off-by: Evan Song <theevansong@gmail.com> * refactor(pyrodropdown): rewrite Signed-off-by: Evan Song <theevansong@gmail.com> * fix(pyrodropdown): do nopt use deprecated substr Signed-off-by: Evan Song <theevansong@gmail.com> * chore: clean Signed-off-by: Evan Song <theevansong@gmail.com> * fix(network): sentence case Signed-off-by: Evan Song <theevansong@gmail.com> * refactor(terminal): initial batch Signed-off-by: Evan Song <theevansong@gmail.com> * fix(terminal): fulllog over fullscreen Signed-off-by: Evan Song <theevansong@gmail.com> * fix(terminal): fullscreen conflict with body scroll Signed-off-by: Evan Song <theevansong@gmail.com> * feat(terminal): init drag select * feat(terminal): shift click support Signed-off-by: Evan Song <theevansong@gmail.com> * chore(terminal): double lines limit Signed-off-by: Evan Song <theevansong@gmail.com> * feat(terminal): copy button Signed-off-by: Evan Song <theevansong@gmail.com> * chore(terminal): protip style Signed-off-by: Evan Song <theevansong@gmail.com> * chore(terminal): improve styles Signed-off-by: Evan Song <theevansong@gmail.com> * feat(terminal): regex search Signed-off-by: Evan Song <theevansong@gmail.com> * chore(terminal): move icons to icons dir Signed-off-by: Evan Song <theevansong@gmail.com> * chore(terminal): improve drag select autoscroll inertia Signed-off-by: Evan Song <theevansong@gmail.com> * fix(terminal): cancel selection on right click Signed-off-by: Evan Song <theevansong@gmail.com> * fix(terminal): progblur and stb btn disappearing Signed-off-by: Evan Song <theevansong@gmail.com> * refactor(serverstats): power efficiency * fix(subdomainlabel): correct tooltip terminology Signed-off-by: Evan Song <theevansong@gmail.com> * feat(preferences): users hide subdomain label Signed-off-by: Evan Song <theevansong@gmail.com> * chore(servers): clean Signed-off-by: Evan Song <theevansong@gmail.com> * chore(terminal): deselect lines on escape Signed-off-by: Evan Song <theevansong@gmail.com> * fix(serversidebar): type err Signed-off-by: Evan Song <theevansong@gmail.com> * fix(fileitem): vue server render type Signed-off-by: Evan Song <theevansong@gmail.com> * fix(terminal): disable pointer events on lines if scrolling Signed-off-by: Evan Song <theevansong@gmail.com> * fix(terminal): search result counts style Signed-off-by: Evan Song <theevansong@gmail.com> * fix(terminal): plural Signed-off-by: Evan Song <theevansong@gmail.com> * chore(terminal): clean Signed-off-by: Evan Song <theevansong@gmail.com> * feat(terminal): view selection Signed-off-by: Evan Song <theevansong@gmail.com> * feat(terminal): show actively selected lines in scrollbar Signed-off-by: Evan Song <theevansong@gmail.com> * fix(terminallog): btn color Signed-off-by: Evan Song <theevansong@gmail.com> * chore: clean Signed-off-by: Evan Song <theevansong@gmail.com> * fix(gamelabel): align to text Signed-off-by: Evan Song <theevansong@gmail.com> * fix(gamelabel): align to text Signed-off-by: Evan Song <theevansong@gmail.com> * fix(listing): remove deadcode Signed-off-by: Evan Song <theevansong@gmail.com> * fix(serverlisting): deprecated process.server Signed-off-by: Evan Song <theevansong@gmail.com> * fix(platform): correctly disable button Signed-off-by: Evan Song <theevansong@gmail.com> * fix(backups): do not allow backup creation during server installation Signed-off-by: Evan Song <theevansong@gmail.com> * fix(platform): flush stale currentversion data on successful install Signed-off-by: Evan Song <theevansong@gmail.com> * fix(gamelabel): fix gap Signed-off-by: Evan Song <theevansong@gmail.com> * chore(network): vaporize uppercase Signed-off-by: Evan Song <theevansong@gmail.com> * chore(info): vaporize uppercase Signed-off-by: Evan Song <theevansong@gmail.com> * chore(backups): style unification Signed-off-by: Evan Song <theevansong@gmail.com> * chore(backups): finalize style change Signed-off-by: Evan Song <theevansong@gmail.com> * fix(servers): catch pyro servers fetch errors during ssr Signed-off-by: Evan Song <theevansong@gmail.com> * fix(serverstats): ram as bytes graph now works Signed-off-by: Evan Song <theevansong@gmail.com> * fix(platform): unify attempts and refresh interval Signed-off-by: Evan Song <theevansong@gmail.com> * fix(terminal): input Signed-off-by: Evan Song <theevansong@gmail.com> * feat(servers): installing ticket + update available notice back in platform Signed-off-by: Evan Song <theevansong@gmail.com> * chore(terminal): dont add bg to scroll track Signed-off-by: Evan Song <theevansong@gmail.com> * fix(terminal): preserve whitespace Signed-off-by: Evan Song <theevansong@gmail.com> * chore(serversroot): unnest blurred icon query Signed-off-by: Evan Song <theevansong@gmail.com> * fix(serverstats): clamp memory usage to 100% no matter what Signed-off-by: Evan Song <theevansong@gmail.com> * feat(terminal): allow copy of single lines, show btn Signed-off-by: Evan Song <theevansong@gmail.com> * chore(terminal): animate copy>view transition Signed-off-by: Evan Song <theevansong@gmail.com> * init: search improvements Signed-off-by: Evan Song <theevansong@gmail.com> * fix: lint Signed-off-by: Evan Song <theevansong@gmail.com> * chore: change log modal title Signed-off-by: Evan Song <theevansong@gmail.com> * fix: hide fullscreen when selecting and cancel selection on clickout Signed-off-by: Evan Song <theevansong@gmail.com> * refactor(terminal): more reliable jumpToLine Signed-off-by: Evan Song <theevansong@gmail.com> * feat: search results separator Signed-off-by: Evan Song <theevansong@gmail.com> * chore: remove buggy isScrollable check Signed-off-by: Evan Song <theevansong@gmail.com> * fix: style Signed-off-by: Evan Song <theevansong@gmail.com> * refactor: correctly store pos to make jump reliable Signed-off-by: Evan Song <theevansong@gmail.com> * fix: disparity between search/log dragselect Signed-off-by: Evan Song <theevansong@gmail.com> * fix: prevent propagation of click events when clicking on jump btn Signed-off-by: Evan Song <theevansong@gmail.com> * fix: switch selection strategies depending on terminal mode Signed-off-by: Evan Song <theevansong@gmail.com> * chore: smarter esc handling Signed-off-by: Evan Song <theevansong@gmail.com> * finalize Signed-off-by: Evan Song <theevansong@gmail.com> * run fix * fix: ensure lines between cannot be selected Signed-off-by: Evan Song <theevansong@gmail.com> * fix: increase initial log batch to 256 Signed-off-by: Evan Song <theevansong@gmail.com> * fix(terminal): click on scroll track should take user to new scroll position Signed-off-by: Evan Song <theevansong@gmail.com> * fix(terminal): update aria label for view selected logs btn Signed-off-by: Evan Song <theevansong@gmail.com> * chore: clean Signed-off-by: Evan Song <theevansong@gmail.com> --------- Signed-off-by: Evan Song <theevansong@gmail.com>
1 parent 037cc86 commit a75538c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+3248
-2490
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ import {
7575
RightArrowIcon,
7676
} from "@modrinth/assets";
7777
import { computed, shallowRef, ref } from "vue";
78-
import { renderToString } from "@vue/server-renderer";
78+
import { renderToString } from "vue/server-renderer";
7979
import { useRouter, useRoute } from "vue-router";
8080
import {
8181
UiServersIconsCogFolderIcon,

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

Lines changed: 20 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<div ref="pyroFilesSentinel" class="sentinel" data-pyro-files-sentinel />
33
<header
44
:class="[
5-
'duration-20 h-26 top-0 flex select-none flex-col justify-between gap-2 bg-table-alternateRow p-3 transition-[border-radius] sm:h-12 sm:flex-row',
5+
'duration-20 top-0 flex select-none flex-col justify-between gap-2 bg-table-alternateRow p-3 transition-[border-radius] sm:h-12 sm:flex-row',
66
!isStuck ? 'rounded-t-2xl' : 'sticky top-0 z-20',
77
]"
88
data-pyro-files-state="browsing"
@@ -76,25 +76,23 @@
7676
<UiServersTeleportOverflowMenu
7777
position="bottom"
7878
direction="left"
79-
aria-label="Sort files"
79+
aria-label="Filter view"
8080
:options="[
81-
{ id: 'normal', action: () => $emit('sort', 'default') },
82-
{ id: 'modified', action: () => $emit('sort', 'modified') },
83-
{ id: 'created', action: () => $emit('sort', 'created') },
84-
{ id: 'filesOnly', action: () => $emit('sort', 'filesOnly') },
85-
{ id: 'foldersOnly', action: () => $emit('sort', 'foldersOnly') },
81+
{ id: 'all', action: () => $emit('filter', 'all') },
82+
{ id: 'filesOnly', action: () => $emit('filter', 'filesOnly') },
83+
{ id: 'foldersOnly', action: () => $emit('filter', 'foldersOnly') },
8684
]"
8785
>
88-
<span class="hidden whitespace-pre text-sm font-medium sm:block">
89-
{{ sortMethodLabel }}
90-
</span>
91-
<SortAscendingIcon aria-hidden="true" />
86+
<div class="flex items-center gap-1">
87+
<FilterIcon aria-hidden="true" class="h-5 w-5" />
88+
<span class="hidden text-sm font-medium sm:block">
89+
{{ filterLabel }}
90+
</span>
91+
</div>
9292
<DropdownIcon aria-hidden="true" class="h-5 w-5 text-secondary" />
93-
<template #normal> Alphabetical </template>
94-
<template #modified> Date modified </template>
95-
<template #created> Date created </template>
96-
<template #filesOnly> Files only </template>
97-
<template #foldersOnly> Folders only </template>
93+
<template #all>Show all</template>
94+
<template #filesOnly>Files only</template>
95+
<template #foldersOnly>Folders only</template>
9896
</UiServersTeleportOverflowMenu>
9997
</ButtonStyled>
10098
<div class="mx-1 w-full text-sm sm:w-48">
@@ -148,9 +146,9 @@ import {
148146
DropdownIcon,
149147
FolderOpenIcon,
150148
SearchIcon,
151-
SortAscendingIcon,
152149
HomeIcon,
153150
ChevronRightIcon,
151+
FilterIcon,
154152
} from "@modrinth/assets";
155153
import { ButtonStyled } from "@modrinth/ui";
156154
import { ref, computed } from "vue";
@@ -159,15 +157,15 @@ import { useIntersectionObserver } from "@vueuse/core";
159157
const props = defineProps<{
160158
breadcrumbSegments: string[];
161159
searchQuery: string;
162-
sortMethod: string;
160+
currentFilter: string;
163161
}>();
164162
165163
defineEmits<{
166164
(e: "navigate", index: number): void;
167-
(e: "sort", method: string): void;
168165
(e: "create", type: "file" | "directory"): void;
169166
(e: "upload"): void;
170167
(e: "update:searchQuery", value: string): void;
168+
(e: "filter", type: string): void;
171169
}>();
172170
173171
const pyroFilesSentinel = ref<HTMLElement | null>(null);
@@ -181,18 +179,14 @@ useIntersectionObserver(
181179
{ threshold: [0, 1] },
182180
);
183181
184-
const sortMethodLabel = computed(() => {
185-
switch (props.sortMethod) {
186-
case "modified":
187-
return "Date modified";
188-
case "created":
189-
return "Date created";
182+
const filterLabel = computed(() => {
183+
switch (props.currentFilter) {
190184
case "filesOnly":
191185
return "Files only";
192186
case "foldersOnly":
193187
return "Folders only";
194188
default:
195-
return "Alphabetical";
189+
return "Show all";
196190
}
197191
});
198192
</script>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
@mouseleave="stopPan"
1010
@wheel.prevent="handleWheel"
1111
>
12-
<UiServersPyroLoading v-if="state.isLoading" />
12+
<div v-if="state.isLoading" />
1313
<div
1414
v-if="state.hasError"
1515
class="flex h-full w-full flex-col items-center justify-center gap-8"
Lines changed: 56 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,65 @@
11
<template>
22
<div
33
aria-hidden="true"
4-
class="flex w-full select-none flex-row items-center border-0 border-b border-solid border-bg-raised px-3 py-2 text-xs font-bold uppercase"
4+
class="sticky top-12 z-20 flex h-8 w-full select-none flex-row items-center border-0 border-b border-solid border-bg-raised bg-bg px-3 text-xs font-bold uppercase"
55
>
66
<div class="min-w-[48px]"></div>
7-
<span class="flex w-full">Name</span>
7+
<button
8+
class="flex h-full w-full appearance-none items-center gap-1 bg-transparent text-left hover:text-brand"
9+
@click="$emit('sort', 'name')"
10+
>
11+
<span>Name</span>
12+
<ChevronUpIcon v-if="sortField === 'name' && !sortDesc" class="h-3 w-3" aria-hidden="true" />
13+
<ChevronDownIcon v-if="sortField === 'name' && sortDesc" class="h-3 w-3" aria-hidden="true" />
14+
</button>
815
<div class="flex shrink-0 gap-4 text-right md:gap-12">
9-
<span class="hidden min-w-[160px] md:block">Created</span>
10-
<span class="mr-4 min-w-[160px]">Modified</span>
11-
<div class="min-w-[36px]"></div>
16+
<button
17+
class="hidden min-w-[160px] appearance-none items-center justify-start gap-1 bg-transparent hover:text-brand md:flex"
18+
@click="$emit('sort', 'created')"
19+
>
20+
<span>Created</span>
21+
<ChevronUpIcon
22+
v-if="sortField === 'created' && !sortDesc"
23+
class="h-3 w-3"
24+
aria-hidden="true"
25+
/>
26+
<ChevronDownIcon
27+
v-if="sortField === 'created' && sortDesc"
28+
class="h-3 w-3"
29+
aria-hidden="true"
30+
/>
31+
</button>
32+
<button
33+
class="mr-4 hidden min-w-[160px] appearance-none items-center justify-start gap-1 bg-transparent hover:text-brand md:flex"
34+
@click="$emit('sort', 'modified')"
35+
>
36+
<span>Modified</span>
37+
<ChevronUpIcon
38+
v-if="sortField === 'modified' && !sortDesc"
39+
class="h-3 w-3"
40+
aria-hidden="true"
41+
/>
42+
<ChevronDownIcon
43+
v-if="sortField === 'modified' && sortDesc"
44+
class="h-3 w-3"
45+
aria-hidden="true"
46+
/>
47+
</button>
48+
<div class="min-w-[24px]"></div>
1249
</div>
1350
</div>
1451
</template>
52+
53+
<script setup lang="ts">
54+
import ChevronDownIcon from "./icons/ChevronDownIcon.vue";
55+
import ChevronUpIcon from "./icons/ChevronUpIcon.vue";
56+
57+
defineProps<{
58+
sortField: string;
59+
sortDesc: boolean;
60+
}>();
61+
62+
defineEmits<{
63+
(e: "sort", field: string): void;
64+
}>();
65+
</script>
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
<template>
2+
<div class="ticker-container">
3+
<div class="ticker-content">
4+
<div
5+
v-for="(message, index) in msgs"
6+
:key="message"
7+
class="ticker-item text-xs"
8+
:class="{ active: index === currentIndex % msgs.length }"
9+
>
10+
{{ message }}
11+
</div>
12+
</div>
13+
</div>
14+
</template>
15+
16+
<script setup lang="ts">
17+
import { ref, onMounted, onUnmounted } from "vue";
18+
19+
const msgs = [
20+
"Organizing files...",
21+
"Downloading mods...",
22+
"Configuring server...",
23+
"Setting up environment...",
24+
"Adding Java...",
25+
];
26+
27+
const currentIndex = ref(0);
28+
29+
let intervalId: NodeJS.Timeout | null = null;
30+
31+
onMounted(() => {
32+
intervalId = setInterval(() => {
33+
currentIndex.value = (currentIndex.value + 1) % msgs.length;
34+
}, 3000);
35+
});
36+
37+
onUnmounted(() => {
38+
if (intervalId) {
39+
clearInterval(intervalId);
40+
}
41+
});
42+
</script>
43+
44+
<style scoped>
45+
.ticker-container {
46+
height: 20px;
47+
width: 100%;
48+
position: relative;
49+
}
50+
51+
.ticker-content {
52+
position: relative;
53+
width: 100%;
54+
}
55+
56+
.ticker-item {
57+
position: absolute;
58+
top: 0;
59+
left: 0;
60+
width: 100%;
61+
height: 20px;
62+
display: flex;
63+
align-items: center;
64+
color: var(--color-secondary-text);
65+
opacity: 0;
66+
transform: scale(0.9);
67+
filter: blur(4px);
68+
transition: all 0.3s ease-in-out;
69+
}
70+
71+
.ticker-item.active {
72+
opacity: 1;
73+
transform: scale(1);
74+
filter: blur(0);
75+
}
76+
</style>

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
:is-current="isCurrentLoader(loader.name)"
1111
:loader-version="data.loader_version"
1212
:current-loader="data.loader"
13+
:is-installing="isInstalling"
1314
@select="selectLoader"
1415
/>
1516
</div>
@@ -28,6 +29,7 @@
2829
:is-current="isCurrentLoader(loader.name)"
2930
:loader-version="data.loader_version"
3031
:current-loader="data.loader"
32+
:is-installing="isInstalling"
3133
@select="selectLoader"
3234
/>
3335
</div>
@@ -47,6 +49,7 @@
4749
:is-current="isCurrentLoader(loader.name)"
4850
:loader-version="data.loader_version"
4951
:current-loader="data.loader"
52+
:is-installing="isInstalling"
5053
@select="selectLoader"
5154
/>
5255
</div>
@@ -60,6 +63,7 @@ const props = defineProps<{
6063
loader: string | null;
6164
loader_version: string | null;
6265
};
66+
isInstalling?: boolean;
6367
}>();
6468
6569
const emit = defineEmits<{

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
</div>
3232

3333
<ButtonStyled>
34-
<button @click="onSelect">
34+
<button :disabled="isInstalling" @click="onSelect">
3535
<DownloadIcon class="h-5 w-5" />
3636
{{ isCurrentLoader ? "Reinstall" : "Install" }}
3737
</button>
@@ -52,6 +52,7 @@ interface Props {
5252
loader: LoaderInfo;
5353
currentLoader: string | null;
5454
loaderVersion: string | null;
55+
isInstalling?: boolean;
5556
}
5657
5758
const props = defineProps<Props>();

0 commit comments

Comments
 (0)