mirror of
https://github.com/rommapp/romm.git
synced 2026-11-30 18:42:34 +01:00
platforms section selector added
This commit is contained in:
@@ -18,14 +18,17 @@ const roms = ref([])
|
||||
const gettingRoms = ref(false)
|
||||
const filter = storeFilter()
|
||||
const romsFiltered = ref([])
|
||||
const firmwares = ["firmware_base", "firmware_bios"]
|
||||
const galleryView = storeGalleryView()
|
||||
const route = useRoute()
|
||||
const sections = ['roms', 'firmwares']
|
||||
const currentSection = ref('roms')
|
||||
|
||||
// Event listeners bus
|
||||
const emitter = inject('emitter')
|
||||
emitter.on('filter', () => { filterRoms() })
|
||||
|
||||
// Functions
|
||||
|
||||
function filterRoms() {
|
||||
romsFiltered.value = roms.value.filter(rom => {
|
||||
return normalizeString(rom.file_name).includes(filter.value)
|
||||
@@ -47,43 +50,75 @@ onBeforeRouteUpdate(async (to, _) => { fetchRoms(to.params.platform) })
|
||||
|
||||
<template>
|
||||
|
||||
<v-app-bar class="gallery-app-bar-secondary" elevation="0" density="compact">
|
||||
<v-select item-title="name" :items="sections" v-model="currentSection" hide-details/>
|
||||
</v-app-bar>
|
||||
|
||||
<v-app-bar class="gallery-app-bar" elevation="0" density="compact">
|
||||
<filter-bar/>
|
||||
<gallery-view-btn/>
|
||||
</v-app-bar>
|
||||
|
||||
<v-row v-show="!gettingRoms && galleryView.value != 2 && roms.length>0" class="pa-1" no-gutters>
|
||||
<v-col v-for="rom in romsFiltered" class="pa-1"
|
||||
:key="rom.file_name"
|
||||
|
||||
|
||||
<v-row v-show="currentSection == 'roms'" no-gutters>
|
||||
|
||||
<v-row v-show="!gettingRoms && galleryView.value != 2 && roms.length>0" class="pa-1" no-gutters>
|
||||
<v-col v-for="rom in romsFiltered" class="pa-1"
|
||||
:key="rom.file_name"
|
||||
:cols="views[galleryView.value]['size-cols']"
|
||||
:xs="views[galleryView.value]['size-xs']"
|
||||
:sm="views[galleryView.value]['size-sm']"
|
||||
:md="views[galleryView.value]['size-md']"
|
||||
:lg="views[galleryView.value]['size-lg']">
|
||||
<game-card :rom="rom"/>
|
||||
</v-col>
|
||||
</v-row>
|
||||
|
||||
<v-row v-show="!gettingRoms && galleryView.value == 2 && roms.length>0" class="pa-1" no-gutters>
|
||||
<v-col class="pa-1"
|
||||
:cols="views[galleryView.value]['size-cols']"
|
||||
:xs="views[galleryView.value]['size-xs']"
|
||||
:sm="views[galleryView.value]['size-sm']"
|
||||
:md="views[galleryView.value]['size-md']"
|
||||
:lg="views[galleryView.value]['size-lg']">
|
||||
<v-table class="bg-secondary">
|
||||
<game-list-header />
|
||||
<v-divider class="border-opacity-100 mb-4 ml-2 mr-2" color="rommAccent1" :thickness="1"/>
|
||||
<tbody>
|
||||
<game-list-item v-for="rom in romsFiltered" :key="rom.file_name" :rom="rom"/>
|
||||
</tbody>
|
||||
</v-table>
|
||||
</v-col>
|
||||
</v-row>
|
||||
|
||||
<v-row v-if="!gettingRoms && roms.length==0" no-gutters>
|
||||
<div class="text-h6 mt-16 mx-auto">Feels cold here... <v-icon>mdi-emoticon-sad</v-icon></div>
|
||||
</v-row>
|
||||
|
||||
<v-row v-if="gettingRoms" no-gutters>
|
||||
<v-progress-circular class="mt-16 mx-auto" color="rommAccent1" :width="3" :size="70" indeterminate/>
|
||||
</v-row>
|
||||
</v-row>
|
||||
|
||||
|
||||
|
||||
<v-row v-show="currentSection == 'firmwares'" no-gutters>
|
||||
<v-col v-for="firmware in firmwares" class="pa-1"
|
||||
:key="firmware"
|
||||
:cols="views[galleryView.value]['size-cols']"
|
||||
:xs="views[galleryView.value]['size-xs']"
|
||||
:sm="views[galleryView.value]['size-sm']"
|
||||
:md="views[galleryView.value]['size-md']"
|
||||
:lg="views[galleryView.value]['size-lg']">
|
||||
<game-card :rom="rom"/>
|
||||
<v-card>
|
||||
<v-card-text>
|
||||
<span>{{ firmware }}</span>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</v-col>
|
||||
</v-row>
|
||||
|
||||
<v-row v-show="!gettingRoms && galleryView.value == 2 && roms.length>0" no-gutters>
|
||||
<v-col class="pa-0">
|
||||
<v-table class="bg-secondary">
|
||||
<game-list-header />
|
||||
<v-divider class="border-opacity-100 mb-4 ml-2 mr-2" color="rommAccent1" :thickness="1"/>
|
||||
<tbody>
|
||||
<game-list-item v-for="rom in romsFiltered" :key="rom.file_name" :rom="rom"/>
|
||||
</tbody>
|
||||
</v-table>
|
||||
</v-col>
|
||||
</v-row>
|
||||
|
||||
<v-row v-if="!gettingRoms && roms.length==0" no-gutters>
|
||||
<div class="text-h6 mt-16 mx-auto">Feels cold here... <v-icon>mdi-emoticon-sad</v-icon></div>
|
||||
</v-row>
|
||||
|
||||
<v-row v-if="gettingRoms" no-gutters>
|
||||
<v-progress-circular class="mt-16 mx-auto" color="rommAccent1" :width="3" :size="70" indeterminate/>
|
||||
</v-row>
|
||||
|
||||
</template>
|
||||
<style scoped>
|
||||
.gallery-app-bar {
|
||||
|
||||
Reference in New Issue
Block a user