@gen3/workspaces 0.12.78 → 0.12.80
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dts/components/CostTracker.d.ts.map +1 -1
- package/dist/dts/components/CostTracker.js +61 -36
- package/dist/dts/components/CostTracker.js.map +1 -1
- package/dist/dts/index.d.ts +2 -1
- package/dist/dts/index.d.ts.map +1 -1
- package/dist/dts/index.js +2 -1
- package/dist/dts/index.js.map +1 -1
- package/dist/index/cjs/index.js +62 -52
- package/dist/index/cjs/index.js.map +1 -1
- package/dist/index/esm/index.js +63 -54
- package/dist/index/esm/index.js.map +1 -1
- package/dist/index.d.ts +6 -2
- package/package.json +4 -4
- package/LICENSE +0 -201
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CostTracker.d.ts","sourceRoot":"","sources":["../../../src/components/CostTracker.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CostTracker.d.ts","sourceRoot":"","sources":["../../../src/components/CostTracker.tsx"],"names":[],"mappings":"AACA,OAAO,KAAmB,MAAM,OAAO,CAAC;AA8DxC,QAAA,MAAM,WAAW;;uBA6RhB,CAAC;eAkEa,WAAW"}
|
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useState } from 'react';
|
|
3
|
-
import { Accordion,
|
|
4
|
-
import { useGetWorkspacePayModelsQuery, useSetCurrentPayModelMutation, } from '@gen3/core';
|
|
3
|
+
import { Accordion, Badge, Button, Divider, Group, Loader, Popover, Progress, Radio, Text, } from '@mantine/core';
|
|
4
|
+
import { useGetActivePayModelQuery, useGetWorkspacePayModelsQuery, useSetCurrentPayModelMutation, } from '@gen3/core';
|
|
5
5
|
import { useDeepCompareCallback, useDeepCompareMemo } from 'use-deep-compare';
|
|
6
6
|
import { FaExclamationCircle as InactiveIcon, FaUser as ActiveIcon, } from 'react-icons/fa';
|
|
7
7
|
import { MdExpandMore, MdOpenInNew } from 'react-icons/md';
|
|
8
|
-
|
|
8
|
+
// TODO rework once requirements are made
|
|
9
|
+
const usdFormatter = new Intl.NumberFormat('en-US', {
|
|
10
|
+
style: 'currency',
|
|
11
|
+
currency: 'USD',
|
|
12
|
+
});
|
|
13
|
+
const paymentNumberToString = (x, undefinedValue = 'N/A', precision = 2) => {
|
|
9
14
|
if (typeof x !== 'number' || Number.isNaN(x))
|
|
10
15
|
return undefinedValue;
|
|
11
|
-
return
|
|
16
|
+
return usdFormatter.format(x);
|
|
12
17
|
};
|
|
13
18
|
const isNoPayModelError = (error) => {
|
|
14
19
|
return ('status' in error &&
|
|
@@ -16,19 +21,56 @@ const isNoPayModelError = (error) => {
|
|
|
16
21
|
error.originalStatus === 404);
|
|
17
22
|
};
|
|
18
23
|
const CostTracker = ({ workspaceAccountManagerTarget = '' }) => {
|
|
19
|
-
const { data, isLoading, isFetching, isError, error } = useGetWorkspacePayModelsQuery(undefined, {
|
|
24
|
+
const { data, isLoading, isFetching, isError, error, isSuccess } = useGetWorkspacePayModelsQuery(undefined, {
|
|
20
25
|
pollingInterval: 120000, // 2 min
|
|
21
26
|
refetchOnMountOrArgChange: true,
|
|
22
27
|
});
|
|
23
|
-
const
|
|
28
|
+
const { data: currentPaymodelData, isFetching: isCurrentPayModelFetching } = useGetActivePayModelQuery();
|
|
29
|
+
const [setWorkspacePayModel, result] = useSetCurrentPayModelMutation();
|
|
24
30
|
const [selectedPayModel, setSelectedPayModel] = useState(null);
|
|
25
31
|
const [opened, setOpened] = useState(false);
|
|
26
32
|
const setPayModel = useDeepCompareCallback((id) => {
|
|
27
|
-
void setWorkspacePayModel(id); // triggers the call to the service to select the pay model
|
|
33
|
+
void setWorkspacePayModel(id).unwrap(); // triggers the call to the service to select the pay model
|
|
28
34
|
setSelectedPayModel(id); // set the paymodel value for the select component
|
|
29
35
|
}, [setWorkspacePayModel, selectedPayModel]);
|
|
30
36
|
const { usersPayModels, workspaceName, hardLimit, totalUsage } = useDeepCompareMemo(() => {
|
|
31
|
-
if (
|
|
37
|
+
if (isSuccess && data) {
|
|
38
|
+
const usersPayModels = data?.allPayModels.map((payModel) => {
|
|
39
|
+
return {
|
|
40
|
+
value: payModel.bmh_workspace_id ?? payModel.workspace_type,
|
|
41
|
+
label: payModel.workspace_type,
|
|
42
|
+
totalUsage: payModel['total-usage'],
|
|
43
|
+
currentPayModel: payModel.current_pay_model ?? null, //TODO temp rework with existing code
|
|
44
|
+
icon: payModel.request_status === 'active' ? (_jsx(ActiveIcon, {})) : (_jsx(InactiveIcon, {})),
|
|
45
|
+
};
|
|
46
|
+
});
|
|
47
|
+
let currentPayModel = null;
|
|
48
|
+
if (data?.currentPayModel) {
|
|
49
|
+
currentPayModel =
|
|
50
|
+
data?.currentPayModel.bmh_workspace_id ??
|
|
51
|
+
data?.currentPayModel.workspace_type;
|
|
52
|
+
}
|
|
53
|
+
setSelectedPayModel(currentPayModel);
|
|
54
|
+
let workspaceName = 'Not Set';
|
|
55
|
+
let totalUsage = undefined;
|
|
56
|
+
let hardLimit = undefined;
|
|
57
|
+
if (data.currentPayModel !== null) {
|
|
58
|
+
workspaceName =
|
|
59
|
+
data.currentPayModel.bmh_workspace_id.length > 0
|
|
60
|
+
? data.currentPayModel.bmh_workspace_id
|
|
61
|
+
: data.currentPayModel.workspace_type;
|
|
62
|
+
totalUsage = data.currentPayModel?.['total-usage'];
|
|
63
|
+
hardLimit = data.currentPayModel?.['hard-limit'];
|
|
64
|
+
}
|
|
65
|
+
return {
|
|
66
|
+
usersPayModels,
|
|
67
|
+
workspaceName,
|
|
68
|
+
selectedPayModel,
|
|
69
|
+
totalUsage,
|
|
70
|
+
hardLimit,
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
32
74
|
return {
|
|
33
75
|
usersPayModels: [],
|
|
34
76
|
selectedPayModel: [],
|
|
@@ -37,25 +79,6 @@ const CostTracker = ({ workspaceAccountManagerTarget = '' }) => {
|
|
|
37
79
|
hardLimit: undefined,
|
|
38
80
|
};
|
|
39
81
|
}
|
|
40
|
-
const usersPayModels = data.allPayModels.map((payModel) => {
|
|
41
|
-
return {
|
|
42
|
-
value: payModel.bmh_workspace_id ?? payModel.workspace_type,
|
|
43
|
-
label: payModel.workspace_type,
|
|
44
|
-
totalUsage: payModel['total-usage'],
|
|
45
|
-
currentPayModel: payModel['current_pay_model'], //TODO temp rework with existing code
|
|
46
|
-
icon: payModel.request_status === 'active' ? (_jsx(ActiveIcon, {})) : (_jsx(InactiveIcon, {})),
|
|
47
|
-
};
|
|
48
|
-
});
|
|
49
|
-
setSelectedPayModel(data.currentPayModel.bmh_workspace_id ??
|
|
50
|
-
data.currentPayModel.workspace_type);
|
|
51
|
-
return {
|
|
52
|
-
usersPayModels,
|
|
53
|
-
workspaceName: data.currentPayModel.bmh_workspace_id.length > 0
|
|
54
|
-
? data.currentPayModel.bmh_workspace_id
|
|
55
|
-
: data.currentPayModel.workspace_type,
|
|
56
|
-
totalUsage: data.currentPayModel['total-usage'],
|
|
57
|
-
hardLimit: data.currentPayModel['hard-limit'],
|
|
58
|
-
};
|
|
59
82
|
}, [data]);
|
|
60
83
|
const PayModelSelectItem = ({ option }) => {
|
|
61
84
|
const menuItem = usersPayModels[Number(option.value)];
|
|
@@ -64,16 +87,16 @@ const CostTracker = ({ workspaceAccountManagerTarget = '' }) => {
|
|
|
64
87
|
return (_jsx("div", { children: _jsxs(Group, { wrap: "nowrap", children: [_jsx(Text, { size: "sm", children: menuItem.label }), _jsx(Text, { size: "sm", children: menuItem.totalUsage }), menuItem.icon] }) }));
|
|
65
88
|
};
|
|
66
89
|
if (isLoading && isFetching)
|
|
67
|
-
return (_jsx(Badge, { leftSection: _jsx(Loader, { size: "xs", type: "dots", className:
|
|
90
|
+
return (_jsx(Badge, { leftSection: _jsx(Loader, { size: "xs", type: "dots", className: "m-1" }), variant: "default", children: "Loading..." }));
|
|
68
91
|
const PayModelError = (message) => {
|
|
69
92
|
// dropdown error state to provide user access to Account Manager if available
|
|
70
93
|
if (workspaceAccountManagerTarget) {
|
|
71
|
-
return (_jsxs(Popover, { width: "target", position: "bottom", shadow: "lg", trapFocus: true, opened: opened, onChange: setOpened, children: [_jsx(Popover.Target, { children: _jsx(Button, { onClick: () => setOpened((o) => !o), size: "xs", radius: "xl", className:
|
|
94
|
+
return (_jsxs(Popover, { width: "target", position: "bottom", shadow: "lg", trapFocus: true, opened: opened, onChange: setOpened, children: [_jsx(Popover.Target, { children: _jsx(Button, { onClick: () => setOpened((o) => !o), size: "xs", radius: "xl", className: "h-[--badge-height] uppercase", color: "utility.3", rightSection: _jsx(MdExpandMore, { size: "1.5em", "aria-label": opened ? 'close' : 'open', style: {
|
|
72
95
|
transform: opened ? 'rotate(180deg)' : 'rotate(0deg)',
|
|
73
96
|
transition: 'transform 200ms ease',
|
|
74
|
-
} }), children: _jsx("span", { className:
|
|
97
|
+
} }), children: _jsx("span", { className: "font-black", children: message }) }) }), _jsx(Popover.Dropdown, { className: "px-2", children: _jsx(Button, { component: "a", href: workspaceAccountManagerTarget, target: "_blank", variant: "outline", leftSection: _jsx(MdOpenInNew, { size: "1.1em", "aria-label": "external" }), size: "xs", className: "w-full", children: "Workspace Account Manager" }) })] }));
|
|
75
98
|
}
|
|
76
|
-
return
|
|
99
|
+
return _jsx(Badge, { color: "utility.3", children: message });
|
|
77
100
|
};
|
|
78
101
|
if (isError) {
|
|
79
102
|
if (isNoPayModelError(error)) {
|
|
@@ -83,18 +106,20 @@ const CostTracker = ({ workspaceAccountManagerTarget = '' }) => {
|
|
|
83
106
|
return PayModelError('Unable to get Payment information');
|
|
84
107
|
}
|
|
85
108
|
}
|
|
86
|
-
const ProgressBar = (className = '') => (_jsx(Progress, { size: "sm", radius: "xl", "aria-label":
|
|
87
|
-
|
|
109
|
+
const ProgressBar = (className = '') => (_jsx(Progress, { size: "sm", radius: "xl", "aria-label": "Monthly Workflow Limit", value: !hardLimit || !totalUsage ? 100 : (hardLimit / totalUsage) * 100, color: !hardLimit || (totalUsage && totalUsage >= hardLimit)
|
|
110
|
+
? 'red.5'
|
|
111
|
+
: 'green.1', className: className }));
|
|
112
|
+
return (_jsxs(Popover, { width: "target", position: "bottom", shadow: "lg", trapFocus: true, opened: opened, onChange: setOpened, children: [_jsx(Popover.Target, { children: _jsxs(Button, { onClick: () => setOpened((o) => !o), size: "xs", radius: "xl", variant: "default", className: "h-[--badge-height]", rightSection: _jsx(MdExpandMore, { className: "text-accent", size: "1.5em", "aria-label": opened ? 'close' : 'open', style: {
|
|
88
113
|
transform: opened ? 'rotate(180deg)' : 'rotate(0deg)',
|
|
89
114
|
transition: 'transform 200ms ease',
|
|
90
|
-
} }), children: [ProgressBar('w-[110px]'),
|
|
115
|
+
} }), children: [ProgressBar('w-[110px]'), _jsx("span", { className: "font-black pl-3 pr-1", children: paymentNumberToString(totalUsage) }), _jsxs("span", { className: "font-normal", children: ["/", paymentNumberToString(hardLimit)] })] }) }), _jsxs(Popover.Dropdown, { className: "px-2", children: [workspaceAccountManagerTarget && (_jsx(Button, { component: "a", href: workspaceAccountManagerTarget, target: "_blank", variant: "outline", leftSection: _jsx(MdOpenInNew, { size: "1.1em", "aria-label": "external" }), size: "xs", className: "w-full mb-4", children: "Workspace Account Manager" })), _jsxs(Text, { size: "sm", className: "uppercase pb-2 px-2", children: ["Limit", ' ', _jsx("span", { className: "font-black pl-1", children: paymentNumberToString(hardLimit) })] }), ProgressBar('mx-2'), _jsx(Divider, { my: "sm" }), _jsx(Text, { size: "sm", className: "uppercase pb-2 px-2", children: "Account & Charges" }), _jsx(Accordion, { variant: "unstyled", classNames: {
|
|
91
116
|
root: '',
|
|
92
117
|
control: 'p-0 px-2',
|
|
93
118
|
label: 'p-0',
|
|
94
119
|
chevron: 'text-accent',
|
|
95
120
|
panel: 'p-0',
|
|
96
|
-
content: 'p-0'
|
|
97
|
-
}, children: _jsxs(Accordion.Item, { value: "accountInformation", children: [_jsx(Accordion.Control, { children:
|
|
121
|
+
content: 'p-0',
|
|
122
|
+
}, children: _jsxs(Accordion.Item, { value: "accountInformation", children: [_jsx(Accordion.Control, { children: _jsx(Text, { size: "sm", className: "font-black", children: `${workspaceName} - ${paymentNumberToString(totalUsage)}` }) }), _jsx(Accordion.Panel, { children: _jsx(Radio.Group, { className: "pt-2", onChange: setPayModel, value: selectedPayModel, children: usersPayModels.map((obj) => (_jsx(Radio.Card, { value: obj.value, className: "p-2 border-none data-checked:bg-primary-lightest data-checked:border-primary-darker data-checked:font-black hover:bg-primary-max ", children: _jsxs(Group, { wrap: "nowrap", align: "flex-start", children: [_jsx(Text, { size: "sm", className: "grow", children: obj.label }), _jsx(Text, { size: "sm", children: `${paymentNumberToString(obj.totalUsage)}` }), _jsx(Radio.Indicator, { color: "accent" })] }) }, obj.value))) }) })] }) })] })] }));
|
|
98
123
|
};
|
|
99
124
|
/*<Accordion chevronPosition="left">
|
|
100
125
|
<Accordion.Item value="accountInformation">
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CostTracker.js","sourceRoot":"","sources":["../../../src/components/CostTracker.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"CostTracker.js","sourceRoot":"","sources":["../../../src/components/CostTracker.tsx"],"names":[],"mappings":";AACA,OAAc,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAExC,OAAO,EACL,SAAS,EACT,KAAK,EACL,MAAM,EACN,OAAO,EACP,KAAK,EACL,MAAM,EACN,OAAO,EACP,QAAQ,EACR,KAAK,EACL,IAAI,GACL,MAAM,eAAe,CAAC;AACvB,OAAO,EAEL,yBAAyB,EACzB,6BAA6B,EAC7B,6BAA6B,GAC9B,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAC9E,OAAO,EACL,mBAAmB,IAAI,YAAY,EACnC,MAAM,IAAI,UAAU,GACrB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE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spacesCenterPageGetServerSideProps } from './pages/WorkspacesCenter';
|
|
2
|
-
|
|
2
|
+
import CostTracker from './components/CostTracker';
|
|
3
|
+
export { CostTracker, WorkspacesCenterPage, WorkspacesCenterPageGetServerSideProps, };
|
|
3
4
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/dts/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,sCAAsC,EACvC,MAAM,0BAA0B,CAAC;AAElC,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,sCAAsC,EACvC,MAAM,0BAA0B,CAAC;AAElC,OAAO,WAAW,MAAM,0BAA0B,CAAC;AAEnD,OAAO,EACL,WAAW,EACX,oBAAoB,EACpB,sCAAsC,GACvC,CAAC"}
|
package/dist/dts/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { WorkspacesCenterPage, WorkspacesCenterPageGetServerSideProps, } from './pages/WorkspacesCenter';
|
|
2
|
-
|
|
2
|
+
import CostTracker from './components/CostTracker';
|
|
3
|
+
export { CostTracker, WorkspacesCenterPage, WorkspacesCenterPageGetServerSideProps, };
|
|
3
4
|
//# sourceMappingURL=index.js.map
|
package/dist/dts/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,sCAAsC,GACvC,MAAM,0BAA0B,CAAC;AAElC,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,sCAAsC,GACvC,MAAM,0BAA0B,CAAC;AAElC,OAAO,WAAW,MAAM,0BAA0B,CAAC;AAEnD,OAAO,EACL,WAAW,EACX,oBAAoB,EACpB,sCAAsC,GACvC,CAAC"}
|
package/dist/index/cjs/index.js
CHANGED
|
@@ -2428,30 +2428,66 @@ const SettingsPanel = ({ showKernels, expanded, setExpanded, width = 380 })=>{
|
|
|
2428
2428
|
});
|
|
2429
2429
|
};
|
|
2430
2430
|
|
|
2431
|
-
|
|
2431
|
+
// TODO rework once requirements are made
|
|
2432
|
+
const usdFormatter = new Intl.NumberFormat('en-US', {
|
|
2433
|
+
style: 'currency',
|
|
2434
|
+
currency: 'USD'
|
|
2435
|
+
});
|
|
2436
|
+
const paymentNumberToString = (x, undefinedValue = 'N/A', precision = 2)=>{
|
|
2432
2437
|
if (typeof x !== 'number' || Number.isNaN(x)) return undefinedValue;
|
|
2433
|
-
return
|
|
2438
|
+
return usdFormatter.format(x);
|
|
2434
2439
|
};
|
|
2435
2440
|
const isNoPayModelError = (error)=>{
|
|
2436
2441
|
return 'status' in error && error.status === 'PARSING_ERROR' && error.originalStatus === 404;
|
|
2437
2442
|
};
|
|
2438
2443
|
const CostTracker = ({ workspaceAccountManagerTarget = '' })=>{
|
|
2439
|
-
const { data, isLoading, isFetching, isError, error } = core$1.useGetWorkspacePayModelsQuery(undefined, {
|
|
2444
|
+
const { data, isLoading, isFetching, isError, error, isSuccess } = core$1.useGetWorkspacePayModelsQuery(undefined, {
|
|
2440
2445
|
pollingInterval: 120000,
|
|
2441
2446
|
refetchOnMountOrArgChange: true
|
|
2442
2447
|
});
|
|
2443
|
-
const
|
|
2448
|
+
const { data: currentPaymodelData, isFetching: isCurrentPayModelFetching } = core$1.useGetActivePayModelQuery();
|
|
2449
|
+
const [setWorkspacePayModel, result] = core$1.useSetCurrentPayModelMutation();
|
|
2444
2450
|
const [selectedPayModel, setSelectedPayModel] = React.useState(null);
|
|
2445
2451
|
const [opened, setOpened] = React.useState(false);
|
|
2446
|
-
useDeepCompare.useDeepCompareCallback((id)=>{
|
|
2447
|
-
void setWorkspacePayModel(id); // triggers the call to the service to select the pay model
|
|
2452
|
+
const setPayModel = useDeepCompare.useDeepCompareCallback((id)=>{
|
|
2453
|
+
void setWorkspacePayModel(id).unwrap(); // triggers the call to the service to select the pay model
|
|
2448
2454
|
setSelectedPayModel(id); // set the paymodel value for the select component
|
|
2449
2455
|
}, [
|
|
2450
2456
|
setWorkspacePayModel,
|
|
2451
2457
|
selectedPayModel
|
|
2452
2458
|
]);
|
|
2453
2459
|
const { usersPayModels, workspaceName, hardLimit, totalUsage } = useDeepCompare.useDeepCompareMemo(()=>{
|
|
2454
|
-
if (
|
|
2460
|
+
if (isSuccess && data) {
|
|
2461
|
+
const usersPayModels = data?.allPayModels.map((payModel)=>{
|
|
2462
|
+
return {
|
|
2463
|
+
value: payModel.bmh_workspace_id ?? payModel.workspace_type,
|
|
2464
|
+
label: payModel.workspace_type,
|
|
2465
|
+
totalUsage: payModel['total-usage'],
|
|
2466
|
+
currentPayModel: payModel.current_pay_model ?? null,
|
|
2467
|
+
icon: payModel.request_status === 'active' ? /*#__PURE__*/ jsxRuntime.jsx(fa.FaUser, {}) : /*#__PURE__*/ jsxRuntime.jsx(fa.FaExclamationCircle, {})
|
|
2468
|
+
};
|
|
2469
|
+
});
|
|
2470
|
+
let currentPayModel = null;
|
|
2471
|
+
if (data?.currentPayModel) {
|
|
2472
|
+
currentPayModel = data?.currentPayModel.bmh_workspace_id ?? data?.currentPayModel.workspace_type;
|
|
2473
|
+
}
|
|
2474
|
+
setSelectedPayModel(currentPayModel);
|
|
2475
|
+
let workspaceName = 'Not Set';
|
|
2476
|
+
let totalUsage = undefined;
|
|
2477
|
+
let hardLimit = undefined;
|
|
2478
|
+
if (data.currentPayModel !== null) {
|
|
2479
|
+
workspaceName = data.currentPayModel.bmh_workspace_id.length > 0 ? data.currentPayModel.bmh_workspace_id : data.currentPayModel.workspace_type;
|
|
2480
|
+
totalUsage = data.currentPayModel?.['total-usage'];
|
|
2481
|
+
hardLimit = data.currentPayModel?.['hard-limit'];
|
|
2482
|
+
}
|
|
2483
|
+
return {
|
|
2484
|
+
usersPayModels,
|
|
2485
|
+
workspaceName,
|
|
2486
|
+
selectedPayModel,
|
|
2487
|
+
totalUsage,
|
|
2488
|
+
hardLimit
|
|
2489
|
+
};
|
|
2490
|
+
} else {
|
|
2455
2491
|
return {
|
|
2456
2492
|
usersPayModels: [],
|
|
2457
2493
|
selectedPayModel: [],
|
|
@@ -2460,22 +2496,6 @@ const CostTracker = ({ workspaceAccountManagerTarget = '' })=>{
|
|
|
2460
2496
|
hardLimit: undefined
|
|
2461
2497
|
};
|
|
2462
2498
|
}
|
|
2463
|
-
const usersPayModels = data.allPayModels.map((payModel)=>{
|
|
2464
|
-
return {
|
|
2465
|
-
value: payModel.bmh_workspace_id ?? payModel.workspace_type,
|
|
2466
|
-
label: payModel.workspace_type,
|
|
2467
|
-
totalUsage: payModel['total-usage'],
|
|
2468
|
-
currentPayModel: payModel['current_pay_model'],
|
|
2469
|
-
icon: payModel.request_status === 'active' ? /*#__PURE__*/ jsxRuntime.jsx(fa.FaUser, {}) : /*#__PURE__*/ jsxRuntime.jsx(fa.FaExclamationCircle, {})
|
|
2470
|
-
};
|
|
2471
|
-
});
|
|
2472
|
-
setSelectedPayModel(data.currentPayModel.bmh_workspace_id ?? data.currentPayModel.workspace_type);
|
|
2473
|
-
return {
|
|
2474
|
-
usersPayModels,
|
|
2475
|
-
workspaceName: data.currentPayModel.bmh_workspace_id.length > 0 ? data.currentPayModel.bmh_workspace_id : data.currentPayModel.workspace_type,
|
|
2476
|
-
totalUsage: data.currentPayModel['total-usage'],
|
|
2477
|
-
hardLimit: data.currentPayModel['hard-limit']
|
|
2478
|
-
};
|
|
2479
2499
|
}, [
|
|
2480
2500
|
data
|
|
2481
2501
|
]);
|
|
@@ -2555,8 +2575,8 @@ const CostTracker = ({ workspaceAccountManagerTarget = '' })=>{
|
|
|
2555
2575
|
size: "sm",
|
|
2556
2576
|
radius: "xl",
|
|
2557
2577
|
"aria-label": "Monthly Workflow Limit",
|
|
2558
|
-
value: !hardLimit ? 100 : hardLimit / totalUsage * 100,
|
|
2559
|
-
color: !hardLimit || totalUsage >= hardLimit ? 'red.5' : 'green.1',
|
|
2578
|
+
value: !hardLimit || !totalUsage ? 100 : hardLimit / totalUsage * 100,
|
|
2579
|
+
color: !hardLimit || totalUsage && totalUsage >= hardLimit ? 'red.5' : 'green.1',
|
|
2560
2580
|
className: className
|
|
2561
2581
|
});
|
|
2562
2582
|
return /*#__PURE__*/ jsxRuntime.jsxs(core.Popover, {
|
|
@@ -2585,18 +2605,15 @@ const CostTracker = ({ workspaceAccountManagerTarget = '' })=>{
|
|
|
2585
2605
|
}),
|
|
2586
2606
|
children: [
|
|
2587
2607
|
ProgressBar('w-[110px]'),
|
|
2588
|
-
/*#__PURE__*/ jsxRuntime.
|
|
2589
|
-
className: "font-black pl-3 pr-
|
|
2590
|
-
children:
|
|
2591
|
-
"$",
|
|
2592
|
-
PaymentNumberToString(totalUsage)
|
|
2593
|
-
]
|
|
2608
|
+
/*#__PURE__*/ jsxRuntime.jsx("span", {
|
|
2609
|
+
className: "font-black pl-3 pr-1",
|
|
2610
|
+
children: paymentNumberToString(totalUsage)
|
|
2594
2611
|
}),
|
|
2595
2612
|
/*#__PURE__*/ jsxRuntime.jsxs("span", {
|
|
2596
2613
|
className: "font-normal",
|
|
2597
2614
|
children: [
|
|
2598
|
-
"
|
|
2599
|
-
|
|
2615
|
+
"/",
|
|
2616
|
+
paymentNumberToString(hardLimit)
|
|
2600
2617
|
]
|
|
2601
2618
|
})
|
|
2602
2619
|
]
|
|
@@ -2622,13 +2639,11 @@ const CostTracker = ({ workspaceAccountManagerTarget = '' })=>{
|
|
|
2622
2639
|
size: "sm",
|
|
2623
2640
|
className: "uppercase pb-2 px-2",
|
|
2624
2641
|
children: [
|
|
2625
|
-
"Limit
|
|
2626
|
-
|
|
2642
|
+
"Limit",
|
|
2643
|
+
' ',
|
|
2644
|
+
/*#__PURE__*/ jsxRuntime.jsx("span", {
|
|
2627
2645
|
className: "font-black pl-1",
|
|
2628
|
-
children:
|
|
2629
|
-
"$",
|
|
2630
|
-
PaymentNumberToString(hardLimit)
|
|
2631
|
-
]
|
|
2646
|
+
children: paymentNumberToString(hardLimit)
|
|
2632
2647
|
})
|
|
2633
2648
|
]
|
|
2634
2649
|
}),
|
|
@@ -2655,22 +2670,19 @@ const CostTracker = ({ workspaceAccountManagerTarget = '' })=>{
|
|
|
2655
2670
|
value: "accountInformation",
|
|
2656
2671
|
children: [
|
|
2657
2672
|
/*#__PURE__*/ jsxRuntime.jsx(core.Accordion.Control, {
|
|
2658
|
-
children: /*#__PURE__*/ jsxRuntime.
|
|
2673
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(core.Text, {
|
|
2659
2674
|
size: "sm",
|
|
2660
2675
|
className: "font-black",
|
|
2661
|
-
children:
|
|
2662
|
-
workspaceName,
|
|
2663
|
-
" - $",
|
|
2664
|
-
PaymentNumberToString(totalUsage)
|
|
2665
|
-
]
|
|
2676
|
+
children: `${workspaceName} - ${paymentNumberToString(totalUsage)}`
|
|
2666
2677
|
})
|
|
2667
2678
|
}),
|
|
2668
2679
|
/*#__PURE__*/ jsxRuntime.jsx(core.Accordion.Panel, {
|
|
2669
2680
|
children: /*#__PURE__*/ jsxRuntime.jsx(core.Radio.Group, {
|
|
2670
2681
|
className: "pt-2",
|
|
2682
|
+
onChange: setPayModel,
|
|
2683
|
+
value: selectedPayModel,
|
|
2671
2684
|
children: usersPayModels.map((obj)=>/*#__PURE__*/ jsxRuntime.jsx(core.Radio.Card, {
|
|
2672
|
-
|
|
2673
|
-
disabled: true,
|
|
2685
|
+
value: obj.value,
|
|
2674
2686
|
className: "p-2 border-none data-checked:bg-primary-lightest data-checked:border-primary-darker data-checked:font-black hover:bg-primary-max ",
|
|
2675
2687
|
children: /*#__PURE__*/ jsxRuntime.jsxs(core.Group, {
|
|
2676
2688
|
wrap: "nowrap",
|
|
@@ -2681,12 +2693,9 @@ const CostTracker = ({ workspaceAccountManagerTarget = '' })=>{
|
|
|
2681
2693
|
className: "grow",
|
|
2682
2694
|
children: obj.label
|
|
2683
2695
|
}),
|
|
2684
|
-
/*#__PURE__*/ jsxRuntime.
|
|
2696
|
+
/*#__PURE__*/ jsxRuntime.jsx(core.Text, {
|
|
2685
2697
|
size: "sm",
|
|
2686
|
-
children:
|
|
2687
|
-
"$",
|
|
2688
|
-
PaymentNumberToString(obj.totalUsage)
|
|
2689
|
-
]
|
|
2698
|
+
children: `${paymentNumberToString(obj.totalUsage)}`
|
|
2690
2699
|
}),
|
|
2691
2700
|
/*#__PURE__*/ jsxRuntime.jsx(core.Radio.Indicator, {
|
|
2692
2701
|
color: "accent"
|
|
@@ -4489,6 +4498,7 @@ const WorkspacesCenterPageGetServerSideProps = async ()=>{
|
|
|
4489
4498
|
}
|
|
4490
4499
|
};
|
|
4491
4500
|
|
|
4501
|
+
exports.CostTracker = CostTracker;
|
|
4492
4502
|
exports.WorkspacesCenterPage = WorkspacesCenterPage;
|
|
4493
4503
|
exports.WorkspacesCenterPageGetServerSideProps = WorkspacesCenterPageGetServerSideProps;
|
|
4494
4504
|
//# sourceMappingURL=index.js.map
|