mirror of
https://github.com/langgenius/dify.git
synced 2026-08-28 19:16:51 +08:00
Co-authored-by: Jingyi-Dify <jingyi.qi@dify.ai> Co-authored-by: yyh <yuanyouhuilyz@gmail.com> Co-authored-by: Joel <iamjoel007@gmail.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: hjlarry <hjlarry@163.com> Co-authored-by: Bond Zhu <783504079@qq.com> Co-authored-by: Yansong Zhang <916125788@qq.com> Co-authored-by: yyh <92089059+lyzno1@users.noreply.github.com>
16 lines
412 B
TypeScript
16 lines
412 B
TypeScript
import type { AgentDetailSectionKey } from './section'
|
|
|
|
export const getAgentDetailPath = (
|
|
agentId: string,
|
|
section: AgentDetailSectionKey,
|
|
) => `/roster/agent/${agentId}/${section}`
|
|
|
|
export const getAgentIdFromPathname = (pathname: string) => {
|
|
const [section, type, agentId] = pathname.split('/').filter(Boolean)
|
|
|
|
if (section !== 'roster' || type !== 'agent')
|
|
return undefined
|
|
|
|
return agentId
|
|
}
|