From 2b64d71f053a9cb088f3a3ac8b44aa8c47cc72bf Mon Sep 17 00:00:00 2001 From: Hari Krishna Date: Tue, 23 Apr 2024 11:11:22 +0000 Subject: [PATCH 1/5] added webhooks to the trigger view --- backend/go-app/main.go | 2 +- frontend/src/views/Admin.jsx | 540 ++++++++++++++++++++++++++++------- 2 files changed, 433 insertions(+), 109 deletions(-) diff --git a/backend/go-app/main.go b/backend/go-app/main.go index 52d8bc78..45bd1b83 100755 --- a/backend/go-app/main.go +++ b/backend/go-app/main.go @@ -4907,7 +4907,7 @@ func initHandlers() { r.HandleFunc("/api/v1/triggers/outlook/{key}", shuffle.HandleGetSpecificTrigger).Methods("GET", "OPTIONS") r.HandleFunc("/api/v1/triggers/gmail/register", shuffle.HandleNewGmailRegister).Methods("GET", "OPTIONS") r.HandleFunc("/api/v1/triggers/gmail/getFolders", shuffle.HandleGetGmailFolders).Methods("GET", "OPTIONS") - + //r.HandleFunc("/api/v1/triggers/all", shuffle.HandleGetTriggers).Methods("GET", "OPTIONS") //r.HandleFunc("/api/v1/triggers/gmail/routing", handleGmailRouting).Methods("POST", "OPTIONS") r.HandleFunc("/api/v1/triggers/gmail/{key}", shuffle.HandleGetSpecificTrigger).Methods("GET", "OPTIONS") diff --git a/frontend/src/views/Admin.jsx b/frontend/src/views/Admin.jsx index a68a9831..aa866c0f 100755 --- a/frontend/src/views/Admin.jsx +++ b/frontend/src/views/Admin.jsx @@ -192,6 +192,8 @@ const Admin = (props) => { const [showApiKey, setShowApiKey] = useState(false); const [billingInfo, setBillingInfo] = React.useState({}); const [selectedStatus, setSelectedStatus] = React.useState([]); + const [webHooks, setWebHooks] = React.useState([]); + const [allSchedules, setAllSchedules] = React.useState([]); const [, forceUpdate] = React.useState(); @@ -231,6 +233,9 @@ const Admin = (props) => { else console.log("error in user data") }, [userdata]); + useEffect(() => { + handleGetAllTriggers() + }, []); const isCloud = window.location.host === "localhost:3002" || window.location.host === "shuffler.io"; @@ -560,6 +565,31 @@ If you're interested, please let me know a time that works for you, or set up a }); }; + const handleGetAllTriggers = () => { + fetch(globalUrl + "/api/v1/triggers/all", { + method: "GET", + headers: { + "Content-Type": "application/json", + Accept: "application/json", + }, + credentials: "include", + }) + .then((response) => { + if (response.status !== 200) { + console.log("Status not 200 for getting all triggers"); + } + + return response.json(); + }) + .then((responseJson) => { + setWebHooks(responseJson.webhooks || []); // Handling the case where the result is null or undefined + setAllSchedules(responseJson.schedules || []); + }) + .catch((error) => { + toast(error.toString()); + }); + }; + const deleteSchedule = (data) => { // FIXME - add some check here ROFL console.log("INPUT: ", data); @@ -585,18 +615,150 @@ If you're interested, please let me know a time that works for you, or set up a if (responseJson["success"] === false) { toast("Failed stopping schedule"); } else { - setTimeout(() => { - getSchedules(); - }, 1500); - //toast("Successfully stopped schedule!") + toast("Successfully stopped schedule!"); } - }) + setTimeout(handleGetAllTriggers, 1000); + }), ) .catch((error) => { console.log("Error in userdata: ", error); }); }; + const startSchedule = (trigger) => { + if (trigger.name.length <= 0) { + toast("Error: name can't be empty"); + return; + } + + toast("Creating schedule"); + const data = { + name: trigger.name, + frequency: trigger.frequency, + execution_argument: trigger.argument, + environment: trigger.environment, + id: trigger.id, + start: trigger.start_node, + }; + + fetch(`${globalUrl}/api/v1/workflows/${trigger.workflow_id}/schedule`, { + method: "POST", + headers: { + "Content-Type": "application/json", + Accept: "application/json", + }, + body: JSON.stringify(data), + credentials: "include", + }) + .then((response) => { + if (response.status !== 200) { + console.log("Status not 200 for stream results :O!"); + } + + return response.json(); + }) + .then((responseJson) => { + if (!responseJson.success) { + toast("Failed to set schedule: " + responseJson.reason); + } else { + toast("Successfully created schedule"); + } + setTimeout(handleGetAllTriggers, 1000); + }) + .catch((error) => { + //toast(error.toString()); + console.log("Get schedule error: ", error.toString()); + }); + }; + + const deleteWebhook = (trigger) => { + if (trigger === undefined) { + return; + } + + fetch(globalUrl + "/api/v1/hooks/" + trigger.id + "/delete", { + method: "DELETE", + headers: { + "Content-Type": "application/json", + Accept: "application/json", + }, + credentials: "include", + }) + .then((response) => { + if (response.status !== 200) { + console.log("Status not 200 for stream results :O!"); + } + + return response.json(); + }) + .then((responseJson) => { + if (responseJson.success) { + toast("Successfully stopped webhook"); + } else { + if (responseJson.reason !== undefined) { + toast("Failed stopping webhook: " + responseJson.reason); + } + } + setTimeout(handleGetAllTriggers, 1000); + }) + .catch((error) => { + toast( + "Delete webhook error. Contact support or check logs if this persists.", + ); + }); + }; + + const startWebHook = (trigger) => { + const hookname = trigger.info.name; + if (hookname.length === 0) { + toast("Missing name"); + return; + } + + if (trigger.id.length !== 36) { + toast("Missing id"); + return; + } + + toast("Starting webhook"); + + const data = { + name: hookname, + type: "webhook", + id: trigger.id, + workflow: trigger.workflows[0], + start: trigger.start, + environment: trigger.environment, + auth: trigger.auth, + custom_response: trigger.custom_response, + version: trigger.version, + version_timeout: 15, + }; + + console.log("Trigger data: ", data); + + fetch(globalUrl + "/api/v1/hooks/new", { + method: "POST", + headers: { "content-type": "application/json" }, + body: JSON.stringify(data), + credentials: "include", + }) + .then((response) => response.json()) + .then((responseJson) => { + if (responseJson.success) { + // Set the status + toast("Successfully started webhook"); + } else { + toast("Failed starting webhook: " + responseJson.reason); + } + setTimeout(handleGetAllTriggers, 1000); + }) + .catch((error) => { + //console.log(error.toString()); + console.log("New webhook error: ", error.toString()); + }); + }; + if (userdata.support === true && selectedOrganization.id !== "" && selectedOrganization.id !== undefined && selectedOrganization.id !== null && selectedOrganization.id !== userdata.active_org.id) { toast("Refreshing window to fix org support access") @@ -3923,110 +4085,272 @@ If you're interested, please let me know a time that works for you, or set up a /> const schedulesView = - curTab === 5 ? ( -
-
-

Schedules

- - Schedules used in Workflows. Makes locating and control easier.{" "} - - Learn more - - -
- - - - - - - - - - - {schedules === undefined || schedules === null - ? null - : schedules.map((schedule, index) => { - var bgColor = "#27292d"; - if (index % 2 === 0) { - bgColor = "#1f2023"; - } - - return ( - - 0 ? - schedule.frequency - : - {schedule.seconds} seconds - } - /> - - - {schedule.workflow_id} - - } - /> - - - - - - ); - })} - + curTab === 5 ? ( +
+
+

Schedules

+ + Schedules used in Workflows. Makes locating and control easier.{" "} + + Learn more + +
- ) : null; + + + + + + + + + + + {allSchedules === undefined || allSchedules === null + ? null + : allSchedules.map((schedule, index) => { + var bgColor = "#27292d"; + if (index % 2 === 0) { + bgColor = "#1f2023"; + } + + return ( + + 0 ? ( + schedule.frequency + ) : ( + {schedule.seconds} seconds + ) + } + /> + + + {schedule.workflow_id} + + } + /> + + + + + + ); + })} + + +
+

