@centreon/ui-context 25.11.2 → 26.3.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/package.json +1 -1
- package/src/acknowledgementAtom.ts +3 -5
- package/src/aclAtom.ts +3 -5
- package/src/additionalResources.ts +2 -2
- package/src/browserLocaleAtom.ts +1 -1
- package/src/cloudServicesAtom.ts +1 -1
- package/src/defaults.ts +45 -45
- package/src/downtimeAtom.ts +3 -5
- package/src/federatedModulesAndWidgetsAtoms.ts +2 -2
- package/src/index.ts +36 -40
- package/src/isOnPublicPageAtom.ts +1 -1
- package/src/isResourceStatusFullSearchEnabledAtom.ts +1 -1
- package/src/platformFeauresAtom.ts +6 -6
- package/src/platformNameAtom.ts +1 -1
- package/src/platformVersionsAtom.ts +2 -2
- package/src/refreshIntervalAtom.ts +2 -2
- package/src/resourceStorageOptimizationMode.ts +3 -3
- package/src/statisticsRefreshIntervalAtom.ts +2 -2
- package/src/types.ts +84 -84
- package/src/userAtom.ts +3 -5
- package/src/userPermissionsAtom.ts +2 -2
package/package.json
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import { atom } from
|
|
2
|
-
|
|
3
|
-
import { defaultAcknowledgement } from
|
|
4
|
-
|
|
5
|
-
import { Acknowledgement } from '.';
|
|
1
|
+
import { atom } from "jotai";
|
|
2
|
+
import type { Acknowledgement } from ".";
|
|
3
|
+
import { defaultAcknowledgement } from "./defaults";
|
|
6
4
|
|
|
7
5
|
const acknowledgementAtom = atom<Acknowledgement>(defaultAcknowledgement);
|
|
8
6
|
|
package/src/aclAtom.ts
CHANGED
package/src/browserLocaleAtom.ts
CHANGED
package/src/cloudServicesAtom.ts
CHANGED
package/src/defaults.ts
CHANGED
|
@@ -1,64 +1,64 @@
|
|
|
1
|
-
import { ListingVariant, ThemeMode, User } from
|
|
1
|
+
import { ListingVariant, ThemeMode, type User } from "./types";
|
|
2
2
|
|
|
3
3
|
const defaultUser: User = {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
4
|
+
alias: "",
|
|
5
|
+
canManageApiTokens: false,
|
|
6
|
+
default_page: "/monitoring/resources",
|
|
7
|
+
id: undefined,
|
|
8
|
+
isAdmin: undefined,
|
|
9
|
+
isExportButtonEnabled: false,
|
|
10
|
+
locale: null,
|
|
11
|
+
name: "",
|
|
12
|
+
themeMode: ThemeMode.light,
|
|
13
|
+
timezone: Intl.DateTimeFormat().resolvedOptions().timeZone,
|
|
14
|
+
use_deprecated_pages: false,
|
|
15
|
+
user_interface_density: ListingVariant.compact,
|
|
16
16
|
};
|
|
17
17
|
|
|
18
18
|
const defaultResourceStorageOptimizationMode = false;
|
|
19
19
|
|
|
20
20
|
const defaultAcl = {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
21
|
+
actions: {
|
|
22
|
+
host: {
|
|
23
|
+
acknowledgement: false,
|
|
24
|
+
check: false,
|
|
25
|
+
comment: false,
|
|
26
|
+
disacknowledgement: false,
|
|
27
|
+
downtime: false,
|
|
28
|
+
submit_status: false,
|
|
29
|
+
},
|
|
30
|
+
service: {
|
|
31
|
+
acknowledgement: false,
|
|
32
|
+
check: false,
|
|
33
|
+
comment: false,
|
|
34
|
+
disacknowledgement: false,
|
|
35
|
+
downtime: false,
|
|
36
|
+
submit_status: false,
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
39
|
};
|
|
40
40
|
|
|
41
41
|
const defaultDowntime = {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
duration: 3600,
|
|
43
|
+
fixed: true,
|
|
44
|
+
with_services: false,
|
|
45
45
|
};
|
|
46
46
|
|
|
47
47
|
const defaultRefreshInterval = 15;
|
|
48
48
|
|
|
49
49
|
const defaultAcknowledgement = {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
50
|
+
force_active_checks: false,
|
|
51
|
+
notify: true,
|
|
52
|
+
persistent: false,
|
|
53
|
+
sticky: false,
|
|
54
|
+
with_services: true,
|
|
55
55
|
};
|
|
56
56
|
|
|
57
57
|
export {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
58
|
+
defaultUser,
|
|
59
|
+
defaultAcl,
|
|
60
|
+
defaultDowntime,
|
|
61
|
+
defaultRefreshInterval,
|
|
62
|
+
defaultAcknowledgement,
|
|
63
|
+
defaultResourceStorageOptimizationMode,
|
|
64
64
|
};
|
package/src/downtimeAtom.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import { atom } from
|
|
2
|
-
|
|
3
|
-
import { defaultDowntime } from
|
|
4
|
-
|
|
5
|
-
import { Downtime } from '.';
|
|
1
|
+
import { atom } from "jotai";
|
|
2
|
+
import type { Downtime } from ".";
|
|
3
|
+
import { defaultDowntime } from "./defaults";
|
|
6
4
|
|
|
7
5
|
const downtimeAtom = atom<Downtime>(defaultDowntime);
|
|
8
6
|
|
package/src/index.ts
CHANGED
|
@@ -1,43 +1,39 @@
|
|
|
1
|
-
export { default as
|
|
2
|
-
export { default as aclAtom } from
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
5
|
-
export { default as
|
|
6
|
-
export { default as
|
|
7
|
-
export { default as acknowledgementAtom } from './acknowledgementAtom';
|
|
8
|
-
export { default as resourceStorageOptimizationModeAtom } from './resourceStorageOptimizationMode';
|
|
9
|
-
export { default as platformNameAtom } from './platformNameAtom';
|
|
10
|
-
export { default as userPermissionsAtom } from './userPermissionsAtom';
|
|
11
|
-
|
|
12
|
-
export { ThemeMode, ListingVariant, DashboardGlobalRole } from './types';
|
|
1
|
+
export { default as acknowledgementAtom } from "./acknowledgementAtom";
|
|
2
|
+
export { default as aclAtom } from "./aclAtom";
|
|
3
|
+
export { additionalResourcesAtom } from "./additionalResources";
|
|
4
|
+
export { browserLocaleAtom } from "./browserLocaleAtom";
|
|
5
|
+
export { default as cloudServicesAtom } from "./cloudServicesAtom";
|
|
6
|
+
export { default as downtimeAtom } from "./downtimeAtom";
|
|
13
7
|
export {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
} from
|
|
17
|
-
|
|
18
|
-
export {
|
|
19
|
-
|
|
20
|
-
export { isOnPublicPageAtom } from './isOnPublicPageAtom';
|
|
21
|
-
export { additionalResourcesAtom } from './additionalResources';
|
|
8
|
+
federatedModulesAtom,
|
|
9
|
+
federatedWidgetsAtom,
|
|
10
|
+
} from "./federatedModulesAndWidgetsAtoms";
|
|
11
|
+
export { isOnPublicPageAtom } from "./isOnPublicPageAtom";
|
|
12
|
+
export { isResourceStatusFullSearchEnabledAtom } from "./isResourceStatusFullSearchEnabledAtom";
|
|
22
13
|
export {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
} from
|
|
26
|
-
export {
|
|
27
|
-
export {
|
|
28
|
-
|
|
14
|
+
featureFlagsDerivedAtom,
|
|
15
|
+
platformFeaturesAtom,
|
|
16
|
+
} from "./platformFeauresAtom";
|
|
17
|
+
export { default as platformNameAtom } from "./platformNameAtom";
|
|
18
|
+
export { platformVersionsAtom } from "./platformVersionsAtom";
|
|
19
|
+
export { default as refreshIntervalAtom } from "./refreshIntervalAtom";
|
|
20
|
+
export { default as resourceStorageOptimizationModeAtom } from "./resourceStorageOptimizationMode";
|
|
21
|
+
export { default as statisticsRefreshIntervalAtom } from "./statisticsRefreshIntervalAtom";
|
|
29
22
|
export type {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
} from
|
|
23
|
+
Acknowledgement,
|
|
24
|
+
Acl,
|
|
25
|
+
ActionAcl,
|
|
26
|
+
Actions,
|
|
27
|
+
AdditionalResource,
|
|
28
|
+
CloudServices,
|
|
29
|
+
DashboardRolesAndPermissions,
|
|
30
|
+
Downtime,
|
|
31
|
+
FeatureFlags,
|
|
32
|
+
PlatformFeatures,
|
|
33
|
+
User,
|
|
34
|
+
UserContext,
|
|
35
|
+
UserPermissions,
|
|
36
|
+
} from "./types";
|
|
37
|
+
export { DashboardGlobalRole, ListingVariant, ThemeMode } from "./types";
|
|
38
|
+
export { default as userAtom } from "./userAtom";
|
|
39
|
+
export { default as userPermissionsAtom } from "./userPermissionsAtom";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { atom } from
|
|
1
|
+
import { atom } from "jotai";
|
|
2
2
|
|
|
3
|
-
import { FeatureFlags, PlatformFeatures } from
|
|
3
|
+
import type { FeatureFlags, PlatformFeatures } from "./types";
|
|
4
4
|
|
|
5
5
|
export const platformFeaturesAtom = atom<PlatformFeatures | null>(null);
|
|
6
6
|
export const featureFlagsDerivedAtom = atom<FeatureFlags | null>(
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
(get): FeatureFlags => {
|
|
8
|
+
const platformFeatures = get(platformFeaturesAtom);
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
return platformFeatures?.featureFlags as FeatureFlags;
|
|
11
|
+
},
|
|
12
12
|
);
|
package/src/platformNameAtom.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { atom } from
|
|
1
|
+
import { atom } from "jotai";
|
|
2
2
|
|
|
3
|
-
import { defaultResourceStorageOptimizationMode } from
|
|
3
|
+
import { defaultResourceStorageOptimizationMode } from "./defaults";
|
|
4
4
|
|
|
5
5
|
const resourceStorageOptimizationModeAtom = atom(
|
|
6
|
-
|
|
6
|
+
defaultResourceStorageOptimizationMode,
|
|
7
7
|
);
|
|
8
8
|
|
|
9
9
|
export default resourceStorageOptimizationModeAtom;
|
package/src/types.ts
CHANGED
|
@@ -1,147 +1,147 @@
|
|
|
1
|
-
import type { Dispatch, SetStateAction } from
|
|
1
|
+
import type { Dispatch, SetStateAction } from "react";
|
|
2
2
|
|
|
3
3
|
export enum ListingVariant {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
compact = "compact",
|
|
5
|
+
extended = "extended",
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
export enum DashboardGlobalRole {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
administrator = "administrator",
|
|
10
|
+
creator = "creator",
|
|
11
|
+
viewer = "viewer",
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
export interface DashboardRolesAndPermissions {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
createDashboards: boolean;
|
|
16
|
+
globalUserRole: DashboardGlobalRole;
|
|
17
|
+
manageAllDashboards: boolean;
|
|
18
|
+
viewDashboards: boolean;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
export interface User {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
22
|
+
alias: string;
|
|
23
|
+
canManageApiTokens: boolean;
|
|
24
|
+
dashboard?: DashboardRolesAndPermissions | null;
|
|
25
|
+
default_page?: string | null;
|
|
26
|
+
id?: number;
|
|
27
|
+
isAdmin?: boolean;
|
|
28
|
+
isExportButtonEnabled: boolean;
|
|
29
|
+
locale: string | null;
|
|
30
|
+
name: string;
|
|
31
|
+
themeMode?: ThemeMode;
|
|
32
|
+
timezone: string;
|
|
33
|
+
use_deprecated_pages: boolean;
|
|
34
|
+
user_interface_density: ListingVariant;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
export enum ThemeMode {
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
dark = "dark",
|
|
39
|
+
light = "light",
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
export interface CloudServices {
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
areCloudServicesEnabled: boolean;
|
|
44
|
+
setAreCloudServicesEnabled: Dispatch<SetStateAction<boolean>>;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
export interface Acknowledgement {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
48
|
+
force_active_checks: boolean;
|
|
49
|
+
notify: boolean;
|
|
50
|
+
persistent: boolean;
|
|
51
|
+
sticky: boolean;
|
|
52
|
+
with_services: boolean;
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
export type UserContext = {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
56
|
+
acknowledgement: Acknowledgement;
|
|
57
|
+
acl: Acl;
|
|
58
|
+
cloudServices: CloudServices | undefined;
|
|
59
|
+
downtime: Downtime;
|
|
60
|
+
refreshInterval: number;
|
|
61
|
+
resourceStorageOptimizationMode: boolean;
|
|
62
62
|
} & User;
|
|
63
63
|
|
|
64
64
|
export interface ActionAcl {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
65
|
+
acknowledgement: boolean;
|
|
66
|
+
check: boolean;
|
|
67
|
+
comment: boolean;
|
|
68
|
+
downtime: boolean;
|
|
69
|
+
submit_status: boolean;
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
export interface Actions {
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
host: ActionAcl;
|
|
74
|
+
service: ActionAcl;
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
export interface Acl {
|
|
78
|
-
|
|
78
|
+
actions: Actions;
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
export interface Downtime {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
82
|
+
duration: number;
|
|
83
|
+
fixed: boolean;
|
|
84
|
+
with_services: boolean;
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
export interface FeatureFlags {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
88
|
+
adExclusionPeriods?: boolean;
|
|
89
|
+
notification?: boolean;
|
|
90
|
+
vault?: boolean;
|
|
91
|
+
mapVisxViewer?: boolean;
|
|
92
92
|
}
|
|
93
93
|
|
|
94
94
|
export interface PlatformFeatures {
|
|
95
|
-
|
|
96
|
-
|
|
95
|
+
featureFlags: FeatureFlags;
|
|
96
|
+
isCloudPlatform: boolean;
|
|
97
97
|
}
|
|
98
98
|
|
|
99
99
|
export interface AdditionalResource {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
100
|
+
baseEndpoint: string;
|
|
101
|
+
defaultMonitoringParameter?: Record<string, boolean | number | string>;
|
|
102
|
+
label: string;
|
|
103
|
+
resourceType: string;
|
|
104
104
|
}
|
|
105
105
|
|
|
106
106
|
interface FederatedComponentsConfiguration {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
107
|
+
federatedComponents: Array<string>;
|
|
108
|
+
panelMinHeight?: number;
|
|
109
|
+
panelMinWidth?: number;
|
|
110
|
+
path: string;
|
|
111
|
+
title?: string;
|
|
112
112
|
}
|
|
113
113
|
|
|
114
114
|
interface PageComponent {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
115
|
+
children?: string;
|
|
116
|
+
component: string;
|
|
117
|
+
featureFlag?: string;
|
|
118
|
+
route: string;
|
|
119
119
|
}
|
|
120
120
|
|
|
121
121
|
export interface FederatedModule {
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
122
|
+
federatedComponentsConfiguration: Array<FederatedComponentsConfiguration>;
|
|
123
|
+
federatedPages: Array<PageComponent>;
|
|
124
|
+
moduleFederationName: string;
|
|
125
|
+
moduleName: string;
|
|
126
|
+
preloadScript?: string;
|
|
127
|
+
remoteEntry: string;
|
|
128
|
+
remoteUrl?: string;
|
|
129
129
|
}
|
|
130
130
|
|
|
131
131
|
interface Version {
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
132
|
+
fix: string;
|
|
133
|
+
major: string;
|
|
134
|
+
minor: string;
|
|
135
|
+
version: string;
|
|
136
136
|
}
|
|
137
137
|
|
|
138
138
|
export interface PlatformVersions {
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
139
|
+
modules: Record<string, Version>;
|
|
140
|
+
web: Version;
|
|
141
|
+
widgets: Record<string, Version | null>;
|
|
142
142
|
}
|
|
143
143
|
|
|
144
144
|
export interface UserPermissions {
|
|
145
|
-
|
|
146
|
-
|
|
145
|
+
top_counter: boolean;
|
|
146
|
+
poller_statistics: boolean;
|
|
147
147
|
}
|
package/src/userAtom.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import { atom } from
|
|
2
|
-
|
|
3
|
-
import { defaultUser } from
|
|
4
|
-
|
|
5
|
-
import { User } from '.';
|
|
1
|
+
import { atom } from "jotai";
|
|
2
|
+
import type { User } from ".";
|
|
3
|
+
import { defaultUser } from "./defaults";
|
|
6
4
|
|
|
7
5
|
const userAtom = atom<User>(defaultUser);
|
|
8
6
|
|