mirror of
https://github.com/cpvalente/ontime.git
synced 2026-09-07 07:19:16 +00:00
feat: automation UI
merge with automation service
This commit is contained in:
committed by
Carlos Valente
parent
05e61e7bf8
commit
8b84963e17
@@ -0,0 +1,39 @@
|
||||
import useScrollIntoView from '../../../../common/hooks/useScrollIntoView';
|
||||
import useAutomationSettings from '../../../../common/hooks-query/useAutomationSettings';
|
||||
import type { PanelBaseProps } from '../../panel-list/PanelList';
|
||||
import * as Panel from '../../panel-utils/PanelUtils';
|
||||
|
||||
import AutomationSettingsForm from './AutomationSettingsForm';
|
||||
import AutomationsList from './AutomationsList';
|
||||
import BlueprintsList from './BlueprintsList';
|
||||
|
||||
export default function AutomationPanel({ location }: PanelBaseProps) {
|
||||
const { data, status } = useAutomationSettings();
|
||||
const settingsRef = useScrollIntoView<HTMLDivElement>('settings', location);
|
||||
const automationRef = useScrollIntoView<HTMLDivElement>('automations', location);
|
||||
const blueprintsRef = useScrollIntoView<HTMLDivElement>('blueprints', location);
|
||||
|
||||
const isLoading = status === 'pending';
|
||||
|
||||
return (
|
||||
<>
|
||||
<Panel.Header>Automation</Panel.Header>
|
||||
<Panel.Section>
|
||||
<Panel.Loader isLoading={isLoading} />
|
||||
<div ref={settingsRef}>
|
||||
<AutomationSettingsForm
|
||||
enabledAutomations={data.enabledAutomations}
|
||||
enabledOscIn={data.enabledOscIn}
|
||||
oscPortIn={data.oscPortIn}
|
||||
/>
|
||||
</div>
|
||||
<div ref={automationRef}>
|
||||
<AutomationsList automations={data.automations} blueprints={data.blueprints} />
|
||||
</div>
|
||||
<div ref={blueprintsRef}>
|
||||
<BlueprintsList blueprints={data.blueprints} />
|
||||
</div>
|
||||
</Panel.Section>
|
||||
</>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user