Skip to content

Commit

Permalink
Make Recorder commands more responsive in UI
Browse files Browse the repository at this point in the history
  • Loading branch information
walesch-yan committed Oct 21, 2024
1 parent bdb90a7 commit 60a0c08
Showing 1 changed file with 24 additions and 13 deletions.
37 changes: 24 additions & 13 deletions ui/src/components/Argus/ArgusForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,20 +61,31 @@ export function ArgusForm(props) {
const runningButtons = (key) => {
return (
<div className={styles.processButtons}>
{Object.values(processes_info.running[key].commands).map((element) => (
<Button
key={`${key}-command-${element}`}
variant="primary"
onClick={() =>
sendExecuteCommand('argus', 'manage_process', {
name: key,
command: element,
})
{Object.values(processes_info.running[key].commands).map((element) => {
if (key === 'Recorder') {
const { recording } = processes_info.running[key].settings;
if (
(element === 'start' && recording) ||
(element === 'stop' && !recording)
) {
return null;
}
>
{capitalize(element)}
</Button>
))}
}
return (
<Button
key={`${key}-command-${element}`}
variant="primary"
onClick={() =>
sendExecuteCommand('argus', 'manage_process', {
name: key,
command: element,
})
}
>
{capitalize(element)}
</Button>
);
})}
<Button
variant="secondary"
onClick={() =>
Expand Down

0 comments on commit 60a0c08

Please sign in to comment.