mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-12 10:53:51 +00:00
refactor: cuesheet v2 (#435)
* refactor: typescript migration * chore: remove prop-types package * refactor: file structure * refactor: migrate ontime table to tanstack table 8 * refactor: rundown controller uses service as data source * refactor: convert to typescript * feat: caching store * refactor: add delay values to rundown * feat: toggle past visibility * chore: update tests * refactor: add extra fields to CSV * style: show skipped events * chore: add route to navigation menu * style: allow jumping to bottom * chore: add tests
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { LogOrigin, OSCSettings } from 'ontime-types';
|
||||
|
||||
import { Server } from 'node-osc';
|
||||
import { OSCSettings } from 'ontime-types';
|
||||
|
||||
import { IAdapter } from './IAdapter.js';
|
||||
import { dispatchFromAdapter } from '../controllers/integrationController.js';
|
||||
@@ -25,13 +26,13 @@ export class OscServer implements IAdapter {
|
||||
|
||||
// get first part before (ontime)
|
||||
if (address !== 'ontime') {
|
||||
logger.error('RX', `OSC IN: OSC messages to ontime must start with /ontime/, received: ${msg}`);
|
||||
logger.error(LogOrigin.Rx, `OSC IN: OSC messages to ontime must start with /ontime/, received: ${msg}`);
|
||||
return;
|
||||
}
|
||||
|
||||
// get second part (command)
|
||||
if (!path) {
|
||||
logger.error('RX', 'OSC IN: No path found');
|
||||
logger.error(LogOrigin.Rx, 'OSC IN: No path found');
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -42,7 +43,7 @@ export class OscServer implements IAdapter {
|
||||
this.osc.emit(topic, payload);
|
||||
}
|
||||
} catch (error) {
|
||||
logger.error('RX', `OSC IN: ${error}`);
|
||||
logger.error(LogOrigin.Rx, `OSC IN: ${error}`);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -14,6 +14,8 @@
|
||||
* Payload: adds necessary payload for the request to be completed
|
||||
*/
|
||||
|
||||
import { LogOrigin } from 'ontime-types';
|
||||
|
||||
import { WebSocket, WebSocketServer } from 'ws';
|
||||
|
||||
import getRandomName from '../utils/getRandomName.js';
|
||||
@@ -47,7 +49,7 @@ export class SocketServer implements IAdapter {
|
||||
this.wss.on('connection', (ws) => {
|
||||
let clientId = getRandomName();
|
||||
this.clientIds.add(clientId);
|
||||
logger.info('CLIENT', `${this.wss.clients.size} Connections with new: ${clientId}`);
|
||||
logger.info(LogOrigin.Client, `${this.wss.clients.size} Connections with new: ${clientId}`);
|
||||
|
||||
// send store payload on connect
|
||||
ws.send(
|
||||
@@ -67,7 +69,7 @@ export class SocketServer implements IAdapter {
|
||||
ws.on('error', console.error);
|
||||
|
||||
ws.on('close', () => {
|
||||
logger.info('CLIENT', `${this.wss.clients.size} Connections with disconnected: ${clientId}`);
|
||||
logger.info(LogOrigin.Client, `${this.wss.clients.size} Connections with disconnected: ${clientId}`);
|
||||
this.clientIds.delete(clientId);
|
||||
});
|
||||
|
||||
@@ -96,7 +98,7 @@ export class SocketServer implements IAdapter {
|
||||
clientId = payload;
|
||||
this.clientIds.delete(previousName);
|
||||
this.clientIds.add(clientId);
|
||||
logger.info('CLIENT', `Client ${previousName} renamed to ${clientId}`);
|
||||
logger.info(LogOrigin.Client, `Client ${previousName} renamed to ${clientId}`);
|
||||
}
|
||||
ws.send(
|
||||
JSON.stringify({
|
||||
@@ -127,7 +129,7 @@ export class SocketServer implements IAdapter {
|
||||
ws.send(topic, payload);
|
||||
}
|
||||
} catch (error) {
|
||||
logger.error('RX', `WS IN: ${error}`);
|
||||
logger.error(LogOrigin.Rx, `WS IN: ${error}`);
|
||||
}
|
||||
} catch (_) {
|
||||
// we ignore unknown
|
||||
|
||||
Reference in New Issue
Block a user