From b1920b67775cc052cb9651e35fe3e726c7178638 Mon Sep 17 00:00:00 2001 From: Frikky Date: Sun, 1 Jun 2025 23:46:32 +0200 Subject: [PATCH] Cloud file sync :) --- frontend/src/components/Billing.jsx | 54 +++++++++++---------- frontend/src/components/BillingStats.jsx | 61 ++++++++++++++++++++++-- frontend/src/components/EditWorkflow.jsx | 2 +- frontend/src/components/LeftSideBar.jsx | 14 +++--- frontend/src/components/LicencePopup.jsx | 2 - frontend/src/views/Admin2.jsx | 3 +- frontend/src/views/Workflows2.jsx | 4 +- 7 files changed, 98 insertions(+), 42 deletions(-) diff --git a/frontend/src/components/Billing.jsx b/frontend/src/components/Billing.jsx index af8bb78c..2e86fd5c 100644 --- a/frontend/src/components/Billing.jsx +++ b/frontend/src/components/Billing.jsx @@ -2608,7 +2608,7 @@ const Billing = memo((props) => { userdata={userdata} /> ): ( - <> + setCurrentTab(newValue)} @@ -2627,35 +2627,37 @@ const Billing = memo((props) => { style={{ textTransform: 'none', fontSize: 16, minWidth: 'auto', paddingLeft: 12, paddingRight: 12 }} /> - {currentTab === 0 ? ( -
- -
- ): ( - - )} - +
+ {currentTab === 0 ? +
+ +
+ : + + } +
+
)} diff --git a/frontend/src/components/BillingStats.jsx b/frontend/src/components/BillingStats.jsx index 7b94c67c..19bda1b8 100644 --- a/frontend/src/components/BillingStats.jsx +++ b/frontend/src/components/BillingStats.jsx @@ -33,8 +33,15 @@ import { import { BarChart, + BarSeries, + Bar, + BarLabel, + GridlineSeries, Gridline, + TooltipArea, + ChartTooltip, + TooltipTemplate, } from 'reaviz'; import { typecost, typecost_single, } from "../views/HandlePaymentNew.jsx"; @@ -45,20 +52,32 @@ const LineChartWrapper = ({keys, inputname, height, width}) => { const inputdata = keys.data === undefined ? keys : keys.data const {themeMode} = useContext(Context) const theme = getTheme(themeMode) - + + return (
- + {inputname} + + } + /> + } gridlines={ } /> } /> +
) } @@ -70,6 +89,7 @@ const AppStats = (defaultprops) => { const [keys, setKeys] = useState([]) const [searches, setSearches] = useState([]); const [appRuns, setAppruns] = useState(undefined); + const [childOrgsAppRuns, setChildOrgsAppRuns] = useState(undefined); const [appRunCosts, setApprunCosts] = useState(undefined); const [workflowRuns, setWorkflowRuns] = useState(undefined); const [subflowRuns, setSubflowRuns] = useState(undefined); @@ -401,6 +421,11 @@ const AppStats = (defaultprops) => { "data": [] } + var childorgappRuns = { + "key": "Child Org App Runs", + "data": [] + } + var workflowRuns = { "key": "Workflow Runs (includes subflows)", "data": [] @@ -442,6 +467,13 @@ const AppStats = (defaultprops) => { }) } + if (item["child_app_executions"] !== undefined && item["child_app_executions"] !== null) { + childorgappRuns["data"].push({ + key: new Date(item["date"]), + data: inputdata["child_app_executions"] + }) + } + // Check if workflow_executions key in item if (item["workflow_executions"] !== undefined && item["workflow_executions"] !== null) { workflowRuns["data"].push({ @@ -471,6 +503,15 @@ const AppStats = (defaultprops) => { }) } + if (inputdata["daily_child_app_executions"] !== undefined && inputdata["daily_app_executions"] !== null) { + childorgappRuns["data"].push({ + key: new Date(), + data: inputdata["daily_child_app_executions"] + }) + + //setApprunCosts(appcostRuns) + } + if (inputdata["daily_workflow_executions"] !== undefined && inputdata["daily_workflow_executions"] !== null) { workflowRuns["data"].push({ key: new Date(), @@ -485,6 +526,11 @@ const AppStats = (defaultprops) => { }) } + // Only for parent orgs + if (childorgappRuns["data"].length > 0) { + setChildOrgsAppRuns(childorgappRuns) + } + setSubflowRuns(subflowRuns) setWorkflowRuns(workflowRuns) setAppruns(appRuns) @@ -895,7 +941,13 @@ const AppStats = (defaultprops) => { {appRuns === undefined ? null : - + + } + + {childOrgsAppRuns === undefined ? + null + : + } {workflowRuns === undefined ? @@ -922,8 +974,9 @@ const AppStats = (defaultprops) => {
Loading usage for selected period (may take a while) + + -
: { } const newWorkflow = isEditing === true ? false : true - const priority = userdata === undefined || userdata === null ? null : userdata.priorities.find(prio => prio.type === "usecase" && prio.active === true) + const priority = userdata === undefined || userdata === null || userdata.priorities === null || userdata.priorities === undefined ? null : userdata?.priorities?.find(prio => prio.type === "usecase" && prio.active === true) var upload = ""; var total_count = 0 diff --git a/frontend/src/components/LeftSideBar.jsx b/frontend/src/components/LeftSideBar.jsx index 7e0ef311..d10d4f00 100644 --- a/frontend/src/components/LeftSideBar.jsx +++ b/frontend/src/components/LeftSideBar.jsx @@ -450,6 +450,8 @@ const LeftSideBar = ({ userdata, serverside, globalUrl, notifications, }) => { const handleUpdateTheme = (newTheme) => { + handleThemeChange(newTheme); + setCurrentSelectedTheme(newTheme) const data = { "user_id": userdata?.id, @@ -470,14 +472,11 @@ const LeftSideBar = ({ userdata, serverside, globalUrl, notifications, }) => { }).then((response) => response.json().then((responseJson) => { if (responseJson["success"] === false) { - toast("Failed updating theme: ", responseJson.reason); - } else { - handleThemeChange(newTheme); - setCurrentSelectedTheme(newTheme); + toast("Failed saving your theme: ", responseJson.reason); } }) ).catch((error) => { - console.log("Error changing theme: ", error); + console.log("Error saving your theme: ", error); }); }; @@ -589,7 +588,8 @@ const LeftSideBar = ({ userdata, serverside, globalUrl, notifications, }) => { } if (userdata?.org_status?.includes("integration_partner")){ handleChangeTheme(newTheme); - }else { + } else { + handleUpdateTheme(newTheme); } }} @@ -671,7 +671,7 @@ const LeftSideBar = ({ userdata, serverside, globalUrl, notifications, }) => { - Version: 2.0.2 + Version: 2.1.0-rc1 diff --git a/frontend/src/components/LicencePopup.jsx b/frontend/src/components/LicencePopup.jsx index 0e580cbb..0267267d 100644 --- a/frontend/src/components/LicencePopup.jsx +++ b/frontend/src/components/LicencePopup.jsx @@ -1127,7 +1127,6 @@ const LicencePopup = (props) => { color: "white", } - console.log("Priceitem: ", shuffleVariant) // const isLoggedInHandler = () => { // if (calculatedCost === payasyougo) { // handlePayasyougo(props.userdata) @@ -1237,7 +1236,6 @@ const LicencePopup = (props) => { }); }; - console.log("Selected Organization: ", selectedOrganization.subscriptions) return (
diff --git a/frontend/src/views/Admin2.jsx b/frontend/src/views/Admin2.jsx index aaff1429..15a82580 100644 --- a/frontend/src/views/Admin2.jsx +++ b/frontend/src/views/Admin2.jsx @@ -334,7 +334,8 @@ const Admin2 = (props) => { } return ( -
+ //
+
); diff --git a/frontend/src/views/Workflows2.jsx b/frontend/src/views/Workflows2.jsx index 4832777a..123f8d86 100644 --- a/frontend/src/views/Workflows2.jsx +++ b/frontend/src/views/Workflows2.jsx @@ -1349,7 +1349,9 @@ const Workflows2 = (props) => { // When there are no workflows, we can set the loading to false setIsLoadingWorkflow(false) if (currTab !== 2) { - toast("No workflows found. Showing workflow discovery") + toast.info("No workflows found in this org. Feel free to look into our public workflows!" , { + timeout: 7500, + }) setCurrTab(2) } }