diff --git a/components/i/Create.vue b/components/i/Create.vue index 10c529f3f2615881528f29322b0b09bd57d01715..f33ae6afb95de624f3d502d4dc98e278cde5666b 100644 --- a/components/i/Create.vue +++ b/components/i/Create.vue @@ -35,10 +35,7 @@ const { fetchRequest } = useFetchRequest() const emits = defineEmits([ 'search' ]) const query = ref('') const selectedRepo = ref('keycloak') -const repos = ref([ - // { url: 'https://github.com/allwefantasy/byzer-llm.git', label: 'byzer-llm', branch: 'master' }, - { url: 'https://github.com/keycloak/keycloak.git', label: 'keycloak', branch: 'master' } -]) +const repos = ref([]) const loading = ref(false) const handleSearch = async () => { if (loading.value || query.value === '') return @@ -57,6 +54,20 @@ const handleSearch = async () => { }) } } + +const repoData = await fetchRequest('/v1/chat/repository', { + headers: { + 'Content-Type': 'application/x-www-form-urlencoded' + } +}) +repos.value = repoData.data.map(item => { + return { + label: item.name, + url: item.path, + branch: item.branch + } +}) + defineShortcuts({ meta_enter: { usingInput: 'createInput',