File tree 2 files changed +24
-9
lines changed
2 files changed +24
-9
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,8 @@ if (import.meta.client && isCallback.value) {
19
19
unsub ()
20
20
})
21
21
}
22
+
23
+ const repos = computed (() => allowedRepos .value .filter (r => r .issuesIndexed > 10 ))
22
24
</script >
23
25
24
26
<template >
@@ -46,17 +48,21 @@ if (import.meta.client && isCallback.value) {
46
48
class =" text-center"
47
49
>
48
50
or pick a repository to browse issue clusters
49
- <ul class =" p-0 flex flex-col gap-2 " >
51
+ <ul class =" p-0 flex flex-row flex-wrap gap-4 justify-center " >
50
52
<li
51
- v-for =" repo in allowedRepos "
52
- :key =" repo"
53
+ v-for =" repo in repos "
54
+ :key =" repo.repo "
53
55
class =" list-none"
54
56
>
55
57
<NuxtLink
56
- :to =" `/${repo}`"
57
- class =" no-underline text-gray-400 hover:underline active:text-white"
58
+ :to =" `/${repo.repo }`"
59
+ class =" no-underline text-gray-400 hover:underline active:text-white flex flex-row gap-1 items-center "
58
60
>
59
- {{ repo }}
61
+ <span
62
+ class =" h-1.5 w-1.5 inline-block rounded-full shadow-sm bg-opacity-90 mt-0.5"
63
+ :class =" repo.indexed ? 'bg-green-600' : 'bg-gray-200'"
64
+ />
65
+ {{ repo.repo }}
60
66
</NuxtLink >
61
67
</li >
62
68
</ul >
Original file line number Diff line number Diff line change 1
1
import { defineCachedCorsEventHandler } from '~~/server/utils/cached-cors'
2
+ import { getMetadataForRepo } from '~~/server/utils/metadata'
2
3
3
4
export default defineCachedCorsEventHandler ( async ( ) => {
4
5
const kv = hubKV ( )
5
6
const keys = await kv . getKeys ( 'repo' )
6
- return keys . flatMap ( ( key ) => {
7
+ return Promise . all ( keys . map ( async ( key ) => {
7
8
const [ owner , name ] = key . split ( ':' ) . slice ( 1 )
8
9
if ( ! owner || ! name ) {
9
10
return [ ]
10
11
}
11
- return [ `${ owner } /${ name } ` ]
12
- } )
12
+ const [ keys , meta ] = await Promise . all ( [
13
+ kv . getKeys ( storagePrefixForRepo ( owner , name ) ) ,
14
+ getMetadataForRepo ( owner , name ) ,
15
+ ] )
16
+ return [ {
17
+ repo : `${ owner } /${ name } ` ,
18
+ issuesIndexed : keys . length ,
19
+ indexed : meta ?. indexed || false ,
20
+ } ]
21
+ } ) ) . then ( r => r . flat ( ) )
13
22
} , { swr : true } )
You can’t perform that action at this time.
0 commit comments