|
|
|
@ -13,8 +13,9 @@ import FactCheckOutlined from "@mui/icons-material/FactCheckOutlined" |
|
|
|
|
import {Box, CircularProgress, IconButton, LinearProgress, TableContainer, Table, TableBody, TableCell, TableHead, TableRow, TablePagination} from "@mui/material" |
|
|
|
|
import ConfirmDialog from "../confirm-dialog"; |
|
|
|
|
import smClient from "../../../api/sm/sm-client"; |
|
|
|
|
import {ProcessesResponseInterface, Status} from "../../../api/sm/responses/processes"; |
|
|
|
|
import Command, {CommandInterface} from "../commands/elements/command"; |
|
|
|
|
import {ProcessInterface, Status} from "../../../api/sm/responses/processes"; |
|
|
|
|
import Command from "../commands/elements/command"; |
|
|
|
|
import {CommandInterface} from "../../../api/sm/responses/comamnds"; |
|
|
|
|
|
|
|
|
|
enum Action { |
|
|
|
|
Run, |
|
|
|
@ -26,14 +27,14 @@ enum Action { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
export default function Processes() { |
|
|
|
|
const [processes, setProcesses] = useState<ProcessesResponseInterface[]>([]); |
|
|
|
|
const [processes, setProcesses] = useState<ProcessInterface[]>([]); |
|
|
|
|
const [page, setPage] = useState<number>(0); |
|
|
|
|
const [count, setCount] = useState<number>(0); |
|
|
|
|
const [loading, setLoading] = useState<boolean>(true); |
|
|
|
|
const [modalLoading, setModalLoading] = useState<boolean>(true); |
|
|
|
|
const [action, setAction] = useState<Action | null>(null); |
|
|
|
|
const [command, setCommand] = useState<CommandInterface | null>(null); |
|
|
|
|
const [selectedProcess, setSelectedProcess] = useState<ProcessesResponseInterface | null>(null); |
|
|
|
|
const [selectedProcess, setSelectedProcess] = useState<ProcessInterface | null>(null); |
|
|
|
|
const [optionList, setOptionList] = useState<Record<string, any>>({}); |
|
|
|
|
const [argumentList, setArgumentList] = useState<Record<string, any>>({}); |
|
|
|
|
|
|
|
|
@ -52,7 +53,7 @@ export default function Processes() { |
|
|
|
|
setLoading(false) |
|
|
|
|
refreshLock = false |
|
|
|
|
} |
|
|
|
|
let output = async (process: ProcessesResponseInterface) => { |
|
|
|
|
let output = async (process: ProcessInterface) => { |
|
|
|
|
const { data: output } = await smClient.getProcessOutput({ |
|
|
|
|
id: process.id |
|
|
|
|
}) |
|
|
|
@ -76,13 +77,13 @@ export default function Processes() { |
|
|
|
|
} |
|
|
|
|
}, [action]); |
|
|
|
|
|
|
|
|
|
let isFinished = (process: ProcessesResponseInterface) => process.cancelledAt || process.completedAt |
|
|
|
|
let isFinished = (process: ProcessInterface) => process.cancelledAt || process.completedAt |
|
|
|
|
|
|
|
|
|
const handleChangePage = (event: any, page: number) => { |
|
|
|
|
setPage(page); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const openDialog = (process: ProcessesResponseInterface, action: Action) => { |
|
|
|
|
const openDialog = (process: ProcessInterface, action: Action) => { |
|
|
|
|
setSelectedProcess(process) |
|
|
|
|
setAction(action) |
|
|
|
|
} |
|
|
|
@ -144,7 +145,7 @@ export default function Processes() { |
|
|
|
|
</TableRow> |
|
|
|
|
</TableHead> |
|
|
|
|
<TableBody> |
|
|
|
|
{processes.map((process: ProcessesResponseInterface, index: number) => ( |
|
|
|
|
{processes.map((process: ProcessInterface, index: number) => ( |
|
|
|
|
<TableRow key={process.id}> |
|
|
|
|
<TableCell>{process.name}</TableCell> |
|
|
|
|
<TableCell> |
|
|
|
|