Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions frontend/src/api/modpack.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
import apiClient from './client'
import type { Modpack, ModpackState, PublicModpack } from '@/types'

export async function getModpackState(): Promise<ModpackState> {
const response = await apiClient.get('/api/modpack')
return response.data.data
}

export async function saveModpackDraft(payload: {
name: string
version: string
modList: string[]
description: string | null
}): Promise<Modpack> {
const response = await apiClient.put('/api/modpack', payload)
return response.data.data
}

export async function buildModpack(): Promise<Modpack> {
const response = await apiClient.post('/api/modpack/build')
return response.data.data
}

export async function publishModpack(): Promise<Modpack> {
const response = await apiClient.post('/api/modpack/publish')
return response.data.data
}

export async function archiveModpack(): Promise<Modpack> {
const response = await apiClient.post('/api/modpack/archive')
return response.data.data
}

export async function unarchiveModpack(): Promise<Modpack> {
const response = await apiClient.post('/api/modpack/unarchive')
return response.data.data
}

export async function deleteModpack(): Promise<void> {
await apiClient.delete('/api/modpack')
}

/**
* Public metadata for the currently-published modpack. Returns null if none
* is published. Doesn't require auth — used by the login page to decide
* whether to show the download CTA.
*/
export async function getPublishedModpack(): Promise<PublicModpack | null> {
try {
const response = await apiClient.get('/api/modpack/public')
const env = response.data
if (env?.code !== 200) return null
return env.data as PublicModpack
} catch {
return null
}
}

/** Public download URL — anchor href, not fetched programmatically. */
export const publicModpackDownloadUrl = '/api/modpack/public/download'
47 changes: 47 additions & 0 deletions frontend/src/i18n/locales/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1037,6 +1037,53 @@ const de = {
modsFound: 'Mods gefunden',
},

modpack: {
tabLabel: 'Modpack',
intro: 'Bündeln Sie installierte Mods in eine einzelne ZIP-Datei, die Spieler von der Anmeldeseite herunterladen können. Nur das veröffentlichte Paket ist öffentlich verfügbar — Entwürfe und archivierte Pakete bleiben privat.',
status: {
draft: 'Entwurf',
published: 'Veröffentlicht',
archived: 'Archiviert',
},
modCount: '{n} Mod(s)',
downloadsCount: '{n} Download(s)',
publicDownloadLink: 'Öffentlichen Download-Link öffnen',
fields: {
name: 'Paketname',
version: 'Version',
modList: 'Enthaltene Mods',
description: 'Beschreibung',
},
placeholders: {
name: 'z. B. KitsuneDen Client Pack',
modList: 'Mods zum Einschließen auswählen...',
description: 'Optional — was im Paket ist, für wen, Versions-Notizen.',
},
modListHint: 'Nur Mods, die derzeit auf dem Server installiert sind, erscheinen hier. Fügen Sie zuerst ein Mod über die Registerkarte „Installiert“ hinzu, dann kehren Sie zurück.',
actions: {
saveDraft: 'Entwurf speichern',
build: 'ZIP erstellen',
publish: 'Veröffentlichen',
archive: 'Archivieren',
unarchive: 'Aus Archiv wiederherstellen',
delete: 'Paket löschen',
},
confirmDelete: 'Modpack-Datensatz und ZIP-Datei löschen? Spieler verlieren den Download-Link, bis Sie ein neues veröffentlichen.',
ctaTooltip: '{size} · {n} Mod(s)',
saved: 'Modpack als Entwurf gespeichert',
built: 'Modpack-ZIP erstellt',
published: 'Modpack veröffentlicht — Download ist jetzt auf der Anmeldeseite verfügbar',
archived: 'Modpack archiviert',
unarchived: 'Modpack als Entwurf wiederhergestellt',
deleted: 'Modpack gelöscht',
failedToLoad: 'Modpack konnte nicht geladen werden',
failedToSave: 'Modpack konnte nicht gespeichert werden',
failedToBuild: 'Modpack-ZIP konnte nicht erstellt werden',
failedToPublish: 'Modpack konnte nicht veröffentlicht werden',
failedToArchive: 'Modpack konnte nicht archiviert werden',
failedToDelete: 'Modpack konnte nicht gelöscht werden',
},

