From fec531f9c8a18d38d383b91a35dedfe196a0da05 Mon Sep 17 00:00:00 2001 From: Aresn Date: Mon, 3 Jun 2024 15:54:14 +0800 Subject: [PATCH] Update Create.vue --- components/i/Create.vue | 96 ++++++++++++++++++++++++++++------------- 1 file changed, 66 insertions(+), 30 deletions(-) diff --git a/components/i/Create.vue b/components/i/Create.vue index 3220da9..0594657 100644 --- a/components/i/Create.vue +++ b/components/i/Create.vue @@ -14,36 +14,60 @@ :padded="false" maxlength="2000" /> -
- - - {{ selectedRepo || '选择 GitHub 项目' }} - +
+
+ - - + + + + + + + + + {{ selectedRepo }} + + + +
+ + +
@@ -52,26 +76,28 @@ const { $repos } = storeToRefs(useReposStore()) const { $setRepo } = useReposStore() const { $setFirstRecordTitle } = useSearchStore() +const { metaSymbol } = useShortcuts() const emits = defineEmits([ 'search' ]) const query = ref('') const selectedRepo = ref('') const loading = ref(false) const cardUI = { body: { - padding: 'p-4 sm:p-4' + padding: 'p-3 sm:p-3' }, rounded: 'rounded-xl' } const menuUI = { width: 'w-auto' } +const isInternet = ref(true) const handleSearch = async () => { if (loading.value || query.value === '') return loading.value = true const currentRepo = $repos.value.find(item => item.label === selectedRepo.value) - const repo_path = currentRepo ? currentRepo.url : '' - const { data, error } = await useRequest('/v1/chat/completion/create', { + const repo_path = currentRepo ? currentRepo.url : '' + const { data, error } = await useRequest('/v1/chat/completion/create', { method: 'post', body: { repo_path, @@ -108,6 +134,16 @@ defineShortcuts({ handler: () => { handleSearch() } + }, + meta_o: { + usingInput: 'createInput', + handler: () => { + handleToggleInternet() + } } }) + +function handleToggleInternet () { + isInternet.value = !isInternet.value +} -- GitLab