fix: pvc events api

This commit is contained in:
jialin
2026-05-26 19:16:50 +08:00
committed by jialin
parent c6e34db329
commit 7f14eb544c
13 changed files with 51 additions and 41 deletions
@@ -162,7 +162,7 @@ const InstanceTypeItem: React.FC<InstanceTypeItemProps> = ({ item }) => {
show={!!remainingData.cpu}
showDot={true}
icon="icon-cpu"
label="vCPU"
label="CPU"
value={remainingData.cpu ?? '-'}
></MetaItem>
</span>
@@ -18,6 +18,7 @@ type ViewEventsModalProps = {
open: boolean;
name: string;
namespace: string;
volumeName?: string;
clusterID?: number;
hasPersistentVolume?: boolean;
onCancel: () => void;
@@ -32,8 +33,15 @@ const eventTypeStatus: Record<string, 'success' | 'warning' | 'error'> = {
const ViewEventsModal: React.FC<ViewEventsModalProps> = (props) => {
const intl = useIntl();
const { open, onCancel, name, namespace, clusterID, hasPersistentVolume } =
props || {};
const {
open,
onCancel,
name,
namespace,
clusterID,
volumeName,
hasPersistentVolume
} = props || {};
const [activeKey, setActiveKey] = useState('instance');
const {
@@ -57,7 +65,7 @@ const ViewEventsModal: React.FC<ViewEventsModalProps> = (props) => {
if (!name || !namespace || !clusterID) return;
fetchInstanceEvents({ name, namespace, clusterID });
if (hasPersistentVolume) {
fetchVolumeEvents({ name, namespace, clusterID });
fetchVolumeEvents({ name: volumeName || '', namespace, clusterID });
}
};
@@ -206,7 +214,10 @@ const ViewEventsModal: React.FC<ViewEventsModalProps> = (props) => {
return (
<ScrollerModal
title={
<span className="flex flex-center" style={{ gap: 8 }}>
<span
className="flex flex-center"
style={{ gap: 8, paddingInline: 24 }}
>
<span style={{ fontWeight: 'var(--font-weight-bold)' }}>
{intl.formatMessage({ id: 'common.button.viewevent' })}
</span>
@@ -232,6 +243,9 @@ const ViewEventsModal: React.FC<ViewEventsModalProps> = (props) => {
styles={{
wrapper: {
borderRadius: 0
},
container: {
paddingInline: 0
}
}}
width="1000px"