diff --git a/web/app/(commonLayout)/deployments/[instanceId]/access/page.tsx b/web/app/(commonLayout)/deployments/[instanceId]/access/page.tsx index 0dd28ad177..f07526fbad 100644 --- a/web/app/(commonLayout)/deployments/[instanceId]/access/page.tsx +++ b/web/app/(commonLayout)/deployments/[instanceId]/access/page.tsx @@ -1,10 +1,8 @@ import { AccessTab } from '@/features/deployments/detail/access-tab' -type PageProps = { +export default async function InstanceDetailAccessPage({ params }: { params: Promise<{ instanceId: string }> -} - -export default async function InstanceDetailAccessPage({ params }: PageProps) { +}) { const { instanceId } = await params return } diff --git a/web/app/(commonLayout)/deployments/[instanceId]/deploy/page.tsx b/web/app/(commonLayout)/deployments/[instanceId]/deploy/page.tsx index dcf37c886b..d7ea2c2607 100644 --- a/web/app/(commonLayout)/deployments/[instanceId]/deploy/page.tsx +++ b/web/app/(commonLayout)/deployments/[instanceId]/deploy/page.tsx @@ -1,10 +1,8 @@ import { DeployTab } from '@/features/deployments/detail/deploy-tab' -type PageProps = { +export default async function InstanceDetailDeployPage({ params }: { params: Promise<{ instanceId: string }> -} - -export default async function InstanceDetailDeployPage({ params }: PageProps) { +}) { const { instanceId } = await params return } diff --git a/web/app/(commonLayout)/deployments/[instanceId]/layout.tsx b/web/app/(commonLayout)/deployments/[instanceId]/layout.tsx index 9f1f38adb8..993d922e0a 100644 --- a/web/app/(commonLayout)/deployments/[instanceId]/layout.tsx +++ b/web/app/(commonLayout)/deployments/[instanceId]/layout.tsx @@ -1,12 +1,10 @@ import type { ReactNode } from 'react' import { InstanceDetail } from '@/features/deployments/detail' -type LayoutProps = { +export default async function InstanceDetailLayout({ children, params }: { children: ReactNode params: Promise<{ instanceId: string }> -} - -export default async function InstanceDetailLayout({ children, params }: LayoutProps) { +}) { const { instanceId } = await params return ( diff --git a/web/app/(commonLayout)/deployments/[instanceId]/overview/page.tsx b/web/app/(commonLayout)/deployments/[instanceId]/overview/page.tsx index 33bc561080..45746f8a98 100644 --- a/web/app/(commonLayout)/deployments/[instanceId]/overview/page.tsx +++ b/web/app/(commonLayout)/deployments/[instanceId]/overview/page.tsx @@ -1,10 +1,8 @@ import { OverviewTab } from '@/features/deployments/detail/overview-tab' -type PageProps = { +export default async function InstanceDetailOverviewPage({ params }: { params: Promise<{ instanceId: string }> -} - -export default async function InstanceDetailOverviewPage({ params }: PageProps) { +}) { const { instanceId } = await params return } diff --git a/web/app/(commonLayout)/deployments/[instanceId]/page.tsx b/web/app/(commonLayout)/deployments/[instanceId]/page.tsx index cb88504e62..6638ffe058 100644 --- a/web/app/(commonLayout)/deployments/[instanceId]/page.tsx +++ b/web/app/(commonLayout)/deployments/[instanceId]/page.tsx @@ -1,10 +1,8 @@ import { redirect } from '@/next/navigation' -type PageProps = { +export default async function InstanceDetailPage({ params }: { params: Promise<{ instanceId: string }> -} - -export default async function InstanceDetailPage({ params }: PageProps) { +}) { const { instanceId } = await params redirect(`/deployments/${instanceId}/overview`) } diff --git a/web/app/(commonLayout)/deployments/[instanceId]/settings/page.tsx b/web/app/(commonLayout)/deployments/[instanceId]/settings/page.tsx index bf6fe1083c..b3b5ca4faa 100644 --- a/web/app/(commonLayout)/deployments/[instanceId]/settings/page.tsx +++ b/web/app/(commonLayout)/deployments/[instanceId]/settings/page.tsx @@ -1,10 +1,8 @@ import { SettingsTab } from '@/features/deployments/detail/settings-tab' -type PageProps = { +export default async function InstanceDetailSettingsPage({ params }: { params: Promise<{ instanceId: string }> -} - -export default async function InstanceDetailSettingsPage({ params }: PageProps) { +}) { const { instanceId } = await params return } diff --git a/web/app/(commonLayout)/deployments/[instanceId]/versions/page.tsx b/web/app/(commonLayout)/deployments/[instanceId]/versions/page.tsx index 92c9d06025..ed176b1a64 100644 --- a/web/app/(commonLayout)/deployments/[instanceId]/versions/page.tsx +++ b/web/app/(commonLayout)/deployments/[instanceId]/versions/page.tsx @@ -1,10 +1,8 @@ import { VersionsTab } from '@/features/deployments/detail/versions-tab' -type PageProps = { +export default async function InstanceDetailVersionsPage({ params }: { params: Promise<{ instanceId: string }> -} - -export default async function InstanceDetailVersionsPage({ params }: PageProps) { +}) { const { instanceId } = await params return } diff --git a/web/features/deployments/components/create-instance-modal.tsx b/web/features/deployments/components/create-instance-modal.tsx index bd2635fc5b..f18f9e78c6 100644 --- a/web/features/deployments/components/create-instance-modal.tsx +++ b/web/features/deployments/components/create-instance-modal.tsx @@ -203,11 +203,9 @@ export function AppPicker({ apps, isLoading, value, onChange }: AppPickerProps) ) } -type CreateInstanceFormProps = { +function CreateInstanceForm({ onClose }: { onClose: () => void -} - -function CreateInstanceForm({ onClose }: CreateInstanceFormProps) { +}) { const { t } = useTranslation('deployments') const router = useRouter() const createInstance = useMutation(consoleQuery.enterprise.appDeploy.createAppInstance.mutationOptions()) diff --git a/web/features/deployments/components/deploy-drawer/select.tsx b/web/features/deployments/components/deploy-drawer/select.tsx index e646e2e635..a80bc3c70f 100644 --- a/web/features/deployments/components/deploy-drawer/select.tsx +++ b/web/features/deployments/components/deploy-drawer/select.tsx @@ -7,13 +7,11 @@ import { useTranslation } from 'react-i18next' import { environmentHealth, environmentMode, environmentName } from '../../utils' import { HealthBadge, ModeBadge } from '../status-badge' -type FieldProps = { +export function Field({ label, hint, children }: { label: string hint?: string children: React.ReactNode -} - -export function Field({ label, hint, children }: FieldProps) { +}) { return (
@@ -78,9 +76,7 @@ export function DeploymentSelect({ value, onChange, options, placeholder }: Sele ) } -type EnvironmentRowProps = { env: EnvironmentOption } - -export function EnvironmentRow({ env }: EnvironmentRowProps) { +export function EnvironmentRow({ env }: { env: EnvironmentOption }) { return (
diff --git a/web/features/deployments/components/rollback-modal.tsx b/web/features/deployments/components/rollback-modal.tsx index 5db7808ed7..492a4e493c 100644 --- a/web/features/deployments/components/rollback-modal.tsx +++ b/web/features/deployments/components/rollback-modal.tsx @@ -25,12 +25,10 @@ import { toAppInfoFromOverview, } from '../utils' -type InfoRowProps = { +function InfoRow({ label, value }: { label: string value: string -} - -function InfoRow({ label, value }: InfoRowProps) { +}) { return (
{label} diff --git a/web/features/deployments/components/status-badge.tsx b/web/features/deployments/components/status-badge.tsx index 7d019f8661..c20c9b2fb4 100644 --- a/web/features/deployments/components/status-badge.tsx +++ b/web/features/deployments/components/status-badge.tsx @@ -3,11 +3,6 @@ import type { DeployStatus, EnvironmentHealth, EnvironmentMode } from '../types' import { cn } from '@langgenius/dify-ui/cn' import { useTranslation } from 'react-i18next' -type StatusBadgeProps = { - status: DeployStatus - className?: string -} - const statusStyles: Record = { ready: 'border-util-colors-green-green-200 bg-util-colors-green-green-50 text-util-colors-green-green-700', deploying: 'border-util-colors-warning-warning-200 bg-util-colors-warning-warning-50 text-util-colors-warning-warning-700', @@ -22,7 +17,10 @@ const statusKey = { const baseBadge = 'inline-flex items-center gap-1 rounded-md border px-2 py-0.5 system-xs-medium whitespace-nowrap' -export function StatusBadge({ status, className }: StatusBadgeProps) { +export function StatusBadge({ status, className }: { + status: DeployStatus + className?: string +}) { const { t } = useTranslation('deployments') return ( @@ -34,12 +32,10 @@ export function StatusBadge({ status, className }: StatusBadgeProps) { ) } -type ModeBadgeProps = { +export function ModeBadge({ mode, className }: { mode: EnvironmentMode className?: string -} - -export function ModeBadge({ mode, className }: ModeBadgeProps) { +}) { const { t } = useTranslation('deployments') const style = mode === 'shared' ? 'border-util-colors-green-green-200 bg-util-colors-green-green-50 text-util-colors-green-green-700' @@ -51,12 +47,10 @@ export function ModeBadge({ mode, className }: ModeBadgeProps) { ) } -type HealthBadgeProps = { +export function HealthBadge({ health, className }: { health: EnvironmentHealth className?: string -} - -export function HealthBadge({ health, className }: HealthBadgeProps) { +}) { const { t } = useTranslation('deployments') const style = health === 'ready' ? 'border-util-colors-green-green-200 bg-util-colors-green-green-50 text-util-colors-green-green-700' diff --git a/web/features/deployments/detail/access-tab.tsx b/web/features/deployments/detail/access-tab.tsx index d1e7f0aeb1..5e581bdc04 100644 --- a/web/features/deployments/detail/access-tab.tsx +++ b/web/features/deployments/detail/access-tab.tsx @@ -26,11 +26,9 @@ function uniqueEnvironments(environments: (ConsoleEnvironmentSummary | undefined }) } -type AccessTabProps = { +export function AccessTab({ instanceId: appId }: { instanceId: string -} - -export function AccessTab({ instanceId: appId }: AccessTabProps) { +}) { const appInput = { params: { appInstanceId: appId } } const { data: accessConfig } = useQuery(consoleQuery.enterprise.appDeploy.getAppInstanceAccess.queryOptions({ input: appInput, diff --git a/web/features/deployments/detail/access-tab/api-keys.tsx b/web/features/deployments/detail/access-tab/api-keys.tsx index 0097a50d38..0dc6eae700 100644 --- a/web/features/deployments/detail/access-tab/api-keys.tsx +++ b/web/features/deployments/detail/access-tab/api-keys.tsx @@ -13,13 +13,11 @@ import { useState } from 'react' import { useTranslation } from 'react-i18next' import { environmentName } from '../../utils' -type ApiKeyRowProps = { +export function ApiKeyRow({ apiKey, onCopy, onRevoke }: { apiKey: DeveloperAPIKeySummary onCopy: (apiKeyId: string) => Promise onRevoke: () => void -} - -export function ApiKeyRow({ apiKey, onCopy, onRevoke }: ApiKeyRowProps) { +}) { const { t } = useTranslation('deployments') const [copied, setCopied] = useState(false) const displayValue = apiKey.maskedKey || apiKey.maskedPrefix || apiKey.id || '—' @@ -74,12 +72,10 @@ export function ApiKeyRow({ apiKey, onCopy, onRevoke }: ApiKeyRowProps) { ) } -type ApiKeyGenerateMenuProps = { +export function ApiKeyGenerateMenu({ environments, onGenerate }: { environments: ConsoleEnvironmentSummary[] onGenerate: (environmentId: string) => void -} - -export function ApiKeyGenerateMenu({ environments, onGenerate }: ApiKeyGenerateMenuProps) { +}) { const { t } = useTranslation('deployments') const [open, setOpen] = useState(false) const selectableEnvironments = environments.filter(env => env.id) diff --git a/web/features/deployments/detail/access-tab/permissions.tsx b/web/features/deployments/detail/access-tab/permissions.tsx index c637060b2e..63ad08ec62 100644 --- a/web/features/deployments/detail/access-tab/permissions.tsx +++ b/web/features/deployments/detail/access-tab/permissions.tsx @@ -36,13 +36,11 @@ const permissionIcon: Record = { const permissionOrder: AccessPermissionKind[] = ['organization', 'specific', 'anyone'] -type PermissionPickerProps = { +function PermissionPicker({ value, disabled, onChange }: { value: AccessPermissionKind disabled?: boolean onChange: (kind: AccessPermissionKind) => void -} - -function PermissionPicker({ value, disabled, onChange }: PermissionPickerProps) { +}) { const { t } = useTranslation('deployments') const icon = permissionIcon[value] const label = t(`access.permission.${value}`) @@ -135,13 +133,11 @@ function selectedSubjectsFromPolicy(policy?: AccessPolicyDetail) { ].map(normalizeSubject).filter((subject): subject is SelectableAccessSubject => Boolean(subject)) } -type SubjectPillProps = { +function SubjectPill({ subject, disabled, onRemove }: { subject: SelectableAccessSubject disabled?: boolean onRemove: () => void -} - -function SubjectPill({ subject, disabled, onRemove }: SubjectPillProps) { +}) { const { t } = useTranslation('deployments') const isGroup = subject.subjectType === 'group' diff --git a/web/features/deployments/detail/deploy-tab.tsx b/web/features/deployments/detail/deploy-tab.tsx index ed5d776f20..db8d5096bc 100644 --- a/web/features/deployments/detail/deploy-tab.tsx +++ b/web/features/deployments/detail/deploy-tab.tsx @@ -32,11 +32,9 @@ import { DeploymentStatusSummary } from './deploy-tab/deployment-status-summary' const GRID_TEMPLATE = 'lg:grid-cols-[minmax(180px,1fr)_minmax(140px,0.75fr)_minmax(180px,0.85fr)_240px]' -type DeployTabProps = { +export function DeployTab({ instanceId: appInstanceId }: { instanceId: string -} - -export function DeployTab({ instanceId: appInstanceId }: DeployTabProps) { +}) { const { t } = useTranslation('deployments') const { data: environmentDeployments } = useQuery(consoleQuery.enterprise.appDeploy.listRuntimeInstances.queryOptions({ input: { diff --git a/web/features/deployments/detail/deploy-tab/deployment-panel.tsx b/web/features/deployments/detail/deploy-tab/deployment-panel.tsx index 1eb8ee8940..73739af2bd 100644 --- a/web/features/deployments/detail/deploy-tab/deployment-panel.tsx +++ b/web/features/deployments/detail/deploy-tab/deployment-panel.tsx @@ -18,12 +18,10 @@ import { runtimeBindingSummary, } from '../../utils' -type InfoBlockProps = { +function InfoBlock({ title, children }: { title: string children: ReactNode -} - -function InfoBlock({ title, children }: InfoBlockProps) { +}) { return (
{title}
@@ -51,11 +49,9 @@ function InfoRow({ label, value, mono, suffix }: InfoRowProps) { ) } -type RuntimeBindingItemProps = { +function RuntimeBindingItem({ binding }: { binding: RuntimeBindingDisplay -} - -function RuntimeBindingItem({ binding }: RuntimeBindingItemProps) { +}) { const summary = runtimeBindingSummary(binding) return ( @@ -67,11 +63,9 @@ function RuntimeBindingItem({ binding }: RuntimeBindingItemProps) { ) } -type DeploymentPanelProps = { +export function DeploymentPanel({ row }: { row: EnvironmentDeploymentRow -} - -export function DeploymentPanel({ row }: DeploymentPanelProps) { +}) { const { t } = useTranslation('deployments') const observed = activeRelease(row) const env = row.environment diff --git a/web/features/deployments/detail/deploy-tab/deployment-status-summary.tsx b/web/features/deployments/detail/deploy-tab/deployment-status-summary.tsx index db7742be51..a7ad2537f0 100644 --- a/web/features/deployments/detail/deploy-tab/deployment-status-summary.tsx +++ b/web/features/deployments/detail/deploy-tab/deployment-status-summary.tsx @@ -9,11 +9,9 @@ import { releaseLabel, } from '../../utils' -type DeploymentStatusSummaryProps = { +export function DeploymentStatusSummary({ row }: { row: EnvironmentDeploymentRow -} - -export function DeploymentStatusSummary({ row }: DeploymentStatusSummaryProps) { +}) { const { t } = useTranslation('deployments') if (isUndeployedDeploymentRow(row)) { return ( diff --git a/web/features/deployments/detail/index.tsx b/web/features/deployments/detail/index.tsx index 1261631796..e87d6cf4b2 100644 --- a/web/features/deployments/detail/index.tsx +++ b/web/features/deployments/detail/index.tsx @@ -16,12 +16,10 @@ import { toAppInfoFromOverview } from '../utils' import { DeploymentSidebar } from './deployment-sidebar' import { isInstanceDetailTabKey } from './tabs' -type InstanceDetailProps = { +export function InstanceDetail({ instanceId, children }: { instanceId: string children: ReactNode -} - -export function InstanceDetail({ instanceId, children }: InstanceDetailProps) { +}) { const { t } = useTranslation('deployments') const { t: tCommon } = useTranslation() const router = useRouter() diff --git a/web/features/deployments/detail/overview-tab.tsx b/web/features/deployments/detail/overview-tab.tsx index 24482648fd..0c318facf3 100644 --- a/web/features/deployments/detail/overview-tab.tsx +++ b/web/features/deployments/detail/overview-tab.tsx @@ -17,19 +17,13 @@ import { webappUrl, } from '../utils' -type OverviewTabProps = { - instanceId: string -} - type SwitchableTab = 'deploy' | 'versions' | 'access' | 'settings' -type SectionProps = { +function Section({ title, action, children }: { title: string action?: ReactNode children: ReactNode -} - -function Section({ title, action, children }: SectionProps) { +}) { return (
@@ -41,13 +35,11 @@ function Section({ title, action, children }: SectionProps) { ) } -type InfoRowProps = { +function InfoRow({ label, value, mono }: { label: string value: ReactNode mono?: boolean -} - -function InfoRow({ label, value, mono }: InfoRowProps) { +}) { return (
{label} @@ -98,7 +90,9 @@ function overviewDeploymentStatus(status?: string) { return 'ready' } -export function OverviewTab({ instanceId }: OverviewTabProps) { +export function OverviewTab({ instanceId }: { + instanceId: string +}) { const { t } = useTranslation('deployments') const { t: tCommon } = useTranslation() const router = useRouter() diff --git a/web/features/deployments/detail/settings-tab.tsx b/web/features/deployments/detail/settings-tab.tsx index 4d46b286c2..bcf96b8d43 100644 --- a/web/features/deployments/detail/settings-tab.tsx +++ b/web/features/deployments/detail/settings-tab.tsx @@ -22,10 +22,6 @@ import { toAppInfoFromOverview, } from '../utils' -type SettingsTabProps = { - instanceId: string -} - type SettingsFormProps = { app: AppInfo settings?: GetAppInstanceSettingsReply @@ -174,7 +170,9 @@ function SettingsForm({ app, settings, hasDeployments, onSave, onDelete }: Setti ) } -export function SettingsTab({ instanceId }: SettingsTabProps) { +export function SettingsTab({ instanceId }: { + instanceId: string +}) { const router = useRouter() const updateInstance = useMutation(consoleQuery.enterprise.appDeploy.updateAppInstance.mutationOptions()) const deleteInstance = useMutation(consoleQuery.enterprise.appDeploy.deleteAppInstance.mutationOptions()) diff --git a/web/features/deployments/detail/versions-tab.tsx b/web/features/deployments/detail/versions-tab.tsx index de74c4adae..f7154ba8cb 100644 --- a/web/features/deployments/detail/versions-tab.tsx +++ b/web/features/deployments/detail/versions-tab.tsx @@ -23,11 +23,9 @@ import { getReleaseDeployments } from './versions-tab/release-deployments' const GRID_TEMPLATE = 'grid-cols-[minmax(0,0.9fr)_minmax(0,1fr)_minmax(0,0.8fr)_minmax(0,1.5fr)_96px]' -type VersionsTabProps = { +export function VersionsTab({ instanceId: appId }: { instanceId: string -} - -export function VersionsTab({ instanceId: appId }: VersionsTabProps) { +}) { const { t } = useTranslation('deployments') const input = { params: { appInstanceId: appId } } const { data: overview } = useQuery(consoleQuery.enterprise.appDeploy.getAppInstanceOverview.queryOptions({ diff --git a/web/features/deployments/detail/versions-tab/deploy-release-menu.tsx b/web/features/deployments/detail/versions-tab/deploy-release-menu.tsx index 04d6df91eb..818706c2ed 100644 --- a/web/features/deployments/detail/versions-tab/deploy-release-menu.tsx +++ b/web/features/deployments/detail/versions-tab/deploy-release-menu.tsx @@ -21,12 +21,10 @@ import { environmentOptionsFromOptionsReply, } from '../../utils' -type DeployReleaseMenuProps = { +export function DeployReleaseMenu({ appInstanceId, releaseId }: { appInstanceId: string releaseId: string -} - -export function DeployReleaseMenu({ appInstanceId, releaseId }: DeployReleaseMenuProps) { +}) { const { t } = useTranslation('deployments') const openDeployDrawer = useDeploymentsStore(state => state.openDeployDrawer) const [open, setOpen] = useState(false) diff --git a/web/features/deployments/detail/versions-tab/deployed-to-badge.tsx b/web/features/deployments/detail/versions-tab/deployed-to-badge.tsx index f5c1d86d24..696d5d7499 100644 --- a/web/features/deployments/detail/versions-tab/deployed-to-badge.tsx +++ b/web/features/deployments/detail/versions-tab/deployed-to-badge.tsx @@ -11,11 +11,9 @@ const RELEASE_DEPLOYMENT_STYLES: Record = { failed: 'border-util-colors-warning-warning-200 bg-util-colors-warning-warning-50 text-util-colors-warning-warning-700', } -type DeployedToBadgeProps = { +export function DeployedToBadge({ item }: { item: ReleaseDeployment -} - -export function DeployedToBadge({ item }: DeployedToBadgeProps) { +}) { const { t } = useTranslation('deployments') const statusLabel = t(`versions.deployedStatus.${item.state}`) diff --git a/web/features/deployments/list/environment-filter.tsx b/web/features/deployments/list/environment-filter.tsx index 34d94fffdd..2f068e5675 100644 --- a/web/features/deployments/list/environment-filter.tsx +++ b/web/features/deployments/list/environment-filter.tsx @@ -18,13 +18,11 @@ export type EnvironmentFilterOption = { disabledReason?: string } -type EnvironmentFilterProps = { +export function EnvironmentFilter({ value, options, onChange }: { value: string options: EnvironmentFilterOption[] onChange: (value: string) => void -} - -export function EnvironmentFilter({ value, options, onChange }: EnvironmentFilterProps) { +}) { const [open, setOpen] = useState(false) const selectedOption = options.find(option => option.value === value) ?? options[0] diff --git a/web/features/deployments/list/instance-card.tsx b/web/features/deployments/list/instance-card.tsx index 54a850864b..afeb1db4db 100644 --- a/web/features/deployments/list/instance-card.tsx +++ b/web/features/deployments/list/instance-card.tsx @@ -21,12 +21,10 @@ import { useFormatTimeFromNow } from '@/hooks/use-format-time-from-now' import { useRouter } from '@/next/navigation' import { useDeploymentsStore } from '../store' -type InstanceCardProps = { +export function InstanceCard({ app, summary }: { app: AppInfo summary?: AppDeploymentSummary -} - -export function InstanceCard({ app, summary }: InstanceCardProps) { +}) { const { t } = useTranslation('deployments') const router = useRouter() const { formatTimeFromNow } = useFormatTimeFromNow() diff --git a/web/features/deployments/list/new-instance-card.tsx b/web/features/deployments/list/new-instance-card.tsx index abe4f25469..452779671f 100644 --- a/web/features/deployments/list/new-instance-card.tsx +++ b/web/features/deployments/list/new-instance-card.tsx @@ -3,10 +3,6 @@ import { cn } from '@langgenius/dify-ui/cn' import { useTranslation } from 'react-i18next' -type NewInstanceCardProps = { - onOpen: () => void -} - type NewInstanceActionProps = { icon: string label: string @@ -41,7 +37,9 @@ function NewInstanceAction({ icon, label, disabled, onClick }: NewInstanceAction ) } -export function NewInstanceCard({ onOpen }: NewInstanceCardProps) { +export function NewInstanceCard({ onOpen }: { + onOpen: () => void +}) { const { t } = useTranslation('deployments') return (