1
1
<script setup lang="ts">
2
2
import hexRgb from ' hex-rgb'
3
3
4
- const { data : clusters, refresh, status } = useFetch (' /api/clusters/nuxt/nuxt' , {
4
+ import { allowedRepos } from ' ~~/shared/repos'
5
+
6
+ const repo = ref (' nuxt/nuxt' )
7
+
8
+ const { data : clusters, refresh, status } = useFetch (() => ` /api/clusters/${repo .value } ` , {
5
9
server: false ,
6
10
immediate: import .meta .client && ! (' startViewTransition' in document ),
7
11
default : () => [],
@@ -13,8 +17,8 @@ onMounted(async () => {
13
17
const promise = new Promise <void >((resolve ) => {
14
18
finishTransition = resolve
15
19
})
16
- watch (clusters , () => document .startViewTransition (() => promise ), { flush: ' pre' , once: true })
17
- watch (clusters , () => nextTick (finishTransition ), { flush: ' post' , once: true })
20
+ watch (clusters , () => document .startViewTransition (() => promise ), { flush: ' pre' })
21
+ watch (clusters , () => nextTick (finishTransition ), { flush: ' post' })
18
22
refresh ()
19
23
}
20
24
})
@@ -32,7 +36,6 @@ function labelColors(color: string) {
32
36
const stateColors: Record <string , string > = {
33
37
open: ' text-green-500' ,
34
38
closed: ' text-purple-500' ,
35
- merged: ' text-purple-500' ,
36
39
}
37
40
38
41
const openState = reactive <Record <string , boolean >>({})
@@ -51,7 +54,7 @@ async function updateSearch() {}
51
54
</p >
52
55
</nav >
53
56
<p class =" flex gap-2 items-center" >
54
- nuxt/nuxt
57
+ {{ repo }}
55
58
<button
56
59
class =" rounded-full w-7 h-7 flex place-items-center border-solid border border-gray-700 bg-transparent color-gray-400 py-2 hover:color-gray-200 active:color-white focus:color-gray-200 hover:border-gray-400 active:border-white focus:border-gray-400 transition-colors"
57
60
:class =" { 'animate-spin opacity-50 pointer-events-none': status === 'pending' || status === 'idle' }"
@@ -66,7 +69,6 @@ async function updateSearch() {}
66
69
</button >
67
70
</p >
68
71
<form
69
- v-if =" false"
70
72
class =" border-solid border border-gray-600 rounded-md flex flex-row items-center relative"
71
73
disabled
72
74
@submit.prevent =" updateSearch"
@@ -79,18 +81,29 @@ async function updateSearch() {}
79
81
>
80
82
include closed issues
81
83
</label> -->
82
- <input
84
+ <!-- < input
83
85
type="text"
84
86
class="bg-transparent pl-8 pr-2 py-2 color-white border-0 flex-grow"
85
87
placeholder="repository"
88
+ > -->
89
+ <select
90
+ v-model =" repo"
91
+ class =" pl-8 bg-transparent pr-2 py-2 color-white border-0 w-full"
86
92
>
93
+ <option
94
+ v-for =" repo in allowedRepos"
95
+ :key =" repo"
96
+ >
97
+ {{ repo }}
98
+ </option >
99
+ </select >
87
100
<Icon
88
101
size =" large"
89
102
class =" absolute ml-2 text-gray-400"
90
103
name =" tabler-search"
91
104
/>
92
105
</form >
93
- <template v-if =" status === ' idle' " >
106
+ <template v-if =" status === ' idle' || status === ' pending ' " >
94
107
<section
95
108
v-for =" i in 7"
96
109
:key =" i"
0 commit comments