You've already forked AstralRinth
forked from didirus/AstralRinth
* refactor: migrate to common eslint+prettier configs * fix: prettier frontend * feat: config changes * fix: lint issues * fix: lint * fix: type imports * fix: cyclical import issue * fix: lockfile * fix: missing dep * fix: switch to tabs * fix: continue switch to tabs * fix: rustfmt parity * fix: moderation lint issue * fix: lint issues * fix: ui intl * fix: lint issues * Revert "fix: rustfmt parity" This reverts commit cb99d2376c321d813d4b7fc7e2a213bb30a54711. * feat: revert last rs
96 lines
2.6 KiB
Vue
96 lines
2.6 KiB
Vue
<template>
|
|
<div class="flex w-full flex-col gap-1 rounded-2xl bg-table-alternateRow p-2">
|
|
<div
|
|
v-for="loader in vanillaLoaders"
|
|
:key="loader.name"
|
|
class="group relative flex items-center justify-between rounded-2xl p-2 pr-2.5 hover:bg-bg"
|
|
>
|
|
<UiServersLoaderSelectorCard
|
|
:loader="loader"
|
|
:is-current="isCurrentLoader(loader.name)"
|
|
:loader-version="data.loader_version"
|
|
:current-loader="data.loader"
|
|
:is-installing="isInstalling"
|
|
@select="selectLoader"
|
|
/>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="mt-4">
|
|
<h2 class="mb-2 px-2 text-lg font-bold text-contrast">Mod loaders</h2>
|
|
<div class="flex w-full flex-col gap-1 rounded-2xl bg-table-alternateRow p-2">
|
|
<div
|
|
v-for="loader in modLoaders"
|
|
:key="loader.name"
|
|
class="group relative flex items-center justify-between rounded-2xl p-2 pr-2.5 hover:bg-bg"
|
|
>
|
|
<UiServersLoaderSelectorCard
|
|
:loader="loader"
|
|
:is-current="isCurrentLoader(loader.name)"
|
|
:loader-version="data.loader_version"
|
|
:current-loader="data.loader"
|
|
:is-installing="isInstalling"
|
|
@select="selectLoader"
|
|
/>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="mt-4">
|
|
<h2 class="mb-2 px-2 text-lg font-bold text-contrast">Plugin loaders</h2>
|
|
<div class="flex w-full flex-col gap-1 rounded-2xl bg-table-alternateRow p-2">
|
|
<div
|
|
v-for="loader in pluginLoaders"
|
|
:key="loader.name"
|
|
class="group relative flex items-center justify-between rounded-2xl p-2 pr-2.5 hover:bg-bg"
|
|
>
|
|
<UiServersLoaderSelectorCard
|
|
:loader="loader"
|
|
:is-current="isCurrentLoader(loader.name)"
|
|
:loader-version="data.loader_version"
|
|
:current-loader="data.loader"
|
|
:is-installing="isInstalling"
|
|
@select="selectLoader"
|
|
/>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
const props = defineProps<{
|
|
data: {
|
|
loader: string | null
|
|
loader_version: string | null
|
|
}
|
|
ignoreCurrentInstallation?: boolean
|
|
isInstalling?: boolean
|
|
}>()
|
|
|
|
const emit = defineEmits<{
|
|
(e: 'selectLoader', loader: string): void
|
|
}>()
|
|
|
|
const vanillaLoaders = [{ name: 'Vanilla' as const, displayName: 'Vanilla' }]
|
|
|
|
const modLoaders = [
|
|
{ name: 'Fabric' as const, displayName: 'Fabric' },
|
|
{ name: 'Quilt' as const, displayName: 'Quilt' },
|
|
{ name: 'Forge' as const, displayName: 'Forge' },
|
|
{ name: 'NeoForge' as const, displayName: 'NeoForge' },
|
|
]
|
|
|
|
const pluginLoaders = [
|
|
{ name: 'Paper' as const, displayName: 'Paper' },
|
|
{ name: 'Purpur' as const, displayName: 'Purpur' },
|
|
]
|
|
|
|
const isCurrentLoader = (loaderName: string) => {
|
|
return props.data.loader?.toLowerCase() === loaderName.toLowerCase()
|
|
}
|
|
|
|
const selectLoader = (loader: string) => {
|
|
emit('selectLoader', loader)
|
|
}
|
|
</script>
|