Feat/end action (#308)

* feat: end action

---------

Co-authored-by: Fabian Posenau <fabian@fphome.de>
Co-authored-by: cv <34649812+cpvalente@users.noreply.github.com>
Co-authored-by: Fabian Posenau <19673098+kellhogs@users.noreply.github.com>
This commit is contained in:
Fabian Posenau
2023-03-16 19:27:15 +01:00
committed by GitHub
parent 76c8f8a4d5
commit 73533600a0
13 changed files with 79 additions and 45 deletions
@@ -15,9 +15,6 @@ export const RUNTIME = ['runtimeStore'];
// external stuff
export const githubURL = 'https://api.github.com/repos/cpvalente/ontime/releases/latest';
// external stuff
export const githubURL = 'https://api.github.com/repos/cpvalente/ontime/releases/latest';
/**
* @description finds server path given the current location, it
* @return {*}
@@ -2,7 +2,7 @@ import { useCallback, useEffect, useState } from 'react';
import { Button, Select, Switch } from '@chakra-ui/react';
import { IoBan } from '@react-icons/all-files/io5/IoBan';
import { useAtom } from 'jotai';
import { OntimeEvent, TimerType } from 'ontime-types';
import { EndAction, OntimeEvent, TimerType } from 'ontime-types';
import { millisToString } from 'ontime-utils';
import { editorEventId } from '../../common/atoms/LocalEventSettings';
@@ -169,18 +169,6 @@ export default function EventEditor() {
/>
</div>
<div className={style.timeSettings}>
<label className={style.inputLabel}>Timer Behaviour</label>
<Select
size='sm'
name='timerBehaviour'
value={event.timerBehaviour}
onChange={(event) => handleChange('timerBehaviour', event.target.value)}
>
<option value='start-end'>Start to end</option>
<option value='duration'>Duration</option>
<option value='follow-previous'>Follow previous</option>
<option value='start-only'>Start only</option>
</Select>
<label className={style.inputLabel}>Timer Type</label>
<Select
size='sm'
@@ -192,6 +180,18 @@ export default function EventEditor() {
<option value={TimerType.CountUp}>Count up</option>
<option value={TimerType.Clock}>Clock</option>
</Select>
<label className={style.inputLabel}>End Action</label>
<Select
size='sm'
name='endAction'
value={event.endAction}
onChange={(event) => handleChange('endAction', event.target.value)}
>
<option value={EndAction.Continue}>Continue</option>
<option value={EndAction.Stop}>Stop</option>
<option value={EndAction.LoadNext}>Load Next</option>
<option value={EndAction.PlayNext}>Play Next</option>
</Select>
<span className={style.spacer} />
<label className={`${style.inputLabel} ${style.publicToggle}`}>
<Switch isChecked={event.isPublic} onChange={() => togglePublic(event.isPublic)} variant='ontime' />