Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions frontend/src/components/license/license-notification.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Alert, AlertDescription, AlertIcon, Box, Button, Flex } from '@redpanda-data/ui';
import { Link, useLocation } from '@tanstack/react-router';
import { useEffect } from 'react';
import { useStore } from 'zustand';

import {
coreHasEnterpriseFeatures,
Expand All @@ -13,15 +12,15 @@ import {
prettyLicenseType,
} from './license-utils';
import { License_Source, License_Type } from '../../protogen/redpanda/api/console/v1alpha1/license_pb';
import { api, useApiStore } from '../../state/backend-api';
import { api, useApiStoreHook } from '../../state/backend-api';
import { capitalizeFirst } from '../../utils/utils';

// biome-ignore lint/complexity/noExcessiveCognitiveComplexity: complex business logic
export const LicenseNotification = () => {
const licenses = useStore(useApiStore, (s) => s.licenses);
const licensesLoaded = useStore(useApiStore, (s) => s.licensesLoaded);
const licenseViolation = useStore(useApiStore, (s) => s.licenseViolation);
const enterpriseFeaturesUsed = useStore(useApiStore, (s) => s.enterpriseFeaturesUsed);
const licenses = useApiStoreHook((s) => s.licenses);
const licensesLoaded = useApiStoreHook((s) => s.licensesLoaded);
const licenseViolation = useApiStoreHook((s) => s.licenseViolation);
const enterpriseFeaturesUsed = useApiStoreHook((s) => s.enterpriseFeaturesUsed);
const location = useLocation();

useEffect(() => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Alert, AlertDescription, AlertIcon, Box, Flex, Text } from '@redpanda-data/ui';
import { Link } from 'components/redpanda-ui/components/typography';
import { type FC, type ReactElement, useEffect, useState } from 'react';
import { useStore } from 'zustand';

import {
consoleHasEnterpriseFeature,
Expand All @@ -20,7 +19,7 @@ import {
} from './license-utils';
import { RegisterModal } from './register-modal';
import { type License, License_Type } from '../../protogen/redpanda/api/console/v1alpha1/license_pb';
import { api, useApiStore } from '../../state/backend-api';
import { api, useApiStoreHook } from '../../state/backend-api';

const getLicenseAlertContent = (
licenses: License[],
Expand Down Expand Up @@ -255,8 +254,8 @@ const getLicenseAlertContent = (
};

export const OverviewLicenseNotification: FC = () => {
const licenses = useStore(useApiStore, (s) => s.licenses);
const clusterOverview = useStore(useApiStore, (s) => s.clusterOverview);
const licenses = useApiStoreHook((s) => s.licenses);
const clusterOverview = useApiStoreHook((s) => s.clusterOverview);
const [registerModalOpen, setIsRegisterModalOpen] = useState(false);

useEffect(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,30 @@ export const RemoteMCPLogsTab = () => {
() => Promise.resolve() // No need to load large messages for this view
}
msg={original}
onDownloadRecord={() => {
const blob = new Blob(
[
JSON.stringify(
{
offset: original.offset,
key: original.keyJson,
value: original.valueJson,
timestamp: original.timestamp,
headers: original.headers,
},
null,
2
),
],
{ type: 'application/json' }
);
const url = URL.createObjectURL(blob);
const a = document.createElement('a');
a.href = url;
a.download = `mcp-log-${original.offset}.json`;
a.click();
URL.revokeObjectURL(url);
}}
/>
)}
/>
Expand Down
Loading