dify/web/features/deployments/list/ui/instance-card-utils.ts
Stephen Zhou 48452aefbc
feat: app deploy (#35670)
Co-authored-by: zhangx1n <zhangxin@dify.ai>
Co-authored-by: yyh <yuanyouhuilyz@gmail.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-06-17 09:28:43 +00:00

22 lines
689 B
TypeScript

import type {
EnvironmentDeployment,
Release,
} from '@dify/contracts/enterprise/types.gen'
import type { InstanceDetailTabKey } from '../../detail/tabs'
import { isUndeployedDeploymentRow } from '../../shared/domain/runtime-status'
export function getInstanceTabHref(appInstanceId: string, tabKey: InstanceDetailTabKey) {
return `/deployments/${appInstanceId}/${tabKey}`
}
export function isActiveDeployment(row: EnvironmentDeployment) {
return !isUndeployedDeploymentRow(row)
}
export function isReleaseDeployed(release: Release | undefined, rows: EnvironmentDeployment[]) {
if (!release)
return false
return rows.some(row => row.currentRelease?.id === release.id)
}