reverting changes that are not done by me

This commit is contained in:
Hari Krishna
2024-04-29 05:08:06 +00:00
parent 29c3b279a1
commit 080f30aecd
2 changed files with 184 additions and 280 deletions
+1 -1
View File
@@ -4907,7 +4907,7 @@ func initHandlers() {
r.HandleFunc("/api/v1/triggers/outlook/{key}", shuffle.HandleGetSpecificTrigger).Methods("GET", "OPTIONS") 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/register", shuffle.HandleNewGmailRegister).Methods("GET", "OPTIONS")
r.HandleFunc("/api/v1/triggers/gmail/getFolders", shuffle.HandleGetGmailFolders).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/routing", handleGmailRouting).Methods("POST", "OPTIONS")
r.HandleFunc("/api/v1/triggers/gmail/{key}", shuffle.HandleGetSpecificTrigger).Methods("GET", "OPTIONS") r.HandleFunc("/api/v1/triggers/gmail/{key}", shuffle.HandleGetSpecificTrigger).Methods("GET", "OPTIONS")
+179 -275
View File
@@ -242,13 +242,13 @@ const Admin = (props) => {
}, [isDropzone]); }, [isDropzone]);
useEffect(() => { useEffect(() => {
if (userdata.orgs !== undefined && if (
userdata.orgs !== undefined &&
userdata.orgs !== null && userdata.orgs !== null &&
userdata.orgs.length > 0) { userdata.orgs.length > 0
handleGetSubOrgs(userdata.active_org.id); ) {
} else { handleGetSubOrgs(userdata.active_org.id);
console.log("Bad Userdata with orgs not existing") } else console.log("error in user data");
}
}, [userdata]); }, [userdata]);
useEffect(() => { 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 = () => { const handleGetAllTriggers = () => {
fetch(globalUrl + "/api/v1/triggers/all", { fetch(globalUrl + "/api/v1/triggers", {
method: "GET", method: "GET",
headers: { headers: {
"Content-Type": "application/json", "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 ( if (
userdata.support === true && userdata.support === true &&
selectedOrganization.id !== "" && 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 = const schedulesView =
curTab === 5 ? (
<div>
<div style={{ marginTop: 20, marginBottom: 20 }}>
<h2 style={{ display: "inline" }}>Schedules</h2>
<span style={{ marginLeft: 25 }}>
Schedules used in Workflows. Makes locating and control easier.{" "}
<a
target="_blank"
rel="noopener noreferrer"
href="/docs/organizations#schedules"
style={{ textDecoration: "none", color: "#f85a3e" }}
>
Learn more
</a>
</span>
</div>
<Divider
style={{
marginTop: 20,
marginBottom: 20,
backgroundColor: theme.palette.inputColor,
}}
/>
<List>
<ListItem>
<ListItemText
primary="Interval"
style={{ maxWidth: 200, minWidth: 200 }}
/>
<ListItemText
primary="Environment"
style={{ maxWidth: 150, minWidth: 150 }}
/>
<ListItemText
primary="Workflow"
style={{ maxWidth: 315, minWidth: 315 }}
/>
<ListItemText
primary="Argument"
style={{ minWidth: 300, maxWidth: 300, overflow: "hidden" }}
/>
<ListItemText primary="Actions" />
<ListItemText primary="Delegation" />
</ListItem>
{allSchedules === undefined || allSchedules === null
? null
: allSchedules.map((schedule, index) => {
var bgColor = "#27292d";
if (index % 2 === 0) {
bgColor = "#1f2023";
}
return (
<ListItem key={index} style={{ backgroundColor: bgColor }}>
<ListItemText
style={{ maxWidth: 200, minWidth: 200 }}
primary={
schedule.environment === "cloud" ||
schedule.environment === "" ||
schedule.frequency.length > 0 ? (
schedule.frequency
) : (
<span>{schedule.seconds} seconds</span>
)
}
/>
<ListItemText
style={{ maxWidth: 150, minWidth: 150 }}
primary={schedule.environment}
/>
<ListItemText
style={{ maxWidth: 315, minWidth: 315 }}
primary={
<a
style={{ textDecoration: "none", color: "#f85a3e" }}
href={`/workflows/${schedule.workflow_id}`}
target="_blank"
rel="noopener noreferrer"
>
{schedule.workflow_id}
</a>
}
/>
<ListItemText
primary={schedule.wrapped_argument.replaceAll('\\"', '"')}
style={{
minWidth: 300,
maxWidth: 300,
overflow: "hidden",
}}
/>
<ListItemText>
<Button
style={{}}
variant = {schedule.status === "running" ? "contained" : "outlined"}
disabled={schedule.status === "uninitialized"}
onClick={() => {
if (schedule.status === "running") {
deleteSchedule(schedule);
} else startSchedule(schedule);
curTab === 5 ? ( curTab === 5 ? (
<div> <div>
<div style={{ marginTop: 20, marginBottom: 20 }}> <div style={{ marginTop: 20, marginBottom: 20 }}>
@@ -4701,9 +4594,9 @@ If you're interested, please let me know a time that works for you, or set up a
<ListItemText primary="Actions" /> <ListItemText primary="Actions" />
<ListItemText primary="Delegation" /> <ListItemText primary="Delegation" />
</ListItem> </ListItem>
{schedules === undefined || schedules === null {allSchedules === undefined || allSchedules === null
? null ? null
: schedules.map((schedule, index) => { : allSchedules.map((schedule, index) => {
var bgColor = "#27292d"; var bgColor = "#27292d";
if (index % 2 === 0) { if (index % 2 === 0) {
bgColor = "#1f2023"; bgColor = "#1f2023";
@@ -4741,177 +4634,188 @@ If you're interested, please let me know a time that works for you, or set up a
} }
/> />
<ListItemText <ListItemText
primary={schedule.argument.replaceAll('\\"', '"')} primary={schedule.wrapped_argument.replaceAll('\\"', '"')}
style={{ style={{
minWidth: 300, minWidth: 300,
maxWidth: 300, maxWidth: 300,
overflow: "hidden", overflow: "hidden",
}} }}
> />
{schedule.status === "running" <ListItemText>
? "Stop Schedule" <Button
: "Start Schedule"} style={{}}
</Button> variant = {schedule.status === "running" ? "contained" : "outlined"}
</ListItemText> disabled={schedule.status === "uninitialized"}
</ListItem> onClick={() => {
); if (schedule.status === "running") {
})} deleteSchedule(schedule);
</List> } else startSchedule(schedule);
}}
<div style={{ marginTop: 20, marginBottom: 20 }}>
<h2 style={{ display: "inline" }}>WebHooks</h2>
</div>
<Divider
style={{
marginTop: 20,
marginBottom: 20,
backgroundColor: theme.palette.inputColor,
}}
/>
<List>
<ListItem>
<ListItemText primary="Name" style={{ maxWidth: 200, minWidth: 200 }} />
<ListItemText
primary="Environment"
style={{ maxWidth: 150, minWidth: 150 }}
/>
<ListItemText
primary="Workflow"
style={{ maxWidth: 315, minWidth: 315 }}
/>
<ListItemText
primary="Url"
style={{ minWidth: 300, maxWidth: 300, overflow: "hidden" }}
/>
<ListItemText
primary="Actions"
/>
</ListItem>
{webHooks === undefined || webHooks === null
? null
: webHooks.map((webhook, index) => {
var bgColor = "#27292d";
if (index % 2 === 0) {
bgColor = "#1f2023";
}
return (
<ListItem key={index} style={{ backgroundColor: bgColor }}>
<ListItemText
style={{ maxWidth: 200, minWidth: 200 }}
primary={webhook.info.name}
/>
<ListItemText
style={{ maxWidth: 150, minWidth: 150 }}
primary={webhook.environment}
/>
<ListItemText
style={{ maxWidth: 315, minWidth: 315 }}
primary={
<a
style={{ textDecoration: "none", color: "#f85a3e" }}
href={`/workflows/${webhook.workflows[0]}`}
target="_blank"
rel="noopener noreferrer"
> >
{webhook.workflows[0]} {schedule.status === "running"
</a> ? "Stop Schedule"
} : "Start Schedule"}
/> </Button>
</ListItemText>
</ListItem>
);
})}
</List>
<ListItemText <div style={{ marginTop: 20, marginBottom: 20 }}>
style={{ marginLeft: 10, maxWidth: 100, minWidth: 100 }} <h2 style={{ display: "inline" }}>WebHooks</h2>
primary={ </div>
webhook.info.url === undefined || webhook.info.url === 0 ? (
"" <Divider
) : ( style={{
<Tooltip marginTop: 20,
title={"Copy URL"} marginBottom: 20,
style={{}} backgroundColor: theme.palette.inputColor,
aria-label={"Copy URL"} }}
/>
<List>
<ListItem>
<ListItemText primary="Name" style={{ maxWidth: 200, minWidth: 200 }} />
<ListItemText
primary="Environment"
style={{ maxWidth: 150, minWidth: 150 }}
/>
<ListItemText
primary="Workflow"
style={{ maxWidth: 315, minWidth: 315 }}
/>
<ListItemText
primary="Url"
style={{ minWidth: 300, maxWidth: 300, overflow: "hidden" }}
/>
<ListItemText
primary="Actions"
/>
</ListItem>
{webHooks === undefined || webHooks === null
? null
: webHooks.map((webhook, index) => {
var bgColor = "#27292d";
if (index % 2 === 0) {
bgColor = "#1f2023";
}
return (
<ListItem key={index} style={{ backgroundColor: bgColor }}>
<ListItemText
style={{ maxWidth: 200, minWidth: 200 }}
primary={webhook.info.name}
/>
<ListItemText
style={{ maxWidth: 150, minWidth: 150 }}
primary={webhook.environment}
/>
<ListItemText
style={{ maxWidth: 315, minWidth: 315 }}
primary={
<a
style={{ textDecoration: "none", color: "#f85a3e" }}
href={`/workflows/${webhook.workflows[0]}`}
target="_blank"
rel="noopener noreferrer"
> >
<IconButton {webhook.workflows[0]}
</a>
}
/>
<ListItemText
style={{ marginLeft: 10, maxWidth: 100, minWidth: 100 }}
primary={
webhook.info.url === undefined || webhook.info.url === 0 ? (
""
) : (
<Tooltip
title={"Copy URL"}
style={{}} style={{}}
onClick={() => { aria-label={"Copy URL"}
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");
}
}}
> >
<FileCopyIcon <IconButton
style={{ color: "rgba(255,255,255,0.8)" }} style={{}}
/> onClick={() => {
</IconButton> const elementName = "copy_element_shuffle";
</Tooltip> 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;
}
<ListItemText> navigator.clipboard.writeText(webhook.info.url);
<Button copyText.select();
style={{ marginLeft: '18%' }} copyText.setSelectionRange(
variant={webhook.status === "running" ? "contained" : "outlined"} 0,
disabled={webhook.status === "uninitialized"} 99999,
onClick={() => { ); /* For mobile devices */
if (webhook.status === "running") {
deleteWebhook(webhook);
} else startWebHook(webhook);
}}
>
{webhook.status === "running"
? "Stop webhook"
: "Start Webhook"}
</Button>
</ListItemText>
</ListItem>
);
})}
</List>
{/* <div style={{ marginTop: 20, marginBottom: 20 }}> /* Copy the text inside the text field */
<h2 style={{ display: "inline" }}>Tenzir Pipelines</h2> document.execCommand("copy");
<span style={{ marginLeft: 25 }}>
Controls a pipeline to run things.{" "} toast("URL copied to clipboard");
<a }
target="_blank" }}
rel="noopener noreferrer" >
href="/docs/triggers#pipelines" <FileCopyIcon
style={{ textDecoration: "none", color: "#f85a3e" }} style={{ color: "rgba(255,255,255,0.8)" }}
> />
Learn more </IconButton>
</a> </Tooltip>
</span> )
}
/>
<ListItemText>
<Button
style={{ marginLeft: '18%' }}
variant={webhook.status === "running" ? "contained" : "outlined"}
disabled={webhook.status === "uninitialized"}
onClick={() => {
if (webhook.status === "running") {
deleteWebhook(webhook);
} else startWebHook(webhook);
}}
>
{webhook.status === "running"
? "Stop webhook"
: "Start Webhook"}
</Button>
</ListItemText>
</ListItem>
);
})}
</List>
{/* <div style={{ marginTop: 20, marginBottom: 20 }}>
<h2 style={{ display: "inline" }}>Tenzir Pipelines</h2>
<span style={{ marginLeft: 25 }}>
Controls a pipeline to run things.{" "}
<a
target="_blank"
rel="noopener noreferrer"
href="/docs/triggers#pipelines"
style={{ textDecoration: "none", color: "#f85a3e" }}
>
Learn more
</a>
</span>
</div>
<Divider
style={{
marginTop: 20,
marginBottom: 20,
backgroundColor: theme.palette.inputColor,
}}
/> */}
</div> </div>
) : null;
<Divider
style={{
marginTop: 20,
marginBottom: 20,
backgroundColor: theme.palette.inputColor,
}}
/> */}
</div>
) : null;
const appCategoryView = const appCategoryView =
curTab === 8 ? ( curTab === 8 ? (