mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-20 06:29:07 +00:00
feat: allow redirecting to preset
This commit is contained in:
committed by
Carlos Valente
parent
88b8e83494
commit
b8d7324be0
@@ -59,11 +59,13 @@ export class SocketServer implements IAdapter {
|
||||
}
|
||||
});
|
||||
const clientId = generateId();
|
||||
const clientName = getRandomName();
|
||||
|
||||
this.clients.set(clientId, {
|
||||
type: 'unknown',
|
||||
identify: false,
|
||||
name: getRandomName(),
|
||||
name: clientName,
|
||||
origin: '',
|
||||
path: '',
|
||||
});
|
||||
|
||||
@@ -72,15 +74,11 @@ export class SocketServer implements IAdapter {
|
||||
|
||||
ws.send(
|
||||
JSON.stringify({
|
||||
type: 'client-id',
|
||||
payload: clientId,
|
||||
}),
|
||||
);
|
||||
|
||||
ws.send(
|
||||
JSON.stringify({
|
||||
type: 'client-name',
|
||||
payload: this.clients.get(clientId).name,
|
||||
type: 'client',
|
||||
payload: {
|
||||
clientId,
|
||||
clientName,
|
||||
},
|
||||
}),
|
||||
);
|
||||
|
||||
@@ -128,6 +126,13 @@ export class SocketServer implements IAdapter {
|
||||
return;
|
||||
}
|
||||
|
||||
if (type === 'set-client-patch') {
|
||||
if (payload && typeof payload == 'object') {
|
||||
this.clients.set(clientId, { ...this.clients.get(clientId), ...payload });
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (type === 'set-client-type') {
|
||||
if (payload && typeof payload == 'string') {
|
||||
const previousData = this.clients.get(clientId);
|
||||
|
||||
Reference in New Issue
Block a user