@xh/hoist 72.1.0 → 72.3.0
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/CHANGELOG.md +44 -0
- package/admin/tabs/activity/clienterrors/ClientErrorsModel.ts +23 -4
- package/admin/tabs/cluster/instances/InstancesTabModel.ts +4 -3
- package/admin/tabs/cluster/instances/logs/LogDisplay.ts +12 -14
- package/admin/tabs/cluster/instances/logs/LogDisplayModel.ts +0 -2
- package/admin/tabs/cluster/instances/logs/LogViewer.ts +6 -5
- package/admin/tabs/cluster/instances/logs/LogViewerModel.ts +8 -1
- package/admin/tabs/cluster/instances/memory/MemoryMonitorModel.ts +1 -0
- package/admin/tabs/cluster/instances/services/DetailsModel.ts +1 -2
- package/admin/tabs/cluster/instances/services/DetailsPanel.ts +19 -14
- package/admin/tabs/cluster/instances/services/ServiceModel.ts +14 -6
- package/admin/tabs/cluster/instances/services/ServicePanel.ts +9 -10
- package/admin/tabs/cluster/instances/websocket/WebSocketColumns.ts +9 -0
- package/admin/tabs/cluster/instances/websocket/WebSocketModel.ts +2 -1
- package/admin/tabs/userData/roles/RoleModel.ts +1 -1
- package/admin/tabs/userData/roles/details/RoleDetailsModel.ts +2 -1
- package/admin/tabs/userData/roles/recategorize/RecategorizeDialogModel.ts +1 -1
- package/appcontainer/AppStateModel.ts +6 -1
- package/build/types/admin/tabs/activity/tracking/ActivityTrackingModel.d.ts +4 -1
- package/build/types/admin/tabs/cluster/instances/services/DetailsModel.d.ts +2 -3
- package/build/types/admin/tabs/cluster/instances/websocket/WebSocketColumns.d.ts +1 -0
- package/build/types/appcontainer/AppStateModel.d.ts +5 -1
- package/build/types/cmp/tab/TabContainerModel.d.ts +5 -5
- package/build/types/core/HoistProps.d.ts +1 -0
- package/build/types/core/XH.d.ts +5 -5
- package/build/types/core/types/Interfaces.d.ts +9 -0
- package/build/types/desktop/cmp/appOption/AutoRefreshAppOption.d.ts +1 -0
- package/build/types/desktop/cmp/appOption/ThemeAppOption.d.ts +1 -0
- package/build/types/desktop/cmp/tab/TabSwitcher.d.ts +1 -1
- package/build/types/kit/blueprint/Wrappers.d.ts +1 -1
- package/build/types/kit/swiper/index.d.ts +4 -4
- package/build/types/security/BaseOAuthClient.d.ts +25 -28
- package/build/types/security/Token.d.ts +0 -1
- package/build/types/security/Types.d.ts +39 -0
- package/build/types/security/authzero/AuthZeroClient.d.ts +3 -4
- package/build/types/security/msal/MsalClient.d.ts +14 -4
- package/build/types/svc/TrackService.d.ts +31 -1
- package/build/types/utils/js/BrowserUtils.d.ts +38 -1
- package/cmp/tab/TabContainerModel.ts +5 -5
- package/core/HoistProps.ts +1 -0
- package/core/XH.ts +13 -5
- package/core/exception/Exception.ts +19 -12
- package/core/types/Interfaces.ts +11 -0
- package/data/Store.ts +3 -0
- package/desktop/appcontainer/ExceptionDialog.ts +1 -1
- package/desktop/cmp/dash/canvas/DashCanvas.ts +2 -1
- package/desktop/cmp/grid/editors/BooleanEditor.ts +15 -3
- package/desktop/cmp/tab/TabSwitcher.ts +1 -1
- package/package.json +2 -2
- package/security/BaseOAuthClient.ts +52 -45
- package/security/Token.ts +0 -2
- package/security/Types.ts +51 -0
- package/security/authzero/AuthZeroClient.ts +6 -8
- package/security/msal/MsalClient.ts +130 -27
- package/svc/FetchService.ts +3 -2
- package/svc/TrackService.ts +94 -8
- package/svc/WebSocketService.ts +1 -2
- package/tsconfig.tsbuildinfo +1 -1
- package/utils/js/BrowserUtils.ts +72 -21
- package/utils/react/LayoutPropUtils.ts +2 -1
package/utils/js/BrowserUtils.ts
CHANGED
|
@@ -4,25 +4,31 @@
|
|
|
4
4
|
*
|
|
5
5
|
* Copyright © 2025 Extremely Heavy Industries Inc.
|
|
6
6
|
*/
|
|
7
|
-
import {
|
|
7
|
+
import {XH} from '@xh/hoist/core';
|
|
8
|
+
import {pick, round} from 'lodash';
|
|
8
9
|
|
|
9
10
|
/**
|
|
10
11
|
* Extract information (if available) about the client browser's window, screen, and network speed.
|
|
11
12
|
*/
|
|
12
|
-
export function getClientDeviceInfo() {
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
13
|
+
export function getClientDeviceInfo(): ClientDeviceInfo {
|
|
14
|
+
const ret: ClientDeviceInfo = {
|
|
15
|
+
window: pick(window, [
|
|
16
|
+
'devicePixelRatio',
|
|
17
|
+
'screenX',
|
|
18
|
+
'screenY',
|
|
19
|
+
'innerWidth',
|
|
20
|
+
'innerHeight',
|
|
21
|
+
'outerWidth',
|
|
22
|
+
'outerHeight'
|
|
23
|
+
]),
|
|
24
|
+
memory: {
|
|
25
|
+
modelCount: XH.getModels().length
|
|
26
|
+
}
|
|
27
|
+
};
|
|
23
28
|
|
|
24
|
-
|
|
25
|
-
|
|
29
|
+
const screen = window.screen as any;
|
|
30
|
+
if (screen) {
|
|
31
|
+
ret.screen = pick(screen, [
|
|
26
32
|
'availWidth',
|
|
27
33
|
'availHeight',
|
|
28
34
|
'width',
|
|
@@ -30,23 +36,68 @@ export function getClientDeviceInfo() {
|
|
|
30
36
|
'colorDepth',
|
|
31
37
|
'pixelDepth',
|
|
32
38
|
'availLeft',
|
|
33
|
-
'availTop'
|
|
34
|
-
'orientation'
|
|
39
|
+
'availTop'
|
|
35
40
|
]);
|
|
36
|
-
if (
|
|
37
|
-
|
|
41
|
+
if (screen.orientation) {
|
|
42
|
+
ret.screen.orientation = pick(screen.orientation, ['angle', 'type']);
|
|
38
43
|
}
|
|
39
44
|
}
|
|
40
45
|
|
|
41
46
|
const nav = window.navigator as any;
|
|
42
47
|
if (nav.connection) {
|
|
43
|
-
|
|
48
|
+
ret.connection = pick(nav.connection, ['downlink', 'effectiveType', 'rtt']);
|
|
44
49
|
}
|
|
45
50
|
|
|
46
51
|
const perf = window.performance as any;
|
|
47
52
|
if (perf?.memory) {
|
|
48
|
-
|
|
53
|
+
['jsHeapSizeLimit', 'totalJSHeapSize', 'usedJSHeapSize'].forEach(key => {
|
|
54
|
+
const raw = perf.memory[key];
|
|
55
|
+
if (raw) ret.memory[key] = round(raw / 1024 / 1024); // convert to MB
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
const {jsHeapSizeLimit: limit, usedJSHeapSize: used} = ret.memory;
|
|
59
|
+
if (limit && used) {
|
|
60
|
+
ret.memory.usedPctLimit = round((used / limit) * 100, 1);
|
|
61
|
+
}
|
|
49
62
|
}
|
|
50
63
|
|
|
51
|
-
return
|
|
64
|
+
return ret;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export interface ClientDeviceInfo {
|
|
68
|
+
window: {
|
|
69
|
+
devicePixelRatio: number;
|
|
70
|
+
screenX: number;
|
|
71
|
+
screenY: number;
|
|
72
|
+
innerWidth: number;
|
|
73
|
+
innerHeight: number;
|
|
74
|
+
outerWidth: number;
|
|
75
|
+
outerHeight: number;
|
|
76
|
+
};
|
|
77
|
+
screen?: {
|
|
78
|
+
availWidth: number;
|
|
79
|
+
availHeight: number;
|
|
80
|
+
width: number;
|
|
81
|
+
height: number;
|
|
82
|
+
colorDepth: number;
|
|
83
|
+
pixelDepth: number;
|
|
84
|
+
availLeft: number;
|
|
85
|
+
availTop: number;
|
|
86
|
+
orientation?: {
|
|
87
|
+
angle: number;
|
|
88
|
+
type: string;
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
connection?: {
|
|
92
|
+
downlink: number;
|
|
93
|
+
effectiveType: string;
|
|
94
|
+
rtt: number;
|
|
95
|
+
};
|
|
96
|
+
memory: {
|
|
97
|
+
modelCount: number;
|
|
98
|
+
usedPctLimit?: number;
|
|
99
|
+
jsHeapSizeLimit?: number;
|
|
100
|
+
totalJSHeapSize?: number;
|
|
101
|
+
usedJSHeapSize?: number;
|
|
102
|
+
};
|
|
52
103
|
}
|
|
@@ -97,7 +97,8 @@ const dimKeys = [
|
|
|
97
97
|
'maxHeight',
|
|
98
98
|
'width',
|
|
99
99
|
'minWidth',
|
|
100
|
-
'maxWidth'
|
|
100
|
+
'maxWidth',
|
|
101
|
+
'gap'
|
|
101
102
|
];
|
|
102
103
|
const flexKeys = ['flex', 'flexBasis', 'flexDirection', 'flexGrow', 'flexShrink', 'flexWrap'];
|
|
103
104
|
const alignKeys = ['alignItems', 'alignSelf', 'alignContent', 'justifyContent'];
|