mirror of
https://github.com/ThatGuySam/doesitarm.git
synced 2026-05-18 06:44:46 -07:00
Add benchmark and performance links to search
This commit is contained in:
parent
f1a772b905
commit
f62f33d98c
4 changed files with 138 additions and 33 deletions
|
|
@ -34,6 +34,29 @@ import ThomasCredit from '~/components/thomas-credit.vue'
|
|||
import gameList from '~/static/game-list.json'
|
||||
|
||||
export default {
|
||||
async asyncData () {
|
||||
const { sortedAppList, allList, allVideoAppsList, makeAppSearchLinks } = await import('~/helpers/get-list.js')
|
||||
const { default: gameList } = await import('~/static/game-list.json')
|
||||
|
||||
return {
|
||||
// Map game list
|
||||
gameList: gameList.map( app => {
|
||||
|
||||
return {
|
||||
name: app.name,
|
||||
status: app.status,
|
||||
slug: app.slug,
|
||||
// endpoint: app.endpoint,
|
||||
text: app.text,
|
||||
lastUpdated: app.lastUpdated,
|
||||
category: app.category,
|
||||
searchLinks: makeAppSearchLinks(app)
|
||||
}
|
||||
}),
|
||||
// allAppSearchLinks,
|
||||
// customSummaryNumbers: getListSummaryNumbers(allList)
|
||||
}
|
||||
},
|
||||
components: {
|
||||
Search,
|
||||
LinkButton,
|
||||
|
|
@ -59,9 +82,9 @@ export default {
|
|||
}
|
||||
},
|
||||
computed: {
|
||||
gameList() {
|
||||
return gameList
|
||||
}
|
||||
// gameList() {
|
||||
// return gameList
|
||||
// }
|
||||
},
|
||||
head() {
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -71,13 +71,33 @@ export default {
|
|||
// const { default: appList } = await import('~/static/app-list.json')
|
||||
// const { default: gamelist } = await import('~/static/game-list.json')
|
||||
|
||||
const { sortedAppList, allList } = await import('~/helpers/get-list.js')
|
||||
const { sortedAppList, allList, allVideoAppsList, makeAppSearchLinks } = await import('~/helpers/get-list.js')
|
||||
|
||||
const allAppSearchLinks = {}
|
||||
|
||||
// console.log('allVideoAppsList', allVideoAppsList)
|
||||
|
||||
allVideoAppsList.forEach( app => {
|
||||
// Make the search links
|
||||
const searchLinks = makeAppSearchLinks(app)
|
||||
|
||||
// If there are more than zero
|
||||
// add them to our list
|
||||
if (searchLinks.length > 0) {
|
||||
allAppSearchLinks[app.slug] = searchLinks
|
||||
}
|
||||
})
|
||||
|
||||
return {
|
||||
// Filter app list to leave out data not needed for search
|
||||
initialAppList: sortedAppList.map( app => {
|
||||
|
||||
let searchLinks = []
|
||||
|
||||
if (typeof allAppSearchLinks[app.slug] !== 'undefined') {
|
||||
searchLinks = allAppSearchLinks[app.slug]
|
||||
}
|
||||
|
||||
return {
|
||||
name: app.name,
|
||||
status: app.status,
|
||||
|
|
@ -86,8 +106,10 @@ export default {
|
|||
text: app.text,
|
||||
lastUpdated: app.lastUpdated,
|
||||
category: app.category,
|
||||
searchLinks
|
||||
}
|
||||
}),
|
||||
allAppSearchLinks,
|
||||
customSummaryNumbers: getListSummaryNumbers(allList)
|
||||
}
|
||||
},
|
||||
|
|
@ -163,6 +185,8 @@ export default {
|
|||
// then stop
|
||||
if (this.fetchedAppList.length !== 0 || this.query.trim().length === 0) return
|
||||
|
||||
// console.log('this.allAppSearchLinks', this.allAppSearchLinks)
|
||||
|
||||
const fetchedListUrls = [
|
||||
'/game-list.json',
|
||||
'/homebrew-list.json'
|
||||
|
|
@ -179,7 +203,19 @@ export default {
|
|||
|
||||
// console.log('fetchedLists', fetchedLists)
|
||||
|
||||
this.fetchedAppList = fetchedLists.flat(1)
|
||||
this.fetchedAppList = fetchedLists.flat(1).map( app => {
|
||||
|
||||
let searchLinks = []
|
||||
|
||||
if (typeof this.allAppSearchLinks[app.slug] !== 'undefined') {
|
||||
searchLinks = this.allAppSearchLinks[app.slug]
|
||||
}
|
||||
|
||||
return {
|
||||
...app,
|
||||
searchLinks
|
||||
}
|
||||
})
|
||||
|
||||
return
|
||||
}
|
||||
|
|
|
|||
|
|
@ -55,26 +55,32 @@
|
|||
import Search from '~/components/search.vue'
|
||||
import LinkButton from '~/components/link-button.vue'
|
||||
|
||||
import { byTimeThenNull } from '~/helpers/sort-list.js'
|
||||
|
||||
import { categories, getAppCategory } from '~/helpers/categories.js'
|
||||
|
||||
import appList from '~/static/app-list.json'
|
||||
import gamelist from '~/static/game-list.json'
|
||||
import homebrewList from '~/static/homebrew-list.json'
|
||||
|
||||
const allList = [
|
||||
...appList.sort(byTimeThenNull),
|
||||
...homebrewList,
|
||||
...gamelist,
|
||||
]
|
||||
|
||||
export default {
|
||||
async asyncData ({ params: { slug } }) {
|
||||
// Maybe I could import() here to reduce client script size
|
||||
const { sortedAppList, allList, allVideoAppsList, makeAppSearchLinks } = await import('~/helpers/get-list.js')
|
||||
const { default: gameList } = await import('~/static/game-list.json')
|
||||
|
||||
const filteredList = allList.filter(app => {
|
||||
return app.category.slug === slug
|
||||
})
|
||||
|
||||
return {
|
||||
slug,
|
||||
// app: appList.find(app => (app.slug === slug))
|
||||
categoryAppList: filteredList.map( app => {
|
||||
|
||||
return {
|
||||
name: app.name,
|
||||
status: app.status,
|
||||
slug: app.slug,
|
||||
// endpoint: app.endpoint,
|
||||
text: app.text,
|
||||
lastUpdated: app.lastUpdated,
|
||||
category: app.category,
|
||||
searchLinks: makeAppSearchLinks(app)
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
components: {
|
||||
|
|
@ -104,20 +110,6 @@ export default {
|
|||
category () {
|
||||
return categories[this.slug]
|
||||
},
|
||||
categoryAppList () {
|
||||
|
||||
const filteredList = allList.filter(app => {
|
||||
return app.category.slug === this.slug
|
||||
})
|
||||
|
||||
// const sortedList = list.sort(byTimeThenNull)
|
||||
|
||||
// if (this.category.slug === 'homebrew') {
|
||||
// return filteredList.slice(0, 300)
|
||||
// }
|
||||
|
||||
return filteredList
|
||||
},
|
||||
supportedAppList () {
|
||||
return this.categoryAppList.filter(app => {
|
||||
return app.status.includes('yes')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue