Skip to content

Commit 645d1a8

Browse files
committed
Bettern ACL error message in the overview tab
1 parent 3df5377 commit 645d1a8

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

frontend/src/components/pages/overview/Overview.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ import {
3333
Skeleton,
3434
Text,
3535
Tooltip,
36+
Alert,
37+
AlertIcon,
38+
AlertDescription,
3639
} from '@redpanda-data/ui';
3740
import type { Row } from '@tanstack/react-table';
3841
import React, { type FC, type ReactNode } from 'react';
@@ -321,7 +324,7 @@ function ClusterDetails() {
321324

322325
const serviceAccounts = overview.redpanda?.userCount ?? 'Admin API not configured';
323326

324-
const aclCount = overview.kafkaAuthorizerInfo?.aclCount ?? 'Authorizer not configured';
327+
const aclCount = overview.kafkaAuthorizerInfo ? overview.kafkaAuthorizerInfo.aclCount : (overview.kafkaAuthorizerError?.message ?? 'Authorizer not configured');
325328

326329
const formatStatus = (overviewStatus?: ComponentStatus): React.ReactNode => {
327330
if (!overviewStatus) {
@@ -394,7 +397,7 @@ function ClusterDetails() {
394397
title="ACLs"
395398
content={[
396399
[
397-
<Link key={0} as={ReactRouterLink} to="/security/acls/">
400+
<Link key={0} as={ReactRouterLink} to="/security/acls/" wordBreak="break-word">
398401
{aclCount}
399402
</Link>,
400403
],

frontend/src/state/backendApi.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ import {
163163
import type { TransformMetadata } from '../protogen/redpanda/api/dataplane/v1alpha2/transform_pb';
164164
import { Features } from './supportedFeatures';
165165
import { PartitionOffsetOrigin } from './ui';
166+
import { log } from 'console';
166167

167168
const REST_TIMEOUT_SEC = 25;
168169
export const REST_CACHE_DURATION_SEC = 20;
@@ -370,7 +371,15 @@ const apiStore = {
370371
// Data
371372
endpointCompatibility: null as EndpointCompatibility | null,
372373

373-
clusterOverview: null as ClusterOverview | null,
374+
clusterOverview: {
375+
kafkaAuthorizerInfo: null,
376+
kafkaAuthorizerError: null,
377+
kafka: null,
378+
redpanda: null,
379+
console: null,
380+
kafkaConnect: null,
381+
schemaRegistry: null,
382+
} as ClusterOverview,
374383
brokers: null as BrokerWithConfigAndStorage[] | null,
375384

376385
clusters: ['A', 'B', 'C'],
@@ -855,6 +864,7 @@ const apiStore = {
855864

856865
const requests: Array<Promise<any>> = [
857866
client.getKafkaAuthorizerInfo({}).catch((e) => {
867+
this.clusterOverview.kafkaAuthorizerError = e;
858868
console.error(e);
859869
return null;
860870
}),
@@ -898,6 +908,7 @@ const apiStore = {
898908
] = responses;
899909

900910
this.clusterOverview = {
911+
...this.clusterOverview,
901912
kafkaAuthorizerInfo: kafkaAuthorizerInfoResponse,
902913
console: consoleInfoResponse,
903914
kafka: kafkaResponse,

0 commit comments

Comments
 (0)