From a430284aa21e3ae1f0d5654e55b2ad2852519cc2 Mon Sep 17 00:00:00 2001 From: wwf <yearningwang@iqtogether.com> Date: 星期三, 04 六月 2025 15:17:49 +0800 Subject: [PATCH] 初始化 --- app/components/app/workflow-log/filter.tsx | 31 +------------------------------ 1 files changed, 1 insertions(+), 30 deletions(-) diff --git a/app/components/app/workflow-log/filter.tsx b/app/components/app/workflow-log/filter.tsx index f60e1f9..466e9b8 100644 --- a/app/components/app/workflow-log/filter.tsx +++ b/app/components/app/workflow-log/filter.tsx @@ -2,27 +2,9 @@ import type { FC } from 'react' import React from 'react' import { useTranslation } from 'react-i18next' -import dayjs from 'dayjs' -import { RiCalendarLine } from '@remixicon/react' -import quarterOfYear from 'dayjs/plugin/quarterOfYear' import type { QueryParam } from './index' import Chip from '@/app/components/base/chip' import Input from '@/app/components/base/input' -dayjs.extend(quarterOfYear) - -const today = dayjs() - -export const TIME_PERIOD_MAPPING: { [key: string]: { value: number; name: string } } = { - 1: { value: 0, name: 'today' }, - 2: { value: 7, name: 'last7days' }, - 3: { value: 28, name: 'last4weeks' }, - 4: { value: today.diff(today.subtract(3, 'month'), 'day'), name: 'last3months' }, - 5: { value: today.diff(today.subtract(12, 'month'), 'day'), name: 'last12months' }, - 6: { value: today.diff(today.startOf('month'), 'day'), name: 'monthToDate' }, - 7: { value: today.diff(today.startOf('quarter'), 'day'), name: 'quarterToDate' }, - 8: { value: today.diff(today.startOf('year'), 'day'), name: 'yearToDate' }, - 9: { value: -1, name: 'allTime' }, -} type IFilterProps = { queryParams: QueryParam @@ -32,7 +14,7 @@ const Filter: FC<IFilterProps> = ({ queryParams, setQueryParams }: IFilterProps) => { const { t } = useTranslation() return ( - <div className='mb-2 flex flex-row flex-wrap gap-2'> + <div className='flex flex-row flex-wrap gap-2 mb-2'> <Chip value={queryParams.status || 'all'} onSelect={(item) => { @@ -44,17 +26,6 @@ { value: 'failed', name: 'Fail' }, { value: 'stopped', name: 'Stop' }, ]} - /> - <Chip - className='min-w-[150px]' - panelClassName='w-[270px]' - leftIcon={<RiCalendarLine className='h-4 w-4 text-text-secondary' />} - value={queryParams.period} - onSelect={(item) => { - setQueryParams({ ...queryParams, period: item.value }) - }} - onClear={() => setQueryParams({ ...queryParams, period: '9' })} - items={Object.entries(TIME_PERIOD_MAPPING).map(([k, v]) => ({ value: k, name: t(`appLog.filter.period.${v.name}`) }))} /> <Input wrapperClassName='w-[200px]' -- Gitblit v1.8.0