feat: last run struct

This commit is contained in:
Joel 2025-04-17 16:45:41 +08:00
parent 079d0f786d
commit cd675651d8
3 changed files with 9 additions and 2 deletions

View File

@ -106,7 +106,7 @@ const BasePanel: FC<BasePanelProps> = ({
}, [handleNodeDataUpdateWithSyncDraft, id, saveStateToHistory])
const [tabType, setTabType] = useState<TabType>(TabType.settings)
const hasLastRunData = true // TODO: add disabled logic
return (
<div className={cn(
'relative mr-2 h-full',
@ -176,6 +176,7 @@ const BasePanel: FC<BasePanelProps> = ({
<Tab
value={tabType}
onChange={setTabType}
canSwitchToLastRun={hasLastRunData}
/>
</div>
<Split />

View File

@ -1,4 +1,5 @@
'use client'
import ResultPanel from '@/app/components/workflow/run/result-panel'
import type { FC } from 'react'
import React from 'react'
@ -12,6 +13,9 @@ const LastRun: FC<Props> = ({
return (
<div>
last run: {appId}
<ResultPanel
status='success'
/>
</div>
)
}

View File

@ -12,18 +12,20 @@ export enum TabType {
type Props = {
value: TabType,
onChange: (value: TabType) => void
canSwitchToLastRun: boolean
}
const Tab: FC<Props> = ({
value,
onChange,
canSwitchToLastRun,
}) => {
const { t } = useTranslation()
return (
<TabHeader
items={[
{ id: TabType.settings, name: t('workflow.debug.settingsTab').toLocaleUpperCase() },
{ id: TabType.lastRun, name: t('workflow.debug.lastRunTab').toLocaleUpperCase(), disabled: true }, // TODO: add disabled logic
{ id: TabType.lastRun, name: t('workflow.debug.lastRunTab').toLocaleUpperCase(), disabled: !canSwitchToLastRun },
]}
itemClassName='ml-0'
value={value}