Skip to content

Commit

Permalink
support-devops-card-checkstyle
Browse files Browse the repository at this point in the history
  • Loading branch information
Zzm0809 committed Dec 20, 2023
1 parent 13ab4b5 commit b063ccd
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,17 @@ type StatisticsCardParams = {
extra?: any;
divider?: boolean;
atClick?: () => void;
isChecked?: boolean; // 是否选中
};
const StatisticsCard = (props: StatisticsCardParams) => {
const { title, value, icon, extra = <></>, divider = true, link, atClick } = props;
const { title, value,isChecked= false, icon, extra = <></>, divider = true, link, atClick } = props;
return (
<>
<ProCard layout={'center'} onClick={() => (atClick ? atClick() : {})} hoverable={true}>
<ProCard
checked={isChecked} boxShadow={isChecked}
layout={'center'} onClick={() => (atClick ? atClick() : {})}
hoverable={true}
>
<Space size={20}>
{icon}
<Space direction='vertical'>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ const JobOverview = (props: any) => {
atClick={() => {
setStatusFilter(undefined);
}}
isChecked={!statusFilter}
extra={
<Space direction='vertical'>
<Button type={'text'} icon={<BatchIcons size={20} />}>
Expand All @@ -85,6 +86,7 @@ const JobOverview = (props: any) => {
atClick={() => {
setStatusFilter(JOB_STATUS.RUNNING);
}}
isChecked={statusFilter === JOB_STATUS.RUNNING}
/>
<StatisticsCard
title={l('devops.joblist.status.cancelled')}
Expand All @@ -93,6 +95,7 @@ const JobOverview = (props: any) => {
atClick={() => {
setStatusFilter(JOB_STATUS.CANCELED);
}}
isChecked={statusFilter === JOB_STATUS.CANCELED}
/>
<StatisticsCard
title={l('devops.joblist.status.failed')}
Expand All @@ -101,6 +104,7 @@ const JobOverview = (props: any) => {
atClick={() => {
setStatusFilter(JOB_STATUS.FAILED);
}}
isChecked={statusFilter === JOB_STATUS.FAILED}
/>
<StatisticsCard
title={l('devops.joblist.status.restarting')}
Expand All @@ -109,6 +113,7 @@ const JobOverview = (props: any) => {
atClick={() => {
setStatusFilter(JOB_STATUS.RESTARTING);
}}
isChecked={statusFilter === JOB_STATUS.RESTARTING}
/>
<StatisticsCard
title={l('devops.joblist.status.finished')}
Expand All @@ -117,6 +122,7 @@ const JobOverview = (props: any) => {
atClick={() => {
setStatusFilter(JOB_STATUS.FINISHED);
}}
isChecked={statusFilter === JOB_STATUS.FINISHED}
/>
<StatisticsCard
title={l('devops.joblist.status.unknown')}
Expand All @@ -126,6 +132,7 @@ const JobOverview = (props: any) => {
atClick={() => {
setStatusFilter(JOB_STATUS.UNKNOWN);
}}
isChecked={statusFilter === JOB_STATUS.UNKNOWN}
/>
</ProCard>
</Col>
Expand Down

0 comments on commit b063ccd

Please sign in to comment.