From 7c0284821475cf28606a61093cae42519e990b01 Mon Sep 17 00:00:00 2001 From: moonrailgun Date: Sat, 29 Jul 2023 02:28:37 +0800 Subject: [PATCH] refactor: update livekit build config and fix style problem and add event log --- docker/livekit.yml | 6 ++--- .../src/components/FullScreenBtn.tsx | 22 ++++++++++--------- .../com.msgbyte.livekit/webhook/index.ts | 2 ++ 3 files changed, 17 insertions(+), 13 deletions(-) diff --git a/docker/livekit.yml b/docker/livekit.yml index 3f43d776..e6fe104d 100644 --- a/docker/livekit.yml +++ b/docker/livekit.yml @@ -15,8 +15,8 @@ services: - redis labels: - "traefik.enable=true" - - "traefik.http.routers.admin.rule=PathPrefix(`/livekit/webhook`)" - - "traefik.http.services.admin.loadbalancer.server.port=3000" + - "traefik.http.routers.livekit.rule=PathPrefix(`/livekit/webhook`)" + - "traefik.http.services.livekit.loadbalancer.server.port=3000" networks: - internal - command: cd server/dist/plugins/com.msgbyte.livekit/webhook && node index.js + command: node server/dist/plugins/com.msgbyte.livekit/webhook/index.js diff --git a/server/plugins/com.msgbyte.livekit/web/plugins/com.msgbyte.livekit/src/components/FullScreenBtn.tsx b/server/plugins/com.msgbyte.livekit/web/plugins/com.msgbyte.livekit/src/components/FullScreenBtn.tsx index 69aa6db9..3b3b8da3 100644 --- a/server/plugins/com.msgbyte.livekit/web/plugins/com.msgbyte.livekit/src/components/FullScreenBtn.tsx +++ b/server/plugins/com.msgbyte.livekit/web/plugins/com.msgbyte.livekit/src/components/FullScreenBtn.tsx @@ -5,16 +5,18 @@ import styled from 'styled-components'; const Root = styled.div.attrs({ className: 'lk-button', })` - position: absolute; - top: 0.25rem; - right: 2.25rem; - padding: 0.125rem; - font-size: 20px; - background-color: rgba(0, 0, 0, 0.5); - border-radius: calc(var(--lk-border-radius) / 2); - opacity: 0; - transition: opacity 0.2s ease-in-out; - transition-delay: 0.2s; + .lk-participant-tile & { + position: absolute; + top: 0.25rem; + right: 2.25rem; + padding: 0.125rem; + font-size: 20px; + background-color: rgba(0, 0, 0, 0.5); + border-radius: calc(var(--lk-border-radius) / 2); + opacity: 0; + transition: opacity 0.2s ease-in-out; + transition-delay: 0.2s; + } .lk-participant-tile:hover & { opacity: 1; diff --git a/server/plugins/com.msgbyte.livekit/webhook/index.ts b/server/plugins/com.msgbyte.livekit/webhook/index.ts index cbe575a1..0c5f1618 100644 --- a/server/plugins/com.msgbyte.livekit/webhook/index.ts +++ b/server/plugins/com.msgbyte.livekit/webhook/index.ts @@ -29,6 +29,8 @@ app.post('/livekit/webhook', (req, res) => { try { const event = receiver.receive(req.body, req.get('Authorization')); + console.log(JSON.stringify(event)); + callBrokerAction('plugin:com.msgbyte.livekit.webhook', event); } finally { res.json({ result: true });