mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-05 18:40:52 +08:00
feat: last run struct
This commit is contained in:
parent
079d0f786d
commit
cd675651d8
@ -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 />
|
||||
|
@ -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>
|
||||
)
|
||||
}
|
||||
|
@ -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}
|
||||
|
Loading…
x
Reference in New Issue
Block a user