mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-11 02:13:48 +00:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| db956f7955 | |||
| 887e5c448e | |||
| 6ce275da7a | |||
| 213f516f71 | |||
| 86e6f8b58c |
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@getontime/cli",
|
"name": "@getontime/cli",
|
||||||
"version": "3.6.0",
|
"version": "3.6.1",
|
||||||
"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",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "ontime-ui",
|
"name": "ontime-ui",
|
||||||
"version": "3.6.0",
|
"version": "3.6.1",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { isAlphanumeric, isIPAddress, isNotEmpty, isOnlyNumbers, startsWithHttp, startsWithSlash } from '../regex';
|
import { isAlphanumeric, isIPAddress, isNotEmpty, isOnlyNumbers, startsWithSlash } from '../regex';
|
||||||
|
|
||||||
describe('simple tests for regex', () => {
|
describe('simple tests for regex', () => {
|
||||||
test('isOnlyNumbers', () => {
|
test('isOnlyNumbers', () => {
|
||||||
@@ -25,18 +25,6 @@ describe('simple tests for regex', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
test('startsWithHttp', () => {
|
|
||||||
const right = ['http://test'];
|
|
||||||
const wrong = ['https://test', 'testing', '123.0.1'];
|
|
||||||
|
|
||||||
right.forEach((t) => {
|
|
||||||
expect(startsWithHttp.test(t)).toBe(true);
|
|
||||||
});
|
|
||||||
wrong.forEach((t) => {
|
|
||||||
expect(startsWithHttp.test(t)).toBe(false);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
test('startsWithSlash', () => {
|
test('startsWithSlash', () => {
|
||||||
const right = ['//test'];
|
const right = ['//test'];
|
||||||
const wrong = ['testing', '123.0.1'];
|
const wrong = ['testing', '123.0.1'];
|
||||||
|
|||||||
@@ -5,7 +5,6 @@
|
|||||||
|
|
||||||
export const isOnlyNumbers = /^\d+$/;
|
export const isOnlyNumbers = /^\d+$/;
|
||||||
export const isIPAddress = /^((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)\.?\b){4}$/;
|
export const isIPAddress = /^((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)\.?\b){4}$/;
|
||||||
export const startsWithHttp = /^http:\/\//;
|
|
||||||
export const startsWithSlash = /^\//;
|
export const startsWithSlash = /^\//;
|
||||||
export const isAlphanumeric = /^[a-z0-9]+$/i;
|
export const isAlphanumeric = /^[a-z0-9]+$/i;
|
||||||
export const isASCII = /^[ -~]+$/; //https://catonmat.net/my-favorite-regex
|
export const isASCII = /^[ -~]+$/; //https://catonmat.net/my-favorite-regex
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import { generateId } from 'ontime-utils';
|
|||||||
import { maybeAxiosError } from '../../../../common/api/utils';
|
import { maybeAxiosError } from '../../../../common/api/utils';
|
||||||
import { useHttpSettings, usePostHttpSettings } from '../../../../common/hooks-query/useHttpSettings';
|
import { useHttpSettings, usePostHttpSettings } from '../../../../common/hooks-query/useHttpSettings';
|
||||||
import { isKeyEscape } from '../../../../common/utils/keyEvent';
|
import { isKeyEscape } from '../../../../common/utils/keyEvent';
|
||||||
import { startsWithHttp } from '../../../../common/utils/regex';
|
|
||||||
import * as Panel from '../PanelUtils';
|
import * as Panel from '../PanelUtils';
|
||||||
|
|
||||||
import { cycles } from './integrationUtils';
|
import { cycles } from './integrationUtils';
|
||||||
@@ -158,10 +157,6 @@ export default function HttpIntegrations() {
|
|||||||
placeholder='http://third-party/vt1/{{timer.current}}'
|
placeholder='http://third-party/vt1/{{timer.current}}'
|
||||||
{...register(`subscriptions.${index}.message`, {
|
{...register(`subscriptions.${index}.message`, {
|
||||||
required: { value: true, message: 'Required field' },
|
required: { value: true, message: 'Required field' },
|
||||||
pattern: {
|
|
||||||
value: startsWithHttp,
|
|
||||||
message: 'HTTP messages should start with http://',
|
|
||||||
},
|
|
||||||
})}
|
})}
|
||||||
/>
|
/>
|
||||||
{maybeError && <Panel.Error>{maybeError}</Panel.Error>}
|
{maybeError && <Panel.Error>{maybeError}</Panel.Error>}
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ export default function TimerPreview() {
|
|||||||
<div className={contentClasses}>
|
<div className={contentClasses}>
|
||||||
<div
|
<div
|
||||||
className={style.mainContent}
|
className={style.mainContent}
|
||||||
data-phase={phase}
|
data-phase={showColourOverride && phase}
|
||||||
style={showColourOverride ? { '--override-colour': overrideColour } : {}}
|
style={showColourOverride ? { '--override-colour': overrideColour } : {}}
|
||||||
>
|
>
|
||||||
{main}
|
{main}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "ontime",
|
"name": "ontime",
|
||||||
"version": "3.6.0",
|
"version": "3.6.1",
|
||||||
"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": "3.6.0",
|
"version": "3.6.1",
|
||||||
"exports": "./src/index.js",
|
"exports": "./src/index.js",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@googleapis/sheets": "^5.0.5",
|
"@googleapis/sheets": "^5.0.5",
|
||||||
|
|||||||
@@ -172,7 +172,7 @@ export async function loadProjectFile(name: string) {
|
|||||||
const { rundown, customFields, osc, http } = result.data;
|
const { rundown, customFields, osc, http } = result.data;
|
||||||
|
|
||||||
// apply the rundown
|
// apply the rundown
|
||||||
initRundown(rundown, customFields);
|
await initRundown(rundown, customFields);
|
||||||
|
|
||||||
// apply integrations
|
// apply integrations
|
||||||
oscIntegration.init(osc);
|
oscIntegration.init(osc);
|
||||||
@@ -246,7 +246,7 @@ export async function renameProjectFile(originalFile: string, newFilename: strin
|
|||||||
const { rundown, customFields, osc, http } = result.data;
|
const { rundown, customFields, osc, http } = result.data;
|
||||||
|
|
||||||
// apply the rundown
|
// apply the rundown
|
||||||
initRundown(rundown, customFields);
|
await initRundown(rundown, customFields);
|
||||||
|
|
||||||
// apply integrations
|
// apply integrations
|
||||||
oscIntegration.init(osc);
|
oscIntegration.init(osc);
|
||||||
@@ -334,7 +334,7 @@ export async function patchCurrentProject(data: Partial<DatabaseModel>) {
|
|||||||
// ... but rundown and custom fields need to be checked
|
// ... but rundown and custom fields need to be checked
|
||||||
if (rundown != null) {
|
if (rundown != null) {
|
||||||
const result = parseRundown(data);
|
const result = parseRundown(data);
|
||||||
initRundown(result.rundown, result.customFields);
|
await initRundown(result.rundown, result.customFields);
|
||||||
}
|
}
|
||||||
|
|
||||||
return newData;
|
return newData;
|
||||||
|
|||||||
@@ -128,7 +128,6 @@ describe('parseHttp()', () => {
|
|||||||
{ id: '1', cycle: 'onLoad', message: 'http://', enabled: true }, // OK
|
{ id: '1', cycle: 'onLoad', message: 'http://', enabled: true }, // OK
|
||||||
{}, // no data
|
{}, // no data
|
||||||
{ id: '2', cycle: 'onStart', enabled: true }, // no message
|
{ id: '2', cycle: 'onStart', enabled: true }, // no message
|
||||||
{ id: '3', cycle: 'onLoad', message: '/test', enabled: true }, // doesnt start with http
|
|
||||||
],
|
],
|
||||||
} as HttpSettings;
|
} as HttpSettings;
|
||||||
const result = parseHttp({ http }, errorEmitter);
|
const result = parseHttp({ http }, errorEmitter);
|
||||||
|
|||||||
@@ -222,11 +222,7 @@ export function sanitiseHttpSubscriptions(subscriptions?: HttpSubscription[]): H
|
|||||||
|
|
||||||
return subscriptions.filter(
|
return subscriptions.filter(
|
||||||
({ id, cycle, message, enabled }) =>
|
({ id, cycle, message, enabled }) =>
|
||||||
typeof id === 'string' &&
|
typeof id === 'string' && isOntimeCycle(cycle) && typeof message === 'string' && typeof enabled === 'boolean',
|
||||||
isOntimeCycle(cycle) &&
|
|
||||||
typeof message === 'string' &&
|
|
||||||
message.startsWith('http://') &&
|
|
||||||
typeof enabled === 'boolean',
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "ontime",
|
"name": "ontime",
|
||||||
"version": "3.6.0",
|
"version": "3.6.1",
|
||||||
"description": "Time keeping for live events",
|
"description": "Time keeping for live events",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"ontime",
|
"ontime",
|
||||||
|
|||||||
Reference in New Issue
Block a user