WebHooks

+
+ + + + + + + + + + + + {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"); + } + }} + > + + + + ) + } + /> + + + + + + ); + })} + + + {/*
+

Tenzir Pipelines

+ + Controls a pipeline to run things.{" "} + + Learn more + + +
+ + */} +
+) : null; const appCategoryView = curTab === 8 ? ( From 080f30aecd92c61b4b8c7480c82467d3d9b2d7be Mon Sep 17 00:00:00 2001 From: Hari Krishna Date: Mon, 29 Apr 2024 05:08:06 +0000 Subject: [PATCH 2/5] reverting changes that are not done by me --- backend/go-app/main.go | 2 +- frontend/src/views/Admin.jsx | 462 ++++++++++++++--------------------- 2 files changed, 184 insertions(+), 280 deletions(-) diff --git a/backend/go-app/main.go b/backend/go-app/main.go index 45bd1b83..eb73f9b9 100755 --- a/backend/go-app/main.go +++ b/backend/go-app/main.go @@ -4907,7 +4907,7 @@ func initHandlers() { r.HandleFunc("/api/v1/triggers/outlook/{key}", shuffle.HandleGetSpecificTrigger).Methods("GET", "OPTIONS") r.HandleFunc("/api/v1/triggers/gmail/register", shuffle.HandleNewGmailRegister).Methods("GET", "OPTIONS") r.HandleFunc("/api/v1/triggers/gmail/getFolders", shuffle.HandleGetGmailFolders).Methods("GET", "OPTIONS") - //r.HandleFunc("/api/v1/triggers/all", shuffle.HandleGetTriggers).Methods("GET", "OPTIONS") + r.HandleFunc("/api/v1/triggers", shuffle.HandleGetTriggers).Methods("GET", "OPTIONS") //r.HandleFunc("/api/v1/triggers/gmail/routing", handleGmailRouting).Methods("POST", "OPTIONS") r.HandleFunc("/api/v1/triggers/gmail/{key}", shuffle.HandleGetSpecificTrigger).Methods("GET", "OPTIONS") diff --git a/frontend/src/views/Admin.jsx b/frontend/src/views/Admin.jsx index d0de71c6..eb4173ef 100755 --- a/frontend/src/views/Admin.jsx +++ b/frontend/src/views/Admin.jsx @@ -242,13 +242,13 @@ const Admin = (props) => { }, [isDropzone]); useEffect(() => { - if (userdata.orgs !== undefined && + if ( + userdata.orgs !== undefined && userdata.orgs !== null && - userdata.orgs.length > 0) { - handleGetSubOrgs(userdata.active_org.id); - } else { - console.log("Bad Userdata with orgs not existing") - } + userdata.orgs.length > 0 + ) { + handleGetSubOrgs(userdata.active_org.id); + } else console.log("error in user data"); }, [userdata]); useEffect(() => { @@ -738,7 +738,7 @@ If you're interested, please let me know a time that works for you, or set up a }; const handleGetAllTriggers = () => { - fetch(globalUrl + "/api/v1/triggers/all", { + fetch(globalUrl + "/api/v1/triggers", { method: "GET", headers: { "Content-Type": "application/json", @@ -933,13 +933,6 @@ If you're interested, please let me know a time that works for you, or set up a }); }; - - if (userdata.support === true && selectedOrganization.id !== "" && selectedOrganization.id !== undefined && selectedOrganization.id !== null && selectedOrganization.id !== userdata.active_org.id) { - toast("Refreshing window to fix org support access") - window.location.reload() - return null - } - if ( userdata.support === true && selectedOrganization.id !== "" && @@ -4556,107 +4549,7 @@ If you're interested, please let me know a time that works for you, or set up a /> ); - const schedulesView = - curTab === 5 ? ( -
-
-

Schedules

- - Schedules used in Workflows. Makes locating and control easier.{" "} - - Learn more - - -
- - - - - - - - - - - {allSchedules === undefined || allSchedules === null - ? null - : allSchedules.map((schedule, index) => { - var bgColor = "#27292d"; - if (index % 2 === 0) { - bgColor = "#1f2023"; - } - - return ( - - 0 ? ( - schedule.frequency - ) : ( - {schedule.seconds} seconds - ) - } - /> - - - {schedule.workflow_id} - - } - /> - - - - - - ); - })} - - -
-

