mirror of
https://github.com/Litlyx/litlyx
synced 2025-12-11 00:08:37 +01:00
new selfhosted version
This commit is contained in:
17
dashboard/composables/useInsight.ts
Normal file
17
dashboard/composables/useInsight.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
|
||||
|
||||
|
||||
const insight = ref<string>("");
|
||||
const insightStatus = ref<'success' | 'pending'>('pending');
|
||||
|
||||
async function insightRefresh() {
|
||||
if (isSelfhosted()) return;
|
||||
insightStatus.value = 'pending';
|
||||
insight.value = await useAuthFetchSync('/api/ai/insight');
|
||||
insightStatus.value = 'success';
|
||||
}
|
||||
|
||||
export function useInsight() {
|
||||
if (insightStatus.value !== 'success') insightRefresh();
|
||||
return { insight, insightRefresh, insightStatus }
|
||||
}
|
||||
Reference in New Issue
Block a user