feat: add modlist export to Arma 3 Launcher HTML format

- RenderModlistHTML: generates compatible preset HTML from a modlist
- GET /api/modlists/:id/export: returns downloadable .html file
- Export button on ModlistEditor page
- Skips local mods (no workshop ID), includes only Steam workshop mods
This commit is contained in:
MrFastwind
2026-07-06 18:33:24 +02:00
parent d94593743f
commit 6774397885
5 changed files with 97 additions and 0 deletions

View File

@@ -64,6 +64,7 @@ export const modlistsApi = {
return r.json() as Promise<Modlist>
})
},
exportUrl: (id: string) => `${BASE}/modlists/${id}/export`,
checkMods: (id: string) => request<ModStatus[]>(`/modlists/${id}/check`),
downloadMissing: (id: string) => request<{ status: string; count?: number }>(`/modlists/${id}/download-missing`, { method: 'POST' }),
updateAll: (id: string) => request<{ status: string; count?: number }>(`/modlists/${id}/update-all`, { method: 'POST' }),

View File

@@ -112,6 +112,13 @@ export default function ModlistEditor() {
</button>
</>
)}
<a
href={modlistsApi.exportUrl(id!)}
download
className="px-3 py-1.5 bg-neutral-700 hover:bg-neutral-600 rounded text-sm"
>
Export
</a>
<button onClick={() => saveMut.mutate()} disabled={!dirty || saveMut.isPending} className="px-4 py-2 bg-blue-600 hover:bg-blue-500 disabled:opacity-50 rounded text-sm">
{saveMut.isPending ? 'Saving...' : 'Save'}
</button>