WebHooks

-
- - - - - - - - - - - - {webHooks === undefined || webHooks === null - ? null - : webHooks.map((webhook, index) => { - var bgColor = "#27292d"; - if (index % 2 === 0) { - bgColor = "#1f2023"; - } - - return ( - - - - + + - - - ); - })} - - - {/*
-

Tenzir Pipelines

- - Controls a pipeline to run things.{" "} - - Learn more - - + { + 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.{" "} + + Learn more + + +
+ + */}
- - */} -
-) : null; + ) : null; const appCategoryView = curTab === 8 ? ( From 1c97e6785568fa3ac024ac6c9d4d77f63d33556b Mon Sep 17 00:00:00 2001 From: Hari Krishna Date: Mon, 29 Apr 2024 07:35:37 +0000 Subject: [PATCH 3/5] adding pipelines to the ui --- frontend/src/views/Admin.jsx | 532 +++++++++++++++++++++-------------- 1 file changed, 327 insertions(+), 205 deletions(-) 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 ? ( From 9837e155023489050081fde345e1c1838111e278 Mon Sep 17 00:00:00 2001 From: Hari Krishna Date: Mon, 29 Apr 2024 10:55:09 +0000 Subject: [PATCH 4/5] some minor nits --- frontend/src/views/Admin.jsx | 199 +++++++++++++++---------- frontend/src/views/AngularWorkflow.jsx | 30 ++-- 2 files changed, 136 insertions(+), 93 deletions(-) diff --git a/frontend/src/views/Admin.jsx b/frontend/src/views/Admin.jsx index 81feaaab..327bfa55 100755 --- a/frontend/src/views/Admin.jsx +++ b/frontend/src/views/Admin.jsx @@ -756,7 +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 || []); + // setPipelines(responseJson.pipelines || []); }) .catch((error) => { toast(error.toString()); @@ -935,13 +935,54 @@ 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 (state.trim() === "") { + toast("state is not defined"); + return; } - - } - + + const data = { + name: pipeline.name, + type: state, + environment: pipeline.environment, + workflow_id: pipeline.workflow_id, + trigger_id: pipeline.trigger_id, + }; + + if (state === "start") toast("starting the pipeline"); + else toast("stopping the pipeline"); + + const url = `${globalUrl}/api/v1/triggers/pipeline`; + fetch(url, { + method: "POST", + headers: { + "Content-Type": "application/json", + Accept: "application/json", + }, + body: JSON.stringify(data), + credentials: "include", + }) + .then((response) => { + if (response.status !== 200) { + console.log("Status not 200 for stream results :O!"); + toast("Failed to update the pipeline state"); + } + + return response.json(); + }) + .then((responseJson) => { + if (!responseJson.success) { + toast("Failed to update the pipeline: " + responseJson.reason); + } else { + if (state === "start") toast("Successfully created pipeline"); + else toast("Sucessfully stopped the pipeline"); + } + }) + .catch((error) => { + //toast(error.toString()); + console.log("Get schedule error: ", error.toString()); + }); + }; + if ( userdata.support === true && selectedOrganization.id !== "" && @@ -4618,74 +4659,72 @@ If you're interested, please let me know a time that works for you, or set up a - { allSchedules.map((schedule, index) => { - var bgColor = "#27292d"; - if (index % 2 === 0) { - bgColor = "#1f2023"; - } + {allSchedules.map((schedule, index) => { + var bgColor = "#27292d"; + if (index % 2 === 0) { + bgColor = "#1f2023"; + } - return ( - - 0 ? ( - schedule.frequency - ) : ( - {schedule.seconds} seconds - ) - } - /> - - - {schedule.workflow_id} - - } - /> - - - - - - ); - })} + return ( + + 0 ? ( + schedule.frequency + ) : ( + {schedule.seconds} seconds + ) + } + /> + + + {schedule.workflow_id} + + } + /> + + + + + + ); + })} )} @@ -4833,7 +4872,7 @@ If you're interested, please let me know a time that works for you, or set up a )} -
+ {/*

Tenzir Pipelines

Controls a pipeline to run things.{" "} @@ -4855,7 +4894,9 @@ If you're interested, please let me know a time that works for you, or set up a backgroundColor: theme.palette.inputColor, }} /> - {pipelines === undefined || pipelines === null || pipelines.length === 0 ? ( + {pipelines === undefined || + pipelines === null || + pipelines.length === 0 ? (
{pipeline.status === "running" - ? "Stop webhook" - : "Start Webhook"} + ? "Stop pipeline" + : "Start pipeline"} ); })} - )} + )}*/}
) : null; diff --git a/frontend/src/views/AngularWorkflow.jsx b/frontend/src/views/AngularWorkflow.jsx index 76953e68..5832f76f 100755 --- a/frontend/src/views/AngularWorkflow.jsx +++ b/frontend/src/views/AngularWorkflow.jsx @@ -13124,7 +13124,7 @@ const AngularWorkflow = (defaultprops) => { if (trigger.id === undefined) { return; } - + fetch(globalUrl + "/api/v1/hooks/" + trigger.id + "/delete", { method: "DELETE", headers: { @@ -13137,32 +13137,34 @@ const AngularWorkflow = (defaultprops) => { if (response.status !== 200) { console.log("Status not 200 for stream results :O!"); } - + return response.json(); }) .then((responseJson) => { + if (!responseJson.success) { + if (responseJson.reason !== undefined) { + toast("Failed to stop webhook: " + responseJson.reason); + } + } else { + toast("Successfully stopped webhook"); + } if (workflow.triggers[triggerindex] !== undefined) { workflow.triggers[triggerindex].status = "stopped"; } - - if (responseJson.success) { - // Set the status - saveWorkflow(workflow); - } else { - if (responseJson.reason !== undefined) { - toast("Failed stopping webhook: " + responseJson.reason); - } - } - trigger.status = "stopped"; - setWorkflow(workflow); setSelectedTrigger(trigger); + setWorkflow(workflow); + saveWorkflow(workflow); + }) .catch((error) => { //toast(error.toString()); - toast("Delete webhook error. Contact support or check logs if this persists.") + toast( + "Delete webhook error. Contact support or check logs if this persists.", + ); }); }; + // POST to /api/v1/workflows const createWorkflow = (workflow, trigger_index) => { From d9d7611ccb9cc4827d1c5329d618bae100d4760f Mon Sep 17 00:00:00 2001 From: Hari Krishna Date: Mon, 29 Apr 2024 11:17:01 +0000 Subject: [PATCH 5/5] removing awful white background color --- frontend/src/views/Admin.jsx | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/frontend/src/views/Admin.jsx b/frontend/src/views/Admin.jsx index 327bfa55..a678bf3b 100755 --- a/frontend/src/views/Admin.jsx +++ b/frontend/src/views/Admin.jsx @@ -4630,7 +4630,6 @@ If you're interested, please let me know a time that works for you, or set up a style={{ textAlign: "center", padding: "20px", - backgroundColor: "#f0f0f0", color: "#666", borderRadius: "5px", }} @@ -4741,14 +4740,13 @@ If you're interested, please let me know a time that works for you, or set up a /> {webHooks === undefined || webHooks === null || webHooks.length === 0 ? (
+ style={{ + textAlign: "center", + padding: "20px", + color: "#666", + borderRadius: "5px", + }} + > No webhooks found.
) : ( @@ -4901,7 +4899,6 @@ If you're interested, please let me know a time that works for you, or set up a style={{ textAlign: "center", padding: "20px", - backgroundColor: "#f0f0f0", color: "#666", borderRadius: "5px", }}