@iotready/nextjs-components-library 1.0.0-preview15 → 1.0.0-preview16
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.
@@ -144,7 +144,7 @@ function getPollTime(intervalInSeconds, pollTime) {
|
|
144
144
|
}
|
145
145
|
function getCsvData(data, measures) {
|
146
146
|
// Initialize the header with timestamp and measure names
|
147
|
-
const headers = ["timestamp", ...measures.map(measure => measure.name)];
|
147
|
+
const headers = ["timestamp", ...measures.map(measure => measure.description || measure.name)];
|
148
148
|
const csvData = [];
|
149
149
|
// Add the header to the csvData
|
150
150
|
csvData.push(headers);
|
@@ -305,7 +305,7 @@ const TrendChart = ({ deviceId, measures1, measures2, enableDatePicker, handleGe
|
|
305
305
|
const influxData = await handleGetInfluxData(measure.name, timeStart, timeEnd, deviceId, polltime, !measure.polltime && rawQuery, !measure.polltime);
|
306
306
|
const points = getChartPoints(influxData);
|
307
307
|
return {
|
308
|
-
label: measure.name,
|
308
|
+
label: measure.description || measure.name,
|
309
309
|
data: points,
|
310
310
|
unit: measure.unit,
|
311
311
|
borderWidth: 2,
|
@@ -484,7 +484,7 @@ const TrendChart = ({ deviceId, measures1, measures2, enableDatePicker, handleGe
|
|
484
484
|
}, minDateTime: moment(timeStart * 1000), slotProps: {
|
485
485
|
textField: { size: 'small', sx: { width: { sm: 210 } } }
|
486
486
|
} })] }) });
|
487
|
-
return (_jsxs(ThemeProvider, { theme: theme, children: [enableDatePicker && _jsx(Box, { sx: { display: { xs: 'flex', lg: 'none', justifyContent: 'flex-end' }, mb: 2 }, children: datePicker }), _jsxs(Box, { sx: { display: 'flex', alignItems: 'center', justifyContent: 'space-between' }, children: [_jsxs(Box, { sx: { display: 'flex', alignItems: 'center' }, children: [!enableExportData && measures && measures.length === 1 ? _jsx(Typography, { variant: 'body1', sx: { mr: 2 }, children: measures[0].name }) : '', enableExportData && (_jsxs(_Fragment, { children: [_jsxs(LoadingButton, { sx: { minWidth: '40px !important', mr: 1, px: 1 }, loading: loadingButton, type: "submit", variant: "text", color: "primary", onClick: handleExportData, disabled: !dataMeasures || !dataMeasures.length, size: 'small', children: [_jsx(LoginIcon, { fontSize: 'small', style: { transform: "rotate(90deg)" } }), _jsx(Box, { sx: { display: { xs: 'none', xl: 'block' }, ml: { md: 1 } }, children: "Export" })] }), _jsx(CSVLink
|
487
|
+
return (_jsxs(ThemeProvider, { theme: theme, children: [enableDatePicker && _jsx(Box, { sx: { display: { xs: 'flex', lg: 'none', justifyContent: 'flex-end' }, mb: 2 }, children: datePicker }), _jsxs(Box, { sx: { display: 'flex', alignItems: 'center', justifyContent: 'space-between' }, children: [_jsxs(Box, { sx: { display: 'flex', alignItems: 'center' }, children: [!enableExportData && measures && measures.length === 1 ? _jsx(Typography, { variant: 'body1', sx: { mr: 2 }, children: measures[0].description || measures[0].name }) : '', enableExportData && (_jsxs(_Fragment, { children: [_jsxs(LoadingButton, { sx: { minWidth: '40px !important', mr: 1, px: 1 }, loading: loadingButton, type: "submit", variant: "text", color: "primary", onClick: handleExportData, disabled: !dataMeasures || !dataMeasures.length, size: 'small', children: [_jsx(LoginIcon, { fontSize: 'small', style: { transform: "rotate(90deg)" } }), _jsx(Box, { sx: { display: { xs: 'none', xl: 'block' }, ml: { md: 1 } }, children: "Export" })] }), _jsx(CSVLink
|
488
488
|
//@ts-ignore
|
489
489
|
, {
|
490
490
|
//@ts-ignore
|
package/package.json
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
export type TrackleConfig = {
|
2
|
+
orgName: string;
|
2
3
|
apiUrl: string;
|
3
|
-
createCustomerUrl: string;
|
4
4
|
clientId: string;
|
5
5
|
clientSecret: string;
|
6
6
|
tokenUrl: string;
|
7
7
|
cookieName: string;
|
8
8
|
cookieSecure: boolean;
|
9
9
|
apiTimeout: number;
|
10
|
+
productID: number;
|
10
11
|
};
|
11
12
|
export declare function logOut(trackleConfig: TrackleConfig): Promise<void>;
|
12
13
|
export declare function createCustomer(trackleConfig: TrackleConfig, uid: string): Promise<{
|
@@ -48,7 +48,7 @@ export async function logOut(trackleConfig) {
|
|
48
48
|
cookies().delete(trackleConfig.cookieName);
|
49
49
|
}
|
50
50
|
export async function createCustomer(trackleConfig, uid) {
|
51
|
-
return await wretch(trackleConfig.
|
51
|
+
return await wretch(`${trackleConfig.apiUrl}/orgs/${trackleConfig.orgName}/customers`)
|
52
52
|
.headers({
|
53
53
|
Authorization: `Basic ${btoa(`${trackleConfig.clientId}:${trackleConfig.clientSecret}`)}`
|
54
54
|
})
|