@perses-dev/core 0.52.0 → 0.53.0-beta.1
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/cjs/model/datasource-api.js +16 -0
- package/dist/cjs/model/external-variable.js +16 -0
- package/dist/cjs/model/index.js +4 -1
- package/dist/cjs/{utils/event.js → model/panel-group.js} +5 -10
- package/dist/cjs/model/units/bytes.js +19 -7
- package/dist/cjs/model/units/throughput.js +14 -2
- package/dist/cjs/utils/fetch.js +2 -2
- package/dist/cjs/utils/index.js +0 -2
- package/dist/cjs/utils/transform-data.js +0 -10
- package/dist/model/datasource-api.d.ts +41 -0
- package/dist/model/datasource-api.d.ts.map +1 -0
- package/dist/model/datasource-api.js +19 -0
- package/dist/model/datasource-api.js.map +1 -0
- package/dist/model/external-variable.d.ts +29 -0
- package/dist/model/external-variable.d.ts.map +1 -0
- package/dist/model/external-variable.js +20 -0
- package/dist/model/external-variable.js.map +1 -0
- package/dist/model/index.d.ts +3 -0
- package/dist/model/index.d.ts.map +1 -1
- package/dist/model/index.js +4 -1
- package/dist/model/index.js.map +1 -1
- package/dist/model/otlp/common/v1/common.d.ts +3 -1
- package/dist/model/otlp/common/v1/common.d.ts.map +1 -1
- package/dist/model/otlp/common/v1/common.js.map +1 -1
- package/dist/model/panel-group.d.ts +63 -0
- package/dist/model/panel-group.d.ts.map +1 -0
- package/dist/model/panel-group.js +19 -0
- package/dist/model/panel-group.js.map +1 -0
- package/dist/model/units/bytes.d.ts +2 -2
- package/dist/model/units/bytes.d.ts.map +1 -1
- package/dist/model/units/bytes.js +19 -7
- package/dist/model/units/bytes.js.map +1 -1
- package/dist/model/units/throughput.d.ts +1 -1
- package/dist/model/units/throughput.d.ts.map +1 -1
- package/dist/model/units/throughput.js +14 -2
- package/dist/model/units/throughput.js.map +1 -1
- package/dist/model/units/units.d.ts +2 -0
- package/dist/model/units/units.d.ts.map +1 -1
- package/dist/utils/fetch.d.ts +4 -4
- package/dist/utils/fetch.d.ts.map +1 -1
- package/dist/utils/fetch.js +3 -3
- package/dist/utils/fetch.js.map +1 -1
- package/dist/utils/index.d.ts +0 -2
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +0 -2
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/transform-data.d.ts +0 -1
- package/dist/utils/transform-data.d.ts.map +1 -1
- package/dist/utils/transform-data.js +0 -7
- package/dist/utils/transform-data.js.map +1 -1
- package/package.json +1 -5
- package/dist/cjs/utils/memo.js +0 -64
- package/dist/utils/event.d.ts +0 -8
- package/dist/utils/event.d.ts.map +0 -1
- package/dist/utils/event.js +0 -27
- package/dist/utils/event.js.map +0 -1
- package/dist/utils/memo.d.ts +0 -13
- package/dist/utils/memo.d.ts.map +0 -1
- package/dist/utils/memo.js +0 -50
- package/dist/utils/memo.js.map +0 -1
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// Copyright 2025 The Perses Authors
|
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
13
|
+
"use strict";
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// Copyright 2025 The Perses Authors
|
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
13
|
+
"use strict";
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
});
|
package/dist/cjs/model/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2025 The Perses Authors
|
|
2
2
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
3
|
// you may not use this file except in compliance with the License.
|
|
4
4
|
// You may obtain a copy of the License at
|
|
@@ -17,9 +17,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
17
17
|
_export_star(require("./calculations"), exports);
|
|
18
18
|
_export_star(require("./dashboard"), exports);
|
|
19
19
|
_export_star(require("./datasource"), exports);
|
|
20
|
+
_export_star(require("./datasource-api"), exports);
|
|
20
21
|
_export_star(require("./definitions"), exports);
|
|
21
22
|
_export_star(require("./display"), exports);
|
|
22
23
|
_export_star(require("./ephemeraldashboard"), exports);
|
|
24
|
+
_export_star(require("./external-variable"), exports);
|
|
23
25
|
_export_star(require("./http"), exports);
|
|
24
26
|
_export_star(require("./http-proxy"), exports);
|
|
25
27
|
_export_star(require("./kind"), exports);
|
|
@@ -27,6 +29,7 @@ _export_star(require("./layout"), exports);
|
|
|
27
29
|
_export_star(require("./legend"), exports);
|
|
28
30
|
_export_star(require("./notice"), exports);
|
|
29
31
|
_export_star(require("./otlp"), exports);
|
|
32
|
+
_export_star(require("./panel-group"), exports);
|
|
30
33
|
_export_star(require("./panels"), exports);
|
|
31
34
|
_export_star(require("./project"), exports);
|
|
32
35
|
_export_star(require("./query"), exports);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2025 The Perses Authors
|
|
2
2
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
3
|
// you may not use this file except in compliance with the License.
|
|
4
4
|
// You may obtain a copy of the License at
|
|
@@ -14,17 +14,12 @@
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", {
|
|
15
15
|
value: true
|
|
16
16
|
});
|
|
17
|
-
Object.defineProperty(exports, "
|
|
17
|
+
Object.defineProperty(exports, "isPanelGroupItemIdEqual", {
|
|
18
18
|
enumerable: true,
|
|
19
19
|
get: function() {
|
|
20
|
-
return
|
|
20
|
+
return isPanelGroupItemIdEqual;
|
|
21
21
|
}
|
|
22
22
|
});
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
const handlerRef = (0, _react.useRef)(handler);
|
|
26
|
-
(0, _react.useLayoutEffect)(()=>{
|
|
27
|
-
handlerRef.current = handler;
|
|
28
|
-
});
|
|
29
|
-
return (0, _react.useCallback)((...args)=>handlerRef.current(...args), []);
|
|
23
|
+
function isPanelGroupItemIdEqual(a, b) {
|
|
24
|
+
return a?.panelGroupId === b?.panelGroupId && a?.panelGroupItemLayoutId === b?.panelGroupItemLayoutId;
|
|
30
25
|
}
|
|
@@ -40,11 +40,17 @@ function _interop_require_default(obj) {
|
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
42
|
/**
|
|
43
|
-
* We
|
|
44
|
-
*
|
|
43
|
+
* We support both SI (decimal) and IEC (binary) units for bytes:
|
|
44
|
+
*
|
|
45
|
+
* SI/decimal (unit: 'decbytes'):
|
|
45
46
|
* 1 KB = 1000 bytes (1000^1 bytes)
|
|
46
47
|
* 1 MB = 1,000,000 bytes (1000^2 bytes)
|
|
47
48
|
* etc.
|
|
49
|
+
*
|
|
50
|
+
* IEC/binary (unit: 'bytes'):
|
|
51
|
+
* 1 KiB = 1024 bytes (1024^1 bytes)
|
|
52
|
+
* 1 MiB = 1,048,576 bytes (1024^2 bytes)
|
|
53
|
+
* etc.
|
|
48
54
|
*/ const DEFAULT_NUMBRO_MANTISSA = 2;
|
|
49
55
|
const BYTES_GROUP_CONFIG = {
|
|
50
56
|
label: 'Bytes',
|
|
@@ -54,12 +60,18 @@ const BYTES_GROUP_CONFIG = {
|
|
|
54
60
|
const BYTES_UNIT_CONFIG = {
|
|
55
61
|
bytes: {
|
|
56
62
|
group: 'Bytes',
|
|
57
|
-
label: 'Bytes'
|
|
63
|
+
label: 'Bytes (IEC)'
|
|
64
|
+
},
|
|
65
|
+
decbytes: {
|
|
66
|
+
group: 'Bytes',
|
|
67
|
+
label: 'Bytes (SI)'
|
|
58
68
|
}
|
|
59
69
|
};
|
|
60
|
-
function formatBytes(bytes, { shortValues, decimalPlaces }) {
|
|
70
|
+
function formatBytes(bytes, { unit = 'bytes', shortValues, decimalPlaces }) {
|
|
71
|
+
const isDecimal = unit === 'decbytes';
|
|
72
|
+
const threshold = isDecimal ? 1000 : 1024;
|
|
61
73
|
// If we're showing the entire value, we can use Intl.NumberFormat.
|
|
62
|
-
if (!(0, _utils.shouldShortenValues)(shortValues) || Math.abs(bytes) <
|
|
74
|
+
if (!(0, _utils.shouldShortenValues)(shortValues) || Math.abs(bytes) < threshold) {
|
|
63
75
|
const formatterOptions = {
|
|
64
76
|
style: 'unit',
|
|
65
77
|
unit: 'byte',
|
|
@@ -70,7 +82,7 @@ function formatBytes(bytes, { shortValues, decimalPlaces }) {
|
|
|
70
82
|
formatterOptions.minimumFractionDigits = (0, _utils.limitDecimalPlaces)(decimalPlaces);
|
|
71
83
|
formatterOptions.maximumFractionDigits = (0, _utils.limitDecimalPlaces)(decimalPlaces);
|
|
72
84
|
} else {
|
|
73
|
-
// This can happen if bytes is between -
|
|
85
|
+
// This can happen if bytes is between -threshold and threshold (1000 for SI, 1024 for IEC)
|
|
74
86
|
if ((0, _utils.shouldShortenValues)(shortValues)) {
|
|
75
87
|
formatterOptions.maximumSignificantDigits = _constants.MAX_SIGNIFICANT_DIGITS;
|
|
76
88
|
}
|
|
@@ -82,7 +94,7 @@ function formatBytes(bytes, { shortValues, decimalPlaces }) {
|
|
|
82
94
|
// numbro is able to add units like KB, MB, GB, etc. correctly.
|
|
83
95
|
return (0, _numbro.default)(bytes).format({
|
|
84
96
|
output: 'byte',
|
|
85
|
-
base: 'decimal',
|
|
97
|
+
base: isDecimal ? 'decimal' : 'binary',
|
|
86
98
|
spaceSeparated: true,
|
|
87
99
|
mantissa: (0, _utils.hasDecimalPlaces)(decimalPlaces) ? decimalPlaces : DEFAULT_NUMBRO_MANTISSA,
|
|
88
100
|
// trimMantissa trims trailing 0s
|
|
@@ -46,7 +46,11 @@ const THROUGHPUT_UNIT_CONFIG = {
|
|
|
46
46
|
},
|
|
47
47
|
'bytes/sec': {
|
|
48
48
|
group: THROUGHPUT_GROUP,
|
|
49
|
-
label: 'Bytes/sec'
|
|
49
|
+
label: 'Bytes/sec (IEC)'
|
|
50
|
+
},
|
|
51
|
+
'decbytes/sec': {
|
|
52
|
+
group: THROUGHPUT_GROUP,
|
|
53
|
+
label: 'Bytes/sec (SI)'
|
|
50
54
|
},
|
|
51
55
|
'counts/sec': {
|
|
52
56
|
group: THROUGHPUT_GROUP,
|
|
@@ -91,8 +95,16 @@ const THROUGHPUT_UNIT_CONFIG = {
|
|
|
91
95
|
};
|
|
92
96
|
function formatThroughput(value, { unit, shortValues, decimalPlaces }) {
|
|
93
97
|
// special case for data throughput
|
|
94
|
-
if (unit === '
|
|
98
|
+
if (unit === 'decbytes/sec') {
|
|
95
99
|
const denominator = Math.abs(value) < 1000 ? 'sec' : 's';
|
|
100
|
+
return (0, _bytes.formatBytes)(value, {
|
|
101
|
+
unit: 'decbytes',
|
|
102
|
+
shortValues,
|
|
103
|
+
decimalPlaces
|
|
104
|
+
}) + '/' + denominator;
|
|
105
|
+
}
|
|
106
|
+
if (unit === 'bytes/sec') {
|
|
107
|
+
const denominator = Math.abs(value) < 1024 ? 'sec' : 's';
|
|
96
108
|
return (0, _bytes.formatBytes)(value, {
|
|
97
109
|
unit: 'bytes',
|
|
98
110
|
shortValues,
|
package/dist/cjs/utils/fetch.js
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
// See the License for the specific language governing permissions and
|
|
12
12
|
// limitations under the License.
|
|
13
13
|
/**
|
|
14
|
-
* Calls `
|
|
14
|
+
* Calls `globalThis.fetch` and determines which type of error to show for non-200 responses.
|
|
15
15
|
*/ "use strict";
|
|
16
16
|
Object.defineProperty(exports, "__esModule", {
|
|
17
17
|
value: true
|
|
@@ -37,7 +37,7 @@ _export(exports, {
|
|
|
37
37
|
}
|
|
38
38
|
});
|
|
39
39
|
async function fetch(...args) {
|
|
40
|
-
const response = await
|
|
40
|
+
const response = await globalThis.fetch(...args);
|
|
41
41
|
if (response.ok === false) {
|
|
42
42
|
const contentType = response.headers.get('content-type');
|
|
43
43
|
if (contentType?.includes('application/json')) {
|
package/dist/cjs/utils/index.js
CHANGED
|
@@ -14,10 +14,8 @@
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", {
|
|
15
15
|
value: true
|
|
16
16
|
});
|
|
17
|
-
_export_star(require("./event"), exports);
|
|
18
17
|
_export_star(require("./fetch"), exports);
|
|
19
18
|
_export_star(require("./is-empty-object"), exports);
|
|
20
|
-
_export_star(require("./memo"), exports);
|
|
21
19
|
_export_star(require("./panel-refs"), exports);
|
|
22
20
|
_export_star(require("./text"), exports);
|
|
23
21
|
_export_star(require("./time-series-data"), exports);
|
|
@@ -35,12 +35,8 @@ _export(exports, {
|
|
|
35
35
|
},
|
|
36
36
|
transformData: function() {
|
|
37
37
|
return transformData;
|
|
38
|
-
},
|
|
39
|
-
useTransformData: function() {
|
|
40
|
-
return useTransformData;
|
|
41
38
|
}
|
|
42
39
|
});
|
|
43
|
-
const _react = require("react");
|
|
44
40
|
function applyJoinTransform(data, columns) {
|
|
45
41
|
// If column is undefined or empty, return data as is
|
|
46
42
|
if (columns.length === 0) {
|
|
@@ -159,9 +155,3 @@ function transformData(data, transforms) {
|
|
|
159
155
|
});
|
|
160
156
|
return result;
|
|
161
157
|
}
|
|
162
|
-
function useTransformData(data, transforms) {
|
|
163
|
-
return (0, _react.useMemo)(()=>transformData(data, transforms), [
|
|
164
|
-
data,
|
|
165
|
-
transforms
|
|
166
|
-
]);
|
|
167
|
-
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { DatasourceResource, DatasourceSelector, GlobalDatasourceResource } from './datasource';
|
|
2
|
+
/**
|
|
3
|
+
* Parameters for building a datasource proxy URL
|
|
4
|
+
*/
|
|
5
|
+
export interface BuildDatasourceProxyUrlParams {
|
|
6
|
+
project?: string;
|
|
7
|
+
dashboard?: string;
|
|
8
|
+
name: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Function type for building datasource proxy URLs
|
|
12
|
+
*/
|
|
13
|
+
export type BuildDatasourceProxyUrlFunc = (params: BuildDatasourceProxyUrlParams) => string;
|
|
14
|
+
/**
|
|
15
|
+
* The external API contract for fetching datasource resources.
|
|
16
|
+
* This defines the interface that must be implemented to provide
|
|
17
|
+
* datasource functionality to the dashboard.
|
|
18
|
+
*/
|
|
19
|
+
export interface DatasourceApi {
|
|
20
|
+
/**
|
|
21
|
+
* Optional function to build proxy URLs for datasources
|
|
22
|
+
*/
|
|
23
|
+
buildProxyUrl?: BuildDatasourceProxyUrlFunc;
|
|
24
|
+
/**
|
|
25
|
+
* Get a datasource resource for a specific project
|
|
26
|
+
*/
|
|
27
|
+
getDatasource: (project: string, selector: DatasourceSelector) => Promise<DatasourceResource | undefined>;
|
|
28
|
+
/**
|
|
29
|
+
* Get a global datasource resource
|
|
30
|
+
*/
|
|
31
|
+
getGlobalDatasource: (selector: DatasourceSelector) => Promise<GlobalDatasourceResource | undefined>;
|
|
32
|
+
/**
|
|
33
|
+
* List all datasources for a project, optionally filtered by plugin kind
|
|
34
|
+
*/
|
|
35
|
+
listDatasources: (project: string, pluginKind?: string) => Promise<DatasourceResource[]>;
|
|
36
|
+
/**
|
|
37
|
+
* List all global datasources, optionally filtered by plugin kind
|
|
38
|
+
*/
|
|
39
|
+
listGlobalDatasources: (pluginKind?: string) => Promise<GlobalDatasourceResource[]>;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=datasource-api.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"datasource-api.d.ts","sourceRoot":"","sources":["../../src/model/datasource-api.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAEhG;;GAEG;AACH,MAAM,WAAW,6BAA6B;IAC5C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,MAAM,MAAM,2BAA2B,GAAG,CAAC,MAAM,EAAE,6BAA6B,KAAK,MAAM,CAAC;AAE5F;;;;GAIG;AACH,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,aAAa,CAAC,EAAE,2BAA2B,CAAC;IAC5C;;OAEG;IACH,aAAa,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,kBAAkB,KAAK,OAAO,CAAC,kBAAkB,GAAG,SAAS,CAAC,CAAC;IAC1G;;OAEG;IACH,mBAAmB,EAAE,CAAC,QAAQ,EAAE,kBAAkB,KAAK,OAAO,CAAC,wBAAwB,GAAG,SAAS,CAAC,CAAC;IACrG;;OAEG;IACH,eAAe,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAAC;IACzF;;OAEG;IACH,qBAAqB,EAAE,CAAC,UAAU,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,wBAAwB,EAAE,CAAC,CAAC;CACrF"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// Copyright 2025 The Perses Authors
|
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
13
|
+
/**
|
|
14
|
+
* The external API contract for fetching datasource resources.
|
|
15
|
+
* This defines the interface that must be implemented to provide
|
|
16
|
+
* datasource functionality to the dashboard.
|
|
17
|
+
*/ export { };
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=datasource-api.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/model/datasource-api.ts"],"sourcesContent":["// Copyright 2025 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { DatasourceResource, DatasourceSelector, GlobalDatasourceResource } from './datasource';\n\n/**\n * Parameters for building a datasource proxy URL\n */\nexport interface BuildDatasourceProxyUrlParams {\n project?: string;\n dashboard?: string;\n name: string;\n}\n\n/**\n * Function type for building datasource proxy URLs\n */\nexport type BuildDatasourceProxyUrlFunc = (params: BuildDatasourceProxyUrlParams) => string;\n\n/**\n * The external API contract for fetching datasource resources.\n * This defines the interface that must be implemented to provide\n * datasource functionality to the dashboard.\n */\nexport interface DatasourceApi {\n /**\n * Optional function to build proxy URLs for datasources\n */\n buildProxyUrl?: BuildDatasourceProxyUrlFunc;\n /**\n * Get a datasource resource for a specific project\n */\n getDatasource: (project: string, selector: DatasourceSelector) => Promise<DatasourceResource | undefined>;\n /**\n * Get a global datasource resource\n */\n getGlobalDatasource: (selector: DatasourceSelector) => Promise<GlobalDatasourceResource | undefined>;\n /**\n * List all datasources for a project, optionally filtered by plugin kind\n */\n listDatasources: (project: string, pluginKind?: string) => Promise<DatasourceResource[]>;\n /**\n * List all global datasources, optionally filtered by plugin kind\n */\n listGlobalDatasources: (pluginKind?: string) => Promise<GlobalDatasourceResource[]>;\n}\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAkBjC;;;;CAIC,GACD,WAqBC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { VariableDefinition } from './variables';
|
|
2
|
+
/**
|
|
3
|
+
* External variable definition that can be provided from an external source.
|
|
4
|
+
* Multiple external variable definitions can be provided to a dashboard, and
|
|
5
|
+
* the order of the sources is important as first one will take precedence on
|
|
6
|
+
* the following ones, in case they have same names.
|
|
7
|
+
*/
|
|
8
|
+
export interface ExternalVariableDefinition {
|
|
9
|
+
/**
|
|
10
|
+
* Source identifier for this set of external variables
|
|
11
|
+
*/
|
|
12
|
+
source: string;
|
|
13
|
+
/**
|
|
14
|
+
* Optional tooltip information for the external variables
|
|
15
|
+
*/
|
|
16
|
+
tooltip?: {
|
|
17
|
+
title?: string;
|
|
18
|
+
description?: string;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Optional link to edit these external variables
|
|
22
|
+
*/
|
|
23
|
+
editLink?: string;
|
|
24
|
+
/**
|
|
25
|
+
* The variable definitions from this external source
|
|
26
|
+
*/
|
|
27
|
+
definitions: VariableDefinition[];
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=external-variable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"external-variable.d.ts","sourceRoot":"","sources":["../../src/model/external-variable.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEjD;;;;;GAKG;AACH,MAAM,WAAW,0BAA0B;IACzC;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,OAAO,CAAC,EAAE;QACR,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB,CAAC;IACF;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,WAAW,EAAE,kBAAkB,EAAE,CAAC;CACnC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// Copyright 2025 The Perses Authors
|
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
13
|
+
/**
|
|
14
|
+
* External variable definition that can be provided from an external source.
|
|
15
|
+
* Multiple external variable definitions can be provided to a dashboard, and
|
|
16
|
+
* the order of the sources is important as first one will take precedence on
|
|
17
|
+
* the following ones, in case they have same names.
|
|
18
|
+
*/ export { };
|
|
19
|
+
|
|
20
|
+
//# sourceMappingURL=external-variable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/model/external-variable.ts"],"sourcesContent":["// Copyright 2025 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { VariableDefinition } from './variables';\n\n/**\n * External variable definition that can be provided from an external source.\n * Multiple external variable definitions can be provided to a dashboard, and\n * the order of the sources is important as first one will take precedence on\n * the following ones, in case they have same names.\n */\nexport interface ExternalVariableDefinition {\n /**\n * Source identifier for this set of external variables\n */\n source: string;\n /**\n * Optional tooltip information for the external variables\n */\n tooltip?: {\n title?: string;\n description?: string;\n };\n /**\n * Optional link to edit these external variables\n */\n editLink?: string;\n /**\n * The variable definitions from this external source\n */\n definitions: VariableDefinition[];\n}\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAIjC;;;;;CAKC,GACD,WAoBC"}
|
package/dist/model/index.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
export * from './calculations';
|
|
2
2
|
export * from './dashboard';
|
|
3
3
|
export * from './datasource';
|
|
4
|
+
export * from './datasource-api';
|
|
4
5
|
export * from './definitions';
|
|
5
6
|
export * from './display';
|
|
6
7
|
export * from './ephemeraldashboard';
|
|
8
|
+
export * from './external-variable';
|
|
7
9
|
export * from './http';
|
|
8
10
|
export * from './http-proxy';
|
|
9
11
|
export * from './kind';
|
|
@@ -11,6 +13,7 @@ export * from './layout';
|
|
|
11
13
|
export * from './legend';
|
|
12
14
|
export * from './notice';
|
|
13
15
|
export * from './otlp';
|
|
16
|
+
export * from './panel-group';
|
|
14
17
|
export * from './panels';
|
|
15
18
|
export * from './project';
|
|
16
19
|
export * from './query';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/model/index.ts"],"names":[],"mappings":"AAaA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,sBAAsB,CAAC;AACrC,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/model/index.ts"],"names":[],"mappings":"AAaA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC"}
|
package/dist/model/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2025 The Perses Authors
|
|
2
2
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
3
|
// you may not use this file except in compliance with the License.
|
|
4
4
|
// You may obtain a copy of the License at
|
|
@@ -13,9 +13,11 @@
|
|
|
13
13
|
export * from './calculations';
|
|
14
14
|
export * from './dashboard';
|
|
15
15
|
export * from './datasource';
|
|
16
|
+
export * from './datasource-api';
|
|
16
17
|
export * from './definitions';
|
|
17
18
|
export * from './display';
|
|
18
19
|
export * from './ephemeraldashboard';
|
|
20
|
+
export * from './external-variable';
|
|
19
21
|
export * from './http';
|
|
20
22
|
export * from './http-proxy';
|
|
21
23
|
export * from './kind';
|
|
@@ -23,6 +25,7 @@ export * from './layout';
|
|
|
23
25
|
export * from './legend';
|
|
24
26
|
export * from './notice';
|
|
25
27
|
export * from './otlp';
|
|
28
|
+
export * from './panel-group';
|
|
26
29
|
export * from './panels';
|
|
27
30
|
export * from './project';
|
|
28
31
|
export * from './query';
|
package/dist/model/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/model/index.ts"],"sourcesContent":["// Copyright
|
|
1
|
+
{"version":3,"sources":["../../src/model/index.ts"],"sourcesContent":["// Copyright 2025 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport * from './calculations';\nexport * from './dashboard';\nexport * from './datasource';\nexport * from './datasource-api';\nexport * from './definitions';\nexport * from './display';\nexport * from './ephemeraldashboard';\nexport * from './external-variable';\nexport * from './http';\nexport * from './http-proxy';\nexport * from './kind';\nexport * from './layout';\nexport * from './legend';\nexport * from './notice';\nexport * from './otlp';\nexport * from './panel-group';\nexport * from './panels';\nexport * from './project';\nexport * from './query';\nexport * from './resource';\nexport * from './roles';\nexport * from './rolebindings';\nexport * from './secrets';\nexport * from './thresholds';\nexport * from './time';\nexport * from './time-series-data';\nexport * from './time-series-queries';\nexport * from './trace-data';\nexport * from './profile-data';\nexport * from './log-data';\nexport * from './transforms';\nexport * from './units';\nexport * from './user';\nexport * from './variables';\nexport * from './value-mapping';\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,iBAAiB;AAC/B,cAAc,cAAc;AAC5B,cAAc,eAAe;AAC7B,cAAc,mBAAmB;AACjC,cAAc,gBAAgB;AAC9B,cAAc,YAAY;AAC1B,cAAc,uBAAuB;AACrC,cAAc,sBAAsB;AACpC,cAAc,SAAS;AACvB,cAAc,eAAe;AAC7B,cAAc,SAAS;AACvB,cAAc,WAAW;AACzB,cAAc,WAAW;AACzB,cAAc,WAAW;AACzB,cAAc,SAAS;AACvB,cAAc,gBAAgB;AAC9B,cAAc,WAAW;AACzB,cAAc,YAAY;AAC1B,cAAc,UAAU;AACxB,cAAc,aAAa;AAC3B,cAAc,UAAU;AACxB,cAAc,iBAAiB;AAC/B,cAAc,YAAY;AAC1B,cAAc,eAAe;AAC7B,cAAc,SAAS;AACvB,cAAc,qBAAqB;AACnC,cAAc,wBAAwB;AACtC,cAAc,eAAe;AAC7B,cAAc,iBAAiB;AAC/B,cAAc,aAAa;AAC3B,cAAc,eAAe;AAC7B,cAAc,UAAU;AACxB,cAAc,SAAS;AACvB,cAAc,cAAc;AAC5B,cAAc,kBAAkB"}
|
|
@@ -6,11 +6,13 @@ export type AnyValue = {
|
|
|
6
6
|
stringValue: string;
|
|
7
7
|
} | {
|
|
8
8
|
intValue: string;
|
|
9
|
+
} | {
|
|
10
|
+
doubleValue: number;
|
|
9
11
|
} | {
|
|
10
12
|
boolValue: boolean;
|
|
11
13
|
} | {
|
|
12
14
|
arrayValue: {
|
|
13
|
-
values
|
|
15
|
+
values?: AnyValue[];
|
|
14
16
|
};
|
|
15
17
|
};
|
|
16
18
|
export interface InstrumentationScope {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../../src/model/otlp/common/v1/common.ts"],"names":[],"mappings":"AAeA,MAAM,WAAW,QAAQ;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,QAAQ,CAAC;CACjB;AAED,MAAM,MAAM,QAAQ,GAChB;IAAE,WAAW,EAAE,MAAM,CAAA;CAAE,GACvB;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,GACpB;IAAE,SAAS,EAAE,OAAO,CAAA;CAAE,GACtB;IAAE,UAAU,EAAE;QAAE,MAAM,EAAE,QAAQ,EAAE,CAAA;KAAE,CAAA;CAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../../src/model/otlp/common/v1/common.ts"],"names":[],"mappings":"AAeA,MAAM,WAAW,QAAQ;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,QAAQ,CAAC;CACjB;AAED,MAAM,MAAM,QAAQ,GAChB;IAAE,WAAW,EAAE,MAAM,CAAA;CAAE,GACvB;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,GACpB;IAAE,WAAW,EAAE,MAAM,CAAA;CAAE,GACvB;IAAE,SAAS,EAAE,OAAO,CAAA;CAAE,GACtB;IAAE,UAAU,EAAE;QAAE,MAAM,CAAC,EAAE,QAAQ,EAAE,CAAA;KAAE,CAAA;CAAE,CAAC;AAE5C,MAAM,WAAW,oBAAoB;IACnC,IAAI,CAAC,EAAE,MAAM,CAAC;CACf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/model/otlp/common/v1/common.ts"],"sourcesContent":["// Copyright 2025 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n// https://github.com/open-telemetry/opentelemetry-proto/blob/v1.5.0/opentelemetry/proto/common/v1/common.proto\n\nexport interface KeyValue {\n key: string;\n value: AnyValue;\n}\n\nexport type AnyValue =\n | { stringValue: string }\n | { intValue: string }\n | { boolValue: boolean }\n | { arrayValue: { values
|
|
1
|
+
{"version":3,"sources":["../../../../../src/model/otlp/common/v1/common.ts"],"sourcesContent":["// Copyright 2025 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n// https://github.com/open-telemetry/opentelemetry-proto/blob/v1.5.0/opentelemetry/proto/common/v1/common.proto\n\nexport interface KeyValue {\n key: string;\n value: AnyValue;\n}\n\nexport type AnyValue =\n | { stringValue: string }\n | { intValue: string }\n | { doubleValue: number }\n | { boolValue: boolean }\n | { arrayValue: { values?: AnyValue[] } };\n\nexport interface InstrumentationScope {\n name?: string;\n}\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,+GAA+G;AAc/G,WAEC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { PanelGroupId } from './panels';
|
|
2
|
+
/**
|
|
3
|
+
* Panel Group Item Layout ID type. String identifier for items within a panel group.
|
|
4
|
+
*/
|
|
5
|
+
export type PanelGroupItemLayoutId = string;
|
|
6
|
+
/**
|
|
7
|
+
* Base layout properties for positioning and sizing items in a grid.
|
|
8
|
+
* This is a framework-agnostic representation that can be used with various grid systems.
|
|
9
|
+
*/
|
|
10
|
+
export interface BaseLayout {
|
|
11
|
+
/**
|
|
12
|
+
* Item identifier
|
|
13
|
+
*/
|
|
14
|
+
i: string;
|
|
15
|
+
/**
|
|
16
|
+
* X position in grid units
|
|
17
|
+
*/
|
|
18
|
+
x: number;
|
|
19
|
+
/**
|
|
20
|
+
* Y position in grid units
|
|
21
|
+
*/
|
|
22
|
+
y: number;
|
|
23
|
+
/**
|
|
24
|
+
* Width in grid units
|
|
25
|
+
*/
|
|
26
|
+
w: number;
|
|
27
|
+
/**
|
|
28
|
+
* Height in grid units
|
|
29
|
+
*/
|
|
30
|
+
h: number;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Layout information for an item within a panel group.
|
|
34
|
+
* Extends BaseLayout with a typed identifier.
|
|
35
|
+
*/
|
|
36
|
+
export interface PanelGroupItemLayout extends BaseLayout {
|
|
37
|
+
i: PanelGroupItemLayoutId;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Uniquely identifies an item in a PanelGroup.
|
|
41
|
+
*/
|
|
42
|
+
export interface PanelGroupItemId {
|
|
43
|
+
panelGroupId: PanelGroupId;
|
|
44
|
+
panelGroupItemLayoutId: PanelGroupItemLayoutId;
|
|
45
|
+
repeatVariable?: [string, string];
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Definition of a panel group, containing layout and panel information.
|
|
49
|
+
*/
|
|
50
|
+
export interface PanelGroupDefinition {
|
|
51
|
+
id: PanelGroupId;
|
|
52
|
+
isCollapsed: boolean;
|
|
53
|
+
title?: string;
|
|
54
|
+
repeatedOriginId?: PanelGroupId;
|
|
55
|
+
repeatVariable?: string;
|
|
56
|
+
itemLayouts: PanelGroupItemLayout[];
|
|
57
|
+
itemPanelKeys: Record<PanelGroupItemLayoutId, string>;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Check if two PanelGroupItemId are equal
|
|
61
|
+
*/
|
|
62
|
+
export declare function isPanelGroupItemIdEqual(a?: PanelGroupItemId, b?: PanelGroupItemId): boolean;
|
|
63
|
+
//# sourceMappingURL=panel-group.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"panel-group.d.ts","sourceRoot":"","sources":["../../src/model/panel-group.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAExC;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG,MAAM,CAAC;AAE5C;;;GAGG;AACH,MAAM,WAAW,UAAU;IACzB;;OAEG;IACH,CAAC,EAAE,MAAM,CAAC;IACV;;OAEG;IACH,CAAC,EAAE,MAAM,CAAC;IACV;;OAEG;IACH,CAAC,EAAE,MAAM,CAAC;IACV;;OAEG;IACH,CAAC,EAAE,MAAM,CAAC;IACV;;OAEG;IACH,CAAC,EAAE,MAAM,CAAC;CACX;AAED;;;GAGG;AACH,MAAM,WAAW,oBAAqB,SAAQ,UAAU;IACtD,CAAC,EAAE,sBAAsB,CAAC;CAC3B;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,YAAY,EAAE,YAAY,CAAC;IAC3B,sBAAsB,EAAE,sBAAsB,CAAC;IAC/C,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACnC;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,EAAE,EAAE,YAAY,CAAC;IACjB,WAAW,EAAE,OAAO,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gBAAgB,CAAC,EAAE,YAAY,CAAC;IAChC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,oBAAoB,EAAE,CAAC;IACpC,aAAa,EAAE,MAAM,CAAC,sBAAsB,EAAE,MAAM,CAAC,CAAC;CACvD;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,CAAC,CAAC,EAAE,gBAAgB,EAAE,CAAC,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAE3F"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// Copyright 2025 The Perses Authors
|
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
13
|
+
/**
|
|
14
|
+
* Check if two PanelGroupItemId are equal
|
|
15
|
+
*/ export function isPanelGroupItemIdEqual(a, b) {
|
|
16
|
+
return a?.panelGroupId === b?.panelGroupId && a?.panelGroupItemLayoutId === b?.panelGroupItemLayoutId;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=panel-group.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/model/panel-group.ts"],"sourcesContent":["// Copyright 2025 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { PanelGroupId } from './panels';\n\n/**\n * Panel Group Item Layout ID type. String identifier for items within a panel group.\n */\nexport type PanelGroupItemLayoutId = string;\n\n/**\n * Base layout properties for positioning and sizing items in a grid.\n * This is a framework-agnostic representation that can be used with various grid systems.\n */\nexport interface BaseLayout {\n /**\n * Item identifier\n */\n i: string;\n /**\n * X position in grid units\n */\n x: number;\n /**\n * Y position in grid units\n */\n y: number;\n /**\n * Width in grid units\n */\n w: number;\n /**\n * Height in grid units\n */\n h: number;\n}\n\n/**\n * Layout information for an item within a panel group.\n * Extends BaseLayout with a typed identifier.\n */\nexport interface PanelGroupItemLayout extends BaseLayout {\n i: PanelGroupItemLayoutId;\n}\n\n/**\n * Uniquely identifies an item in a PanelGroup.\n */\nexport interface PanelGroupItemId {\n panelGroupId: PanelGroupId;\n panelGroupItemLayoutId: PanelGroupItemLayoutId;\n repeatVariable?: [string, string]; // Optional, used for repeated panel groups. Variable name and value.\n}\n\n/**\n * Definition of a panel group, containing layout and panel information.\n */\nexport interface PanelGroupDefinition {\n id: PanelGroupId;\n isCollapsed: boolean;\n title?: string;\n repeatedOriginId?: PanelGroupId; // ID of the original panel group from which this repeated group is derived\n repeatVariable?: string; // Optional, used for repeated panel groups\n itemLayouts: PanelGroupItemLayout[];\n itemPanelKeys: Record<PanelGroupItemLayoutId, string>;\n}\n\n/**\n * Check if two PanelGroupItemId are equal\n */\nexport function isPanelGroupItemIdEqual(a?: PanelGroupItemId, b?: PanelGroupItemId): boolean {\n return a?.panelGroupId === b?.panelGroupId && a?.panelGroupItemLayoutId === b?.panelGroupItemLayoutId;\n}\n"],"names":["isPanelGroupItemIdEqual","a","b","panelGroupId","panelGroupItemLayoutId"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAkEjC;;CAEC,GACD,OAAO,SAASA,wBAAwBC,CAAoB,EAAEC,CAAoB;IAChF,OAAOD,GAAGE,iBAAiBD,GAAGC,gBAAgBF,GAAGG,2BAA2BF,GAAGE;AACjF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { UnitGroupConfig, UnitConfig } from './types';
|
|
2
|
-
type BytesUnit = 'bytes';
|
|
2
|
+
type BytesUnit = 'bytes' | 'decbytes';
|
|
3
3
|
export type BytesFormatOptions = {
|
|
4
4
|
unit?: BytesUnit;
|
|
5
5
|
decimalPlaces?: number;
|
|
@@ -7,6 +7,6 @@ export type BytesFormatOptions = {
|
|
|
7
7
|
};
|
|
8
8
|
export declare const BYTES_GROUP_CONFIG: UnitGroupConfig;
|
|
9
9
|
export declare const BYTES_UNIT_CONFIG: Readonly<Record<BytesUnit, UnitConfig>>;
|
|
10
|
-
export declare function formatBytes(bytes: number, { shortValues, decimalPlaces }: BytesFormatOptions): string;
|
|
10
|
+
export declare function formatBytes(bytes: number, { unit, shortValues, decimalPlaces }: BytesFormatOptions): string;
|
|
11
11
|
export {};
|
|
12
12
|
//# sourceMappingURL=bytes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bytes.d.ts","sourceRoot":"","sources":["../../../src/model/units/bytes.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"bytes.d.ts","sourceRoot":"","sources":["../../../src/model/units/bytes.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAmBtD,KAAK,SAAS,GAAG,OAAO,GAAG,UAAU,CAAC;AAEtC,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AACF,eAAO,MAAM,kBAAkB,EAAE,eAIhC,CAAC;AACF,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,MAAM,CAAC,SAAS,EAAE,UAAU,CAAC,CASrE,CAAC;AAEF,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,IAAc,EAAE,WAAW,EAAE,aAAa,EAAE,EAAE,kBAAkB,GAAG,MAAM,CAsCrH"}
|