diff --git a/frontend/src/views/Admin.jsx b/frontend/src/views/Admin.jsx index eb4173ef..81feaaab 100755 --- a/frontend/src/views/Admin.jsx +++ b/frontend/src/views/Admin.jsx @@ -203,7 +203,7 @@ const Admin = (props) => { const [selectedStatus, setSelectedStatus] = React.useState([]); const [webHooks, setWebHooks] = React.useState([]); const [allSchedules, setAllSchedules] = React.useState([]); - + const [pipelines, setPipelines] = React.useState([]); const [, forceUpdate] = React.useState(); const [showDeleteAccountTextbox, setShowDeleteAccountTextbox] = @@ -756,6 +756,7 @@ If you're interested, please let me know a time that works for you, or set up a .then((responseJson) => { setWebHooks(responseJson.webhooks || []); // Handling the case where the result is null or undefined setAllSchedules(responseJson.schedules || []); + setPipelines(responseJson.pipelines || []); }) .catch((error) => { toast(error.toString()); @@ -933,6 +934,14 @@ If you're interested, please let me know a time that works for you, or set up a }); }; + const changePipelineState = (pipeline, state) => { + if (state.trim() === ''){ + toast("state is not defined") + return + } + + } + if ( userdata.support === true && selectedOrganization.id !== "" && @@ -4573,94 +4582,112 @@ If you're interested, please let me know a time that works for you, or set up a backgroundColor: theme.palette.inputColor, }} /> - - - - - - - - - - {allSchedules === undefined || allSchedules === null - ? null - : allSchedules.map((schedule, index) => { - var bgColor = "#27292d"; - if (index % 2 === 0) { - bgColor = "#1f2023"; - } + {allSchedules === undefined || + allSchedules === null || + allSchedules.length === 0 ? ( +
+ No schedules found. +
+ ) : ( + + + + + + + + + + { allSchedules.map((schedule, index) => { + var bgColor = "#27292d"; + if (index % 2 === 0) { + bgColor = "#1f2023"; + } - return ( - - 0 ? ( - schedule.frequency - ) : ( - {schedule.seconds} seconds - ) - } - /> - - - {schedule.workflow_id} - - } - /> - - - - - - ); - })} - + + + + ); + })} +
+ )}

WebHooks

@@ -4673,126 +4700,140 @@ If you're interested, please let me know a time that works for you, or set up a backgroundColor: theme.palette.inputColor, }} /> + {webHooks === undefined || webHooks === null || webHooks.length === 0 ? ( +
+ No webhooks found. +
+ ) : ( + + + + + + + + + {webHooks.map((webhook, index) => { + var bgColor = "#27292d"; + if (index % 2 === 0) { + bgColor = "#1f2023"; + } - - - - - - - - - {webHooks === undefined || webHooks === null - ? null - : webHooks.map((webhook, index) => { - var bgColor = "#27292d"; - if (index % 2 === 0) { - bgColor = "#1f2023"; - } - - return ( - - - - - {webhook.workflows[0]} - - } - /> - - - { - const elementName = "copy_element_shuffle"; - var copyText = document.getElementById(elementName); - if (copyText !== null && copyText !== undefined) { - const clipboard = navigator.clipboard; - if (clipboard === undefined) { - toast("Can only copy over HTTPS (port 3443)"); - return; - } - - navigator.clipboard.writeText(webhook.info.url); - copyText.select(); - copyText.setSelectionRange( - 0, - 99999, - ); /* For mobile devices */ - - /* Copy the text inside the text field */ - document.execCommand("copy"); - - toast("URL copied to clipboard"); - } - }} - > - - - - ) - } - /> - - - - - - ); - })} - + {webhook.workflows[0]} + + } + /> - {/*
+ + { + const elementName = "copy_element_shuffle"; + var copyText = document.getElementById(elementName); + if (copyText !== null && copyText !== undefined) { + const clipboard = navigator.clipboard; + if (clipboard === undefined) { + toast("Can only copy over HTTPS (port 3443)"); + return; + } + + navigator.clipboard.writeText(webhook.info.url); + copyText.select(); + copyText.setSelectionRange( + 0, + 99999, + ); /* For mobile devices */ + + /* Copy the text inside the text field */ + document.execCommand("copy"); + + toast("URL copied to clipboard"); + } + }} + > + + + + ) + } + /> + + + + + + ); + })} + + )} + +

Tenzir Pipelines

Controls a pipeline to run things.{" "} @@ -4813,9 +4854,90 @@ If you're interested, please let me know a time that works for you, or set up a marginBottom: 20, backgroundColor: theme.palette.inputColor, }} - /> */} + /> + {pipelines === undefined || pipelines === null || pipelines.length === 0 ? ( +
+ No pipelines found. +
+ ) : ( + + + + + + + + {pipelines.map((pipeline, index) => { + var bgColor = "#27292d"; + if (index % 2 === 0) { + bgColor = "#1f2023"; + } + + return ( + + + + + {pipeline.workflow_id} + + } + /> + + + + + ); + })} + + )}
- ) : null; + ) : null; const appCategoryView = curTab === 8 ? (