mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-12-02 22:14:50 +00:00
feat(video): generate transcripts with the local embedding server
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import { useQuery } from '@tanstack/react-query'
|
||||
import { client } from '@/ui/api/client'
|
||||
import { useServerFeatures } from './use-server-features'
|
||||
|
||||
export interface ArchiveConfig {
|
||||
archiveStorageEnabled: boolean
|
||||
@@ -7,21 +6,7 @@ export interface ArchiveConfig {
|
||||
}
|
||||
|
||||
export function useArchiveConfig(): ArchiveConfig {
|
||||
const { data, isLoading } = useQuery({
|
||||
queryKey: ['signup-info'],
|
||||
queryFn: async () => {
|
||||
const res = await client.api['signup-info'].$get()
|
||||
if (!res.ok) {
|
||||
return { initialized: true, demoMode: false, archiveStorageEnabled: false }
|
||||
}
|
||||
return (await res.json()) as {
|
||||
initialized?: boolean
|
||||
demoMode?: boolean
|
||||
archiveStorageEnabled?: boolean
|
||||
}
|
||||
},
|
||||
staleTime: 5 * 60 * 1000,
|
||||
})
|
||||
const { data, isLoading } = useServerFeatures()
|
||||
|
||||
return {
|
||||
archiveStorageEnabled: Boolean(data?.archiveStorageEnabled),
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
import { useQuery } from '@tanstack/react-query'
|
||||
import { client } from '@/ui/api/client'
|
||||
|
||||
export function useServerFeatures() {
|
||||
return useQuery({
|
||||
queryKey: ['signup-info'],
|
||||
queryFn: async () => {
|
||||
const res = await client.api['signup-info'].$get()
|
||||
if (!res.ok) return null
|
||||
return await res.json()
|
||||
},
|
||||
staleTime: 5 * 60 * 1000,
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user