@yugabytedb/perf-advisor-ui 1.0.160 → 1.0.162

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/api.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { AxiosError, AxiosRequestConfig, AxiosResponse } from 'axios';
2
- import { Anomaly, AnomalyDetectionStatus, AnomalyGroup, BackgroundTasksResponse, ClusterLoadResponseData, MetadataFields, GraphRequestParams, QueryPlanData, QueryStatsPagedBody, ClusterDetails, IndexPagedResponse, MaterializedViewPagedResponse, TablePagedResponse } from './helpers/dtos';
2
+ import { Anomaly, AnomalyDetectionStatus, AnomalyGroup, BackgroundTasksResponse, ClusterLoadResponseData, MetadataFields, GraphRequestParams, QueryPlanData, QueryStatsPagedBody, ClusterDetails, IndexPagedResponse, MaterializedViewPagedResponse, TablePagedResponse, HaState, HaGroupRequest, HaPromoteRequest } from './helpers/dtos';
3
3
  export declare enum QUERY_KEY {
4
4
  fetchAnomalies = "fetchAnomalies",
5
5
  fetchGraphs = "fetchGraphs",
@@ -36,7 +36,9 @@ export declare enum QUERY_KEY {
36
36
  fetchClusterDetails = "fetchClusterDetails",
37
37
  fetchIndexesPage = "fetchIndexesPage",
38
38
  fetchTableMetadata = "fetchTableMetadata",
39
- fetchMaterializedViewMetadata = "fetchMaterializedViewMetadata"
39
+ fetchMaterializedViewMetadata = "fetchMaterializedViewMetadata",
40
+ fetchHaState = "fetchHaState",
41
+ fetchAppConfig = "fetchAppConfig"
40
42
  }
41
43
  export type { AxiosError, AxiosRequestConfig, AxiosResponse };
42
44
  export type PerfAdvisorRequestInterceptor = (config: AxiosRequestConfig) => AxiosRequestConfig | Promise<AxiosRequestConfig>;
@@ -120,5 +122,25 @@ declare class ApiService {
120
122
  fetchAnomalyGroupById: (universeUuid: string, anomalyGroupId: string, startTime: string, endTime: string, apiUrl?: string) => {};
121
123
  sendTelemetryEvent: (universeUuid: string, payload: any, apiUrl?: string) => Promise<any>;
122
124
  fetchClusterDetails: (universeUuid: string, startTime: string | null, endTime: string | null, apiUrl?: string) => Promise<any>;
125
+ fetchHaState: (apiUrl?: string) => Promise<HaState>;
126
+ applyHaGroup: (payload: HaGroupRequest, apiUrl?: string) => Promise<HaState>;
127
+ promoteHaMember: (payload: HaPromoteRequest, apiUrl?: string) => Promise<HaState>;
128
+ leaveHaGroup: (apiUrl?: string) => Promise<HaState>;
129
+ /**
130
+ * Leader-only "disband HA group" action. Routes through the backend's
131
+ * {@code HaService.disbandGroup()} which proactively fires {@code POST /api/ha/member/kick} at
132
+ * every remote follower before wiping its own {@code ha_group} / {@code ha_member} rows -
133
+ * followers therefore run their own CONFIG purge + COLLECTED cleanup synchronously instead of
134
+ * waiting up to a full follower-poll cycle to discover the eviction. If a follower is
135
+ * unreachable at disband time the leader logs it and proceeds; the follower will need to be
136
+ * cleaned up manually via its own "Leave HA group" button once it's back online.
137
+ *
138
+ * <p>On a non-leader caller the backend falls back to the plain {@code leave()} path so this
139
+ * endpoint stays idempotent from the UI regardless of which side of the group the operator
140
+ * clicks it on. The UI still prefers to hide this affordance behind an explicit "leader
141
+ * disband" button so the copy can call out the kick-fan-out behaviour.
142
+ */
143
+ deleteHaGroup: (apiUrl?: string) => Promise<HaState>;
144
+ restartHaBootstrap: (apiUrl?: string) => Promise<HaState>;
123
145
  }
124
146
  export declare const PerfAdvisorAPI: ApiService;
@@ -0,0 +1,38 @@
1
+ import { HaMemberState } from '../../helpers/dtos';
2
+ interface HaMembersTableProps {
3
+ members: HaMemberState[];
4
+ leaderMemberUuid?: string;
5
+ /**
6
+ * Whether the local PA is the current group leader. Historically we used this to hide the
7
+ * Promote button on standbys; now the button is enabled on both roles because operators may
8
+ * need to promote *this* standby when the active PA is down and unreachable. The button is
9
+ * still disabled per-row for anything other than a READY member so an in-flight bootstrap
10
+ * doesn't get promoted mid-catch-up (see {@link HaMemberLifecycleState}).
11
+ */
12
+ localIsLeader: boolean;
13
+ localMemberUuid?: string;
14
+ promoting?: string;
15
+ /**
16
+ * Promote request handler. The optional {@code force} parameter is true only when the
17
+ * "Force Promote" dialog was confirmed on a STALE_CONFIG row - the backend uses it to
18
+ * bypass the version-order and STALE_CONFIG promote gates. Defaults to false / undefined
19
+ * on the normal Promote button which keeps every existing caller working unchanged.
20
+ */
21
+ onPromote: (memberUuid: string, force?: boolean) => void;
22
+ /**
23
+ * "Retry Bootstrap" affordance for the local follower. Rendered next to the Promote button on
24
+ * the local row when its state is FAILED (bootstrap retry budget exhausted) so an operator
25
+ * can un-stick the follower without shelling into the box. Undefined on the leader UI and on
26
+ * peer rows - retry is a local-only recovery action; nobody can (or should) restart another
27
+ * PA's bootstrap remotely.
28
+ */
29
+ onRetryBootstrap?: () => void;
30
+ /**
31
+ * Set to {@code true} while the {@code POST /api/ha/member/bootstrap/restart} call is
32
+ * inflight. Disables the button and swaps the label to a "Retrying…" spinner so the
33
+ * operator can't double-click and stack requests.
34
+ */
35
+ retryingBootstrap?: boolean;
36
+ }
37
+ export declare const HaMembersTable: ({ members, leaderMemberUuid, localIsLeader, localMemberUuid, promoting, onPromote, onRetryBootstrap, retryingBootstrap }: HaMembersTableProps) => JSX.Element;
38
+ export {};
@@ -0,0 +1,27 @@
1
+ import { HaGroupMode, HaMemberSpec, HaState } from '../../helpers/dtos';
2
+ interface HaSetupDialogProps {
3
+ open: boolean;
4
+ apiUrl: string;
5
+ onClose: () => void;
6
+ onApplied: (next: HaState) => void;
7
+ toast: {
8
+ success: (message: string) => void;
9
+ error: (message: string) => void;
10
+ };
11
+ /**
12
+ * Optional starting members. When editing an existing group we prefill the form so operators can
13
+ * add or remove a peer without retyping everything. The local member is identified by
14
+ * {@link HaMemberSpec.isLocal}.
15
+ */
16
+ initialMembers?: HaMemberSpec[];
17
+ initialGroupUuid?: string;
18
+ initialClusterKey?: string;
19
+ /**
20
+ * When editing, the caller passes the local PA's current role so the dialog opens in the
21
+ * matching mode and locks the toggle (mode switches are not a control-plane operation the setup
22
+ * dialog is authorised to perform - use promote / leave for that).
23
+ */
24
+ initialMode?: HaGroupMode;
25
+ }
26
+ export declare const HaSetupDialog: ({ open, apiUrl, onClose, onApplied, toast, initialMembers, initialGroupUuid, initialClusterKey, initialMode }: HaSetupDialogProps) => JSX.Element;
27
+ export {};
@@ -0,0 +1,11 @@
1
+ import { AppName, HaMemberRole } from '../../helpers/dtos';
2
+ interface HighAvailabilityProps {
3
+ apiUrl: string;
4
+ appName: AppName;
5
+ toast: {
6
+ success: (message: string) => void;
7
+ error: (message: string) => void;
8
+ };
9
+ }
10
+ export declare const HighAvailability: ({ apiUrl, appName, toast }: HighAvailabilityProps) => JSX.Element;
11
+ export { HaMemberRole };
@@ -0,0 +1,28 @@
1
+ /// <reference types="react" />
2
+ interface StandbyBannerProps {
3
+ /**
4
+ * Optional API URL prefix. Must match the value the host app passes to other PA entry points
5
+ * (e.g. {@code PerfAdvisorEntry}); mismatched values would cause the banner to poll a
6
+ * different backend than the mutation buttons themselves, opening a "banner hidden but
7
+ * server refuses" gap on the affected page.
8
+ */
9
+ apiUrl?: string;
10
+ }
11
+ /**
12
+ * Persistent banner rendered at the top of every top-level PA entry point when the current PA
13
+ * is a HA standby. Signals to the operator:
14
+ *
15
+ * <ul>
16
+ * <li>They are on a read-only PA. Any mutation they attempt will be refused server-side
17
+ * with a 409 CONFLICT (see {@code HaService.requireLeaderOrStandalone}).
18
+ * <li>Where to go to make the change: a link to the current active PA's endpoint, when
19
+ * we know it. When we don't (leader row missing an endpoint, or leader currently
20
+ * elected but not addressable), the banner degrades to a static warning.
21
+ * </ul>
22
+ *
23
+ * <p>Renders nothing when not on a standby - {@link useHaStandby} handles the loading and
24
+ * error states as "hide the banner", so this component is safe to include at the top of any
25
+ * entry point without gating it further.
26
+ */
27
+ export declare const StandbyBanner: ({ apiUrl }: StandbyBannerProps) => JSX.Element | null;
28
+ export {};
@@ -6,5 +6,8 @@ export * from './PrimaryDashboard/DbCPUActivity/CPUByDatabaseChart';
6
6
  export * from './PrimaryDashboard/DbCPUActivity/CPUByDatabaseMetadata';
7
7
  export * from './ConfigureUniverse/ConfigureUniverseMetadata';
8
8
  export * from './RuntimeConfigs/RuntimeConfigs';
9
+ export * from './HighAvailability/HighAvailability';
10
+ export * from './HighAvailability/StandbyBanner';
9
11
  export * from '../helpers/dtos';
12
+ export * from '../helpers/useHaStandby';
10
13
  export * from '../api';