You've already forked AstralRinth
forked from didirus/AstralRinth
* Base impl * Make project type selectable * Update Browse.vue * address changes * Quick create * Run linter * fix merge * Addressed changes * Installation improvements * Run lint * resourcepacks * automatic installation of dependencies * Fix bugs with search * Addressed changes * Run linter * Fixed direct install not working * Remove back to search * Update Index.vue * Addressed some changes * Shader fix * fix resetting * Update Browse.vue * Direct install from search * More improvements * Update SearchCard.vue * Card V2 * Run linter * add instance ignoring * Update Browse.vue * Finalize changes * Update SearchCard.vue * More adjustments * Fix out of order rendering * Run linter * Fix issues * Add unlisteners --------- Co-authored-by: Geometrically <18202329+Geometrically@users.noreply.github.com> Co-authored-by: Jai A <jaiagr+gpg@pm.me>
39 lines
955 B
Vue
39 lines
955 B
Vue
<script setup>
|
|
import { onUnmounted, shallowRef } from 'vue'
|
|
import GridDisplay from '@/components/GridDisplay.vue'
|
|
import { list } from '@/helpers/profile.js'
|
|
import { useRoute } from 'vue-router'
|
|
import { useBreadcrumbs } from '@/store/breadcrumbs'
|
|
import { profile_listener } from '@/helpers/events.js'
|
|
|
|
const route = useRoute()
|
|
const breadcrumbs = useBreadcrumbs()
|
|
|
|
breadcrumbs.setRootContext({ name: 'Library', link: route.path })
|
|
|
|
const profiles = await list(true)
|
|
const instances = shallowRef(Object.values(profiles))
|
|
|
|
const unlisten = await profile_listener(async () => {
|
|
const profiles = await list(true)
|
|
instances.value = Object.values(profiles)
|
|
})
|
|
onUnmounted(() => unlisten())
|
|
</script>
|
|
|
|
<template>
|
|
<GridDisplay
|
|
v-if="instances.length > 0"
|
|
label="Instances"
|
|
:instances="instances"
|
|
class="display"
|
|
/>
|
|
</template>
|
|
|
|
<style lang="scss" scoped>
|
|
.display {
|
|
background-color: rgb(30, 31, 34);
|
|
min-height: 100%;
|
|
}
|
|
</style>
|