fix: improve schedule trigger and quick settings app-operation btns ui (#24843)

This commit is contained in:
lyzno1 2025-08-31 16:59:49 +08:00 committed by GitHub
parent c138f4c3a6
commit 9ed45594c6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 8 additions and 39 deletions

View File

@ -62,7 +62,7 @@ const AppOperations = ({ primaryOperations, secondaryOperations, gap }: {
key={operation.id}
size={'small'}
variant={'secondary'}
className="gap-[1px]"
className="gap-[1px] px-1.5"
onClick={operation.onClick}>
{cloneElement(operation.icon, { className: 'h-3.5 w-3.5 text-components-button-secondary-text' })}
<span className="system-xs-medium text-components-button-secondary-text">
@ -85,7 +85,7 @@ const AppOperations = ({ primaryOperations, secondaryOperations, gap }: {
<Button
size={'small'}
variant={'secondary'}
className='gap-1'
className='gap-1 px-1.5'
>
<RiMoreFill className='h-3.5 w-3.5 text-components-button-secondary-text' />
<span className='system-xs-medium text-components-button-secondary-text'>{t('common.operation.more')}</span>

View File

@ -1,24 +0,0 @@
import React from 'react'
import { useTranslation } from 'react-i18next'
type ExecuteNowButtonProps = {
onClick: () => void
disabled?: boolean
}
const ExecuteNowButton = ({ onClick, disabled = false }: ExecuteNowButtonProps) => {
const { t } = useTranslation()
return (
<button
type="button"
onClick={onClick}
disabled={disabled}
className="w-full rounded-lg border-[0.5px] border-components-button-secondary-border bg-components-button-secondary-bg py-1.5 text-xs font-medium text-components-button-secondary-text shadow-xs hover:bg-components-button-secondary-bg-hover disabled:cursor-not-allowed disabled:opacity-50"
>
{t('workflow.nodes.triggerSchedule.executeNow')}
</button>
)
}
export default ExecuteNowButton

View File

@ -23,13 +23,15 @@ const NextExecutionTimes = ({ data }: NextExecutionTimesProps) => {
<label className="block text-xs font-medium text-gray-500">
{t('workflow.nodes.triggerSchedule.nextExecutionTimes')}
</label>
<div className="space-y-2 rounded-lg bg-components-input-bg-normal p-3">
<div className="flex min-h-[80px] flex-col rounded-xl bg-components-input-bg-normal py-2">
{executionTimes.map((time, index) => (
<div key={index} className="flex items-baseline gap-3 text-xs text-text-secondary">
<span className="select-none font-mono leading-none text-text-quaternary">
<div key={index} className="flex items-baseline text-xs">
<span className="w-6 select-none text-right font-mono font-normal leading-[150%] tracking-wider text-text-quaternary">
{String(index + 1).padStart(2, '0')}
</span>
<span className="leading-none">{time}</span>
<span className="pl-2 pr-3 font-mono font-normal leading-[150%] tracking-wider text-text-secondary">
{time}
</span>
</div>
))}
</div>

View File

@ -10,7 +10,6 @@ import WeekdaySelector from './components/weekday-selector'
import TimePicker from '@/app/components/base/date-and-time-picker/time-picker'
import dayjs from 'dayjs'
import NextExecutionTimes from './components/next-execution-times'
import ExecuteNowButton from './components/execute-now-button'
import MonthlyDaysSelector from './components/monthly-days-selector'
import OnMinuteSelector from './components/on-minute-selector'
import Input from '@/app/components/base/input'
@ -34,11 +33,6 @@ const Panel: FC<NodePanelProps<ScheduleTriggerNodeType>> = ({
handleOnMinuteChange,
} = useConfig(id, data)
const handleExecuteNow = () => {
// TODO: Implement execute now functionality
console.log('Execute now clicked')
}
return (
<div className='mt-2'>
<div className='space-y-4 px-4 pb-3 pt-2'>
@ -146,9 +140,6 @@ const Panel: FC<NodePanelProps<ScheduleTriggerNodeType>> = ({
<NextExecutionTimes data={inputs} />
<div className="pt-2">
<ExecuteNowButton onClick={handleExecuteNow} />
</div>
</div>
</div>
)