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