|
|
@ -11,6 +11,9 @@ import ReplayOutlined from "@mui/icons-material/ReplayOutlined" |
|
|
|
import RunCircleOutlined from "@mui/icons-material/RunCircleOutlined" |
|
|
|
import RunCircleOutlined from "@mui/icons-material/RunCircleOutlined" |
|
|
|
import FactCheckOutlined from "@mui/icons-material/FactCheckOutlined" |
|
|
|
import FactCheckOutlined from "@mui/icons-material/FactCheckOutlined" |
|
|
|
import ThumbUpAltOutlined from '@mui/icons-material/ThumbUpAltOutlined' |
|
|
|
import ThumbUpAltOutlined from '@mui/icons-material/ThumbUpAltOutlined' |
|
|
|
|
|
|
|
import LockOutlined from '@mui/icons-material/LockOutlined'; |
|
|
|
|
|
|
|
import LockOpenOutlined from '@mui/icons-material/LockOpenOutlined'; |
|
|
|
|
|
|
|
|
|
|
|
import { |
|
|
|
import { |
|
|
|
Box, |
|
|
|
Box, |
|
|
|
TextField, |
|
|
|
TextField, |
|
|
@ -41,6 +44,7 @@ enum Action { |
|
|
|
Play, |
|
|
|
Play, |
|
|
|
Pause, |
|
|
|
Pause, |
|
|
|
Approve, |
|
|
|
Approve, |
|
|
|
|
|
|
|
Unlock, |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
export default function Processes() { |
|
|
|
export default function Processes() { |
|
|
@ -157,6 +161,12 @@ export default function Processes() { |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (action === Action.Unlock) { |
|
|
|
|
|
|
|
await api.unlockProcess({ |
|
|
|
|
|
|
|
id: selectedProcess.id, |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (action === Action.Repeat) { |
|
|
|
if (action === Action.Repeat) { |
|
|
|
await api.repeatProcess({ |
|
|
|
await api.repeatProcess({ |
|
|
|
id: selectedProcess.id, |
|
|
|
id: selectedProcess.id, |
|
|
@ -259,15 +269,21 @@ export default function Processes() { |
|
|
|
{Status.Wait === process.status && <IconButton title={`Wait`} aria-label="Wait"> |
|
|
|
{Status.Wait === process.status && <IconButton title={`Wait`} aria-label="Wait"> |
|
|
|
<HourglassEmptyOutlined/> |
|
|
|
<HourglassEmptyOutlined/> |
|
|
|
</IconButton>} |
|
|
|
</IconButton>} |
|
|
|
|
|
|
|
{process.lock && <IconButton title={`Locked`} aria-label="Locked"> |
|
|
|
|
|
|
|
<LockOutlined/> |
|
|
|
|
|
|
|
</IconButton>} |
|
|
|
</TableCell> |
|
|
|
</TableCell> |
|
|
|
<TableCell> |
|
|
|
<TableCell> |
|
|
|
|
|
|
|
{process.canUnlock && token?.permissions.indexOf('unlock_process') > -1 && <IconButton onClick={() => openDialog(process, Action.Unlock)} title={`Unlock`} aria-label="Unlock"> |
|
|
|
|
|
|
|
<LockOpenOutlined/> |
|
|
|
|
|
|
|
</IconButton>} |
|
|
|
{process.canApprove && token?.permissions.indexOf('approve_process') > -1 && <IconButton onClick={() => openDialog(process, Action.Approve)} title={`Approve`} aria-label="Approve"> |
|
|
|
{process.canApprove && token?.permissions.indexOf('approve_process') > -1 && <IconButton onClick={() => openDialog(process, Action.Approve)} title={`Approve`} aria-label="Approve"> |
|
|
|
<ThumbUpAltOutlined/> |
|
|
|
<ThumbUpAltOutlined/> |
|
|
|
</IconButton>} |
|
|
|
</IconButton>} |
|
|
|
{process.canRepeat && <IconButton onClick={() => openDialog(process, Action.Repeat)} title={`Repeat`} aria-label="Repeat"> |
|
|
|
{process.canRepeat && token?.permissions.indexOf('run_command') > -1 && <IconButton onClick={() => openDialog(process, Action.Repeat)} title={`Repeat`} aria-label="Repeat"> |
|
|
|
<ReplayOutlined/> |
|
|
|
<ReplayOutlined/> |
|
|
|
</IconButton>} |
|
|
|
</IconButton>} |
|
|
|
{process.canKill && <IconButton onClick={() => openDialog(process, Action.Kill)} title={`Kill`} aria-label="Kill"> |
|
|
|
{process.canKill && token?.permissions.indexOf('kill_process') > -1 && <IconButton onClick={() => openDialog(process, Action.Kill)} title={`Kill`} aria-label="Kill"> |
|
|
|
<DeleteForeverOutlined/> |
|
|
|
<DeleteForeverOutlined/> |
|
|
|
</IconButton>} |
|
|
|
</IconButton>} |
|
|
|
{process?.outputId && <IconButton title={`Output`} onClick={() => output(process)} aria-label="Output"> |
|
|
|
{process?.outputId && <IconButton title={`Output`} onClick={() => output(process)} aria-label="Output"> |
|
|
@ -324,6 +340,13 @@ export default function Processes() { |
|
|
|
closeCallback={() => {setAction(null)}}> |
|
|
|
closeCallback={() => {setAction(null)}}> |
|
|
|
Approve? |
|
|
|
Approve? |
|
|
|
</ConfirmDialog>} |
|
|
|
</ConfirmDialog>} |
|
|
|
|
|
|
|
{selectedProcess && <ConfirmDialog |
|
|
|
|
|
|
|
title={selectedProcess.name} |
|
|
|
|
|
|
|
open={Action.Unlock === action} |
|
|
|
|
|
|
|
agreeCallback={agreeCallback} |
|
|
|
|
|
|
|
closeCallback={() => {setAction(null)}}> |
|
|
|
|
|
|
|
Unlock? |
|
|
|
|
|
|
|
</ConfirmDialog>} |
|
|
|
{selectedProcess && <ConfirmDialog |
|
|
|
{selectedProcess && <ConfirmDialog |
|
|
|
title={`Are you sure?`} |
|
|
|
title={`Are you sure?`} |
|
|
|
open={ !!action && ([Action.Play, Action.Pause, Action.Stop, Action.Kill].indexOf(action) > -1) } |
|
|
|
open={ !!action && ([Action.Play, Action.Pause, Action.Stop, Action.Kill].indexOf(action) > -1) } |
|
|
|