backups: {
title: 'Sicherungen',
createNow: 'Sicherung erstellen',
Expand Down
47 changes: 47 additions & 0 deletions frontend/src/i18n/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1034,6 +1034,53 @@ const en = {
modsFound: 'mods found',
},

modpack: {
tabLabel: 'Modpack',
intro: 'Bundle installed mods into a single zip players can download from the login page. Only the published pack is publicly downloadable — drafts and archived packs stay private.',
status: {
draft: 'Draft',
published: 'Published',
archived: 'Archived',
},
modCount: '{n} mod(s)',
downloadsCount: '{n} download(s)',
publicDownloadLink: 'Open public download link',
fields: {
name: 'Pack name',
version: 'Version',
modList: 'Included mods',
description: 'Description',
},
placeholders: {
name: 'e.g. KitsuneDen Client Pack',
modList: 'Pick mods to include...',
description: 'Optional — what\'s in this pack, who it\'s for, version notes.',
},
modListHint: 'Only mods currently installed on the server appear here. Add a mod via the Installed tab first, then come back to include it.',
actions: {
saveDraft: 'Save Draft',
build: 'Build Zip',
publish: 'Publish',
archive: 'Archive',
unarchive: 'Restore from Archive',
delete: 'Delete Pack',
},
confirmDelete: 'Delete the modpack record and its zip file? Players will lose the download link until you publish a new one.',
ctaTooltip: '{size} · {n} mod(s)',
saved: 'Modpack saved as draft',
built: 'Modpack zip built',
published: 'Modpack published — download is now live on the login page',
archived: 'Modpack archived',
unarchived: 'Modpack restored to draft',
deleted: 'Modpack deleted',
failedToLoad: 'Failed to load modpack',
failedToSave: 'Failed to save modpack',
failedToBuild: 'Failed to build modpack zip',
failedToPublish: 'Failed to publish modpack',
failedToArchive: 'Failed to archive modpack',
failedToDelete: 'Failed to delete modpack',
},

backups: {
title: 'Backups',
createNow: 'Create Backup',
Expand Down
47 changes: 47 additions & 0 deletions frontend/src/i18n/locales/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1037,6 +1037,53 @@ const es = {
modsFound: 'mods encontrados',
},

modpack: {
tabLabel: 'Modpack',
intro: 'Agrupe los mods instalados en un único archivo ZIP que los jugadores pueden descargar desde la página de inicio de sesión. Solo el pack publicado se puede descargar públicamente — los borradores y los packs archivados permanecen privados.',
status: {
draft: 'Borrador',
published: 'Publicado',
archived: 'Archivado',
},
modCount: '{n} mod(s)',
downloadsCount: '{n} descarga(s)',
publicDownloadLink: 'Abrir enlace de descarga pública',
fields: {
name: 'Nombre del pack',
version: 'Versión',
modList: 'Mods incluidos',
description: 'Descripción',
},
placeholders: {
name: 'p. ej. KitsuneDen Client Pack',
modList: 'Elija mods para incluir...',
description: 'Opcional — qué contiene este pack, a quién va dirigido, notas de versión.',
},
modListHint: 'Solo aparecen aquí los mods actualmente instalados en el servidor. Añada primero un mod desde la pestaña Instalados, y luego regrese para incluirlo.',
actions: {
saveDraft: 'Guardar borrador',
build: 'Construir ZIP',
publish: 'Publicar',
archive: 'Archivar',
unarchive: 'Restaurar desde archivo',
delete: 'Eliminar pack',
},
confirmDelete: '¿Eliminar el registro del modpack y su archivo ZIP? Los jugadores perderán el enlace de descarga hasta que publique uno nuevo.',
ctaTooltip: '{size} · {n} mod(s)',
saved: 'Modpack guardado como borrador',
built: 'ZIP del modpack construido',
published: 'Modpack publicado — la descarga está activa en la página de inicio de sesión',
archived: 'Modpack archivado',
unarchived: 'Modpack restaurado a borrador',
deleted: 'Modpack eliminado',
failedToLoad: 'No se pudo cargar el modpack',
failedToSave: 'No se pudo guardar el modpack',
failedToBuild: 'No se pudo construir el ZIP del modpack',
failedToPublish: 'No se pudo publicar el modpack',
failedToArchive: 'No se pudo archivar el modpack',
failedToDelete: 'No se pudo eliminar el modpack',
},

backups: {
title: 'Copias de seguridad',
createNow: 'Crear copia de seguridad',
Expand Down
47 changes: 47 additions & 0 deletions frontend/src/i18n/locales/fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1037,6 +1037,53 @@ const fr = {
modsFound: 'mods trouvés',
},

modpack: {
tabLabel: 'Modpack',
intro: 'Regroupez les mods installés dans une seule archive ZIP que les joueurs peuvent télécharger depuis la page de connexion. Seul le pack publié est téléchargeable publiquement — les brouillons et les packs archivés restent privés.',
status: {
draft: 'Brouillon',
published: 'Publié',
archived: 'Archivé',
},
modCount: '{n} mod(s)',
downloadsCount: '{n} téléchargement(s)',
publicDownloadLink: 'Ouvrir le lien de téléchargement public',
fields: {
name: 'Nom du pack',
version: 'Version',
modList: 'Mods inclus',
description: 'Description',
},
placeholders: {
name: 'p. ex. KitsuneDen Client Pack',
modList: 'Choisissez les mods à inclure...',
description: 'Optionnel — ce qui est dans ce pack, à qui il s\'adresse, notes de version.',
},
modListHint: 'Seuls les mods actuellement installés sur le serveur apparaissent ici. Ajoutez d\'abord un mod via l\'onglet Installés, puis revenez pour l\'inclure.',
actions: {
saveDraft: 'Enregistrer le brouillon',
build: 'Construire le ZIP',
publish: 'Publier',
archive: 'Archiver',
unarchive: 'Restaurer depuis l\'archive',
delete: 'Supprimer le pack',
},
confirmDelete: 'Supprimer l\'enregistrement du modpack et son fichier ZIP ? Les joueurs perdront le lien de téléchargement jusqu\'à ce que vous publiiez un nouveau pack.',
ctaTooltip: '{size} · {n} mod(s)',
saved: 'Modpack enregistré comme brouillon',
built: 'ZIP du modpack construit',
published: 'Modpack publié — le téléchargement est désormais actif sur la page de connexion',
archived: 'Modpack archivé',
unarchived: 'Modpack restauré en brouillon',
deleted: 'Modpack supprimé',
failedToLoad: 'Impossible de charger le modpack',
failedToSave: 'Impossible d\'enregistrer le modpack',
failedToBuild: 'Impossible de construire le ZIP du modpack',
failedToPublish: 'Impossible de publier le modpack',
failedToArchive: 'Impossible d\'archiver le modpack',
failedToDelete: 'Impossible de supprimer le modpack',
},

backups: {
title: 'Sauvegardes',
createNow: 'Créer une sauvegarde',
Expand Down
39 changes: 39 additions & 0 deletions frontend/src/i18n/locales/ja.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1022,6 +1022,45 @@ const ja: Messages = {
modsFound: '件のMODが見つかりました',
},

modpack: {
// English placeholders — translations TBD
tabLabel: 'Modpack',
intro: 'Bundle installed mods into a single zip players can download from the login page. Only the published pack is publicly downloadable — drafts and archived packs stay private.',
status: { draft: 'Draft', published: 'Published', archived: 'Archived' },
modCount: '{n} mod(s)',
downloadsCount: '{n} download(s)',
publicDownloadLink: 'Open public download link',
fields: { name: 'Pack name', version: 'Version', modList: 'Included mods', description: 'Description' },
placeholders: {
name: 'e.g. KitsuneDen Client Pack',
modList: 'Pick mods to include...',
description: 'Optional — what\'s in this pack, who it\'s for, version notes.',
},
modListHint: 'Only mods currently installed on the server appear here. Add a mod via the Installed tab first, then come back to include it.',
actions: {
saveDraft: 'Save Draft',
build: 'Build Zip',
publish: 'Publish',
archive: 'Archive',
unarchive: 'Restore from Archive',
delete: 'Delete Pack',
},
confirmDelete: 'Delete the modpack record and its zip file? Players will lose the download link until you publish a new one.',
ctaTooltip: '{size} · {n} mod(s)',
saved: 'Modpack saved as draft',
built: 'Modpack zip built',
published: 'Modpack published — download is now live on the login page',
archived: 'Modpack archived',
unarchived: 'Modpack restored to draft',
deleted: 'Modpack deleted',
failedToLoad: 'Failed to load modpack',
failedToSave: 'Failed to save modpack',
failedToBuild: 'Failed to build modpack zip',
failedToPublish: 'Failed to publish modpack',
failedToArchive: 'Failed to archive modpack',
failedToDelete: 'Failed to delete modpack',
},

backups: {
title: 'バックアップ',
createNow: 'バックアップを作成',
Expand Down
39 changes: 39 additions & 0 deletions frontend/src/i18n/locales/ko.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1038,6 +1038,45 @@ const ko: Messages = {
modsFound: '개의 모드를 찾았습니다',
},

modpack: {
// English placeholders — translations TBD
tabLabel: 'Modpack',
intro: 'Bundle installed mods into a single zip players can download from the login page. Only the published pack is publicly downloadable — drafts and archived packs stay private.',
status: { draft: 'Draft', published: 'Published', archived: 'Archived' },
modCount: '{n} mod(s)',
downloadsCount: '{n} download(s)',
publicDownloadLink: 'Open public download link',
fields: { name: 'Pack name', version: 'Version', modList: 'Included mods', description: 'Description' },
placeholders: {
name: 'e.g. KitsuneDen Client Pack',
modList: 'Pick mods to include...',
description: 'Optional — what\'s in this pack, who it\'s for, version notes.',
},
modListHint: 'Only mods currently installed on the server appear here. Add a mod via the Installed tab first, then come back to include it.',
actions: {
saveDraft: 'Save Draft',
build: 'Build Zip',
publish: 'Publish',
archive: 'Archive',
unarchive: 'Restore from Archive',
delete: 'Delete Pack',
},
confirmDelete: 'Delete the modpack record and its zip file? Players will lose the download link until you publish a new one.',
ctaTooltip: '{size} · {n} mod(s)',
saved: 'Modpack saved as draft',
built: 'Modpack zip built',
published: 'Modpack published — download is now live on the login page',
archived: 'Modpack archived',
unarchived: 'Modpack restored to draft',
deleted: 'Modpack deleted',
failedToLoad: 'Failed to load modpack',
failedToSave: 'Failed to save modpack',
failedToBuild: 'Failed to build modpack zip',
failedToPublish: 'Failed to publish modpack',
failedToArchive: 'Failed to archive modpack',
failedToDelete: 'Failed to delete modpack',
},

backups: {
title: '백업',
createNow: '백업 생성',
Expand Down
Loading
Loading