mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-20 14:39:06 +00:00
Merge remote-tracking branch 'origin/master' into feat/operator
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "ontime-ui",
|
"name": "ontime-ui",
|
||||||
"version": "2.7.0",
|
"version": "2.7.2",
|
||||||
"private": true,
|
"private": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@chakra-ui/react": "^2.7.0",
|
"@chakra-ui/react": "^2.7.0",
|
||||||
|
|||||||
@@ -12,9 +12,10 @@ export const RUNTIME = ['runtimeStore'];
|
|||||||
|
|
||||||
const location = window.location;
|
const location = window.location;
|
||||||
const socketProtocol = location.protocol === 'https:' ? 'wss' : 'ws';
|
const socketProtocol = location.protocol === 'https:' ? 'wss' : 'ws';
|
||||||
|
export const isProduction = import.meta.env.MODE === 'production';
|
||||||
|
|
||||||
const STATIC_PORT = 4001;
|
const STATIC_PORT = 4001;
|
||||||
export const serverPort = import.meta.env.DEV ? STATIC_PORT : location.port;
|
export const serverPort = isProduction ? location.port : STATIC_PORT;
|
||||||
export const serverURL = `${location.protocol}//${location.hostname}:${serverPort}`;
|
export const serverURL = `${location.protocol}//${location.hostname}:${serverPort}`;
|
||||||
export const websocketUrl = `${socketProtocol}://${location.hostname}:${serverPort}/ws`;
|
export const websocketUrl = `${socketProtocol}://${location.hostname}:${serverPort}/ws`;
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Log, RuntimeStore } from 'ontime-types';
|
import { Log, RuntimeStore } from 'ontime-types';
|
||||||
|
|
||||||
import { RUNTIME, websocketUrl } from '../api/apiConstants';
|
import { isProduction, RUNTIME, websocketUrl } from '../api/apiConstants';
|
||||||
import { ontimeQueryClient } from '../queryClient';
|
import { ontimeQueryClient } from '../queryClient';
|
||||||
import { socketClientName } from '../stores/connectionName';
|
import { socketClientName } from '../stores/connectionName';
|
||||||
import { addLog } from '../stores/logger';
|
import { addLog } from '../stores/logger';
|
||||||
@@ -64,7 +64,7 @@ export const connectSocket = (preferredClientName?: string) => {
|
|||||||
}
|
}
|
||||||
case 'ontime': {
|
case 'ontime': {
|
||||||
runtime.setState(payload as RuntimeStore);
|
runtime.setState(payload as RuntimeStore);
|
||||||
if (import.meta.env.DEV) {
|
if (!isProduction) {
|
||||||
ontimeQueryClient.setQueryData(RUNTIME, data.payload);
|
ontimeQueryClient.setQueryData(RUNTIME, data.payload);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import { useCallback } from 'react';
|
import { useCallback } from 'react';
|
||||||
import { Input, InputProps } from '@chakra-ui/react';
|
import { Input, InputProps } from '@chakra-ui/react';
|
||||||
import { sanitiseCue } from 'ontime-utils';
|
|
||||||
|
|
||||||
import useReactiveTextInput from '../../../common/components/input/text-input/useReactiveTextInput';
|
import useReactiveTextInput from '../../../common/components/input/text-input/useReactiveTextInput';
|
||||||
import { EditorUpdateFields } from '../EventEditor';
|
import { EditorUpdateFields } from '../EventEditor';
|
||||||
@@ -17,10 +16,7 @@ interface CountedTextInputProps extends InputProps {
|
|||||||
export default function CountedTextInput(props: CountedTextInputProps) {
|
export default function CountedTextInput(props: CountedTextInputProps) {
|
||||||
const { field, label, initialValue, submitHandler, maxLength } = props;
|
const { field, label, initialValue, submitHandler, maxLength } = props;
|
||||||
|
|
||||||
const submitCallback = useCallback(
|
const submitCallback = useCallback((newValue: string) => submitHandler(field, newValue), [field, submitHandler]);
|
||||||
(newValue: string) => submitHandler(field, sanitiseCue(newValue)),
|
|
||||||
[field, submitHandler],
|
|
||||||
);
|
|
||||||
|
|
||||||
const { value, onChange, onBlur, onKeyDown } = useReactiveTextInput(initialValue, submitCallback, {
|
const { value, onChange, onBlur, onKeyDown } = useReactiveTextInput(initialValue, submitCallback, {
|
||||||
submitOnEnter: true,
|
submitOnEnter: true,
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import { memo } from 'react';
|
import { memo } from 'react';
|
||||||
import { Input } from '@chakra-ui/react';
|
import { Input } from '@chakra-ui/react';
|
||||||
|
import { sanitiseCue } from 'ontime-utils';
|
||||||
|
|
||||||
import { type EditorUpdateFields } from '../EventEditor';
|
import { type EditorUpdateFields } from '../EventEditor';
|
||||||
|
|
||||||
@@ -19,6 +20,10 @@ interface EventEditorLeftProps {
|
|||||||
const EventEditorDataLeft = (props: EventEditorLeftProps) => {
|
const EventEditorDataLeft = (props: EventEditorLeftProps) => {
|
||||||
const { eventId, cue, title, presenter, subtitle, handleSubmit } = props;
|
const { eventId, cue, title, presenter, subtitle, handleSubmit } = props;
|
||||||
|
|
||||||
|
const cueSubmitHandler = (_field: string, newValue: string) => {
|
||||||
|
handleSubmit('cue', sanitiseCue(newValue));
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={style.left}>
|
<div className={style.left}>
|
||||||
<div className={style.splitTwo}>
|
<div className={style.splitTwo}>
|
||||||
@@ -37,7 +42,7 @@ const EventEditorDataLeft = (props: EventEditorLeftProps) => {
|
|||||||
readOnly
|
readOnly
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<CountedTextInput field='cue' label='Cue' initialValue={cue} submitHandler={handleSubmit} maxLength={10} />
|
<CountedTextInput field='cue' label='Cue' initialValue={cue} submitHandler={cueSubmitHandler} maxLength={10} />
|
||||||
</div>
|
</div>
|
||||||
<CountedTextInput field='title' label='Title' initialValue={title} submitHandler={handleSubmit} />
|
<CountedTextInput field='title' label='Title' initialValue={title} submitHandler={handleSubmit} />
|
||||||
<CountedTextInput field='presenter' label='Presenter' initialValue={presenter} submitHandler={handleSubmit} />
|
<CountedTextInput field='presenter' label='Presenter' initialValue={presenter} submitHandler={handleSubmit} />
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "ontime",
|
"name": "ontime",
|
||||||
"version": "2.7.0",
|
"version": "2.7.2",
|
||||||
"author": "Carlos Valente",
|
"author": "Carlos Valente",
|
||||||
"description": "Time keeping for live events",
|
"description": "Time keeping for live events",
|
||||||
"repository": "https://github.com/cpvalente/ontime",
|
"repository": "https://github.com/cpvalente/ontime",
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
"name": "ontime-server",
|
"name": "ontime-server",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "src/index.ts",
|
"main": "src/index.ts",
|
||||||
"version": "2.7.0",
|
"version": "2.7.2",
|
||||||
"exports": "./src/index.js",
|
"exports": "./src/index.js",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"body-parser": "^1.20.0",
|
"body-parser": "^1.20.0",
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "ontime",
|
"name": "ontime",
|
||||||
"version": "2.7.0",
|
"version": "2.7.2",
|
||||||
"description": "Time keeping for live events",
|
"description": "Time keeping for live events",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"lighdev",
|
"lighdev",
|
||||||
|
|||||||
Reference in New Issue
Block a user