initial frontend
This commit is contained in:
13
frontend/src/composables/telemetry.ts
Normal file
13
frontend/src/composables/telemetry.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import { ref } from 'vue'
|
||||
|
||||
export function useTelemetry(name: string) {
|
||||
const data = ref<any | null>(null);
|
||||
const error = ref<any | null>(null);
|
||||
|
||||
fetch(`/api/tlm/${name}`)
|
||||
.then((res) => res.json())
|
||||
.then((json) => (data.value = json))
|
||||
.catch((err) => (error.value = err));
|
||||
|
||||
return { data, error };
|
||||
}
|
||||
Reference in New Issue
Block a user