MCPcopy
hub / github.com/xpf0000/FlyEnv / fetchData

Function fetchData

src/render/components/Ollama/models/local/setup.ts:54–71  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

52 })
53
54 const fetchData = () => {
55 if (!currentService.value) {
56 return
57 }
58 if (fetching.value || Object.keys(OllamaLocalModelsSetup.list).length > 0) {
59 return
60 }
61 OllamaLocalModelsSetup.fetching = true
62
63 IPC.send('app-fork:ollama', 'allModel', JSON.parse(JSON.stringify(currentService.value))).then(
64 (key: string, res: any) => {
65 IPC.off(key)
66 const list = res?.data ?? []
67 OllamaLocalModelsSetup.list = reactive(list)
68 OllamaLocalModelsSetup.fetching = false
69 }
70 )
71 }
72
73 const tableData = computed(() => {
74 return OllamaLocalModelsSetup.list

Callers 1

SetupFunction · 0.70

Calls 4

offMethod · 0.80
thenMethod · 0.45
sendMethod · 0.45
parseMethod · 0.45

Tested by

no test coverage detected