feat(dify): 把本地控制台的中文与去外链改动入库
这些界面改动和专家服务草稿停在工作区,没有随上一笔主分支提交进入仓库。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
9c7c80e194
commit
c2cb845a32
211 files changed
+3030
-2794
No files matched your search
@@ -0,0 +1,18 @@
|
||||
const OFFICIAL_HOST = /(^|\.)dify\.(ai|com)$/i
|
||||
|
||||
export function isOfficialDifyUrl(value?: string | null): boolean {
|
||||
const trimmed = value?.trim() ?? ''
|
||||
if (!trimmed) return false
|
||||
|
||||
const mailto = trimmed.match(/^mailto:([^?]+)/i)
|
||||
if (mailto) {
|
||||
const host = mailto[1]?.split('@').pop() ?? ''
|
||||
return OFFICIAL_HOST.test(host)
|
||||
}
|
||||
|
||||
try {
|
||||
return OFFICIAL_HOST.test(new URL(trimmed).hostname)
|
||||
} catch {
|
||||
return false
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
// Official plugin metadata still uses the upstream product name as the author.
|
||||
// Local deployments hide that label and keep other authors visible.
|
||||
export function visibleAuthorName(value?: string | null): string {
|
||||
const text = value?.trim() ?? ''
|
||||
if (!text) return ''
|
||||
if (text.toLowerCase() === 'dify' || text.toLowerCase().startsWith('dify ')) return ''
|
||||
return text
|
||||
}
|
||||
Reference in new issue
Block a user