Cloud file sync :)
This commit is contained in:
@@ -2608,7 +2608,7 @@ const Billing = memo((props) => {
|
||||
userdata={userdata}
|
||||
/>
|
||||
): (
|
||||
<>
|
||||
<span>
|
||||
<Tabs
|
||||
value={currentTab}
|
||||
onChange={(event, newValue) => setCurrentTab(newValue)}
|
||||
@@ -2627,35 +2627,37 @@ const Billing = memo((props) => {
|
||||
style={{ textTransform: 'none', fontSize: 16, minWidth: 'auto', paddingLeft: 12, paddingRight: 12 }}
|
||||
/>
|
||||
<Tab
|
||||
label="Child Organization"
|
||||
label="Child Organization Stats"
|
||||
style={{ textTransform: 'none', fontSize: 16, minWidth: 'auto', paddingLeft: 12, paddingRight: 12 }}
|
||||
/>
|
||||
</Tabs>
|
||||
|
||||
{currentTab === 0 ? (
|
||||
<div style={{ marginTop: 30,}}>
|
||||
<BillingStats
|
||||
isCloud={isCloud}
|
||||
clickedFromOrgTab={clickedFromOrgTab}
|
||||
globalUrl={globalUrl}
|
||||
selectedOrganization={selectedOrganization}
|
||||
userdata={userdata}
|
||||
/>
|
||||
</div>
|
||||
): (
|
||||
<BillingStatsChildOrg
|
||||
isCloud={isCloud}
|
||||
clickedFromOrgTab={clickedFromOrgTab}
|
||||
globalUrl={globalUrl}
|
||||
selectedOrganization={selectedOrganization}
|
||||
userdata={userdata}
|
||||
allChildOrgs={allChildOrgs}
|
||||
setAllChildOrgs={setAllChildOrgs}
|
||||
allChildOrgsStats={allChildOrgsStats}
|
||||
setAllChildOrgsStats={setAllChildOrgsStats}
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
<div style={{paddingBottom: 200, }}>
|
||||
{currentTab === 0 ?
|
||||
<div style={{ marginTop: 30,}}>
|
||||
<BillingStats
|
||||
isCloud={isCloud}
|
||||
clickedFromOrgTab={clickedFromOrgTab}
|
||||
globalUrl={globalUrl}
|
||||
selectedOrganization={selectedOrganization}
|
||||
userdata={userdata}
|
||||
/>
|
||||
</div>
|
||||
:
|
||||
<BillingStatsChildOrg
|
||||
isCloud={isCloud}
|
||||
clickedFromOrgTab={clickedFromOrgTab}
|
||||
globalUrl={globalUrl}
|
||||
selectedOrganization={selectedOrganization}
|
||||
userdata={userdata}
|
||||
allChildOrgs={allChildOrgs}
|
||||
setAllChildOrgs={setAllChildOrgs}
|
||||
allChildOrgsStats={allChildOrgsStats}
|
||||
setAllChildOrgsStats={setAllChildOrgsStats}
|
||||
/>
|
||||
}
|
||||
</div>
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
</Wrapper>
|
||||
|
||||
@@ -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 (
|
||||
<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}
|
||||
</Typography>
|
||||
|
||||
<BarChart
|
||||
style={{marginTop: 100, }}
|
||||
width={"100%"}
|
||||
height={height}
|
||||
data={inputdata}
|
||||
|
||||
series={
|
||||
<BarSeries
|
||||
bar={
|
||||
<Bar />
|
||||
}
|
||||
/>
|
||||
}
|
||||
gridlines={
|
||||
<GridlineSeries line={<Gridline direction="all" />} />
|
||||
}
|
||||
/>
|
||||
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -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
|
||||
:
|
||||
<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 ?
|
||||
@@ -922,8 +974,9 @@ const AppStats = (defaultprops) => {
|
||||
<div style={{margin: "auto", alignItems: "center", width: 350, height: "100%", }}>
|
||||
<Typography variant="body2" color="textSecondary" component="p" style={{textAlign: "center", marginTop: 50, marginBottom: 15, }}>
|
||||
Loading usage for selected period (may take a while)
|
||||
|
||||
<CircularProgress style={{marginTop: 15, }} />
|
||||
</Typography>
|
||||
<CircularProgress style={{}} />
|
||||
</div>
|
||||
:
|
||||
<DataGrid
|
||||
|
||||
@@ -188,7 +188,7 @@ const EditWorkflow = (props) => {
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
|
||||
@@ -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, }) => {
|
||||
<Divider style={{ marginBottom: 10, }} />
|
||||
|
||||
<Typography color="textSecondary" align="center" style={{ marginTop: 5, marginBottom: 5, fontSize: 18 }}>
|
||||
Version: 2.0.2
|
||||
Version: 2.1.0-rc1
|
||||
</Typography>
|
||||
</Menu>
|
||||
</span>
|
||||
|
||||
@@ -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 (
|
||||
<div>
|
||||
<Grid container spacing={2} style={{ flexDirection: "row", flexWrap: "nowrap", borderRadius: '16px', display: "flex"}}>
|
||||
|
||||
@@ -334,7 +334,8 @@ const Admin2 = (props) => {
|
||||
}
|
||||
|
||||
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}/>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user