Skip to content

Commit

Permalink
feat (tool): serve via http
Browse files Browse the repository at this point in the history
  • Loading branch information
glencoden committed Jan 15, 2025
1 parent 488f8bc commit 2f95df9
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
4 changes: 3 additions & 1 deletion apps/cloud/app/routes/session.$sessionId.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -837,7 +837,9 @@ export default function ActiveSession() {
}
disabled={
isPending ||
!!session.isLocked
Boolean(
session.isLocked,
)
}
>
<PlayCircle className='h-14 w-14 fill-pink-700 text-black' />
Expand Down
15 changes: 9 additions & 6 deletions apps/tool/app/routes/_index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import Logo from '@repo/ui/components/Logo'
import QRDemo from '@repo/ui/components/QRDemo'
import QRLive from '@repo/ui/components/QRLive'
import { cn } from '@repo/ui/helpers'
import H3 from '@repo/ui/typography/H3'
import { useEffectEvent } from '@repo/utils/hooks'
import { useQuery } from '@tanstack/react-query'
import { useEffect, useState } from 'react'
Expand Down Expand Up @@ -417,8 +418,8 @@ export default function Index() {
const retryInterval = 5000 // ms

const connect = () => {
websocket = new WebSocket(`wss://${autoToolServerIP}:5555`)
// websocket = new WebSocket(`wss://localhost:5555`)
websocket = new WebSocket(`ws://${autoToolServerIP}:5555`)
// websocket = new WebSocket(`ws://localhost:5555`)

websocket.addEventListener('error', (error) => {
console.log(
Expand All @@ -433,7 +434,6 @@ export default function Index() {
})

websocket.addEventListener('open', () => {
console.log('WEBSOCKET OPEN')
setIsAutoLyricsConnected(true)
})

Expand Down Expand Up @@ -483,7 +483,6 @@ export default function Index() {
const screen = useAutoScreen()

useEffect(() => {
console.log('NEW SCREEN')
if (screen.type === 'lyrics') {
setSelectedSongId(screen.songId)
return
Expand All @@ -510,6 +509,10 @@ export default function Index() {
<main className='relative flex h-screen cursor-none flex-col items-center justify-center'>
<Logo className='absolute right-12 top-12 w-40' />

<H3 className='absolute left-12 top-12 w-40'>
{isAutoLyricsConnected ? 'CONNECTED' : 'WAITING...'}
</H3>

<h1
className={cn(
'duration-[1.5s]e absolute left-1/2 top-20 w-full -translate-x-1/2 px-72 text-center text-yellow-400 opacity-0 transition-opacity',
Expand All @@ -522,8 +525,8 @@ export default function Index() {
{selectedText?.title ?? screen.type}
</h1>

<QRLive className='absolute left-12 top-12' />
<QRDemo className='absolute right-12 top-12' />
<QRLive className='absolute bottom-12 left-12' />
<QRDemo className='absolute bottom-12 right-12' />

<section className='absolute left-1/2 top-1/2 w-full -translate-x-1/2 -translate-y-1/2 overflow-hidden px-12'>
<div
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ services:
SUPABASE_URL: ${DOCKER_SUPABASE_URL}
SUPABASE_ANON_KEY: ${SUPABASE_ANON_KEY}
VIRTUAL_HOST: ${HOST_TOOL}
LETSENCRYPT_HOST: ${HOST_TOOL}
VIRTUAL_PROTO: http
extra_hosts:
- "host.docker.internal:host-gateway"

Expand Down

0 comments on commit 2f95df9

Please sign in to comment.