Compare commits

..
5 changed files with 43 additions and 50 deletions

No files matched your search

@@ -259,7 +259,7 @@
</button> </button>
</ButtonStyled> </ButtonStyled>
<ButtonStyled color="green"> <ButtonStyled color="green">
<button @click="sendMessage(project.requested_status ?? 'approved')"> <button @click="sendMessage('approved')">
<CheckIcon aria-hidden="true" /> <CheckIcon aria-hidden="true" />
Approve Approve
</button> </button>
@@ -355,7 +355,6 @@ import {
renderHighlightedString, renderHighlightedString,
type ModerationJudgements, type ModerationJudgements,
type ModerationModpackItem, type ModerationModpackItem,
type ProjectStatus,
} from "@modrinth/utils"; } from "@modrinth/utils";
import { computedAsync, useLocalStorage } from "@vueuse/core"; import { computedAsync, useLocalStorage } from "@vueuse/core";
import { import {
@@ -528,7 +527,7 @@ function handleKeybinds(event: KeyboardEvent) {
tryResetProgress: resetProgress, tryResetProgress: resetProgress,
tryExitModeration: () => emit("exit"), tryExitModeration: () => emit("exit"),
tryApprove: () => sendMessage(props.project.requested_status), tryApprove: () => sendMessage("approved"),
tryReject: () => sendMessage("rejected"), tryReject: () => sendMessage("rejected"),
tryWithhold: () => sendMessage("withheld"), tryWithhold: () => sendMessage("withheld"),
tryEditMessage: goBackToStages, tryEditMessage: goBackToStages,
@@ -1209,7 +1208,7 @@ function generateModpackMessage(allFiles: {
} }
const hasNextProject = ref(false); const hasNextProject = ref(false);
async function sendMessage(status: ProjectStatus) { async function sendMessage(status: "approved" | "rejected" | "withheld") {
try { try {
await useBaseFetch(`project/${props.project.id}`, { await useBaseFetch(`project/${props.project.id}`, {
method: "PATCH", method: "PATCH",
@@ -147,7 +147,7 @@ export async function useServersFetch<T>(
404: "Not Found", 404: "Not Found",
405: "Method Not Allowed", 405: "Method Not Allowed",
408: "Request Timeout", 408: "Request Timeout",
429: "You're making requests too quickly. Please wait a moment and try again.", 429: "Too Many Requests",
500: "Internal Server Error", 500: "Internal Server Error",
502: "Bad Gateway", 502: "Bad Gateway",
503: "Service Unavailable", 503: "Service Unavailable",
@@ -167,17 +167,11 @@ export async function useServersFetch<T>(
console.error("Fetch error:", error); console.error("Fetch error:", error);
const fetchError = new ModrinthServersFetchError( const fetchError = new ModrinthServersFetchError(
`[Modrinth Servers] ${error.message}`, `[Modrinth Servers] ${message}`,
statusCode, statusCode,
error, error,
); );
throw new ModrinthServerError( throw new ModrinthServerError(error.message, statusCode, fetchError, module, v1Error);
`[Modrinth Servers] ${message}`,
statusCode,
fetchError,
module,
v1Error,
);
} }
const baseDelay = statusCode && statusCode >= 500 ? 5000 : 1000; const baseDelay = statusCode && statusCode >= 500 ? 5000 : 1000;
@@ -42,7 +42,7 @@
</label> </label>
<ButtonStyled> <ButtonStyled>
<button <button
:disabled="invocation === originalInvocation" :disabled="invocation === startupSettings?.original_invocation"
class="!w-full sm:!w-auto" class="!w-full sm:!w-auto"
@click="resetToDefault" @click="resetToDefault"
> >
@@ -120,9 +120,8 @@ const props = defineProps<{
server: ModrinthServer; server: ModrinthServer;
}>(); }>();
await props.server.startup.fetch();
const data = computed(() => props.server.general); const data = computed(() => props.server.general);
const startupSettings = computed(() => props.server.startup);
const showAllVersions = ref(false); const showAllVersions = ref(false);
const jdkVersionMap = [ const jdkVersionMap = [
@@ -138,15 +137,33 @@ const jdkBuildMap = [
{ value: "graal", label: "GraalVM" }, { value: "graal", label: "GraalVM" },
]; ];
const invocation = ref(props.server.startup.invocation); const invocation = ref("");
const jdkVersion = ref( const jdkVersion = ref("");
jdkVersionMap.find((v) => v.value === props.server.startup.jdk_version)?.label, const jdkBuild = ref("");
);
const jdkBuild = ref(jdkBuildMap.find((v) => v.value === props.server.startup.jdk_build)?.label);
const originalInvocation = ref(invocation.value); const originalInvocation = ref("");
const originalJdkVersion = ref(jdkVersion.value); const originalJdkVersion = ref("");
const originalJdkBuild = ref(jdkBuild.value); const originalJdkBuild = ref("");
watch(
startupSettings,
(newSettings) => {
if (newSettings) {
invocation.value = newSettings.invocation;
originalInvocation.value = newSettings.invocation;
const jdkVersionLabel =
jdkVersionMap.find((v) => v.value === newSettings.jdk_version)?.label || "";
jdkVersion.value = jdkVersionLabel;
originalJdkVersion.value = jdkVersionLabel;
const jdkBuildLabel = jdkBuildMap.find((v) => v.value === newSettings.jdk_build)?.label || "";
jdkBuild.value = jdkBuildLabel;
originalJdkBuild.value = jdkBuildLabel;
}
},
{ immediate: true },
);
const hasUnsavedChanges = computed( const hasUnsavedChanges = computed(
() => () =>
@@ -178,7 +195,7 @@ const displayedJavaVersions = computed(() => {
return showAllVersions.value ? jdkVersionMap.map((v) => v.label) : compatibleJavaVersions.value; return showAllVersions.value ? jdkVersionMap.map((v) => v.label) : compatibleJavaVersions.value;
}); });
async function saveStartup() { const saveStartup = async () => {
try { try {
isUpdating.value = true; isUpdating.value = true;
const invocationValue = invocation.value ?? ""; const invocationValue = invocation.value ?? "";
@@ -215,17 +232,17 @@ async function saveStartup() {
} finally { } finally {
isUpdating.value = false; isUpdating.value = false;
} }
} };
function resetStartup() { const resetStartup = () => {
invocation.value = originalInvocation.value; invocation.value = originalInvocation.value;
jdkVersion.value = originalJdkVersion.value; jdkVersion.value = originalJdkVersion.value;
jdkBuild.value = originalJdkBuild.value; jdkBuild.value = originalJdkBuild.value;
} };
function resetToDefault() { const resetToDefault = () => {
invocation.value = originalInvocation.value ?? ""; invocation.value = startupSettings.value?.original_invocation ?? "";
} };
</script> </script>
<style scoped> <style scoped>
@@ -4,7 +4,7 @@ Per section 5.1 of %RULES%, it is important that the metadata of your projects i
For a brief rundown of how this works: For a brief rundown of how this works:
- Some modpacks can be client-side, usually aimed at providing utility and optimization while allowing the player to join an unmodded server, for instance, [Fabulously Optimized](https://modrinth.com/project/1KVo5zza). - Some modpacks can be client-side, usually aimed at providing utility and optimization while allowing the player to join an unmodded server, for instance, [Fabulously Optimized](https://modrinth.com/modpack/fabulously-optimized).
- Most other modpacks that change how the game is played are going to be required on both the client and server, like the modpack [Aged](https://modrinth.com/project/i4XHCd7Q). - Most other modpacks that change how the game is played are going to be required on both the client and server, like the modpack [Dying Light](https://modrinth.com/modpack/dying-light).
When in doubt, test for yourself or check the requirements of the mods in your pack. When in doubt, test for yourself or check the requirements of the mods in your pack.
-17
View File
@@ -10,23 +10,6 @@ export type VersionEntry = {
} }
const VERSIONS: VersionEntry[] = [ const VERSIONS: VersionEntry[] = [
{
date: `2025-08-01T21:30:00-04:00`,
product: 'web',
body: `### Improvements
- Fixed issues with the newsletter subscription checkbox & buttons on news pages. ([#4072](https://github.com/modrinth/code/pull/4072), [#4073](https://github.com/modrinth/code/pull/4073))
- You can now access the "Moderation" tab on project pages again even if your project is approved. ([#4067](https://github.com/modrinth/code/pull/4067))
- Fixed issues with collection visibility. ([#4070](https://github.com/modrinth/code/pull/4070))
- Fixed text issue on collection icon upload dropdown. ([#4069](https://github.com/modrinth/code/pull/4069))`,
},
{
date: `2025-08-01T21:30:00-04:00`,
product: 'servers',
body: `### Improvements
- Server status information is now correctly displayed in the 'My Servers' page. ([#4071](https://github.com/modrinth/code/pull/4071))
- Fixed an error with displaying startup settings.
- Improved ratelimit error message.`,
},
{ {
date: `2025-07-19T15:20:00-07:00`, date: `2025-07-19T15:20:00-07:00`,
product: 'web', product: 'web',