Cloud file sync :)

This commit is contained in:
Frikky
2025-06-01 23:46:32 +02:00
parent 063c82ee0d
commit b1920b6777
7 changed files with 98 additions and 42 deletions
+8 -6
View File
@@ -2608,7 +2608,7 @@ const Billing = memo((props) => {
userdata={userdata} userdata={userdata}
/> />
): ( ): (
<> <span>
<Tabs <Tabs
value={currentTab} value={currentTab}
onChange={(event, newValue) => setCurrentTab(newValue)} onChange={(event, newValue) => setCurrentTab(newValue)}
@@ -2627,12 +2627,13 @@ const Billing = memo((props) => {
style={{ textTransform: 'none', fontSize: 16, minWidth: 'auto', paddingLeft: 12, paddingRight: 12 }} style={{ textTransform: 'none', fontSize: 16, minWidth: 'auto', paddingLeft: 12, paddingRight: 12 }}
/> />
<Tab <Tab
label="Child Organization" label="Child Organization Stats"
style={{ textTransform: 'none', fontSize: 16, minWidth: 'auto', paddingLeft: 12, paddingRight: 12 }} style={{ textTransform: 'none', fontSize: 16, minWidth: 'auto', paddingLeft: 12, paddingRight: 12 }}
/> />
</Tabs> </Tabs>
{currentTab === 0 ? ( <div style={{paddingBottom: 200, }}>
{currentTab === 0 ?
<div style={{ marginTop: 30,}}> <div style={{ marginTop: 30,}}>
<BillingStats <BillingStats
isCloud={isCloud} isCloud={isCloud}
@@ -2642,7 +2643,7 @@ const Billing = memo((props) => {
userdata={userdata} userdata={userdata}
/> />
</div> </div>
): ( :
<BillingStatsChildOrg <BillingStatsChildOrg
isCloud={isCloud} isCloud={isCloud}
clickedFromOrgTab={clickedFromOrgTab} clickedFromOrgTab={clickedFromOrgTab}
@@ -2654,8 +2655,9 @@ const Billing = memo((props) => {
allChildOrgsStats={allChildOrgsStats} allChildOrgsStats={allChildOrgsStats}
setAllChildOrgsStats={setAllChildOrgsStats} setAllChildOrgsStats={setAllChildOrgsStats}
/> />
)} }
</> </div>
</span>
)} )}
</div> </div>
</Wrapper> </Wrapper>
+56 -3
View File
@@ -33,8 +33,15 @@ import {
import { import {
BarChart, BarChart,
BarSeries,
Bar,
BarLabel,
GridlineSeries, GridlineSeries,
Gridline, Gridline,
TooltipArea,
ChartTooltip,
TooltipTemplate,
} from 'reaviz'; } from 'reaviz';
import { typecost, typecost_single, } from "../views/HandlePaymentNew.jsx"; import { typecost, typecost_single, } from "../views/HandlePaymentNew.jsx";
@@ -46,19 +53,31 @@ const LineChartWrapper = ({keys, inputname, height, width}) => {
const {themeMode} = useContext(Context) const {themeMode} = useContext(Context)
const theme = getTheme(themeMode) const theme = getTheme(themeMode)
return ( return (
<div style={{color: "white", border: "1px solid rgba(255,255,255,0.3)", borderRadius: theme.palette?.borderRadius, padding: 30, marginTop: 15, backgroundColor: theme.palette.platformColor, overflow: "hidden", }}> <div style={{color: "white", border: "1px solid rgba(255,255,255,0.3)", borderRadius: theme.palette?.borderRadius, padding: 30, marginTop: 15, backgroundColor: theme.palette.platformColor, overflow: "hidden", }}>
<Typography variant="h6" style={{marginBotton: 15, }}> <Typography variant="h6" style={{marginBotton: 30, }}>
{inputname} {inputname}
</Typography> </Typography>
<BarChart <BarChart
style={{marginTop: 100, }}
width={"100%"} width={"100%"}
height={height} height={height}
data={inputdata} data={inputdata}
series={
<BarSeries
bar={
<Bar />
}
/>
}
gridlines={ gridlines={
<GridlineSeries line={<Gridline direction="all" />} /> <GridlineSeries line={<Gridline direction="all" />} />
} }
/> />
</div> </div>
) )
} }
@@ -70,6 +89,7 @@ const AppStats = (defaultprops) => {
const [keys, setKeys] = useState([]) const [keys, setKeys] = useState([])
const [searches, setSearches] = useState([]); const [searches, setSearches] = useState([]);
const [appRuns, setAppruns] = useState(undefined); const [appRuns, setAppruns] = useState(undefined);
const [childOrgsAppRuns, setChildOrgsAppRuns] = useState(undefined);
const [appRunCosts, setApprunCosts] = useState(undefined); const [appRunCosts, setApprunCosts] = useState(undefined);
const [workflowRuns, setWorkflowRuns] = useState(undefined); const [workflowRuns, setWorkflowRuns] = useState(undefined);
const [subflowRuns, setSubflowRuns] = useState(undefined); const [subflowRuns, setSubflowRuns] = useState(undefined);
@@ -401,6 +421,11 @@ const AppStats = (defaultprops) => {
"data": [] "data": []
} }
var childorgappRuns = {
"key": "Child Org App Runs",
"data": []
}
var workflowRuns = { var workflowRuns = {
"key": "Workflow Runs (includes subflows)", "key": "Workflow Runs (includes subflows)",
"data": [] "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 // Check if workflow_executions key in item
if (item["workflow_executions"] !== undefined && item["workflow_executions"] !== null) { if (item["workflow_executions"] !== undefined && item["workflow_executions"] !== null) {
workflowRuns["data"].push({ 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) { if (inputdata["daily_workflow_executions"] !== undefined && inputdata["daily_workflow_executions"] !== null) {
workflowRuns["data"].push({ workflowRuns["data"].push({
key: new Date(), key: new Date(),
@@ -485,6 +526,11 @@ const AppStats = (defaultprops) => {
}) })
} }
// Only for parent orgs
if (childorgappRuns["data"].length > 0) {
setChildOrgsAppRuns(childorgappRuns)
}
setSubflowRuns(subflowRuns) setSubflowRuns(subflowRuns)
setWorkflowRuns(workflowRuns) setWorkflowRuns(workflowRuns)
setAppruns(appRuns) setAppruns(appRuns)
@@ -895,7 +941,13 @@ const AppStats = (defaultprops) => {
{appRuns === undefined ? {appRuns === undefined ?
null null
: :
<LineChartWrapper keys={appRuns} height={300} width={"100%"} inputname={"Daily App Runs"}/> <LineChartWrapper keys={appRuns} height={300} width={"100%"} inputname={"App Runs - Current Org"}/>
}
{childOrgsAppRuns === undefined ?
null
:
<LineChartWrapper keys={childOrgsAppRuns} height={300} width={"100%"} inputname={"Child Org App Runs"}/>
} }
{workflowRuns === undefined ? {workflowRuns === undefined ?
@@ -922,8 +974,9 @@ const AppStats = (defaultprops) => {
<div style={{margin: "auto", alignItems: "center", width: 350, height: "100%", }}> <div style={{margin: "auto", alignItems: "center", width: 350, height: "100%", }}>
<Typography variant="body2" color="textSecondary" component="p" style={{textAlign: "center", marginTop: 50, marginBottom: 15, }}> <Typography variant="body2" color="textSecondary" component="p" style={{textAlign: "center", marginTop: 50, marginBottom: 15, }}>
Loading usage for selected period (may take a while) Loading usage for selected period (may take a while)
<CircularProgress style={{marginTop: 15, }} />
</Typography> </Typography>
<CircularProgress style={{}} />
</div> </div>
: :
<DataGrid <DataGrid
+1 -1
View File
@@ -188,7 +188,7 @@ const EditWorkflow = (props) => {
} }
const newWorkflow = isEditing === true ? false : true 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 upload = "";
var total_count = 0 var total_count = 0
+6 -6
View File
@@ -450,6 +450,8 @@ const LeftSideBar = ({ userdata, serverside, globalUrl, notifications, }) => {
const handleUpdateTheme = (newTheme) => { const handleUpdateTheme = (newTheme) => {
handleThemeChange(newTheme);
setCurrentSelectedTheme(newTheme)
const data = { const data = {
"user_id": userdata?.id, "user_id": userdata?.id,
@@ -470,14 +472,11 @@ const LeftSideBar = ({ userdata, serverside, globalUrl, notifications, }) => {
}).then((response) => }).then((response) =>
response.json().then((responseJson) => { response.json().then((responseJson) => {
if (responseJson["success"] === false) { if (responseJson["success"] === false) {
toast("Failed updating theme: ", responseJson.reason); toast("Failed saving your theme: ", responseJson.reason);
} else {
handleThemeChange(newTheme);
setCurrentSelectedTheme(newTheme);
} }
}) })
).catch((error) => { ).catch((error) => {
console.log("Error changing theme: ", error); console.log("Error saving your theme: ", error);
}); });
}; };
@@ -590,6 +589,7 @@ const LeftSideBar = ({ userdata, serverside, globalUrl, notifications, }) => {
if (userdata?.org_status?.includes("integration_partner")){ if (userdata?.org_status?.includes("integration_partner")){
handleChangeTheme(newTheme); handleChangeTheme(newTheme);
} else { } else {
handleUpdateTheme(newTheme); handleUpdateTheme(newTheme);
} }
}} }}
@@ -671,7 +671,7 @@ const LeftSideBar = ({ userdata, serverside, globalUrl, notifications, }) => {
<Divider style={{ marginBottom: 10, }} /> <Divider style={{ marginBottom: 10, }} />
<Typography color="textSecondary" align="center" style={{ marginTop: 5, marginBottom: 5, fontSize: 18 }}> <Typography color="textSecondary" align="center" style={{ marginTop: 5, marginBottom: 5, fontSize: 18 }}>
Version: 2.0.2 Version: 2.1.0-rc1
</Typography> </Typography>
</Menu> </Menu>
</span> </span>
-2
View File
@@ -1127,7 +1127,6 @@ const LicencePopup = (props) => {
color: "white", color: "white",
} }
console.log("Priceitem: ", shuffleVariant)
// const isLoggedInHandler = () => { // const isLoggedInHandler = () => {
// if (calculatedCost === payasyougo) { // if (calculatedCost === payasyougo) {
// handlePayasyougo(props.userdata) // handlePayasyougo(props.userdata)
@@ -1237,7 +1236,6 @@ const LicencePopup = (props) => {
}); });
}; };
console.log("Selected Organization: ", selectedOrganization.subscriptions)
return ( return (
<div> <div>
<Grid container spacing={2} style={{ flexDirection: "row", flexWrap: "nowrap", borderRadius: '16px', display: "flex"}}> <Grid container spacing={2} style={{ flexDirection: "row", flexWrap: "nowrap", borderRadius: '16px', display: "flex"}}>
+2 -1
View File
@@ -334,7 +334,8 @@ const Admin2 = (props) => {
} }
return ( return (
<div style={{ display: 'flex', justifyContent: 'center', paddingTop: 29, zoom: 0.9}}> //<div style={{ display: 'flex', justifyContent: 'center', paddingTop: 29, zoom: 0.9}}>
<div style={{ display: 'flex', justifyContent: 'center', paddingTop: 29, zoom: 1, }}>
<AdminNavBar userdata={userdata} isLoaded={isLoaded} isOrgLoaded={isOrgLoaded} selectedStatus={selectedStatus} setSelectedStatus={setSelectedStatus} selectedTab={selectedTab} orgId={selectedOrganization.id} handleStatusChange={handleStatusChange} handleEditOrg={handleEditOrg} handleGetOrg={handleGetOrg} setSelectedOrganization={setSelectedOrganization} selectedOrganization={selectedOrganization} setNotifications={setNotifications} stripeKey={stripeKey} notifications={notifications} checkLogin={checkLogin} globalUrl={globalUrl} isCloud={isCloud}/> <AdminNavBar userdata={userdata} isLoaded={isLoaded} isOrgLoaded={isOrgLoaded} selectedStatus={selectedStatus} setSelectedStatus={setSelectedStatus} selectedTab={selectedTab} orgId={selectedOrganization.id} handleStatusChange={handleStatusChange} handleEditOrg={handleEditOrg} handleGetOrg={handleGetOrg} setSelectedOrganization={setSelectedOrganization} selectedOrganization={selectedOrganization} setNotifications={setNotifications} stripeKey={stripeKey} notifications={notifications} checkLogin={checkLogin} globalUrl={globalUrl} isCloud={isCloud}/>
</div> </div>
); );
+3 -1
View File
@@ -1349,7 +1349,9 @@ const Workflows2 = (props) => {
// When there are no workflows, we can set the loading to false // When there are no workflows, we can set the loading to false
setIsLoadingWorkflow(false) setIsLoadingWorkflow(false)
if (currTab !== 2) { 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) setCurrTab(2)
} }
} }