+
+ {logsError.value ?
Error: {logsError.value.message}
: null}
+ {error.value ?
Error: {error.value.message}
: null}
+
+
+ {isLoading.value ?
Loading...
:
}
+
+
+ )
+ },
+})
diff --git a/client/src/components/LiveLogs.tsx b/client/src/components/LiveLogs.tsx
index b03f0fb..0c7cfb3 100644
--- a/client/src/components/LiveLogs.tsx
+++ b/client/src/components/LiveLogs.tsx
@@ -1,8 +1,10 @@
-import { useQuery, useQueryClient } from '@tanstack/vue-query'
+// import { useQuery, useQueryClient } from '@tanstack/vue-query'
+import { useQuery } from '@tanstack/vue-query'
import { cva } from 'class-variance-authority'
import { computed, defineComponent, onMounted, ref } from 'vue'
-import { logStreamQueries } from '~/io/queries'
-import { type MessageSchema } from '~/io/queries/logStreamQueries'
+// import { type LogStreamMessageSchema } from '$schemas'
+import { useLogStream } from '~/hooks'
+import { logStreamQueries } from '~/io/queries/logStream.queries'
const statusVariants = cva([
'rounded px-2 text-black ',
@@ -62,23 +64,32 @@ const FormatLogLine = defineComponent({
export default defineComponent({
name: 'LiveLogs',
setup () {
- const queryClient = useQueryClient()
+ // const queryClient = useQueryClient()
+ //
+ // const {
+ // data: logs,
+ // error: logsError,
+ // refetch: refetchLogs,
+ // isLoading: isLoadingLogs,
+ // } = useQuery({
+ // enabled: false,
+ // queryKey: ['logs'],
+ // retry: false,
+ // queryFn: () => (
+ // logStreamQueries.connectLogs((data) => {
+ // queryClient.setQueryData(['logs'], (oldData: LogStreamMessageSchema[] = []) => {
+ // return [...oldData, data]
+ // })
+ // })
+ // ),
+ // })
const {
data: logs,
error: logsError,
refetch: refetchLogs,
isLoading: isLoadingLogs,
- } = useQuery({
- enabled: false,
- queryKey: ['logs'],
- retry: false,
- queryFn: () => logStreamQueries.connectLogs((data) => {
- queryClient.setQueryData(['logs'], (oldData: MessageSchema[] = []) => {
- return [...oldData, data]
- })
- }),
- })
+ } = useLogStream()
const logText = ref('')
diff --git a/client/src/components/WeatherLocation.tsx b/client/src/components/WeatherLocation.tsx
index 50b9a9f..fc98a7a 100644
--- a/client/src/components/WeatherLocation.tsx
+++ b/client/src/components/WeatherLocation.tsx
@@ -2,7 +2,7 @@ import { useQuery, useQueryClient } from '@tanstack/vue-query'
import { useNow } from '@vueuse/core'
import { computed, defineComponent, onMounted } from 'vue'
import { useEmoji } from '~/hooks/useEmoji'
-import { weatherQueries } from '~/io/queries/index'
+import { weatherQueries } from '~/io/queries/weather.queries'
import { getWeatherEmoji } from '~/utils/emoji.util'
export default defineComponent({
diff --git a/client/src/components/index.ts b/client/src/components/index.ts
deleted file mode 100644
index 7a86a7e..0000000
--- a/client/src/components/index.ts
+++ /dev/null
@@ -1,5 +0,0 @@
-export { default as LiveLogs } from './LiveLogs'
-export { default as MonitorGrid } from './MonitorGrid'
-export { default as TimeDate } from './TimeDate'
-export { default as WeatherLocation } from './WeatherLocation'
-export { default as WorkspaceGrid } from './WorkspaceGrid'
diff --git a/client/src/hooks/index.ts b/client/src/hooks/index.ts
index a844457..8f0aaf7 100644
--- a/client/src/hooks/index.ts
+++ b/client/src/hooks/index.ts
@@ -1 +1,2 @@
export { useEmoji } from './useEmoji'
+export { useLogStream } from './useLogStream'
diff --git a/client/src/hooks/useGlazeWM.ts b/client/src/hooks/useGlazeWM.ts
new file mode 100644
index 0000000..667fe0b
--- /dev/null
+++ b/client/src/hooks/useGlazeWM.ts
@@ -0,0 +1,86 @@
+import { filter, map, Subject } from 'rxjs'
+import { computed, ref } from 'vue'
+import { createProviderGroup, type GlazeWmOutput } from 'zebar'
+
+type WMPayload = GlazeWmOutput | null
+
+type WMEvent = {
+ type: string
+ payload: WMPayload
+}
+
+const wm = ref