|
|
|
@@ -99,6 +99,21 @@
|
|
|
|
|
<a v-if="latestStable.docsFolderPath" :href="latestStable.docsFolderPath" target="_blank" class="flex items-center justify-center py-3 px-4 bg-indigo-500/30 border border-indigo-400/30 text-white font-bold rounded-xl transition-all hover:bg-indigo-500/40 text-sm whitespace-nowrap">{{ t('catalogShow.docs') }}</a>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div v-if="binaryAssets(latestStable).length" class="mt-6 pt-6 border-t border-white/15">
|
|
|
|
|
<div class="text-[10px] font-black uppercase tracking-widest text-indigo-200 mb-3">{{ t('catalogShow.binariesTitle') }}</div>
|
|
|
|
|
<div class="flex flex-wrap gap-2">
|
|
|
|
|
<a
|
|
|
|
|
v-for="asset in binaryAssets(latestStable)"
|
|
|
|
|
:key="asset.kind"
|
|
|
|
|
:href="downloadUrl(asset.path)"
|
|
|
|
|
:class="['flex items-center justify-center py-2 px-4 font-bold rounded-xl transition-all text-sm whitespace-nowrap',
|
|
|
|
|
asset.kind === primaryBinaryKind(latestStable)
|
|
|
|
|
? 'bg-white text-indigo-900 hover:bg-indigo-50 shadow-lg shadow-black/10'
|
|
|
|
|
: 'bg-indigo-500/30 border border-indigo-400/30 text-white hover:bg-indigo-500/40']"
|
|
|
|
|
>💾 {{ t('catalogShow.binary.' + asset.kind) }}</a>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="bg-white rounded-3xl shadow-xl overflow-hidden border border-gray-100">
|
|
|
|
@@ -127,6 +142,7 @@
|
|
|
|
|
<a v-if="release.cartridgePath" :href="downloadUrl(release.cartridgePath)" class="text-blue-600 hover:text-blue-900 font-bold text-sm flex items-center gap-1">{{ t('catalogShow.download') }}</a>
|
|
|
|
|
<a v-if="release.sourcePath" :href="downloadUrl(release.sourcePath)" class="text-green-600 hover:text-green-900 font-bold text-sm flex items-center gap-1">{{ t('catalogShow.source') }}</a>
|
|
|
|
|
<a v-if="release.docsFolderPath" :href="release.docsFolderPath" target="_blank" class="text-yellow-600 hover:text-yellow-900 font-bold text-sm flex items-center gap-1">{{ t('catalogShow.docs') }}</a>
|
|
|
|
|
<a v-for="asset in binaryAssets(release)" :key="asset.kind" :href="downloadUrl(asset.path)" class="text-indigo-600 hover:text-indigo-900 font-bold text-sm flex items-center gap-1">💾 {{ t('catalogShow.binary.' + asset.kind) }}</a>
|
|
|
|
|
</div>
|
|
|
|
|
</td>
|
|
|
|
|
<td class="px-8 py-4 text-gray-500 align-top pt-5">{{ formatDateTime(release.UpdatedAt) }}</td>
|
|
|
|
@@ -142,6 +158,7 @@
|
|
|
|
|
<div class="flex flex-wrap gap-4">
|
|
|
|
|
<a v-if="release.htmlFolderPath" :href="release.htmlFolderPath" target="_blank" class="text-purple-600 hover:text-purple-900 font-bold text-sm flex items-center gap-1">{{ t('catalogShow.play') }}</a>
|
|
|
|
|
<a v-if="release.cartridgePath" :href="downloadUrl(release.cartridgePath)" class="text-blue-600 hover:text-blue-900 font-bold text-sm flex items-center gap-1">{{ t('catalogShow.download') }}</a>
|
|
|
|
|
<a v-for="asset in binaryAssets(release)" :key="asset.kind" :href="downloadUrl(asset.path)" class="text-indigo-600 hover:text-indigo-900 font-bold text-sm flex items-center gap-1">💾 {{ t('catalogShow.binary.' + asset.kind) }}</a>
|
|
|
|
|
</div>
|
|
|
|
|
</td>
|
|
|
|
|
<td class="px-8 py-4 text-gray-500 align-top pt-5">{{ formatDateTime(release.UpdatedAt) }}</td>
|
|
|
|
@@ -169,6 +186,7 @@
|
|
|
|
|
<a v-if="release.cartridgePath" :href="downloadUrl(release.cartridgePath)" class="flex items-center justify-center py-2 bg-blue-100 text-blue-700 font-bold rounded-lg text-sm">{{ t('catalogShow.download') }}</a>
|
|
|
|
|
<a v-if="release.sourcePath" :href="downloadUrl(release.sourcePath)" class="flex items-center justify-center py-2 bg-green-100 text-green-700 font-bold rounded-lg text-sm">{{ t('catalogShow.source') }}</a>
|
|
|
|
|
<a v-if="release.docsFolderPath" :href="release.docsFolderPath" target="_blank" class="flex items-center justify-center py-2 bg-yellow-100 text-yellow-700 font-bold rounded-lg text-sm">{{ t('catalogShow.docs') }}</a>
|
|
|
|
|
<a v-for="asset in binaryAssets(release)" :key="asset.kind" :href="downloadUrl(asset.path)" class="flex items-center justify-center py-2 bg-indigo-100 text-indigo-700 font-bold rounded-lg text-sm">💾 {{ t('catalogShow.binary.' + asset.kind) }}</a>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
@@ -247,6 +265,37 @@ const latestStable = computed(() => stableReleases.value[0] ?? null)
|
|
|
|
|
const downloadUrl = (path: string) =>
|
|
|
|
|
`/api/download?path=${encodeURIComponent(path.replace('/file/', ''))}`
|
|
|
|
|
|
|
|
|
|
const BINARY_KINDS = ['win_x64', 'win_x86', 'linux_x64', 'linux_x86', 'mac_universal', 'mac_arm64', 'mac_x64']
|
|
|
|
|
|
|
|
|
|
// a látogató OS-éhez illő targetek, preferencia-sorrendben
|
|
|
|
|
function osPreferredKinds(): string[] {
|
|
|
|
|
const ua = navigator.userAgent
|
|
|
|
|
if (/Windows/i.test(ua)) {
|
|
|
|
|
return /WOW64|Win64|x64|amd64/i.test(ua) ? ['win_x64', 'win_x86'] : ['win_x86', 'win_x64']
|
|
|
|
|
}
|
|
|
|
|
if (/Macintosh|Mac OS X/i.test(ua)) return ['mac_universal', 'mac_arm64', 'mac_x64']
|
|
|
|
|
if (/Linux/i.test(ua)) return ['linux_x64', 'linux_x86']
|
|
|
|
|
return []
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const preferredKinds = osPreferredKinds()
|
|
|
|
|
|
|
|
|
|
const kindRank = (kind: string) => {
|
|
|
|
|
const preferred = preferredKinds.indexOf(kind)
|
|
|
|
|
return preferred >= 0 ? preferred : preferredKinds.length + BINARY_KINDS.indexOf(kind)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const binaryAssets = (release: Release) =>
|
|
|
|
|
(release.assets ?? [])
|
|
|
|
|
.filter(a => BINARY_KINDS.includes(a.kind))
|
|
|
|
|
.sort((a, b) => kindRank(a.kind) - kindRank(b.kind))
|
|
|
|
|
|
|
|
|
|
// a kiemelt gomb: a látogató OS-éhez legjobban illő elérhető bináris
|
|
|
|
|
const primaryBinaryKind = (release: Release) => {
|
|
|
|
|
const first = binaryAssets(release)[0]
|
|
|
|
|
return first && preferredKinds.includes(first.kind) ? first.kind : null
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onMounted(async () => {
|
|
|
|
|
try {
|
|
|
|
|
await store.fetchAll()
|
|
|
|
|