Updated billing list with links to track users

This commit is contained in:
Frikky
2024-03-05 16:31:16 +01:00
parent 1da44d12ec
commit 294c8060ef
6 changed files with 105 additions and 100 deletions
+16 -15
View File
@@ -431,6 +431,18 @@ const Billing = (props) => {
<Typography variant="h6" style={{ marginTop: 10, marginBottom: 10, flex: 5, }}> <Typography variant="h6" style={{ marginTop: 10, marginBottom: 10, flex: 5, }}>
{top_text} {top_text}
</Typography> </Typography>
{top_text === "Base Cloud Access" && userdata.has_card_available === false ?
<img
src="/images/stripenew.png"
style={{
margin: "auto",
width: 100,
backgroundColor: "white",
borderRadius: theme.palette.borderRadius,
}}
/>
: null}
{isCloud && highlight === true && top_text !== "Base Cloud Access" ? {isCloud && highlight === true && top_text !== "Base Cloud Access" ?
<Tooltip <Tooltip
title="Sign EULA" title="Sign EULA"
@@ -562,9 +574,10 @@ const Billing = (props) => {
userdata.has_card_available === true ? userdata.has_card_available === true ?
"While you have a card attached to your account, Shuffle will no longer prevent workflows from running. Billing will occur at the start of each month." "While you have a card attached to your account, Shuffle will no longer prevent workflows from running. Billing will occur at the start of each month."
: :
`You are not subscribed to any plan and are using the free plan with max 10,000 app runs per month. Upgrade to deactivate this limit. Your organisations manager email is ${selectedOrganization.org}.` `You are not subscribed to any plan and are using the free plan with max 10,000 app runs per month. Upgrade to deactivate this limit.`
} }
</Typography> </Typography>
Billing email: {selectedOrganization.org}
{/*isCloud ? {/*isCloud ?
<Button <Button
variant="contained" variant="contained"
@@ -589,6 +602,8 @@ const Billing = (props) => {
height: 40, height: 40,
fontSize: 14, fontSize: 14,
color: "white", color: "white",
backgroundImage: userdata.has_card_available ? null : "linear-gradient(to right, #f86a3e, #f34079)",
}} }}
onClick={() => { onClick={() => {
if (isCloud) { if (isCloud) {
@@ -632,20 +647,6 @@ const Billing = (props) => {
</Button> </Button>
: null} : null}
{userdata.has_card_available === false ?
<img
src="/images/stripenew.png"
style={{
margin: "auto",
marginTop: 20,
width: 100,
marginLeft: "35%",
backgroundColor: "white",
borderRadius: theme.palette.borderRadius,
clip: "rect(30px, 30px, 30px, 30px)",
}}
/>
: null}
</span> </span>
: null} : null}
{showSupport ? {showSupport ?
-4
View File
@@ -113,8 +113,6 @@ const AppStats = (defaultprops) => {
return return
} }
console.log("START TIME", starttime, endtime)
var url = `${globalUrl}/api/v1/workflows/${workflow.id}/executions/count` var url = `${globalUrl}/api/v1/workflows/${workflow.id}/executions/count`
if (starttime !== "") { if (starttime !== "") {
@@ -178,8 +176,6 @@ const AppStats = (defaultprops) => {
const allData = Promise.all(promises); const allData = Promise.all(promises);
allData.then((data) => { allData.then((data) => {
console.log("IN ALL DATA")
var total = 0 var total = 0
for (var i = 0; i < data.length; i++) { for (var i = 0; i < data.length; i++) {
if (data[i].runcount !== undefined) { if (data[i].runcount !== undefined) {
+39 -35
View File
@@ -454,12 +454,7 @@ const ParsedAction = (props) => {
} }
} }
// FIXME: Add values from previous executions if they exist if (workflow.execution_variables !== null && workflow.execution_variables !== undefined && workflow.execution_variables.length > 0) {
if (
workflow.execution_variables !== null &&
workflow.execution_variables !== undefined &&
workflow.execution_variables.length > 0
) {
for (let [key,keyval] in Object.entries(workflow.execution_variables)) { for (let [key,keyval] in Object.entries(workflow.execution_variables)) {
const item = workflow.execution_variables[key]; const item = workflow.execution_variables[key];
actionlist.push({ actionlist.push({
@@ -475,34 +470,39 @@ const ParsedAction = (props) => {
// Loops parent nodes' old results to fix autocomplete // Loops parent nodes' old results to fix autocomplete
if (getParents !== undefined) { if (getParents !== undefined) {
var parents = getParents(selectedAction); var parents = getParents(selectedAction)
if (parents.length > 1) { if (parents.length > 1) {
for (let [key,keyval] in Object.entries(parents)) { var labels = []
const item = parents[key]; //for (let [parentkey, parentkeyval] in Object.entries(parents)) {
if (item.label === "Execution Argument") { for (let parentkey in parents) {
continue; const parentNode = parents[parentkey]
if (parentNode.label === "Execution Argument") {
continue
} }
var exampledata = item.example === undefined || item.example === null ? "" : item.example; //if (labels.includes(item.label)) {
// continue
//}
labels.push(parentNode.label)
var exampledata = parentNode.example === undefined || parentNode.example === null ? "" : parentNode.example
// Find previous execution and their variables // Find previous execution and their variables
//exampledata === "" && //exampledata === "" &&
if (workflowExecutions.length > 0) { if (workflowExecutions.length > 0) {
// Look for the ID // Look for the ID
const found = false; const found = false;
for (let [key,keyval] in Object.entries(workflowExecutions)) { for (let wfkey in workflowExecutions) {
if ( if (workflowExecutions[wfkey].results === undefined || workflowExecutions[wfkey].results === null) {
workflowExecutions[key].results === undefined ||
workflowExecutions[key].results === null
) {
continue; continue;
} }
var foundResult = workflowExecutions[key].results.find( var foundResult = workflowExecutions[wfkey].results.find((result) => result.action.id === parentNode.id)
(result) => result.action.id === item.id
);
if (foundResult === undefined || foundResult === null) { if (foundResult === undefined || foundResult === null) {
continue; continue
} }
if (foundResult.result !== undefined && foundResult.result !== null) { if (foundResult.result !== undefined && foundResult.result !== null) {
@@ -514,34 +514,38 @@ const ParsedAction = (props) => {
if (valid.result.success === false) { if (valid.result.success === false) {
//console.log("Skipping success false autocomplete") //console.log("Skipping success false autocomplete")
} else { } else {
exampledata = valid.result;
break; // FIXME: Have a merge system to allow to use kind of any key from that node in the last 10-20 execs
//if (exampledata.length > 0) {
// exampledata = valid.result
//} else {
// exampledata = valid.result
//}
exampledata = valid.result
break
} }
} else { } else {
exampledata = foundResult; exampledata = foundResult
} }
} }
} }
// 1. Take // 1. Take
const itemlabelComplete = const itemlabelComplete = parentNode.label === null || parentNode.label === undefined ? "" : parentNode.label.split(" ").join("_");
item.label === null || item.label === undefined
? ""
: item.label.split(" ").join("_");
const actionvalue = { const actionvalue = {
type: "action", type: "action",
id: item.id, id: parentNode.id,
name: item.label, name: parentNode.label,
autocomplete: itemlabelComplete, autocomplete: itemlabelComplete,
example: exampledata, example: exampledata,
}; }
actionlist.push(actionvalue); actionlist.push(actionvalue)
} }
} }
//console.log("ACTIONLIST: ", actionlist)
setActionlist(actionlist); setActionlist(actionlist);
} }
} }
@@ -672,7 +676,6 @@ const ParsedAction = (props) => {
selectedAction.parameters[count]["value_replace"] = selectedAction.parameters[count]["value_replace"] =
paramcheck["value_replace"]; paramcheck["value_replace"];
} }
console.log("RESULT: ", selectedAction);
setSelectedAction(selectedAction); setSelectedAction(selectedAction);
//setUpdate(Math.random()) //setUpdate(Math.random())
return; return;
@@ -2618,7 +2621,8 @@ const ParsedAction = (props) => {
<FormatListNumberedIcon style={iconStyle} /> <FormatListNumberedIcon style={iconStyle} />
) : ( ) : (
<ExpandMoreIcon style={iconStyle} /> <ExpandMoreIcon style={iconStyle} />
); )
return ( return (
<MenuItem <MenuItem
key={data.name} key={data.name}
+33 -25
View File
@@ -1096,7 +1096,6 @@ const AngularWorkflow = (defaultprops) => {
return response.json(); return response.json();
}) })
.then((responseJson) => { .then((responseJson) => {
//console.log("RESPONSE: ", responseJson)
handleUpdateResults(responseJson, executionRequest); handleUpdateResults(responseJson, executionRequest);
}) })
.catch((error) => { .catch((error) => {
@@ -1349,12 +1348,10 @@ const AngularWorkflow = (defaultprops) => {
const sendStreamRequest = (body) => { const sendStreamRequest = (body) => {
//console.log("Stream not activated yet.") //console.log("Stream not activated yet.")
if (!isCloud) { if (!isCloud) {
console.log("Stream not activated yet for onprem")
return return
} }
if (streamDisabled) { if (streamDisabled) {
console.log("Stream disabled - send")
return return
} }
@@ -1365,7 +1362,7 @@ const AngularWorkflow = (defaultprops) => {
//const url = ${globalUrl}/api/v1/workflows/${props.match.params.key}/stream //const url = ${globalUrl}/api/v1/workflows/${props.match.params.key}/stream
//const streamUrl = "http://localhost:5002" //const streamUrl = "http://localhost:5002"
console.log("Stream request: ", body) //console.log("Stream request: ", body)
const streamUrl = "https://stream.shuffler.io" const streamUrl = "https://stream.shuffler.io"
const url = `${streamUrl}/api/v1/workflows/${props.match.params.key}/stream` const url = `${streamUrl}/api/v1/workflows/${props.match.params.key}/stream`
@@ -1397,7 +1394,7 @@ const AngularWorkflow = (defaultprops) => {
return response.json(); return response.json();
}) })
.then((responseJson) => { .then((responseJson) => {
console.log("Stream resp: ", responseJson) //console.log("Stream resp: ", responseJson)
}) })
.catch((error) => { .catch((error) => {
console.log("Stream send error: ", error.toString()) console.log("Stream send error: ", error.toString())
@@ -1410,9 +1407,19 @@ const AngularWorkflow = (defaultprops) => {
var success = false; var success = false;
if (isCloud && !isLoggedIn) { if (isCloud && !isLoggedIn) {
console.log("Should redirect to register with redirect."); console.log("Should redirect to register with redirect.")
window.location.href = `/register?view=/workflows/${props.match.params.key}&message=You need sign up to use workflows with Shuffle`; window.location.href = `/register?view=/workflows/${props.match.params.key}&message=You need sign up to use workflows with Shuffle`
return; return
}
if (curworkflow === undefined || curworkflow === null) {
console.log("No workflow during save")
return
}
if (curworkflow.actions === undefined || curworkflow.actions === null || curworkflow.actions.length === 0) {
console.log("Can't save without actions")
return
} }
setSavingState(2); setSavingState(2);
@@ -4467,7 +4474,6 @@ const AngularWorkflow = (defaultprops) => {
const foundresult = GetParamMatch(paramname, exampledata, ""); const foundresult = GetParamMatch(paramname, exampledata, "");
if (foundresult.length > 0) { if (foundresult.length > 0) {
console.log("FOUND ReS for field: ", dstdata.parameters[dstdataParamKey].name, foundresult)
if (dstdata.parameters[dstdataParamKey].value.length === 0) { if (dstdata.parameters[dstdataParamKey].value.length === 0) {
dstdata.parameters[dstdataParamKey].value = `$${parentlabel}${foundresult}`; dstdata.parameters[dstdataParamKey].value = `$${parentlabel}${foundresult}`;
dstdata.parameters[dstdataParamKey].autocompleted = true dstdata.parameters[dstdataParamKey].autocompleted = true
@@ -4550,7 +4556,6 @@ const AngularWorkflow = (defaultprops) => {
if (sourcenode.data("app_name") !== "Shuffle Workflow" && sourcenode.data("app_name") !== "User Input") { if (sourcenode.data("app_name") !== "Shuffle Workflow" && sourcenode.data("app_name") !== "User Input") {
setTimeout(() => { setTimeout(() => {
const alledges = cy.edges().jsons() const alledges = cy.edges().jsons()
console.log("edges: ", alledges, edge)
var targetedge = alledges.findIndex( var targetedge = alledges.findIndex(
(data) => data.data.source === edge.source && data.data.id !== edge.id (data) => data.data.source === edge.source && data.data.id !== edge.id
) )
@@ -4576,7 +4581,6 @@ const AngularWorkflow = (defaultprops) => {
const edgeCurve = calculateEdgeCurve(sourcenode.position(), destinationnode.position()) const edgeCurve = calculateEdgeCurve(sourcenode.position(), destinationnode.position())
const currentedge = cy.getElementById(edge.id) const currentedge = cy.getElementById(edge.id)
if (currentedge !== undefined && currentedge !== null) { if (currentedge !== undefined && currentedge !== null) {
console.log("Setting edge curve: ", edgeCurve)
currentedge.style('control-point-distance', edgeCurve.distance) currentedge.style('control-point-distance', edgeCurve.distance)
currentedge.style('control-point-weight', edgeCurve.weight) currentedge.style('control-point-weight', edgeCurve.weight)
} }
@@ -4587,7 +4591,6 @@ const AngularWorkflow = (defaultprops) => {
(data) => data.id === edge.target (data) => data.id === edge.target
); );
if (targetnode !== -1) { if (targetnode !== -1) {
console.log("TARGETNODE: ", targetnode);
if (workflow.triggers[targetnode].app_name === "User Input" || workflow.triggers[targetnode].app_name === "Shuffle Workflow" || workflow.triggers[targetnode].app_name === "Shuffle Subflow") { if (workflow.triggers[targetnode].app_name === "User Input" || workflow.triggers[targetnode].app_name === "Shuffle Workflow" || workflow.triggers[targetnode].app_name === "Shuffle Subflow") {
} else { } else {
toast("Can't have triggers as target of branch"); toast("Can't have triggers as target of branch");
@@ -4689,7 +4692,6 @@ const AngularWorkflow = (defaultprops) => {
/* /*
targetnode = workflow.triggers.findIndex(data => data.id === edge.target) targetnode = workflow.triggers.findIndex(data => data.id === edge.target)
if (targetnode !== -1) { if (targetnode !== -1) {
console.log("TARGETNODE: ", targetnode)
if (workflow.triggers[targetnode].app_name === "User Input" || workflow.triggers[targetnode].app_name === "Shuffle Workflow") { if (workflow.triggers[targetnode].app_name === "User Input" || workflow.triggers[targetnode].app_name === "Shuffle Workflow") {
} else { } else {
toast("Can't have triggers as target of branch") toast("Can't have triggers as target of branch")
@@ -4883,7 +4885,6 @@ const AngularWorkflow = (defaultprops) => {
// toast("Recommendations to show??") // toast("Recommendations to show??")
//} //}
console.log("Added to workflow!!")
setWorkflow(workflow); setWorkflow(workflow);
fetchRecommendations(workflow) fetchRecommendations(workflow)
} else if (nodedata.type === "TRIGGER") { } else if (nodedata.type === "TRIGGER") {
@@ -6180,7 +6181,6 @@ const AngularWorkflow = (defaultprops) => {
if (inputworkflow.actions !== undefined && inputworkflow.actions !== null && inputworkflow.actions.length > 0) { if (inputworkflow.actions !== undefined && inputworkflow.actions !== null && inputworkflow.actions.length > 0) {
cy.remove('*') cy.remove('*')
} }
console.log("INPUT: ", inputworkflow)
} }
if (inputworkflow.actions === undefined || inputworkflow.actions === null) { if (inputworkflow.actions === undefined || inputworkflow.actions === null) {
@@ -6482,6 +6482,7 @@ const AngularWorkflow = (defaultprops) => {
// Get selected node // Get selected node
if (selectedNode.data().type === "TRIGGER") { if (selectedNode.data().type === "TRIGGER") {
console.log("Should remove trigger!"); console.log("Should remove trigger!");
console.log(selectedNode.data()); console.log(selectedNode.data());
const triggerindex = workflow.triggers.findIndex( const triggerindex = workflow.triggers.findIndex(
@@ -8780,7 +8781,7 @@ const AngularWorkflow = (defaultprops) => {
results.push({ id: allkeys[parentkey], type: "TRIGGER" }); results.push({ id: allkeys[parentkey], type: "TRIGGER" });
} else { } else {
if (handled.includes(currentnode.data().id)) { if (handled.includes(currentnode.data().id)) {
continue; continue
} else { } else {
handled.push(currentnode.data().id); handled.push(currentnode.data().id);
results.push(currentnode.data()); results.push(currentnode.data());
@@ -8817,11 +8818,12 @@ const AngularWorkflow = (defaultprops) => {
} }
// Remove on the end as we don't want to remove everything // Remove on the end as we don't want to remove everything
results = results.filter((data) => data.id !== action.id); results = results.filter((data) => data.id !== action.id)
results = results.filter((data) => data.type === "ACTION" || data.app_name === "Shuffle Workflow" || data.app_name === "User Input"); results = results.filter((data) => data.type === "ACTION" || data.app_name === "Shuffle Workflow" || data.app_name === "User Input")
results.push({ label: "Execution Argument", type: "INTERNAL" }); results.push({ label: "Execution Argument", type: "INTERNAL" })
return results;
}; return results
}
// BOLD name: type: required? // BOLD name: type: required?
// FORM // FORM
@@ -10290,7 +10292,6 @@ const AngularWorkflow = (defaultprops) => {
return response.json(); return response.json();
}) })
.then((responseJson) => { .then((responseJson) => {
//console.log("RESPONSE: ");
setTriggerAuthentication(responseJson); setTriggerAuthentication(responseJson);
clearInterval(id); clearInterval(id);
newwin.close(); newwin.close();
@@ -14290,7 +14291,7 @@ const AngularWorkflow = (defaultprops) => {
lastSaved && !workflow.public ? "outlined" : "contained" lastSaved && !workflow.public ? "outlined" : "contained"
} }
onClick={() => { onClick={() => {
saveWorkflow() saveWorkflow(workflow)
if (workflow.public === true) { if (workflow.public === true) {
console.log("Public!") console.log("Public!")
@@ -14773,7 +14774,7 @@ const AngularWorkflow = (defaultprops) => {
</Typography> </Typography>
<Typography variant="body2" color="textSecondary"> <Typography variant="body2" color="textSecondary">
This workflow is public and <span style={{ color: "#f86a3e", cursor: "pointer", }} onClick={() => { This workflow is public and <span style={{ color: "#f86a3e", cursor: "pointer", }} onClick={() => {
saveWorkflow() saveWorkflow(workflow)
}}>must be saved</span> or exported before use. }}>must be saved</span> or exported before use.
</Typography> </Typography>
{Object.getOwnPropertyNames(creatorProfile).length !== 0 && creatorProfile.github_avatar !== undefined && creatorProfile.github_avatar !== null ? {Object.getOwnPropertyNames(creatorProfile).length !== 0 && creatorProfile.github_avatar !== undefined && creatorProfile.github_avatar !== null ?
@@ -15563,7 +15564,7 @@ const AngularWorkflow = (defaultprops) => {
style={{ color: "white", fontSize: 16 }} style={{ color: "white", fontSize: 16 }}
> >
<h2 style={{ color: "rgba(255,255,255,0.5)" }}> <h2 style={{ color: "rgba(255,255,255,0.5)" }}>
<DirectionsRunIcon style={{ marginRight: 10 }} /> <DirectionsRunIcon style={{ marginRight: 0, }} />
All Workflow Runs All Workflow Runs
</h2> </h2>
</Breadcrumbs> </Breadcrumbs>
@@ -18394,9 +18395,16 @@ const AngularWorkflow = (defaultprops) => {
cy.removeListener("drag"); cy.removeListener("drag");
cy.removeListener("free"); cy.removeListener("free");
cy.removeListener("cxttap"); cy.removeListener("cxttap");
//cy.remove('*')
setElements([])
} }
// Remove all cy nodes
setTimeout(() => {
setupGraph(newrevision) setupGraph(newrevision)
}, 100)
// Re-adding cytoscape triggers // Re-adding cytoscape triggers
if (cy !== undefined && cy !== null) { if (cy !== undefined && cy !== null) {
+1 -1
View File
@@ -518,7 +518,7 @@ export const validateJson = (showResult) => {
} }
} }
} catch (e) { } catch (e) {
console.log("Failed parsing inside json subvalues: ", e) //console.log("Failed parsing inside json subvalues: ", e)
} }
} }
-4
View File
@@ -570,12 +570,10 @@ func deployServiceWorkers(image string) {
overrideHttpProxy := os.Getenv("SHUFFLE_INTERNAL_HTTP_PROXY") overrideHttpProxy := os.Getenv("SHUFFLE_INTERNAL_HTTP_PROXY")
overrideHttpsProxy := os.Getenv("SHUFFLE_INTERNAL_HTTPS_PROXY") overrideHttpsProxy := os.Getenv("SHUFFLE_INTERNAL_HTTPS_PROXY")
if len(overrideHttpProxy) > 0 { if len(overrideHttpProxy) > 0 {
log.Printf("[DEBUG] Added internal proxy: %s", overrideHttpProxy)
serviceSpec.TaskTemplate.ContainerSpec.Env = append(serviceSpec.TaskTemplate.ContainerSpec.Env, fmt.Sprintf("SHUFFLE_INTERNAL_HTTP_PROXY=%s", overrideHttpProxy)) serviceSpec.TaskTemplate.ContainerSpec.Env = append(serviceSpec.TaskTemplate.ContainerSpec.Env, fmt.Sprintf("SHUFFLE_INTERNAL_HTTP_PROXY=%s", overrideHttpProxy))
} }
if len(overrideHttpsProxy) > 0 { if len(overrideHttpsProxy) > 0 {
log.Printf("[DEBUG] Added internal proxy: %s", overrideHttpsProxy)
serviceSpec.TaskTemplate.ContainerSpec.Env = append(serviceSpec.TaskTemplate.ContainerSpec.Env, fmt.Sprintf("SHUFFLE_INTERNAL_HTTPS_PROXY=%s", overrideHttpsProxy)) serviceSpec.TaskTemplate.ContainerSpec.Env = append(serviceSpec.TaskTemplate.ContainerSpec.Env, fmt.Sprintf("SHUFFLE_INTERNAL_HTTPS_PROXY=%s", overrideHttpsProxy))
} }
@@ -1758,12 +1756,10 @@ func main() {
overrideHttpProxy := os.Getenv("SHUFFLE_INTERNAL_HTTP_PROXY") overrideHttpProxy := os.Getenv("SHUFFLE_INTERNAL_HTTP_PROXY")
overrideHttpsProxy := os.Getenv("SHUFFLE_INTERNAL_HTTPS_PROXY") overrideHttpsProxy := os.Getenv("SHUFFLE_INTERNAL_HTTPS_PROXY")
if len(overrideHttpProxy) > 0 { if len(overrideHttpProxy) > 0 {
log.Printf("[DEBUG] Added internal proxy: %s", overrideHttpProxy)
env = append(env, fmt.Sprintf("SHUFFLE_INTERNAL_HTTP_PROXY=%s", overrideHttpProxy)) env = append(env, fmt.Sprintf("SHUFFLE_INTERNAL_HTTP_PROXY=%s", overrideHttpProxy))
} }
if len(overrideHttpsProxy) > 0 { if len(overrideHttpsProxy) > 0 {
log.Printf("[DEBUG] Added internal proxy: %s", overrideHttpsProxy)
env = append(env, fmt.Sprintf("SHUFFLE_INTERNAL_HTTPS_PROXY=%s", overrideHttpsProxy)) env = append(env, fmt.Sprintf("SHUFFLE_INTERNAL_HTTPS_PROXY=%s", overrideHttpsProxy))
} }