mirror of
https://github.com/langgenius/dify.git
synced 2026-05-04 01:18:05 +08:00
Merge branch 'feat/rag-2' of https://github.com/langgenius/dify into feat/rag-2
This commit is contained in:
566
web/__tests__/check-i18n.test.ts
Normal file
566
web/__tests__/check-i18n.test.ts
Normal file
@ -0,0 +1,566 @@
|
||||
import fs from 'node:fs'
|
||||
import path from 'node:path'
|
||||
|
||||
// Mock functions to simulate the check-i18n functionality
|
||||
const vm = require('node:vm')
|
||||
const transpile = require('typescript').transpile
|
||||
|
||||
describe('check-i18n script functionality', () => {
|
||||
const testDir = path.join(__dirname, '../i18n-test')
|
||||
const testEnDir = path.join(testDir, 'en-US')
|
||||
const testZhDir = path.join(testDir, 'zh-Hans')
|
||||
|
||||
// Helper function that replicates the getKeysFromLanguage logic
|
||||
async function getKeysFromLanguage(language: string, testPath = testDir): Promise<string[]> {
|
||||
return new Promise((resolve, reject) => {
|
||||
const folderPath = path.resolve(testPath, language)
|
||||
const allKeys: string[] = []
|
||||
|
||||
if (!fs.existsSync(folderPath)) {
|
||||
resolve([])
|
||||
return
|
||||
}
|
||||
|
||||
fs.readdir(folderPath, (err, files) => {
|
||||
if (err) {
|
||||
reject(err)
|
||||
return
|
||||
}
|
||||
|
||||
const translationFiles = files.filter(file => /\.(ts|js)$/.test(file))
|
||||
|
||||
translationFiles.forEach((file) => {
|
||||
const filePath = path.join(folderPath, file)
|
||||
const fileName = file.replace(/\.[^/.]+$/, '')
|
||||
const camelCaseFileName = fileName.replace(/[-_](.)/g, (_, c) =>
|
||||
c.toUpperCase(),
|
||||
)
|
||||
|
||||
try {
|
||||
const content = fs.readFileSync(filePath, 'utf8')
|
||||
const moduleExports = {}
|
||||
const context = {
|
||||
exports: moduleExports,
|
||||
module: { exports: moduleExports },
|
||||
require,
|
||||
console,
|
||||
__filename: filePath,
|
||||
__dirname: folderPath,
|
||||
}
|
||||
|
||||
vm.runInNewContext(transpile(content), context)
|
||||
const translationObj = (context.module.exports as any).default || context.module.exports
|
||||
|
||||
if (!translationObj || typeof translationObj !== 'object')
|
||||
throw new Error(`Error parsing file: ${filePath}`)
|
||||
|
||||
const nestedKeys: string[] = []
|
||||
const iterateKeys = (obj: any, prefix = '') => {
|
||||
for (const key in obj) {
|
||||
const nestedKey = prefix ? `${prefix}.${key}` : key
|
||||
if (typeof obj[key] === 'object' && obj[key] !== null && !Array.isArray(obj[key])) {
|
||||
// This is an object (but not array), recurse into it but don't add it as a key
|
||||
iterateKeys(obj[key], nestedKey)
|
||||
}
|
||||
else {
|
||||
// This is a leaf node (string, number, boolean, array, etc.), add it as a key
|
||||
nestedKeys.push(nestedKey)
|
||||
}
|
||||
}
|
||||
}
|
||||
iterateKeys(translationObj)
|
||||
|
||||
const fileKeys = nestedKeys.map(key => `${camelCaseFileName}.${key}`)
|
||||
allKeys.push(...fileKeys)
|
||||
}
|
||||
catch (error) {
|
||||
reject(error)
|
||||
}
|
||||
})
|
||||
resolve(allKeys)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
beforeEach(() => {
|
||||
// Clean up and create test directories
|
||||
if (fs.existsSync(testDir))
|
||||
fs.rmSync(testDir, { recursive: true })
|
||||
|
||||
fs.mkdirSync(testDir, { recursive: true })
|
||||
fs.mkdirSync(testEnDir, { recursive: true })
|
||||
fs.mkdirSync(testZhDir, { recursive: true })
|
||||
})
|
||||
|
||||
afterEach(() => {
|
||||
// Clean up test files
|
||||
if (fs.existsSync(testDir))
|
||||
fs.rmSync(testDir, { recursive: true })
|
||||
})
|
||||
|
||||
describe('Key extraction logic', () => {
|
||||
it('should extract only leaf node keys, not intermediate objects', async () => {
|
||||
const testContent = `const translation = {
|
||||
simple: 'Simple Value',
|
||||
nested: {
|
||||
level1: 'Level 1 Value',
|
||||
deep: {
|
||||
level2: 'Level 2 Value'
|
||||
}
|
||||
},
|
||||
array: ['not extracted'],
|
||||
number: 42,
|
||||
boolean: true
|
||||
}
|
||||
|
||||
export default translation
|
||||
`
|
||||
|
||||
fs.writeFileSync(path.join(testEnDir, 'test.ts'), testContent)
|
||||
|
||||
const keys = await getKeysFromLanguage('en-US')
|
||||
|
||||
expect(keys).toEqual([
|
||||
'test.simple',
|
||||
'test.nested.level1',
|
||||
'test.nested.deep.level2',
|
||||
'test.array',
|
||||
'test.number',
|
||||
'test.boolean',
|
||||
])
|
||||
|
||||
// Should not include intermediate object keys
|
||||
expect(keys).not.toContain('test.nested')
|
||||
expect(keys).not.toContain('test.nested.deep')
|
||||
})
|
||||
|
||||
it('should handle camelCase file name conversion correctly', async () => {
|
||||
const testContent = `const translation = {
|
||||
key: 'value'
|
||||
}
|
||||
|
||||
export default translation
|
||||
`
|
||||
|
||||
fs.writeFileSync(path.join(testEnDir, 'app-debug.ts'), testContent)
|
||||
fs.writeFileSync(path.join(testEnDir, 'user_profile.ts'), testContent)
|
||||
|
||||
const keys = await getKeysFromLanguage('en-US')
|
||||
|
||||
expect(keys).toContain('appDebug.key')
|
||||
expect(keys).toContain('userProfile.key')
|
||||
})
|
||||
})
|
||||
|
||||
describe('Missing keys detection', () => {
|
||||
it('should detect missing keys in target language', async () => {
|
||||
const enContent = `const translation = {
|
||||
common: {
|
||||
save: 'Save',
|
||||
cancel: 'Cancel',
|
||||
delete: 'Delete'
|
||||
},
|
||||
app: {
|
||||
title: 'My App',
|
||||
version: '1.0'
|
||||
}
|
||||
}
|
||||
|
||||
export default translation
|
||||
`
|
||||
|
||||
const zhContent = `const translation = {
|
||||
common: {
|
||||
save: '保存',
|
||||
cancel: '取消'
|
||||
// missing 'delete'
|
||||
},
|
||||
app: {
|
||||
title: '我的应用'
|
||||
// missing 'version'
|
||||
}
|
||||
}
|
||||
|
||||
export default translation
|
||||
`
|
||||
|
||||
fs.writeFileSync(path.join(testEnDir, 'test.ts'), enContent)
|
||||
fs.writeFileSync(path.join(testZhDir, 'test.ts'), zhContent)
|
||||
|
||||
const enKeys = await getKeysFromLanguage('en-US')
|
||||
const zhKeys = await getKeysFromLanguage('zh-Hans')
|
||||
|
||||
const missingKeys = enKeys.filter(key => !zhKeys.includes(key))
|
||||
|
||||
expect(missingKeys).toContain('test.common.delete')
|
||||
expect(missingKeys).toContain('test.app.version')
|
||||
expect(missingKeys).toHaveLength(2)
|
||||
})
|
||||
})
|
||||
|
||||
describe('Extra keys detection', () => {
|
||||
it('should detect extra keys in target language', async () => {
|
||||
const enContent = `const translation = {
|
||||
common: {
|
||||
save: 'Save',
|
||||
cancel: 'Cancel'
|
||||
}
|
||||
}
|
||||
|
||||
export default translation
|
||||
`
|
||||
|
||||
const zhContent = `const translation = {
|
||||
common: {
|
||||
save: '保存',
|
||||
cancel: '取消',
|
||||
delete: '删除', // extra key
|
||||
extra: '额外的' // another extra key
|
||||
},
|
||||
newSection: {
|
||||
someKey: '某个值' // extra section
|
||||
}
|
||||
}
|
||||
|
||||
export default translation
|
||||
`
|
||||
|
||||
fs.writeFileSync(path.join(testEnDir, 'test.ts'), enContent)
|
||||
fs.writeFileSync(path.join(testZhDir, 'test.ts'), zhContent)
|
||||
|
||||
const enKeys = await getKeysFromLanguage('en-US')
|
||||
const zhKeys = await getKeysFromLanguage('zh-Hans')
|
||||
|
||||
const extraKeys = zhKeys.filter(key => !enKeys.includes(key))
|
||||
|
||||
expect(extraKeys).toContain('test.common.delete')
|
||||
expect(extraKeys).toContain('test.common.extra')
|
||||
expect(extraKeys).toContain('test.newSection.someKey')
|
||||
expect(extraKeys).toHaveLength(3)
|
||||
})
|
||||
})
|
||||
|
||||
describe('File filtering logic', () => {
|
||||
it('should filter keys by specific file correctly', async () => {
|
||||
// Create multiple files
|
||||
const file1Content = `const translation = {
|
||||
button: 'Button',
|
||||
text: 'Text'
|
||||
}
|
||||
|
||||
export default translation
|
||||
`
|
||||
|
||||
const file2Content = `const translation = {
|
||||
title: 'Title',
|
||||
description: 'Description'
|
||||
}
|
||||
|
||||
export default translation
|
||||
`
|
||||
|
||||
fs.writeFileSync(path.join(testEnDir, 'components.ts'), file1Content)
|
||||
fs.writeFileSync(path.join(testEnDir, 'pages.ts'), file2Content)
|
||||
fs.writeFileSync(path.join(testZhDir, 'components.ts'), file1Content)
|
||||
fs.writeFileSync(path.join(testZhDir, 'pages.ts'), file2Content)
|
||||
|
||||
const allEnKeys = await getKeysFromLanguage('en-US')
|
||||
const allZhKeys = await getKeysFromLanguage('zh-Hans')
|
||||
|
||||
// Test file filtering logic
|
||||
const targetFile = 'components'
|
||||
const filteredEnKeys = allEnKeys.filter(key =>
|
||||
key.startsWith(targetFile.replace(/[-_](.)/g, (_, c) => c.toUpperCase())),
|
||||
)
|
||||
|
||||
expect(allEnKeys).toHaveLength(4) // 2 keys from each file
|
||||
expect(filteredEnKeys).toHaveLength(2) // only components keys
|
||||
expect(filteredEnKeys).toContain('components.button')
|
||||
expect(filteredEnKeys).toContain('components.text')
|
||||
expect(filteredEnKeys).not.toContain('pages.title')
|
||||
expect(filteredEnKeys).not.toContain('pages.description')
|
||||
})
|
||||
})
|
||||
|
||||
describe('Complex nested structure handling', () => {
|
||||
it('should handle deeply nested objects correctly', async () => {
|
||||
const complexContent = `const translation = {
|
||||
level1: {
|
||||
level2: {
|
||||
level3: {
|
||||
level4: {
|
||||
deepValue: 'Deep Value'
|
||||
},
|
||||
anotherValue: 'Another Value'
|
||||
},
|
||||
simpleValue: 'Simple Value'
|
||||
},
|
||||
directValue: 'Direct Value'
|
||||
},
|
||||
rootValue: 'Root Value'
|
||||
}
|
||||
|
||||
export default translation
|
||||
`
|
||||
|
||||
fs.writeFileSync(path.join(testEnDir, 'complex.ts'), complexContent)
|
||||
|
||||
const keys = await getKeysFromLanguage('en-US')
|
||||
|
||||
expect(keys).toContain('complex.level1.level2.level3.level4.deepValue')
|
||||
expect(keys).toContain('complex.level1.level2.level3.anotherValue')
|
||||
expect(keys).toContain('complex.level1.level2.simpleValue')
|
||||
expect(keys).toContain('complex.level1.directValue')
|
||||
expect(keys).toContain('complex.rootValue')
|
||||
|
||||
// Should not include intermediate objects
|
||||
expect(keys).not.toContain('complex.level1')
|
||||
expect(keys).not.toContain('complex.level1.level2')
|
||||
expect(keys).not.toContain('complex.level1.level2.level3')
|
||||
expect(keys).not.toContain('complex.level1.level2.level3.level4')
|
||||
})
|
||||
})
|
||||
|
||||
describe('Edge cases', () => {
|
||||
it('should handle empty objects', async () => {
|
||||
const emptyContent = `const translation = {
|
||||
empty: {},
|
||||
withValue: 'value'
|
||||
}
|
||||
|
||||
export default translation
|
||||
`
|
||||
|
||||
fs.writeFileSync(path.join(testEnDir, 'empty.ts'), emptyContent)
|
||||
|
||||
const keys = await getKeysFromLanguage('en-US')
|
||||
|
||||
expect(keys).toContain('empty.withValue')
|
||||
expect(keys).not.toContain('empty.empty')
|
||||
})
|
||||
|
||||
it('should handle special characters in keys', async () => {
|
||||
const specialContent = `const translation = {
|
||||
'key-with-dash': 'value1',
|
||||
'key_with_underscore': 'value2',
|
||||
'key.with.dots': 'value3',
|
||||
normalKey: 'value4'
|
||||
}
|
||||
|
||||
export default translation
|
||||
`
|
||||
|
||||
fs.writeFileSync(path.join(testEnDir, 'special.ts'), specialContent)
|
||||
|
||||
const keys = await getKeysFromLanguage('en-US')
|
||||
|
||||
expect(keys).toContain('special.key-with-dash')
|
||||
expect(keys).toContain('special.key_with_underscore')
|
||||
expect(keys).toContain('special.key.with.dots')
|
||||
expect(keys).toContain('special.normalKey')
|
||||
})
|
||||
|
||||
it('should handle different value types', async () => {
|
||||
const typesContent = `const translation = {
|
||||
stringValue: 'string',
|
||||
numberValue: 42,
|
||||
booleanValue: true,
|
||||
nullValue: null,
|
||||
undefinedValue: undefined,
|
||||
arrayValue: ['array', 'values'],
|
||||
objectValue: {
|
||||
nested: 'nested value'
|
||||
}
|
||||
}
|
||||
|
||||
export default translation
|
||||
`
|
||||
|
||||
fs.writeFileSync(path.join(testEnDir, 'types.ts'), typesContent)
|
||||
|
||||
const keys = await getKeysFromLanguage('en-US')
|
||||
|
||||
expect(keys).toContain('types.stringValue')
|
||||
expect(keys).toContain('types.numberValue')
|
||||
expect(keys).toContain('types.booleanValue')
|
||||
expect(keys).toContain('types.nullValue')
|
||||
expect(keys).toContain('types.undefinedValue')
|
||||
expect(keys).toContain('types.arrayValue')
|
||||
expect(keys).toContain('types.objectValue.nested')
|
||||
expect(keys).not.toContain('types.objectValue')
|
||||
})
|
||||
})
|
||||
|
||||
describe('Real-world scenario tests', () => {
|
||||
it('should handle app-debug structure like real files', async () => {
|
||||
const appDebugEn = `const translation = {
|
||||
pageTitle: {
|
||||
line1: 'Prompt',
|
||||
line2: 'Engineering'
|
||||
},
|
||||
operation: {
|
||||
applyConfig: 'Publish',
|
||||
resetConfig: 'Reset',
|
||||
debugConfig: 'Debug'
|
||||
},
|
||||
generate: {
|
||||
instruction: 'Instructions',
|
||||
generate: 'Generate',
|
||||
resTitle: 'Generated Prompt',
|
||||
noDataLine1: 'Describe your use case on the left,',
|
||||
noDataLine2: 'the orchestration preview will show here.'
|
||||
}
|
||||
}
|
||||
|
||||
export default translation
|
||||
`
|
||||
|
||||
const appDebugZh = `const translation = {
|
||||
pageTitle: {
|
||||
line1: '提示词',
|
||||
line2: '编排'
|
||||
},
|
||||
operation: {
|
||||
applyConfig: '发布',
|
||||
resetConfig: '重置',
|
||||
debugConfig: '调试'
|
||||
},
|
||||
generate: {
|
||||
instruction: '指令',
|
||||
generate: '生成',
|
||||
resTitle: '生成的提示词',
|
||||
noData: '在左侧描述您的用例,编排预览将在此处显示。' // This is extra
|
||||
}
|
||||
}
|
||||
|
||||
export default translation
|
||||
`
|
||||
|
||||
fs.writeFileSync(path.join(testEnDir, 'app-debug.ts'), appDebugEn)
|
||||
fs.writeFileSync(path.join(testZhDir, 'app-debug.ts'), appDebugZh)
|
||||
|
||||
const enKeys = await getKeysFromLanguage('en-US')
|
||||
const zhKeys = await getKeysFromLanguage('zh-Hans')
|
||||
|
||||
const missingKeys = enKeys.filter(key => !zhKeys.includes(key))
|
||||
const extraKeys = zhKeys.filter(key => !enKeys.includes(key))
|
||||
|
||||
expect(missingKeys).toContain('appDebug.generate.noDataLine1')
|
||||
expect(missingKeys).toContain('appDebug.generate.noDataLine2')
|
||||
expect(extraKeys).toContain('appDebug.generate.noData')
|
||||
|
||||
expect(missingKeys).toHaveLength(2)
|
||||
expect(extraKeys).toHaveLength(1)
|
||||
})
|
||||
|
||||
it('should handle time structure with operation nested keys', async () => {
|
||||
const timeEn = `const translation = {
|
||||
months: {
|
||||
January: 'January',
|
||||
February: 'February'
|
||||
},
|
||||
operation: {
|
||||
now: 'Now',
|
||||
ok: 'OK',
|
||||
cancel: 'Cancel',
|
||||
pickDate: 'Pick Date'
|
||||
},
|
||||
title: {
|
||||
pickTime: 'Pick Time'
|
||||
},
|
||||
defaultPlaceholder: 'Pick a time...'
|
||||
}
|
||||
|
||||
export default translation
|
||||
`
|
||||
|
||||
const timeZh = `const translation = {
|
||||
months: {
|
||||
January: '一月',
|
||||
February: '二月'
|
||||
},
|
||||
operation: {
|
||||
now: '此刻',
|
||||
ok: '确定',
|
||||
cancel: '取消',
|
||||
pickDate: '选择日期'
|
||||
},
|
||||
title: {
|
||||
pickTime: '选择时间'
|
||||
},
|
||||
pickDate: '选择日期', // This is extra - duplicates operation.pickDate
|
||||
defaultPlaceholder: '请选择时间...'
|
||||
}
|
||||
|
||||
export default translation
|
||||
`
|
||||
|
||||
fs.writeFileSync(path.join(testEnDir, 'time.ts'), timeEn)
|
||||
fs.writeFileSync(path.join(testZhDir, 'time.ts'), timeZh)
|
||||
|
||||
const enKeys = await getKeysFromLanguage('en-US')
|
||||
const zhKeys = await getKeysFromLanguage('zh-Hans')
|
||||
|
||||
const missingKeys = enKeys.filter(key => !zhKeys.includes(key))
|
||||
const extraKeys = zhKeys.filter(key => !enKeys.includes(key))
|
||||
|
||||
expect(missingKeys).toHaveLength(0) // No missing keys
|
||||
expect(extraKeys).toContain('time.pickDate') // Extra root-level pickDate
|
||||
expect(extraKeys).toHaveLength(1)
|
||||
|
||||
// Should have both keys available
|
||||
expect(zhKeys).toContain('time.operation.pickDate') // Correct nested key
|
||||
expect(zhKeys).toContain('time.pickDate') // Extra duplicate key
|
||||
})
|
||||
})
|
||||
|
||||
describe('Statistics calculation', () => {
|
||||
it('should calculate correct difference statistics', async () => {
|
||||
const enContent = `const translation = {
|
||||
key1: 'value1',
|
||||
key2: 'value2',
|
||||
key3: 'value3'
|
||||
}
|
||||
|
||||
export default translation
|
||||
`
|
||||
|
||||
const zhContentMissing = `const translation = {
|
||||
key1: 'value1',
|
||||
key2: 'value2'
|
||||
// missing key3
|
||||
}
|
||||
|
||||
export default translation
|
||||
`
|
||||
|
||||
const zhContentExtra = `const translation = {
|
||||
key1: 'value1',
|
||||
key2: 'value2',
|
||||
key3: 'value3',
|
||||
key4: 'extra',
|
||||
key5: 'extra2'
|
||||
}
|
||||
|
||||
export default translation
|
||||
`
|
||||
|
||||
fs.writeFileSync(path.join(testEnDir, 'stats.ts'), enContent)
|
||||
|
||||
// Test missing keys scenario
|
||||
fs.writeFileSync(path.join(testZhDir, 'stats.ts'), zhContentMissing)
|
||||
|
||||
const enKeys = await getKeysFromLanguage('en-US')
|
||||
const zhKeysMissing = await getKeysFromLanguage('zh-Hans')
|
||||
|
||||
expect(enKeys.length - zhKeysMissing.length).toBe(1) // +1 means 1 missing key
|
||||
|
||||
// Test extra keys scenario
|
||||
fs.writeFileSync(path.join(testZhDir, 'stats.ts'), zhContentExtra)
|
||||
|
||||
const zhKeysExtra = await getKeysFromLanguage('zh-Hans')
|
||||
|
||||
expect(enKeys.length - zhKeysExtra.length).toBe(-2) // -2 means 2 extra keys
|
||||
})
|
||||
})
|
||||
})
|
||||
207
web/__tests__/plugin-tool-workflow-error.test.tsx
Normal file
207
web/__tests__/plugin-tool-workflow-error.test.tsx
Normal file
@ -0,0 +1,207 @@
|
||||
/**
|
||||
* Test cases to reproduce the plugin tool workflow error
|
||||
* Issue: #23154 - Application error when loading plugin tools in workflow
|
||||
* Root cause: split() operation called on null/undefined values
|
||||
*/
|
||||
|
||||
describe('Plugin Tool Workflow Error Reproduction', () => {
|
||||
/**
|
||||
* Mock function to simulate the problematic code in switch-plugin-version.tsx:29
|
||||
* const [pluginId] = uniqueIdentifier.split(':')
|
||||
*/
|
||||
const mockSwitchPluginVersionLogic = (uniqueIdentifier: string | null | undefined) => {
|
||||
// This directly reproduces the problematic line from switch-plugin-version.tsx:29
|
||||
const [pluginId] = uniqueIdentifier!.split(':')
|
||||
return pluginId
|
||||
}
|
||||
|
||||
/**
|
||||
* Test case 1: Simulate null uniqueIdentifier
|
||||
* This should reproduce the error mentioned in the issue
|
||||
*/
|
||||
it('should reproduce error when uniqueIdentifier is null', () => {
|
||||
expect(() => {
|
||||
mockSwitchPluginVersionLogic(null)
|
||||
}).toThrow('Cannot read properties of null (reading \'split\')')
|
||||
})
|
||||
|
||||
/**
|
||||
* Test case 2: Simulate undefined uniqueIdentifier
|
||||
*/
|
||||
it('should reproduce error when uniqueIdentifier is undefined', () => {
|
||||
expect(() => {
|
||||
mockSwitchPluginVersionLogic(undefined)
|
||||
}).toThrow('Cannot read properties of undefined (reading \'split\')')
|
||||
})
|
||||
|
||||
/**
|
||||
* Test case 3: Simulate empty string uniqueIdentifier
|
||||
*/
|
||||
it('should handle empty string uniqueIdentifier', () => {
|
||||
expect(() => {
|
||||
const result = mockSwitchPluginVersionLogic('')
|
||||
expect(result).toBe('') // Empty string split by ':' returns ['']
|
||||
}).not.toThrow()
|
||||
})
|
||||
|
||||
/**
|
||||
* Test case 4: Simulate malformed uniqueIdentifier without colon separator
|
||||
*/
|
||||
it('should handle malformed uniqueIdentifier without colon separator', () => {
|
||||
expect(() => {
|
||||
const result = mockSwitchPluginVersionLogic('malformed-identifier-without-colon')
|
||||
expect(result).toBe('malformed-identifier-without-colon') // No colon means full string returned
|
||||
}).not.toThrow()
|
||||
})
|
||||
|
||||
/**
|
||||
* Test case 5: Simulate valid uniqueIdentifier
|
||||
*/
|
||||
it('should work correctly with valid uniqueIdentifier', () => {
|
||||
expect(() => {
|
||||
const result = mockSwitchPluginVersionLogic('valid-plugin-id:1.0.0')
|
||||
expect(result).toBe('valid-plugin-id')
|
||||
}).not.toThrow()
|
||||
})
|
||||
})
|
||||
|
||||
/**
|
||||
* Test for the variable processing split error in use-single-run-form-params
|
||||
*/
|
||||
describe('Variable Processing Split Error', () => {
|
||||
/**
|
||||
* Mock function to simulate the problematic code in use-single-run-form-params.ts:91
|
||||
* const getDependentVars = () => {
|
||||
* return varInputs.map(item => item.variable.slice(1, -1).split('.'))
|
||||
* }
|
||||
*/
|
||||
const mockGetDependentVars = (varInputs: Array<{ variable: string | null | undefined }>) => {
|
||||
return varInputs.map((item) => {
|
||||
// Guard against null/undefined variable to prevent app crash
|
||||
if (!item.variable || typeof item.variable !== 'string')
|
||||
return []
|
||||
|
||||
return item.variable.slice(1, -1).split('.')
|
||||
}).filter(arr => arr.length > 0) // Filter out empty arrays
|
||||
}
|
||||
|
||||
/**
|
||||
* Test case 1: Variable processing with null variable
|
||||
*/
|
||||
it('should handle null variable safely', () => {
|
||||
const varInputs = [{ variable: null }]
|
||||
|
||||
expect(() => {
|
||||
mockGetDependentVars(varInputs)
|
||||
}).not.toThrow()
|
||||
|
||||
const result = mockGetDependentVars(varInputs)
|
||||
expect(result).toEqual([]) // null variables are filtered out
|
||||
})
|
||||
|
||||
/**
|
||||
* Test case 2: Variable processing with undefined variable
|
||||
*/
|
||||
it('should handle undefined variable safely', () => {
|
||||
const varInputs = [{ variable: undefined }]
|
||||
|
||||
expect(() => {
|
||||
mockGetDependentVars(varInputs)
|
||||
}).not.toThrow()
|
||||
|
||||
const result = mockGetDependentVars(varInputs)
|
||||
expect(result).toEqual([]) // undefined variables are filtered out
|
||||
})
|
||||
|
||||
/**
|
||||
* Test case 3: Variable processing with empty string
|
||||
*/
|
||||
it('should handle empty string variable', () => {
|
||||
const varInputs = [{ variable: '' }]
|
||||
|
||||
expect(() => {
|
||||
mockGetDependentVars(varInputs)
|
||||
}).not.toThrow()
|
||||
|
||||
const result = mockGetDependentVars(varInputs)
|
||||
expect(result).toEqual([]) // Empty string is filtered out, so result is empty array
|
||||
})
|
||||
|
||||
/**
|
||||
* Test case 4: Variable processing with valid variable format
|
||||
*/
|
||||
it('should work correctly with valid variable format', () => {
|
||||
const varInputs = [{ variable: '{{workflow.node.output}}' }]
|
||||
|
||||
expect(() => {
|
||||
mockGetDependentVars(varInputs)
|
||||
}).not.toThrow()
|
||||
|
||||
const result = mockGetDependentVars(varInputs)
|
||||
expect(result[0]).toEqual(['{workflow', 'node', 'output}'])
|
||||
})
|
||||
})
|
||||
|
||||
/**
|
||||
* Integration test to simulate the complete workflow scenario
|
||||
*/
|
||||
describe('Plugin Tool Workflow Integration', () => {
|
||||
/**
|
||||
* Simulate the scenario where plugin metadata is incomplete or corrupted
|
||||
* This can happen when:
|
||||
* 1. Plugin is being loaded from marketplace but metadata request fails
|
||||
* 2. Plugin configuration is corrupted in database
|
||||
* 3. Network issues during plugin loading
|
||||
*/
|
||||
it('should reproduce the client-side exception scenario', () => {
|
||||
// Mock incomplete plugin data that could cause the error
|
||||
const incompletePluginData = {
|
||||
// Missing or null uniqueIdentifier
|
||||
uniqueIdentifier: null,
|
||||
meta: null,
|
||||
minimum_dify_version: undefined,
|
||||
}
|
||||
|
||||
// This simulates the error path that leads to the white screen
|
||||
expect(() => {
|
||||
// Simulate the code path in switch-plugin-version.tsx:29
|
||||
// The actual problematic code doesn't use optional chaining
|
||||
const _pluginId = (incompletePluginData.uniqueIdentifier as any).split(':')[0]
|
||||
}).toThrow('Cannot read properties of null (reading \'split\')')
|
||||
})
|
||||
|
||||
/**
|
||||
* Test the scenario mentioned in the issue where plugin tools are loaded in workflow
|
||||
*/
|
||||
it('should simulate plugin tool loading in workflow context', () => {
|
||||
// Mock the workflow context where plugin tools are being loaded
|
||||
const workflowPluginTools = [
|
||||
{
|
||||
provider_name: 'test-plugin',
|
||||
uniqueIdentifier: null, // This is the problematic case
|
||||
tool_name: 'test-tool',
|
||||
},
|
||||
{
|
||||
provider_name: 'valid-plugin',
|
||||
uniqueIdentifier: 'valid-plugin:1.0.0',
|
||||
tool_name: 'valid-tool',
|
||||
},
|
||||
]
|
||||
|
||||
// Process each plugin tool
|
||||
workflowPluginTools.forEach((tool, _index) => {
|
||||
if (tool.uniqueIdentifier === null) {
|
||||
// This reproduces the exact error scenario
|
||||
expect(() => {
|
||||
const _pluginId = (tool.uniqueIdentifier as any).split(':')[0]
|
||||
}).toThrow()
|
||||
}
|
||||
else {
|
||||
// Valid tools should work fine
|
||||
expect(() => {
|
||||
const _pluginId = tool.uniqueIdentifier.split(':')[0]
|
||||
}).not.toThrow()
|
||||
}
|
||||
})
|
||||
})
|
||||
})
|
||||
301
web/__tests__/workflow-parallel-limit.test.tsx
Normal file
301
web/__tests__/workflow-parallel-limit.test.tsx
Normal file
@ -0,0 +1,301 @@
|
||||
/**
|
||||
* MAX_PARALLEL_LIMIT Configuration Bug Test
|
||||
*
|
||||
* This test reproduces and verifies the fix for issue #23083:
|
||||
* MAX_PARALLEL_LIMIT environment variable does not take effect in iteration panel
|
||||
*/
|
||||
|
||||
import { render, screen } from '@testing-library/react'
|
||||
import React from 'react'
|
||||
|
||||
// Mock environment variables before importing constants
|
||||
const originalEnv = process.env.NEXT_PUBLIC_MAX_PARALLEL_LIMIT
|
||||
|
||||
// Test with different environment values
|
||||
function setupEnvironment(value?: string) {
|
||||
if (value)
|
||||
process.env.NEXT_PUBLIC_MAX_PARALLEL_LIMIT = value
|
||||
else
|
||||
delete process.env.NEXT_PUBLIC_MAX_PARALLEL_LIMIT
|
||||
|
||||
// Clear module cache to force re-evaluation
|
||||
jest.resetModules()
|
||||
}
|
||||
|
||||
function restoreEnvironment() {
|
||||
if (originalEnv)
|
||||
process.env.NEXT_PUBLIC_MAX_PARALLEL_LIMIT = originalEnv
|
||||
else
|
||||
delete process.env.NEXT_PUBLIC_MAX_PARALLEL_LIMIT
|
||||
|
||||
jest.resetModules()
|
||||
}
|
||||
|
||||
// Mock i18next with proper implementation
|
||||
jest.mock('react-i18next', () => ({
|
||||
useTranslation: () => ({
|
||||
t: (key: string) => {
|
||||
if (key.includes('MaxParallelismTitle')) return 'Max Parallelism'
|
||||
if (key.includes('MaxParallelismDesc')) return 'Maximum number of parallel executions'
|
||||
if (key.includes('parallelMode')) return 'Parallel Mode'
|
||||
if (key.includes('parallelPanelDesc')) return 'Enable parallel execution'
|
||||
if (key.includes('errorResponseMethod')) return 'Error Response Method'
|
||||
return key
|
||||
},
|
||||
}),
|
||||
initReactI18next: {
|
||||
type: '3rdParty',
|
||||
init: jest.fn(),
|
||||
},
|
||||
}))
|
||||
|
||||
// Mock i18next module completely to prevent initialization issues
|
||||
jest.mock('i18next', () => ({
|
||||
use: jest.fn().mockReturnThis(),
|
||||
init: jest.fn().mockReturnThis(),
|
||||
t: jest.fn(key => key),
|
||||
isInitialized: true,
|
||||
}))
|
||||
|
||||
// Mock the useConfig hook
|
||||
jest.mock('@/app/components/workflow/nodes/iteration/use-config', () => ({
|
||||
__esModule: true,
|
||||
default: () => ({
|
||||
inputs: {
|
||||
is_parallel: true,
|
||||
parallel_nums: 5,
|
||||
error_handle_mode: 'terminated',
|
||||
},
|
||||
changeParallel: jest.fn(),
|
||||
changeParallelNums: jest.fn(),
|
||||
changeErrorHandleMode: jest.fn(),
|
||||
}),
|
||||
}))
|
||||
|
||||
// Mock other components
|
||||
jest.mock('@/app/components/workflow/nodes/_base/components/variable/var-reference-picker', () => {
|
||||
return function MockVarReferencePicker() {
|
||||
return <div data-testid="var-reference-picker">VarReferencePicker</div>
|
||||
}
|
||||
})
|
||||
|
||||
jest.mock('@/app/components/workflow/nodes/_base/components/split', () => {
|
||||
return function MockSplit() {
|
||||
return <div data-testid="split">Split</div>
|
||||
}
|
||||
})
|
||||
|
||||
jest.mock('@/app/components/workflow/nodes/_base/components/field', () => {
|
||||
return function MockField({ title, children }: { title: string, children: React.ReactNode }) {
|
||||
return (
|
||||
<div data-testid="field">
|
||||
<label>{title}</label>
|
||||
{children}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
})
|
||||
|
||||
jest.mock('@/app/components/base/switch', () => {
|
||||
return function MockSwitch({ defaultValue }: { defaultValue: boolean }) {
|
||||
return <input type="checkbox" defaultChecked={defaultValue} data-testid="switch" />
|
||||
}
|
||||
})
|
||||
|
||||
jest.mock('@/app/components/base/select', () => {
|
||||
return function MockSelect() {
|
||||
return <select data-testid="select">Select</select>
|
||||
}
|
||||
})
|
||||
|
||||
// Use defaultValue to avoid controlled input warnings
|
||||
jest.mock('@/app/components/base/slider', () => {
|
||||
return function MockSlider({ value, max, min }: { value: number, max: number, min: number }) {
|
||||
return (
|
||||
<input
|
||||
type="range"
|
||||
defaultValue={value}
|
||||
max={max}
|
||||
min={min}
|
||||
data-testid="slider"
|
||||
data-max={max}
|
||||
data-min={min}
|
||||
readOnly
|
||||
/>
|
||||
)
|
||||
}
|
||||
})
|
||||
|
||||
// Use defaultValue to avoid controlled input warnings
|
||||
jest.mock('@/app/components/base/input', () => {
|
||||
return function MockInput({ type, max, min, value }: { type: string, max: number, min: number, value: number }) {
|
||||
return (
|
||||
<input
|
||||
type={type}
|
||||
defaultValue={value}
|
||||
max={max}
|
||||
min={min}
|
||||
data-testid="number-input"
|
||||
data-max={max}
|
||||
data-min={min}
|
||||
readOnly
|
||||
/>
|
||||
)
|
||||
}
|
||||
})
|
||||
|
||||
describe('MAX_PARALLEL_LIMIT Configuration Bug', () => {
|
||||
const mockNodeData = {
|
||||
id: 'test-iteration-node',
|
||||
type: 'iteration' as const,
|
||||
data: {
|
||||
title: 'Test Iteration',
|
||||
desc: 'Test iteration node',
|
||||
iterator_selector: ['test'],
|
||||
output_selector: ['output'],
|
||||
is_parallel: true,
|
||||
parallel_nums: 5,
|
||||
error_handle_mode: 'terminated' as const,
|
||||
},
|
||||
}
|
||||
|
||||
beforeEach(() => {
|
||||
jest.clearAllMocks()
|
||||
})
|
||||
|
||||
afterEach(() => {
|
||||
restoreEnvironment()
|
||||
})
|
||||
|
||||
afterAll(() => {
|
||||
restoreEnvironment()
|
||||
})
|
||||
|
||||
describe('Environment Variable Parsing', () => {
|
||||
it('should parse MAX_PARALLEL_LIMIT from NEXT_PUBLIC_MAX_PARALLEL_LIMIT environment variable', () => {
|
||||
setupEnvironment('25')
|
||||
const { MAX_PARALLEL_LIMIT } = require('@/config')
|
||||
expect(MAX_PARALLEL_LIMIT).toBe(25)
|
||||
})
|
||||
|
||||
it('should fallback to default when environment variable is not set', () => {
|
||||
setupEnvironment() // No environment variable
|
||||
const { MAX_PARALLEL_LIMIT } = require('@/config')
|
||||
expect(MAX_PARALLEL_LIMIT).toBe(10)
|
||||
})
|
||||
|
||||
it('should handle invalid environment variable values', () => {
|
||||
setupEnvironment('invalid')
|
||||
const { MAX_PARALLEL_LIMIT } = require('@/config')
|
||||
|
||||
// Should fall back to default when parsing fails
|
||||
expect(MAX_PARALLEL_LIMIT).toBe(10)
|
||||
})
|
||||
|
||||
it('should handle empty environment variable', () => {
|
||||
setupEnvironment('')
|
||||
const { MAX_PARALLEL_LIMIT } = require('@/config')
|
||||
|
||||
// Should fall back to default when empty
|
||||
expect(MAX_PARALLEL_LIMIT).toBe(10)
|
||||
})
|
||||
|
||||
// Edge cases for boundary values
|
||||
it('should clamp MAX_PARALLEL_LIMIT to MIN when env is 0 or negative', () => {
|
||||
setupEnvironment('0')
|
||||
let { MAX_PARALLEL_LIMIT } = require('@/config')
|
||||
expect(MAX_PARALLEL_LIMIT).toBe(10) // Falls back to default
|
||||
|
||||
setupEnvironment('-5')
|
||||
;({ MAX_PARALLEL_LIMIT } = require('@/config'))
|
||||
expect(MAX_PARALLEL_LIMIT).toBe(10) // Falls back to default
|
||||
})
|
||||
|
||||
it('should handle float numbers by parseInt behavior', () => {
|
||||
setupEnvironment('12.7')
|
||||
const { MAX_PARALLEL_LIMIT } = require('@/config')
|
||||
// parseInt truncates to integer
|
||||
expect(MAX_PARALLEL_LIMIT).toBe(12)
|
||||
})
|
||||
})
|
||||
|
||||
describe('UI Component Integration (Main Fix Verification)', () => {
|
||||
it('should render iteration panel with environment-configured max value', () => {
|
||||
// Set environment variable to a different value
|
||||
setupEnvironment('30')
|
||||
|
||||
// Import Panel after setting environment
|
||||
const Panel = require('@/app/components/workflow/nodes/iteration/panel').default
|
||||
const { MAX_PARALLEL_LIMIT } = require('@/config')
|
||||
|
||||
render(
|
||||
<Panel
|
||||
id="test-node"
|
||||
data={mockNodeData.data}
|
||||
/>,
|
||||
)
|
||||
|
||||
// Behavior-focused assertion: UI max should equal MAX_PARALLEL_LIMIT
|
||||
const numberInput = screen.getByTestId('number-input')
|
||||
expect(numberInput).toHaveAttribute('data-max', String(MAX_PARALLEL_LIMIT))
|
||||
|
||||
const slider = screen.getByTestId('slider')
|
||||
expect(slider).toHaveAttribute('data-max', String(MAX_PARALLEL_LIMIT))
|
||||
|
||||
// Verify the actual values
|
||||
expect(MAX_PARALLEL_LIMIT).toBe(30)
|
||||
expect(numberInput.getAttribute('data-max')).toBe('30')
|
||||
expect(slider.getAttribute('data-max')).toBe('30')
|
||||
})
|
||||
|
||||
it('should maintain UI consistency with different environment values', () => {
|
||||
setupEnvironment('15')
|
||||
const Panel = require('@/app/components/workflow/nodes/iteration/panel').default
|
||||
const { MAX_PARALLEL_LIMIT } = require('@/config')
|
||||
|
||||
render(
|
||||
<Panel
|
||||
id="test-node"
|
||||
data={mockNodeData.data}
|
||||
/>,
|
||||
)
|
||||
|
||||
// Both input and slider should use the same max value from MAX_PARALLEL_LIMIT
|
||||
const numberInput = screen.getByTestId('number-input')
|
||||
const slider = screen.getByTestId('slider')
|
||||
|
||||
expect(numberInput.getAttribute('data-max')).toBe(slider.getAttribute('data-max'))
|
||||
expect(numberInput.getAttribute('data-max')).toBe(String(MAX_PARALLEL_LIMIT))
|
||||
})
|
||||
})
|
||||
|
||||
describe('Legacy Constant Verification (For Transition Period)', () => {
|
||||
// Marked as transition/deprecation tests
|
||||
it('should maintain MAX_ITERATION_PARALLEL_NUM for backward compatibility', () => {
|
||||
const { MAX_ITERATION_PARALLEL_NUM } = require('@/app/components/workflow/constants')
|
||||
expect(typeof MAX_ITERATION_PARALLEL_NUM).toBe('number')
|
||||
expect(MAX_ITERATION_PARALLEL_NUM).toBe(10) // Hardcoded legacy value
|
||||
})
|
||||
|
||||
it('should demonstrate MAX_PARALLEL_LIMIT vs legacy constant difference', () => {
|
||||
setupEnvironment('50')
|
||||
const { MAX_PARALLEL_LIMIT } = require('@/config')
|
||||
const { MAX_ITERATION_PARALLEL_NUM } = require('@/app/components/workflow/constants')
|
||||
|
||||
// MAX_PARALLEL_LIMIT is configurable, MAX_ITERATION_PARALLEL_NUM is not
|
||||
expect(MAX_PARALLEL_LIMIT).toBe(50)
|
||||
expect(MAX_ITERATION_PARALLEL_NUM).toBe(10)
|
||||
expect(MAX_PARALLEL_LIMIT).not.toBe(MAX_ITERATION_PARALLEL_NUM)
|
||||
})
|
||||
})
|
||||
|
||||
describe('Constants Validation', () => {
|
||||
it('should validate that required constants exist and have correct types', () => {
|
||||
const { MAX_PARALLEL_LIMIT } = require('@/config')
|
||||
const { MIN_ITERATION_PARALLEL_NUM } = require('@/app/components/workflow/constants')
|
||||
expect(typeof MAX_PARALLEL_LIMIT).toBe('number')
|
||||
expect(typeof MIN_ITERATION_PARALLEL_NUM).toBe('number')
|
||||
expect(MAX_PARALLEL_LIMIT).toBeGreaterThanOrEqual(MIN_ITERATION_PARALLEL_NUM)
|
||||
})
|
||||
})
|
||||
})
|
||||
79
web/app/components/app/annotation/batch-action.tsx
Normal file
79
web/app/components/app/annotation/batch-action.tsx
Normal file
@ -0,0 +1,79 @@
|
||||
import React, { type FC } from 'react'
|
||||
import { RiDeleteBinLine } from '@remixicon/react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { useBoolean } from 'ahooks'
|
||||
import Divider from '@/app/components/base/divider'
|
||||
import classNames from '@/utils/classnames'
|
||||
import Confirm from '@/app/components/base/confirm'
|
||||
|
||||
const i18nPrefix = 'appAnnotation.batchAction'
|
||||
|
||||
type IBatchActionProps = {
|
||||
className?: string
|
||||
selectedIds: string[]
|
||||
onBatchDelete: () => Promise<void>
|
||||
onCancel: () => void
|
||||
}
|
||||
|
||||
const BatchAction: FC<IBatchActionProps> = ({
|
||||
className,
|
||||
selectedIds,
|
||||
onBatchDelete,
|
||||
onCancel,
|
||||
}) => {
|
||||
const { t } = useTranslation()
|
||||
const [isShowDeleteConfirm, {
|
||||
setTrue: showDeleteConfirm,
|
||||
setFalse: hideDeleteConfirm,
|
||||
}] = useBoolean(false)
|
||||
const [isDeleting, {
|
||||
setTrue: setIsDeleting,
|
||||
setFalse: setIsNotDeleting,
|
||||
}] = useBoolean(false)
|
||||
|
||||
const handleBatchDelete = async () => {
|
||||
setIsDeleting()
|
||||
await onBatchDelete()
|
||||
hideDeleteConfirm()
|
||||
setIsNotDeleting()
|
||||
}
|
||||
return (
|
||||
<div className={classNames('pointer-events-none flex w-full justify-center', className)}>
|
||||
<div className='pointer-events-auto flex items-center gap-x-1 rounded-[10px] border border-components-actionbar-border-accent bg-components-actionbar-bg-accent p-1 shadow-xl shadow-shadow-shadow-5 backdrop-blur-[5px]'>
|
||||
<div className='inline-flex items-center gap-x-2 py-1 pl-2 pr-3'>
|
||||
<span className='flex h-5 w-5 items-center justify-center rounded-md bg-text-accent px-1 py-0.5 text-xs font-medium text-text-primary-on-surface'>
|
||||
{selectedIds.length}
|
||||
</span>
|
||||
<span className='text-[13px] font-semibold leading-[16px] text-text-accent'>{t(`${i18nPrefix}.selected`)}</span>
|
||||
</div>
|
||||
<Divider type='vertical' className='mx-0.5 h-3.5 bg-divider-regular' />
|
||||
<div className='flex cursor-pointer items-center gap-x-0.5 px-3 py-2' onClick={showDeleteConfirm}>
|
||||
<RiDeleteBinLine className='h-4 w-4 text-components-button-destructive-ghost-text' />
|
||||
<button type='button' className='px-0.5 text-[13px] font-medium leading-[16px] text-components-button-destructive-ghost-text' >
|
||||
{t('common.operation.delete')}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<Divider type='vertical' className='mx-0.5 h-3.5 bg-divider-regular' />
|
||||
<button type='button' className='px-3.5 py-2 text-[13px] font-medium leading-[16px] text-components-button-ghost-text' onClick={onCancel}>
|
||||
{t('common.operation.cancel')}
|
||||
</button>
|
||||
</div>
|
||||
{
|
||||
isShowDeleteConfirm && (
|
||||
<Confirm
|
||||
isShow
|
||||
title={t('appAnnotation.list.delete.title')}
|
||||
confirmText={t('common.operation.delete')}
|
||||
onConfirm={handleBatchDelete}
|
||||
onCancel={hideDeleteConfirm}
|
||||
isLoading={isDeleting}
|
||||
isDisabled={isDeleting}
|
||||
/>
|
||||
)
|
||||
}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default React.memo(BatchAction)
|
||||
@ -26,6 +26,7 @@ import { useProviderContext } from '@/context/provider-context'
|
||||
import AnnotationFullModal from '@/app/components/billing/annotation-full/modal'
|
||||
import type { App } from '@/types/app'
|
||||
import cn from '@/utils/classnames'
|
||||
import { delAnnotations } from '@/service/annotation'
|
||||
|
||||
type Props = {
|
||||
appDetail: App
|
||||
@ -50,7 +51,9 @@ const Annotation: FC<Props> = (props) => {
|
||||
const [controlUpdateList, setControlUpdateList] = useState(Date.now())
|
||||
const [currItem, setCurrItem] = useState<AnnotationItem | null>(null)
|
||||
const [isShowViewModal, setIsShowViewModal] = useState(false)
|
||||
const [selectedIds, setSelectedIds] = useState<string[]>([])
|
||||
const debouncedQueryParams = useDebounce(queryParams, { wait: 500 })
|
||||
const [isBatchDeleting, setIsBatchDeleting] = useState(false)
|
||||
|
||||
const fetchAnnotationConfig = async () => {
|
||||
const res = await doFetchAnnotationConfig(appDetail.id)
|
||||
@ -60,7 +63,6 @@ const Annotation: FC<Props> = (props) => {
|
||||
|
||||
useEffect(() => {
|
||||
if (isChatApp) fetchAnnotationConfig()
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [])
|
||||
|
||||
const ensureJobCompleted = async (jobId: string, status: AnnotationEnableStatus) => {
|
||||
@ -89,7 +91,6 @@ const Annotation: FC<Props> = (props) => {
|
||||
|
||||
useEffect(() => {
|
||||
fetchList(currPage + 1)
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [currPage, limit, debouncedQueryParams])
|
||||
|
||||
const handleAdd = async (payload: AnnotationItemBasic) => {
|
||||
@ -106,6 +107,25 @@ const Annotation: FC<Props> = (props) => {
|
||||
setControlUpdateList(Date.now())
|
||||
}
|
||||
|
||||
const handleBatchDelete = async () => {
|
||||
if (isBatchDeleting)
|
||||
return
|
||||
setIsBatchDeleting(true)
|
||||
try {
|
||||
await delAnnotations(appDetail.id, selectedIds)
|
||||
Toast.notify({ message: t('common.api.actionSuccess'), type: 'success' })
|
||||
fetchList()
|
||||
setControlUpdateList(Date.now())
|
||||
setSelectedIds([])
|
||||
}
|
||||
catch (e: any) {
|
||||
Toast.notify({ type: 'error', message: e.message || t('common.api.actionFailed') })
|
||||
}
|
||||
finally {
|
||||
setIsBatchDeleting(false)
|
||||
}
|
||||
}
|
||||
|
||||
const handleView = (item: AnnotationItem) => {
|
||||
setCurrItem(item)
|
||||
setIsShowViewModal(true)
|
||||
@ -189,6 +209,11 @@ const Annotation: FC<Props> = (props) => {
|
||||
list={list}
|
||||
onRemove={handleRemove}
|
||||
onView={handleView}
|
||||
selectedIds={selectedIds}
|
||||
onSelectedIdsChange={setSelectedIds}
|
||||
onBatchDelete={handleBatchDelete}
|
||||
onCancel={() => setSelectedIds([])}
|
||||
isBatchDeleting={isBatchDeleting}
|
||||
/>
|
||||
: <div className='flex h-full grow items-center justify-center'><EmptyElement /></div>
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
'use client'
|
||||
import type { FC } from 'react'
|
||||
import React from 'react'
|
||||
import React, { useCallback, useMemo } from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { RiDeleteBinLine, RiEditLine } from '@remixicon/react'
|
||||
import type { AnnotationItem } from './type'
|
||||
@ -8,28 +8,67 @@ import RemoveAnnotationConfirmModal from './remove-annotation-confirm-modal'
|
||||
import ActionButton from '@/app/components/base/action-button'
|
||||
import useTimestamp from '@/hooks/use-timestamp'
|
||||
import cn from '@/utils/classnames'
|
||||
import Checkbox from '@/app/components/base/checkbox'
|
||||
import BatchAction from './batch-action'
|
||||
|
||||
type Props = {
|
||||
list: AnnotationItem[]
|
||||
onRemove: (id: string) => void
|
||||
onView: (item: AnnotationItem) => void
|
||||
onRemove: (id: string) => void
|
||||
selectedIds: string[]
|
||||
onSelectedIdsChange: (selectedIds: string[]) => void
|
||||
onBatchDelete: () => Promise<void>
|
||||
onCancel: () => void
|
||||
isBatchDeleting?: boolean
|
||||
}
|
||||
|
||||
const List: FC<Props> = ({
|
||||
list,
|
||||
onView,
|
||||
onRemove,
|
||||
selectedIds,
|
||||
onSelectedIdsChange,
|
||||
onBatchDelete,
|
||||
onCancel,
|
||||
isBatchDeleting,
|
||||
}) => {
|
||||
const { t } = useTranslation()
|
||||
const { formatTime } = useTimestamp()
|
||||
const [currId, setCurrId] = React.useState<string | null>(null)
|
||||
const [showConfirmDelete, setShowConfirmDelete] = React.useState(false)
|
||||
|
||||
const isAllSelected = useMemo(() => {
|
||||
return list.length > 0 && list.every(item => selectedIds.includes(item.id))
|
||||
}, [list, selectedIds])
|
||||
|
||||
const isSomeSelected = useMemo(() => {
|
||||
return list.some(item => selectedIds.includes(item.id))
|
||||
}, [list, selectedIds])
|
||||
|
||||
const handleSelectAll = useCallback(() => {
|
||||
const currentPageIds = list.map(item => item.id)
|
||||
const otherPageIds = selectedIds.filter(id => !currentPageIds.includes(id))
|
||||
|
||||
if (isAllSelected)
|
||||
onSelectedIdsChange(otherPageIds)
|
||||
else
|
||||
onSelectedIdsChange([...otherPageIds, ...currentPageIds])
|
||||
}, [isAllSelected, list, selectedIds, onSelectedIdsChange])
|
||||
|
||||
return (
|
||||
<div className='overflow-x-auto'>
|
||||
<div className='relative grow overflow-x-auto'>
|
||||
<table className={cn('mt-2 w-full min-w-[440px] border-collapse border-0')}>
|
||||
<thead className='system-xs-medium-uppercase text-text-tertiary'>
|
||||
<tr>
|
||||
<td className='w-5 whitespace-nowrap rounded-l-lg bg-background-section-burn pl-2 pr-1'>{t('appAnnotation.table.header.question')}</td>
|
||||
<td className='w-12 whitespace-nowrap rounded-l-lg bg-background-section-burn px-2'>
|
||||
<Checkbox
|
||||
className='mr-2'
|
||||
checked={isAllSelected}
|
||||
indeterminate={!isAllSelected && isSomeSelected}
|
||||
onCheck={handleSelectAll}
|
||||
/>
|
||||
</td>
|
||||
<td className='w-5 whitespace-nowrap bg-background-section-burn pl-2 pr-1'>{t('appAnnotation.table.header.question')}</td>
|
||||
<td className='whitespace-nowrap bg-background-section-burn py-1.5 pl-3'>{t('appAnnotation.table.header.answer')}</td>
|
||||
<td className='whitespace-nowrap bg-background-section-burn py-1.5 pl-3'>{t('appAnnotation.table.header.createdAt')}</td>
|
||||
<td className='whitespace-nowrap bg-background-section-burn py-1.5 pl-3'>{t('appAnnotation.table.header.hits')}</td>
|
||||
@ -47,6 +86,18 @@ const List: FC<Props> = ({
|
||||
}
|
||||
}
|
||||
>
|
||||
<td className='w-12 px-2' onClick={e => e.stopPropagation()}>
|
||||
<Checkbox
|
||||
className='mr-2'
|
||||
checked={selectedIds.includes(item.id)}
|
||||
onCheck={() => {
|
||||
if (selectedIds.includes(item.id))
|
||||
onSelectedIdsChange(selectedIds.filter(id => id !== item.id))
|
||||
else
|
||||
onSelectedIdsChange([...selectedIds, item.id])
|
||||
}}
|
||||
/>
|
||||
</td>
|
||||
<td
|
||||
className='max-w-[250px] overflow-hidden text-ellipsis whitespace-nowrap p-3 pr-2'
|
||||
title={item.question}
|
||||
@ -85,6 +136,15 @@ const List: FC<Props> = ({
|
||||
setShowConfirmDelete(false)
|
||||
}}
|
||||
/>
|
||||
{selectedIds.length > 0 && (
|
||||
<BatchAction
|
||||
className='absolute bottom-6 left-1/2 z-20 -translate-x-1/2'
|
||||
selectedIds={selectedIds}
|
||||
onBatchDelete={onBatchDelete}
|
||||
onCancel={onCancel}
|
||||
isBatchDeleting={isBatchDeleting}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
@ -124,6 +124,8 @@ const DetailHeader = ({
|
||||
const isAutoUpgradeEnabled = useMemo(() => {
|
||||
if (!autoUpgradeInfo || !isFromMarketplace)
|
||||
return false
|
||||
if(autoUpgradeInfo.strategy_setting === 'disabled')
|
||||
return false
|
||||
if(autoUpgradeInfo.upgrade_mode === AUTO_UPDATE_MODE.update_all)
|
||||
return true
|
||||
if(autoUpgradeInfo.upgrade_mode === AUTO_UPDATE_MODE.partial && autoUpgradeInfo.include_plugins.includes(plugin_id))
|
||||
|
||||
@ -35,14 +35,6 @@ export const NODE_LAYOUT_HORIZONTAL_PADDING = 60
|
||||
export const NODE_LAYOUT_VERTICAL_PADDING = 60
|
||||
export const NODE_LAYOUT_MIN_DISTANCE = 100
|
||||
|
||||
let maxParallelLimit = 10
|
||||
|
||||
if (process.env.NEXT_PUBLIC_MAX_PARALLEL_LIMIT && process.env.NEXT_PUBLIC_MAX_PARALLEL_LIMIT !== '')
|
||||
maxParallelLimit = Number.parseInt(process.env.NEXT_PUBLIC_MAX_PARALLEL_LIMIT)
|
||||
else if (globalThis.document?.body?.getAttribute('data-public-max-parallel-limit') && globalThis.document.body.getAttribute('data-public-max-parallel-limit') !== '')
|
||||
maxParallelLimit = Number.parseInt(globalThis.document.body.getAttribute('data-public-max-parallel-limit') as string)
|
||||
|
||||
export const PARALLEL_LIMIT = maxParallelLimit
|
||||
export const PARALLEL_DEPTH_LIMIT = 3
|
||||
|
||||
export const RETRIEVAL_OUTPUT_STRUCT = `{
|
||||
|
||||
@ -27,7 +27,6 @@ import {
|
||||
import { getParallelInfo } from '../utils'
|
||||
import {
|
||||
PARALLEL_DEPTH_LIMIT,
|
||||
PARALLEL_LIMIT,
|
||||
SUPPORT_OUTPUT_VARS_NODE,
|
||||
} from '../constants'
|
||||
import type { IterationNodeType } from '../nodes/iteration/types'
|
||||
@ -45,6 +44,8 @@ import {
|
||||
import { CUSTOM_ITERATION_START_NODE } from '@/app/components/workflow/nodes/iteration-start/constants'
|
||||
import { CUSTOM_LOOP_START_NODE } from '@/app/components/workflow/nodes/loop-start/constants'
|
||||
import { basePath } from '@/utils/var'
|
||||
import { canFindTool } from '@/utils'
|
||||
import { MAX_PARALLEL_LIMIT } from '@/config'
|
||||
import { useNodesMetaData } from '.'
|
||||
|
||||
export const useIsChatMode = () => {
|
||||
@ -257,8 +258,6 @@ export const useWorkflow = () => {
|
||||
})
|
||||
setNodes(newNodes)
|
||||
}
|
||||
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [store])
|
||||
|
||||
const isVarUsedInNodes = useCallback((varSelector: ValueSelector) => {
|
||||
@ -297,9 +296,9 @@ export const useWorkflow = () => {
|
||||
edges,
|
||||
} = store.getState()
|
||||
const connectedEdges = edges.filter(edge => edge.source === nodeId && edge.sourceHandle === nodeHandle)
|
||||
if (connectedEdges.length > PARALLEL_LIMIT - 1) {
|
||||
if (connectedEdges.length > MAX_PARALLEL_LIMIT - 1) {
|
||||
const { setShowTips } = workflowStore.getState()
|
||||
setShowTips(t('workflow.common.parallelTip.limit', { num: PARALLEL_LIMIT }))
|
||||
setShowTips(t('workflow.common.parallelTip.limit', { num: MAX_PARALLEL_LIMIT }))
|
||||
return false
|
||||
}
|
||||
|
||||
|
||||
@ -26,7 +26,8 @@ export type SwitchPluginVersionProps = {
|
||||
|
||||
export const SwitchPluginVersion: FC<SwitchPluginVersionProps> = (props) => {
|
||||
const { uniqueIdentifier, tooltip, onChange, className } = props
|
||||
const [pluginId] = uniqueIdentifier.split(':')
|
||||
|
||||
const [pluginId] = uniqueIdentifier?.split(':') || ['']
|
||||
const [isShow, setIsShow] = useState(false)
|
||||
const [isShowUpdateModal, { setTrue: showUpdateModal, setFalse: hideUpdateModal }] = useBoolean(false)
|
||||
const [target, setTarget] = useState<{
|
||||
@ -60,6 +61,11 @@ export const SwitchPluginVersion: FC<SwitchPluginVersionProps> = (props) => {
|
||||
})
|
||||
}
|
||||
const { t } = useTranslation()
|
||||
|
||||
// Guard against null/undefined uniqueIdentifier to prevent app crash
|
||||
if (!uniqueIdentifier || !pluginId)
|
||||
return null
|
||||
|
||||
return <Tooltip popupContent={!isShow && !isShowUpdateModal && tooltip} triggerMethod='hover'>
|
||||
<div className={cn('flex w-fit items-center justify-center', className)} onClick={e => e.stopPropagation()}>
|
||||
{isShowUpdateModal && pluginDetail && <PluginMutationModel
|
||||
|
||||
@ -19,6 +19,7 @@ import useLoopSingleRunFormParams from '@/app/components/workflow/nodes/loop/use
|
||||
import useIfElseSingleRunFormParams from '@/app/components/workflow/nodes/if-else/use-single-run-form-params'
|
||||
import useVariableAggregatorSingleRunFormParams from '@/app/components/workflow/nodes/variable-assigner/use-single-run-form-params'
|
||||
import useVariableAssignerSingleRunFormParams from '@/app/components/workflow/nodes/assigner/use-single-run-form-params'
|
||||
import useKnowledgeBaseSingleRunFormParams from '@/app/components/workflow/nodes/knowledge-base/use-single-run-form-params'
|
||||
|
||||
import useToolGetDataForCheckMore from '@/app/components/workflow/nodes/tool/use-get-data-for-check-more'
|
||||
import { VALUE_SELECTOR_DELIMITER as DELIMITER } from '@/config'
|
||||
@ -51,6 +52,7 @@ const singleRunFormParamsHooks: Record<BlockEnum, any> = {
|
||||
[BlockEnum.IfElse]: useIfElseSingleRunFormParams,
|
||||
[BlockEnum.VariableAggregator]: useVariableAggregatorSingleRunFormParams,
|
||||
[BlockEnum.Assigner]: useVariableAssignerSingleRunFormParams,
|
||||
[BlockEnum.KnowledgeBase]: useKnowledgeBaseSingleRunFormParams,
|
||||
[BlockEnum.VariableAssigner]: undefined,
|
||||
[BlockEnum.End]: undefined,
|
||||
[BlockEnum.Answer]: undefined,
|
||||
@ -60,7 +62,6 @@ const singleRunFormParamsHooks: Record<BlockEnum, any> = {
|
||||
[BlockEnum.LoopEnd]: undefined,
|
||||
[BlockEnum.DataSource]: undefined,
|
||||
[BlockEnum.DataSourceEmpty]: undefined,
|
||||
[BlockEnum.KnowledgeBase]: undefined,
|
||||
}
|
||||
|
||||
const useSingleRunFormParamsHooks = (nodeType: BlockEnum) => {
|
||||
|
||||
@ -77,7 +77,13 @@ const useSingleRunFormParams = ({
|
||||
}, [runResult, t])
|
||||
|
||||
const getDependentVars = () => {
|
||||
return varInputs.map(item => item.variable.slice(1, -1).split('.'))
|
||||
return varInputs.map((item) => {
|
||||
// Guard against null/undefined variable to prevent app crash
|
||||
if (!item.variable || typeof item.variable !== 'string')
|
||||
return []
|
||||
|
||||
return item.variable.slice(1, -1).split('.')
|
||||
}).filter(arr => arr.length > 0)
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
@ -20,7 +20,7 @@ const InputField: FC<{
|
||||
description: string
|
||||
placeholder: string
|
||||
value?: number
|
||||
onChange: (value: number) => void
|
||||
onChange: (value: number | undefined) => void
|
||||
readOnly?: boolean
|
||||
min: number
|
||||
max: number
|
||||
@ -35,8 +35,18 @@ const InputField: FC<{
|
||||
type='number'
|
||||
value={value}
|
||||
onChange={(e) => {
|
||||
const value = Math.max(min, Math.min(max, Number.parseInt(e.target.value, 10)))
|
||||
onChange(value)
|
||||
const inputValue = e.target.value
|
||||
if (inputValue === '') {
|
||||
// When user clears the input, set to undefined to let backend use default values
|
||||
onChange(undefined)
|
||||
}
|
||||
else {
|
||||
const parsedValue = Number.parseInt(inputValue, 10)
|
||||
if (!Number.isNaN(parsedValue)) {
|
||||
const value = Math.max(min, Math.min(max, parsedValue))
|
||||
onChange(value)
|
||||
}
|
||||
}
|
||||
}}
|
||||
placeholder={placeholder}
|
||||
readOnly={readOnly}
|
||||
|
||||
@ -62,7 +62,13 @@ const useSingleRunFormParams = ({
|
||||
}, [inputVarValues, setInputVarValues, varInputs])
|
||||
|
||||
const getDependentVars = () => {
|
||||
return varInputs.map(item => item.variable.slice(1, -1).split('.'))
|
||||
return varInputs.map((item) => {
|
||||
// Guard against null/undefined variable to prevent app crash
|
||||
if (!item.variable || typeof item.variable !== 'string')
|
||||
return []
|
||||
|
||||
return item.variable.slice(1, -1).split('.')
|
||||
}).filter(arr => arr.length > 0)
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
@ -3,7 +3,7 @@ import React from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import VarReferencePicker from '../_base/components/variable/var-reference-picker'
|
||||
import Split from '../_base/components/split'
|
||||
import { MAX_ITERATION_PARALLEL_NUM, MIN_ITERATION_PARALLEL_NUM } from '../../constants'
|
||||
import { MIN_ITERATION_PARALLEL_NUM } from '../../constants'
|
||||
import type { IterationNodeType } from './types'
|
||||
import useConfig from './use-config'
|
||||
import { ErrorHandleMode, type NodePanelProps } from '@/app/components/workflow/types'
|
||||
@ -12,6 +12,7 @@ import Switch from '@/app/components/base/switch'
|
||||
import Select from '@/app/components/base/select'
|
||||
import Slider from '@/app/components/base/slider'
|
||||
import Input from '@/app/components/base/input'
|
||||
import { MAX_PARALLEL_LIMIT } from '@/config'
|
||||
|
||||
const i18nPrefix = 'workflow.nodes.iteration'
|
||||
|
||||
@ -96,11 +97,11 @@ const Panel: FC<NodePanelProps<IterationNodeType>> = ({
|
||||
inputs.is_parallel && (<div className='px-4 pb-2'>
|
||||
<Field title={t(`${i18nPrefix}.MaxParallelismTitle`)} isSubTitle tooltip={<div className='w-[230px]'>{t(`${i18nPrefix}.MaxParallelismDesc`)}</div>}>
|
||||
<div className='row flex'>
|
||||
<Input type='number' wrapperClassName='w-18 mr-4 ' max={MAX_ITERATION_PARALLEL_NUM} min={MIN_ITERATION_PARALLEL_NUM} value={inputs.parallel_nums} onChange={(e) => { changeParallelNums(Number(e.target.value)) }} />
|
||||
<Input type='number' wrapperClassName='w-18 mr-4 ' max={MAX_PARALLEL_LIMIT} min={MIN_ITERATION_PARALLEL_NUM} value={inputs.parallel_nums} onChange={(e) => { changeParallelNums(Number(e.target.value)) }} />
|
||||
<Slider
|
||||
value={inputs.parallel_nums}
|
||||
onChange={changeParallelNums}
|
||||
max={MAX_ITERATION_PARALLEL_NUM}
|
||||
max={MAX_PARALLEL_LIMIT}
|
||||
min={MIN_ITERATION_PARALLEL_NUM}
|
||||
className=' mt-4 flex-1 shrink-0'
|
||||
/>
|
||||
|
||||
@ -0,0 +1,59 @@
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import type { InputVar, Variable } from '@/app/components/workflow/types'
|
||||
import { InputVarType } from '@/app/components/workflow/types'
|
||||
import { useCallback, useMemo } from 'react'
|
||||
import type { KnowledgeBaseNodeType } from './types'
|
||||
|
||||
type Params = {
|
||||
id: string,
|
||||
payload: KnowledgeBaseNodeType
|
||||
runInputData: Record<string, any>
|
||||
getInputVars: (textList: string[]) => InputVar[]
|
||||
setRunInputData: (data: Record<string, any>) => void
|
||||
toVarInputs: (variables: Variable[]) => InputVar[]
|
||||
}
|
||||
const useSingleRunFormParams = ({
|
||||
payload,
|
||||
runInputData,
|
||||
setRunInputData,
|
||||
}: Params) => {
|
||||
const { t } = useTranslation()
|
||||
const query = runInputData.query
|
||||
const setQuery = useCallback((newQuery: string) => {
|
||||
setRunInputData({
|
||||
...runInputData,
|
||||
query: newQuery,
|
||||
})
|
||||
}, [runInputData, setRunInputData])
|
||||
|
||||
const forms = useMemo(() => {
|
||||
return [
|
||||
{
|
||||
inputs: [{
|
||||
label: t('workflow.nodes.common.inputVars'),
|
||||
variable: 'query',
|
||||
type: InputVarType.paragraph,
|
||||
required: true,
|
||||
}],
|
||||
values: { query },
|
||||
onChange: (keyValue: Record<string, any>) => setQuery(keyValue.query),
|
||||
},
|
||||
]
|
||||
}, [query, setQuery, t])
|
||||
|
||||
const getDependentVars = () => {
|
||||
return [payload.index_chunk_variable_selector]
|
||||
}
|
||||
const getDependentVar = (variable: string) => {
|
||||
if(variable === 'query')
|
||||
return payload.index_chunk_variable_selector
|
||||
}
|
||||
|
||||
return {
|
||||
forms,
|
||||
getDependentVars,
|
||||
getDependentVar,
|
||||
}
|
||||
}
|
||||
|
||||
export default useSingleRunFormParams
|
||||
@ -32,6 +32,8 @@ export const getOperators = (type?: MetadataFilteringVariableType) => {
|
||||
ComparisonOperator.endWith,
|
||||
ComparisonOperator.empty,
|
||||
ComparisonOperator.notEmpty,
|
||||
ComparisonOperator.in,
|
||||
ComparisonOperator.notIn,
|
||||
]
|
||||
case MetadataFilteringVariableType.number:
|
||||
return [
|
||||
|
||||
@ -15,18 +15,21 @@ import cn from '@/utils/classnames'
|
||||
import { VarType } from '../../../types'
|
||||
|
||||
const optionNameI18NPrefix = 'workflow.nodes.ifElse.optionName'
|
||||
import { getConditionValueAsString } from '@/app/components/workflow/nodes/utils'
|
||||
|
||||
const VAR_INPUT_SUPPORTED_KEYS: Record<string, VarType> = {
|
||||
name: VarType.string,
|
||||
url: VarType.string,
|
||||
extension: VarType.string,
|
||||
mime_type: VarType.string,
|
||||
related_id: VarType.number,
|
||||
related_id: VarType.string,
|
||||
size: VarType.number,
|
||||
}
|
||||
|
||||
type Props = {
|
||||
condition: Condition
|
||||
onChange: (condition: Condition) => void
|
||||
varType: VarType
|
||||
hasSubVariable: boolean
|
||||
readOnly: boolean
|
||||
nodeId: string
|
||||
@ -34,6 +37,7 @@ type Props = {
|
||||
|
||||
const FilterCondition: FC<Props> = ({
|
||||
condition = { key: '', comparison_operator: ComparisonOperator.equal, value: '' },
|
||||
varType,
|
||||
onChange,
|
||||
hasSubVariable,
|
||||
readOnly,
|
||||
@ -42,7 +46,7 @@ const FilterCondition: FC<Props> = ({
|
||||
const { t } = useTranslation()
|
||||
const [isFocus, setIsFocus] = useState(false)
|
||||
|
||||
const expectedVarType = VAR_INPUT_SUPPORTED_KEYS[condition.key]
|
||||
const expectedVarType = condition.key ? VAR_INPUT_SUPPORTED_KEYS[condition.key] : varType
|
||||
const supportVariableInput = !!expectedVarType
|
||||
|
||||
const { availableVars, availableNodesWithParent } = useAvailableVarList(nodeId, {
|
||||
@ -93,6 +97,59 @@ const FilterCondition: FC<Props> = ({
|
||||
})
|
||||
}, [onChange, expectedVarType])
|
||||
|
||||
// Extract input rendering logic to avoid nested ternary
|
||||
let inputElement: React.ReactNode = null
|
||||
if (!comparisonOperatorNotRequireValue(condition.comparison_operator)) {
|
||||
if (isSelect) {
|
||||
inputElement = (
|
||||
<Select
|
||||
items={selectOptions}
|
||||
defaultValue={isArrayValue ? (condition.value as string[])[0] : condition.value as string}
|
||||
onSelect={item => handleChange('value')(item.value)}
|
||||
className='!text-[13px]'
|
||||
wrapperClassName='grow h-8'
|
||||
placeholder='Select value'
|
||||
/>
|
||||
)
|
||||
}
|
||||
else if (supportVariableInput) {
|
||||
inputElement = (
|
||||
<Input
|
||||
instanceId='filter-condition-input'
|
||||
className={cn(
|
||||
isFocus
|
||||
? 'border-components-input-border-active bg-components-input-bg-active shadow-xs'
|
||||
: 'border-components-input-border-hover bg-components-input-bg-normal',
|
||||
'w-0 grow rounded-lg border px-3 py-[6px]',
|
||||
)}
|
||||
value={
|
||||
getConditionValueAsString(condition)
|
||||
}
|
||||
onChange={handleChange('value')}
|
||||
readOnly={readOnly}
|
||||
nodesOutputVars={availableVars}
|
||||
availableNodes={availableNodesWithParent}
|
||||
onFocusChange={setIsFocus}
|
||||
placeholder={!readOnly ? t('workflow.nodes.http.insertVarPlaceholder')! : ''}
|
||||
placeholderClassName='!leading-[21px]'
|
||||
/>
|
||||
)
|
||||
}
|
||||
else {
|
||||
inputElement = (
|
||||
<input
|
||||
type={((hasSubVariable && condition.key === 'size') || (!hasSubVariable && varType === VarType.number)) ? 'number' : 'text'}
|
||||
className='grow rounded-lg border border-components-input-border-hover bg-components-input-bg-normal px-3 py-[6px]'
|
||||
value={
|
||||
getConditionValueAsString(condition)
|
||||
}
|
||||
onChange={e => handleChange('value')(e.target.value)}
|
||||
readOnly={readOnly}
|
||||
/>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<div>
|
||||
{hasSubVariable && (
|
||||
@ -111,46 +168,7 @@ const FilterCondition: FC<Props> = ({
|
||||
file={hasSubVariable ? { key: condition.key } : undefined}
|
||||
disabled={readOnly}
|
||||
/>
|
||||
{!comparisonOperatorNotRequireValue(condition.comparison_operator) && (
|
||||
<>
|
||||
{isSelect ? (
|
||||
<Select
|
||||
items={selectOptions}
|
||||
defaultValue={isArrayValue ? (condition.value as string[])[0] : condition.value as string}
|
||||
onSelect={item => handleChange('value')(item.value)}
|
||||
className='!text-[13px]'
|
||||
wrapperClassName='grow h-8'
|
||||
placeholder='Select value'
|
||||
/>
|
||||
) : supportVariableInput ? (
|
||||
<Input
|
||||
instanceId='filter-condition-input'
|
||||
className={cn(
|
||||
isFocus
|
||||
? 'border-components-input-border-active bg-components-input-bg-active shadow-xs'
|
||||
: 'border-components-input-border-hover bg-components-input-bg-normal',
|
||||
'w-0 grow rounded-lg border px-3 py-[6px]',
|
||||
)}
|
||||
value={condition.value}
|
||||
onChange={handleChange('value')}
|
||||
readOnly={readOnly}
|
||||
nodesOutputVars={availableVars}
|
||||
availableNodes={availableNodesWithParent}
|
||||
onFocusChange={setIsFocus}
|
||||
placeholder={!readOnly ? t('workflow.nodes.http.extractListPlaceholder')! : ''}
|
||||
placeholderClassName='!leading-[21px]'
|
||||
/>
|
||||
) : (
|
||||
<input
|
||||
type={(condition.key === 'size' || expectedVarType === VarType.number) ? 'number' : 'text'}
|
||||
className='grow rounded-lg border border-components-input-border-hover bg-components-input-bg-normal px-3 py-[6px]'
|
||||
value={condition.value}
|
||||
onChange={e => handleChange('value')(e.target.value)}
|
||||
readOnly={readOnly}
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
{inputElement}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
|
||||
@ -168,7 +168,13 @@ const useSingleRunFormParams = ({
|
||||
})()
|
||||
|
||||
const getDependentVars = () => {
|
||||
const promptVars = varInputs.map(item => item.variable.slice(1, -1).split('.'))
|
||||
const promptVars = varInputs.map((item) => {
|
||||
// Guard against null/undefined variable to prevent app crash
|
||||
if (!item.variable || typeof item.variable !== 'string')
|
||||
return []
|
||||
|
||||
return item.variable.slice(1, -1).split('.')
|
||||
}).filter(arr => arr.length > 0)
|
||||
const contextVar = payload.context.variable_selector
|
||||
const vars = [...promptVars, contextVar]
|
||||
if (isVisionModel && payload.vision?.enabled && payload.vision?.configs?.variable_selector) {
|
||||
|
||||
@ -120,7 +120,13 @@ const useSingleRunFormParams = ({
|
||||
})()
|
||||
|
||||
const getDependentVars = () => {
|
||||
const promptVars = varInputs.map(item => item.variable.slice(1, -1).split('.'))
|
||||
const promptVars = varInputs.map((item) => {
|
||||
// Guard against null/undefined variable to prevent app crash
|
||||
if (!item.variable || typeof item.variable !== 'string')
|
||||
return []
|
||||
|
||||
return item.variable.slice(1, -1).split('.')
|
||||
}).filter(arr => arr.length > 0)
|
||||
const vars = [payload.query, ...promptVars]
|
||||
if (isVisionModel && payload.vision?.enabled && payload.vision?.configs?.variable_selector) {
|
||||
const visionVar = payload.vision.configs.variable_selector
|
||||
|
||||
@ -118,7 +118,13 @@ const useSingleRunFormParams = ({
|
||||
})()
|
||||
|
||||
const getDependentVars = () => {
|
||||
const promptVars = varInputs.map(item => item.variable.slice(1, -1).split('.'))
|
||||
const promptVars = varInputs.map((item) => {
|
||||
// Guard against null/undefined variable to prevent app crash
|
||||
if (!item.variable || typeof item.variable !== 'string')
|
||||
return []
|
||||
|
||||
return item.variable.slice(1, -1).split('.')
|
||||
}).filter(arr => arr.length > 0)
|
||||
const vars = [payload.query_variable_selector, ...promptVars]
|
||||
if (isVisionModel && payload.vision?.enabled && payload.vision?.configs?.variable_selector) {
|
||||
const visionVar = payload.vision.configs.variable_selector
|
||||
|
||||
@ -88,7 +88,13 @@ const useSingleRunFormParams = ({
|
||||
const toolIcon = useToolIcon(payload)
|
||||
|
||||
const getDependentVars = () => {
|
||||
return varInputs.map(item => item.variable.slice(1, -1).split('.'))
|
||||
return varInputs.map((item) => {
|
||||
// Guard against null/undefined variable to prevent app crash
|
||||
if (!item.variable || typeof item.variable !== 'string')
|
||||
return []
|
||||
|
||||
return item.variable.slice(1, -1).split('.')
|
||||
}).filter(arr => arr.length > 0)
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
@ -28,3 +28,13 @@ export const findVariableWhenOnLLMVision = (valueSelector: ValueSelector, availa
|
||||
formType,
|
||||
}
|
||||
}
|
||||
|
||||
export const getConditionValueAsString = (condition: { value: any }) => {
|
||||
if (Array.isArray(condition.value))
|
||||
return condition.value[0] ?? ''
|
||||
|
||||
if (typeof condition.value === 'number')
|
||||
return String(condition.value)
|
||||
|
||||
return condition.value ?? ''
|
||||
}
|
||||
|
||||
@ -38,7 +38,6 @@ export const canRunBySingle = (nodeType: BlockEnum, isChildNode: boolean) => {
|
||||
|| nodeType === BlockEnum.VariableAggregator
|
||||
|| nodeType === BlockEnum.Assigner
|
||||
|| nodeType === BlockEnum.DataSource
|
||||
// || nodeType === BlockEnum.KnowledgeBase
|
||||
}
|
||||
|
||||
export const isSupportCustomRunForm = (nodeType: BlockEnum) => {
|
||||
|
||||
@ -14,12 +14,18 @@ const getBooleanConfig = (envVar: string | undefined, dataAttrKey: DatasetAttr,
|
||||
}
|
||||
|
||||
const getNumberConfig = (envVar: string | undefined, dataAttrKey: DatasetAttr, defaultValue: number) => {
|
||||
if (envVar)
|
||||
return Number.parseInt(envVar)
|
||||
if (envVar) {
|
||||
const parsed = Number.parseInt(envVar)
|
||||
if (!Number.isNaN(parsed) && parsed > 0)
|
||||
return parsed
|
||||
}
|
||||
|
||||
const attrValue = globalThis.document?.body?.getAttribute(dataAttrKey)
|
||||
if (attrValue)
|
||||
return Number.parseInt(attrValue)
|
||||
if (attrValue) {
|
||||
const parsed = Number.parseInt(attrValue)
|
||||
if (!Number.isNaN(parsed) && parsed > 0)
|
||||
return parsed
|
||||
}
|
||||
return defaultValue
|
||||
}
|
||||
|
||||
@ -275,6 +281,7 @@ export const FULL_DOC_PREVIEW_LENGTH = 50
|
||||
export const JSON_SCHEMA_MAX_DEPTH = 10
|
||||
|
||||
export const MAX_TOOLS_NUM = getNumberConfig(process.env.NEXT_PUBLIC_MAX_TOOLS_NUM, DatasetAttr.DATA_PUBLIC_MAX_TOOLS_NUM, 10)
|
||||
export const MAX_PARALLEL_LIMIT = getNumberConfig(process.env.NEXT_PUBLIC_MAX_PARALLEL_LIMIT, DatasetAttr.DATA_PUBLIC_MAX_PARALLEL_LIMIT, 10)
|
||||
export const TEXT_GENERATION_TIMEOUT_MS = getNumberConfig(process.env.NEXT_PUBLIC_TEXT_GENERATION_TIMEOUT_MS, DatasetAttr.DATA_PUBLIC_TEXT_GENERATION_TIMEOUT_MS, 60000)
|
||||
export const LOOP_NODE_MAX_COUNT = getNumberConfig(process.env.NEXT_PUBLIC_LOOP_NODE_MAX_COUNT, DatasetAttr.DATA_PUBLIC_LOOP_NODE_MAX_COUNT, 100)
|
||||
export const MAX_ITERATIONS_NUM = getNumberConfig(process.env.NEXT_PUBLIC_MAX_ITERATIONS_NUM, DatasetAttr.DATA_PUBLIC_MAX_ITERATIONS_NUM, 99)
|
||||
|
||||
@ -8,7 +8,6 @@ This directory contains the internationalization (i18n) files for this project.
|
||||
|
||||
```
|
||||
├── [ 24] README.md
|
||||
├── [ 0] README_CN.md
|
||||
├── [ 704] en-US
|
||||
│ ├── [2.4K] app-annotation.ts
|
||||
│ ├── [5.2K] app-api.ts
|
||||
@ -37,7 +36,7 @@ This directory contains the internationalization (i18n) files for this project.
|
||||
|
||||
We use English as the default language. The i18n files are organized by language and then by module. For example, the English translation for the `app` module is in `en-US/app.ts`.
|
||||
|
||||
If you want to add a new language or modify an existing translation, you can create a new file for the language or modify the existing file. The file name should be the language code (e.g., `zh-CN` for Chinese) and the file extension should be `.ts`.
|
||||
If you want to add a new language or modify an existing translation, you can create a new file for the language or modify the existing file. The file name should be the language code (e.g., `zh-Hans` for Chinese) and the file extension should be `.ts`.
|
||||
|
||||
For example, if you want to add french translation, you can create a new folder `fr-FR` and add the translation files in it.
|
||||
|
||||
@ -48,6 +47,7 @@ By default we will use `LanguagesSupported` to determine which languages are sup
|
||||
1. Create a new folder for the new language.
|
||||
|
||||
```
|
||||
cd web/i18n
|
||||
cp -r en-US fr-FR
|
||||
```
|
||||
|
||||
|
||||
@ -58,9 +58,14 @@ async function getKeysFromLanguage(language) {
|
||||
const iterateKeys = (obj, prefix = '') => {
|
||||
for (const key in obj) {
|
||||
const nestedKey = prefix ? `${prefix}.${key}` : key
|
||||
nestedKeys.push(nestedKey)
|
||||
if (typeof obj[key] === 'object' && obj[key] !== null)
|
||||
if (typeof obj[key] === 'object' && obj[key] !== null && !Array.isArray(obj[key])) {
|
||||
// This is an object (but not array), recurse into it but don't add it as a key
|
||||
iterateKeys(obj[key], nestedKey)
|
||||
}
|
||||
else {
|
||||
// This is a leaf node (string, number, boolean, array, etc.), add it as a key
|
||||
nestedKeys.push(nestedKey)
|
||||
}
|
||||
}
|
||||
}
|
||||
iterateKeys(translationObj)
|
||||
@ -79,15 +84,176 @@ async function getKeysFromLanguage(language) {
|
||||
})
|
||||
}
|
||||
|
||||
function removeKeysFromObject(obj, keysToRemove, prefix = '') {
|
||||
let modified = false
|
||||
for (const key in obj) {
|
||||
const fullKey = prefix ? `${prefix}.${key}` : key
|
||||
|
||||
if (keysToRemove.includes(fullKey)) {
|
||||
delete obj[key]
|
||||
modified = true
|
||||
console.log(`🗑️ Removed key: ${fullKey}`)
|
||||
}
|
||||
else if (typeof obj[key] === 'object' && obj[key] !== null) {
|
||||
const subModified = removeKeysFromObject(obj[key], keysToRemove, fullKey)
|
||||
modified = modified || subModified
|
||||
}
|
||||
}
|
||||
return modified
|
||||
}
|
||||
|
||||
async function removeExtraKeysFromFile(language, fileName, extraKeys) {
|
||||
const filePath = path.resolve(__dirname, '../i18n', language, `${fileName}.ts`)
|
||||
|
||||
if (!fs.existsSync(filePath)) {
|
||||
console.log(`⚠️ File not found: ${filePath}`)
|
||||
return false
|
||||
}
|
||||
|
||||
try {
|
||||
// Filter keys that belong to this file
|
||||
const camelCaseFileName = fileName.replace(/[-_](.)/g, (_, c) => c.toUpperCase())
|
||||
const fileSpecificKeys = extraKeys
|
||||
.filter(key => key.startsWith(`${camelCaseFileName}.`))
|
||||
.map(key => key.substring(camelCaseFileName.length + 1)) // Remove file prefix
|
||||
|
||||
if (fileSpecificKeys.length === 0)
|
||||
return false
|
||||
|
||||
console.log(`🔄 Processing file: ${filePath}`)
|
||||
|
||||
// Read the original file content
|
||||
const content = fs.readFileSync(filePath, 'utf8')
|
||||
const lines = content.split('\n')
|
||||
|
||||
let modified = false
|
||||
const linesToRemove = []
|
||||
|
||||
// Find lines to remove for each key
|
||||
for (const keyToRemove of fileSpecificKeys) {
|
||||
const keyParts = keyToRemove.split('.')
|
||||
let targetLineIndex = -1
|
||||
|
||||
// Build regex pattern for the exact key path
|
||||
if (keyParts.length === 1) {
|
||||
// Simple key at root level like "pickDate: 'value'"
|
||||
for (let i = 0; i < lines.length; i++) {
|
||||
const line = lines[i]
|
||||
const simpleKeyPattern = new RegExp(`^\\s*${keyParts[0]}\\s*:`)
|
||||
if (simpleKeyPattern.test(line)) {
|
||||
targetLineIndex = i
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
// Nested key - need to find the exact path
|
||||
const currentPath = []
|
||||
let braceDepth = 0
|
||||
|
||||
for (let i = 0; i < lines.length; i++) {
|
||||
const line = lines[i]
|
||||
const trimmedLine = line.trim()
|
||||
|
||||
// Track current object path
|
||||
const keyMatch = trimmedLine.match(/^(\w+)\s*:\s*{/)
|
||||
if (keyMatch) {
|
||||
currentPath.push(keyMatch[1])
|
||||
braceDepth++
|
||||
}
|
||||
else if (trimmedLine === '},' || trimmedLine === '}') {
|
||||
if (braceDepth > 0) {
|
||||
braceDepth--
|
||||
currentPath.pop()
|
||||
}
|
||||
}
|
||||
|
||||
// Check if this line matches our target key
|
||||
const leafKeyMatch = trimmedLine.match(/^(\w+)\s*:/)
|
||||
if (leafKeyMatch) {
|
||||
const fullPath = [...currentPath, leafKeyMatch[1]]
|
||||
const fullPathString = fullPath.join('.')
|
||||
|
||||
if (fullPathString === keyToRemove) {
|
||||
targetLineIndex = i
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (targetLineIndex !== -1) {
|
||||
linesToRemove.push(targetLineIndex)
|
||||
console.log(`🗑️ Found key to remove: ${keyToRemove} at line ${targetLineIndex + 1}`)
|
||||
modified = true
|
||||
}
|
||||
else {
|
||||
console.log(`⚠️ Could not find key: ${keyToRemove}`)
|
||||
}
|
||||
}
|
||||
|
||||
if (modified) {
|
||||
// Remove lines in reverse order to maintain correct indices
|
||||
linesToRemove.sort((a, b) => b - a)
|
||||
|
||||
for (const lineIndex of linesToRemove) {
|
||||
const line = lines[lineIndex]
|
||||
console.log(`🗑️ Removing line ${lineIndex + 1}: ${line.trim()}`)
|
||||
lines.splice(lineIndex, 1)
|
||||
|
||||
// Also remove trailing comma from previous line if it exists and the next line is a closing brace
|
||||
if (lineIndex > 0 && lineIndex < lines.length) {
|
||||
const prevLine = lines[lineIndex - 1]
|
||||
const nextLine = lines[lineIndex] ? lines[lineIndex].trim() : ''
|
||||
|
||||
if (prevLine.trim().endsWith(',') && (nextLine.startsWith('}') || nextLine === ''))
|
||||
lines[lineIndex - 1] = prevLine.replace(/,\s*$/, '')
|
||||
}
|
||||
}
|
||||
|
||||
// Write back to file
|
||||
const newContent = lines.join('\n')
|
||||
fs.writeFileSync(filePath, newContent)
|
||||
console.log(`💾 Updated file: ${filePath}`)
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
catch (error) {
|
||||
console.error(`Error processing file ${filePath}:`, error.message)
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
// Add command line argument support
|
||||
const targetFile = process.argv.find(arg => arg.startsWith('--file='))?.split('=')[1]
|
||||
const targetLang = process.argv.find(arg => arg.startsWith('--lang='))?.split('=')[1]
|
||||
const autoRemove = process.argv.includes('--auto-remove')
|
||||
|
||||
async function main() {
|
||||
const compareKeysCount = async () => {
|
||||
const targetKeys = await getKeysFromLanguage(targetLanguage)
|
||||
const languagesKeys = await Promise.all(languages.map(language => getKeysFromLanguage(language)))
|
||||
const allTargetKeys = await getKeysFromLanguage(targetLanguage)
|
||||
|
||||
// Filter target keys by file if specified
|
||||
const targetKeys = targetFile
|
||||
? allTargetKeys.filter(key => key.startsWith(targetFile.replace(/[-_](.)/g, (_, c) => c.toUpperCase())))
|
||||
: allTargetKeys
|
||||
|
||||
// Filter languages by target language if specified
|
||||
const languagesToProcess = targetLang ? [targetLang] : languages
|
||||
|
||||
const allLanguagesKeys = await Promise.all(languagesToProcess.map(language => getKeysFromLanguage(language)))
|
||||
|
||||
// Filter language keys by file if specified
|
||||
const languagesKeys = targetFile
|
||||
? allLanguagesKeys.map(keys => keys.filter(key => key.startsWith(targetFile.replace(/[-_](.)/g, (_, c) => c.toUpperCase()))))
|
||||
: allLanguagesKeys
|
||||
|
||||
const keysCount = languagesKeys.map(keys => keys.length)
|
||||
const targetKeysCount = targetKeys.length
|
||||
|
||||
const comparison = languages.reduce((result, language, index) => {
|
||||
const comparison = languagesToProcess.reduce((result, language, index) => {
|
||||
const languageKeysCount = keysCount[index]
|
||||
const difference = targetKeysCount - languageKeysCount
|
||||
result[language] = difference
|
||||
@ -96,13 +262,52 @@ async function main() {
|
||||
|
||||
console.log(comparison)
|
||||
|
||||
// Print missing keys
|
||||
languages.forEach((language, index) => {
|
||||
const missingKeys = targetKeys.filter(key => !languagesKeys[index].includes(key))
|
||||
// Print missing keys and extra keys
|
||||
for (let index = 0; index < languagesToProcess.length; index++) {
|
||||
const language = languagesToProcess[index]
|
||||
const languageKeys = languagesKeys[index]
|
||||
const missingKeys = targetKeys.filter(key => !languageKeys.includes(key))
|
||||
const extraKeys = languageKeys.filter(key => !targetKeys.includes(key))
|
||||
|
||||
console.log(`Missing keys in ${language}:`, missingKeys)
|
||||
})
|
||||
|
||||
// Show extra keys only when there are extra keys (negative difference)
|
||||
if (extraKeys.length > 0) {
|
||||
console.log(`Extra keys in ${language} (not in ${targetLanguage}):`, extraKeys)
|
||||
|
||||
// Auto-remove extra keys if flag is set
|
||||
if (autoRemove) {
|
||||
console.log(`\n🤖 Auto-removing extra keys from ${language}...`)
|
||||
|
||||
// Get all translation files
|
||||
const i18nFolder = path.resolve(__dirname, '../i18n', language)
|
||||
const files = fs.readdirSync(i18nFolder)
|
||||
.filter(file => /\.ts$/.test(file))
|
||||
.map(file => file.replace(/\.ts$/, ''))
|
||||
.filter(f => !targetFile || f === targetFile) // Filter by target file if specified
|
||||
|
||||
let totalRemoved = 0
|
||||
for (const fileName of files) {
|
||||
const removed = await removeExtraKeysFromFile(language, fileName, extraKeys)
|
||||
if (removed) totalRemoved++
|
||||
}
|
||||
|
||||
console.log(`✅ Auto-removal completed for ${language}. Modified ${totalRemoved} files.`)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
console.log('🚀 Starting check-i18n script...')
|
||||
if (targetFile)
|
||||
console.log(`📁 Checking file: ${targetFile}`)
|
||||
|
||||
if (targetLang)
|
||||
console.log(`🌍 Checking language: ${targetLang}`)
|
||||
|
||||
if (autoRemove)
|
||||
console.log('🤖 Auto-remove mode: ENABLED')
|
||||
|
||||
compareKeysCount()
|
||||
}
|
||||
|
||||
|
||||
@ -276,7 +276,6 @@ const translation = {
|
||||
queryNoBeEmpty: 'Anfrage muss im Prompt gesetzt sein',
|
||||
},
|
||||
variableConfig: {
|
||||
modalTitle: 'Feldeinstellungen',
|
||||
description: 'Einstellung für Variable {{varName}}',
|
||||
fieldType: 'Feldtyp',
|
||||
string: 'Kurztext',
|
||||
|
||||
@ -2,7 +2,6 @@ const translation = {
|
||||
createApp: 'Neue App erstellen',
|
||||
types: {
|
||||
all: 'Alle',
|
||||
assistant: 'Assistent',
|
||||
completion: 'Vervollständigung',
|
||||
workflow: 'Arbeitsablauf',
|
||||
agent: 'Agent',
|
||||
@ -11,8 +10,6 @@ const translation = {
|
||||
advanced: 'Chatflow',
|
||||
},
|
||||
modes: {
|
||||
completion: 'Textgenerator',
|
||||
chat: 'Basisassistent',
|
||||
},
|
||||
createFromConfigFile: 'App aus Konfigurationsdatei erstellen',
|
||||
deleteAppConfirmTitle: 'Diese App löschen?',
|
||||
@ -24,11 +21,8 @@ const translation = {
|
||||
communityIntro:
|
||||
'Diskutieren Sie mit Teammitgliedern, Mitwirkenden und Entwicklern auf verschiedenen Kanälen.',
|
||||
roadmap: 'Sehen Sie unseren Fahrplan',
|
||||
appNamePlaceholder: 'Bitte geben Sie den Namen der App ein',
|
||||
newApp: {
|
||||
startToCreate: 'Lassen Sie uns mit Ihrer neuen App beginnen',
|
||||
captionName: 'App-Symbol & Name',
|
||||
captionAppType: 'Welchen Typ von App möchten Sie erstellen?',
|
||||
previewDemo: 'Vorschau-Demo',
|
||||
chatApp: 'Assistent',
|
||||
chatAppIntro:
|
||||
@ -46,25 +40,12 @@ const translation = {
|
||||
appTypeRequired: 'Bitte wählen Sie einen App-Typ',
|
||||
appCreated: 'App erstellt',
|
||||
appCreateFailed: 'Erstellen der App fehlgeschlagen',
|
||||
basic: 'Grundlegend',
|
||||
chatbotType: 'Chatbot-Orchestrierungsmethode',
|
||||
workflowDescription: 'Erstellen Sie eine Anwendung, die qualitativ hochwertigen Text auf der Grundlage von Workflow-Orchestrierungen mit einem hohen Maß an Anpassung generiert. Es ist für erfahrene Benutzer geeignet.',
|
||||
advancedFor: 'Für Fortgeschrittene',
|
||||
startFromTemplate: 'Aus Vorlage erstellen',
|
||||
appNamePlaceholder: 'Geben Sie Ihrer App einen Namen',
|
||||
startFromBlank: 'Aus Leer erstellen',
|
||||
basicTip: 'Für Anfänger können Sie später zu Chatflow wechseln',
|
||||
basicDescription: 'Basic Orchestrate ermöglicht die Orchestrierung einer Chatbot-App mit einfachen Einstellungen, ohne die Möglichkeit, integrierte Eingabeaufforderungen zu ändern. Es ist für Anfänger geeignet.',
|
||||
workflowWarning: 'Derzeit in der Beta-Phase',
|
||||
advancedDescription: 'Workflow Orchestrate orchestriert Chatbots in Form von Workflows und bietet ein hohes Maß an Individualisierung, einschließlich der Möglichkeit, integrierte Eingabeaufforderungen zu bearbeiten. Es ist für erfahrene Benutzer geeignet.',
|
||||
basicFor: 'FÜR ANFÄNGER',
|
||||
completionWarning: 'Diese Art von App wird nicht mehr unterstützt.',
|
||||
chatbotDescription: 'Erstellen Sie eine chatbasierte Anwendung. Diese App verwendet ein Frage-und-Antwort-Format, das mehrere Runden kontinuierlicher Konversation ermöglicht.',
|
||||
captionDescription: 'Beschreibung',
|
||||
advanced: 'Chatflow',
|
||||
useTemplate: 'Diese Vorlage verwenden',
|
||||
agentDescription: 'Erstellen Sie einen intelligenten Agenten, der autonom Werkzeuge auswählen kann, um die Aufgaben zu erledigen',
|
||||
completionDescription: 'Erstellen Sie eine Anwendung, die qualitativ hochwertigen Text auf der Grundlage von Eingabeaufforderungen generiert, z. B. zum Generieren von Artikeln, Zusammenfassungen, Übersetzungen und mehr.',
|
||||
appDescriptionPlaceholder: 'Geben Sie die Beschreibung der App ein',
|
||||
caution: 'Vorsicht',
|
||||
Confirm: 'Bestätigen',
|
||||
|
||||
@ -23,18 +23,13 @@ const translation = {
|
||||
contractSales: 'Vertrieb kontaktieren',
|
||||
contractOwner: 'Teammanager kontaktieren',
|
||||
startForFree: 'Kostenlos starten',
|
||||
getStartedWith: 'Beginnen Sie mit ',
|
||||
contactSales: 'Vertrieb kontaktieren',
|
||||
talkToSales: 'Mit dem Vertrieb sprechen',
|
||||
modelProviders: 'Modellanbieter',
|
||||
teamMembers: 'Teammitglieder',
|
||||
buildApps: 'Apps bauen',
|
||||
vectorSpace: 'Vektorraum',
|
||||
vectorSpaceBillingTooltip: 'Jedes 1MB kann ungefähr 1,2 Millionen Zeichen an vektorisierten Daten speichern (geschätzt mit OpenAI Embeddings, variiert je nach Modell).',
|
||||
vectorSpaceTooltip: 'Vektorraum ist das Langzeitspeichersystem, das erforderlich ist, damit LLMs Ihre Daten verstehen können.',
|
||||
documentsUploadQuota: 'Dokumenten-Upload-Kontingent',
|
||||
documentProcessingPriority: 'Priorität der Dokumentenverarbeitung',
|
||||
documentProcessingPriorityTip: 'Für eine höhere Dokumentenverarbeitungspriorität, bitte Ihren Tarif upgraden.',
|
||||
documentProcessingPriorityUpgrade: 'Mehr Daten mit höherer Genauigkeit bei schnelleren Geschwindigkeiten verarbeiten.',
|
||||
priority: {
|
||||
'standard': 'Standard',
|
||||
@ -103,61 +98,52 @@ const translation = {
|
||||
sandbox: {
|
||||
name: 'Sandbox',
|
||||
description: '200 mal GPT kostenlos testen',
|
||||
includesTitle: 'Beinhaltet:',
|
||||
for: 'Kostenlose Testversion der Kernfunktionen',
|
||||
},
|
||||
professional: {
|
||||
name: 'Professionell',
|
||||
description: 'Für Einzelpersonen und kleine Teams, um mehr Leistung erschwinglich freizuschalten.',
|
||||
includesTitle: 'Alles im kostenlosen Tarif, plus:',
|
||||
for: 'Für unabhängige Entwickler/kleine Teams',
|
||||
},
|
||||
team: {
|
||||
name: 'Team',
|
||||
description: 'Zusammenarbeiten ohne Grenzen und Top-Leistung genießen.',
|
||||
includesTitle: 'Alles im Professionell-Tarif, plus:',
|
||||
for: 'Für mittelgroße Teams',
|
||||
},
|
||||
enterprise: {
|
||||
name: 'Unternehmen',
|
||||
description: 'Erhalten Sie volle Fähigkeiten und Unterstützung für großangelegte, missionskritische Systeme.',
|
||||
includesTitle: 'Alles im Team-Tarif, plus:',
|
||||
features: {
|
||||
2: 'Exklusive Unternehmensfunktionen',
|
||||
8: 'Professioneller technischer Support',
|
||||
6: 'Erweiterte Sicherheits- und Kontrollsysteme',
|
||||
4: 'SSO',
|
||||
0: 'Enterprise-Grade Skalierbare Bereitstellungslösungen',
|
||||
3: 'Mehrere Arbeitsbereiche und Unternehmensverwaltung',
|
||||
1: 'Kommerzielle Lizenzgenehmigung',
|
||||
5: 'Verhandelte SLAs durch Dify-Partner',
|
||||
7: 'Updates und Wartung von Dify offiziell',
|
||||
},
|
||||
btnText: 'Vertrieb kontaktieren',
|
||||
price: 'Benutzerdefiniert',
|
||||
priceTip: 'Jährliche Abrechnung nur',
|
||||
for: 'Für große Teams',
|
||||
features: [
|
||||
'Skalierbare Bereitstellungslösungen in Unternehmensqualität',
|
||||
'Kommerzielle Lizenzierung',
|
||||
'Exklusive Enterprise-Funktionen',
|
||||
'Mehrere Arbeitsbereiche und Unternehmensverwaltung',
|
||||
'SSO (Single Sign-On)',
|
||||
'Vereinbarte SLAs mit Dify-Partnern',
|
||||
'Erweiterte Sicherheitsfunktionen und Kontrollen',
|
||||
'Offizielle Updates und Wartung durch Dify',
|
||||
'Professioneller technischer Support',
|
||||
],
|
||||
},
|
||||
community: {
|
||||
features: {
|
||||
2: 'Entspricht der Dify Open Source Lizenz',
|
||||
1: 'Einzelner Arbeitsbereich',
|
||||
0: 'Alle Kernfunktionen wurden im öffentlichen Repository veröffentlicht.',
|
||||
},
|
||||
description: 'Für Einzelbenutzer, kleine Teams oder nicht-kommerzielle Projekte',
|
||||
for: 'Für Einzelbenutzer, kleine Teams oder nicht-kommerzielle Projekte',
|
||||
btnText: 'Beginnen Sie mit der Gemeinschaft',
|
||||
price: 'Kostenlos',
|
||||
includesTitle: 'Kostenlose Funktionen:',
|
||||
name: 'Gemeinschaft',
|
||||
features: [
|
||||
'Alle Kernfunktionen im öffentlichen Repository veröffentlicht',
|
||||
'Einzelner Arbeitsbereich',
|
||||
'Entspricht der Dify Open-Source-Lizenz',
|
||||
],
|
||||
},
|
||||
premium: {
|
||||
features: {
|
||||
2: 'WebApp-Logo und Branding-Anpassung',
|
||||
0: 'Selbstverwaltete Zuverlässigkeit durch verschiedene Cloud-Anbieter',
|
||||
3: 'Priorisierte E-Mail- und Chat-Unterstützung',
|
||||
1: 'Einzelner Arbeitsbereich',
|
||||
},
|
||||
includesTitle: 'Alles aus der Community, plus:',
|
||||
name: 'Premium',
|
||||
priceTip: 'Basierend auf dem Cloud-Marktplatz',
|
||||
@ -166,6 +152,12 @@ const translation = {
|
||||
comingSoon: 'Microsoft Azure- und Google Cloud-Support demnächst verfügbar',
|
||||
description: 'Für mittelgroße Organisationen und Teams',
|
||||
price: 'Skalierbar',
|
||||
features: [
|
||||
'Selbstverwaltete Zuverlässigkeit durch verschiedene Cloud-Anbieter',
|
||||
'Einzelner Arbeitsbereich',
|
||||
'Anpassung von WebApp-Logo und Branding',
|
||||
'Bevorzugter E-Mail- und Chat-Support',
|
||||
],
|
||||
},
|
||||
},
|
||||
vectorSpace: {
|
||||
@ -173,8 +165,6 @@ const translation = {
|
||||
fullSolution: 'Upgraden Sie Ihren Tarif, um mehr Speicherplatz zu erhalten.',
|
||||
},
|
||||
apps: {
|
||||
fullTipLine1: 'Upgraden Sie Ihren Tarif, um',
|
||||
fullTipLine2: 'mehr Apps zu bauen.',
|
||||
contactUs: 'Kontaktieren Sie uns',
|
||||
fullTip1: 'Upgrade, um mehr Apps zu erstellen',
|
||||
fullTip2des: 'Es wird empfohlen, inaktive Anwendungen zu bereinigen, um Speicherplatz freizugeben, oder uns zu kontaktieren.',
|
||||
|
||||
@ -197,7 +197,6 @@ const translation = {
|
||||
showAppLength: '{{length}} Apps anzeigen',
|
||||
delete: 'Konto löschen',
|
||||
deleteTip: 'Wenn Sie Ihr Konto löschen, werden alle Ihre Daten dauerhaft gelöscht und können nicht wiederhergestellt werden.',
|
||||
deleteConfirmTip: 'Zur Bestätigung senden Sie bitte Folgendes von Ihrer registrierten E-Mail-Adresse an ',
|
||||
myAccount: 'Mein Konto',
|
||||
studio: 'Dify Studio',
|
||||
account: 'Konto',
|
||||
|
||||
@ -1,8 +1,6 @@
|
||||
const translation = {
|
||||
steps: {
|
||||
header: {
|
||||
creation: 'Wissen erstellen',
|
||||
update: 'Daten hinzufügen',
|
||||
fallbackRoute: 'Wissen',
|
||||
},
|
||||
one: 'Datenquelle wählen',
|
||||
|
||||
@ -146,7 +146,6 @@ const translation = {
|
||||
journalConferenceName: 'Zeitschrift/Konferenzname',
|
||||
volumeIssuePage: 'Band/Ausgabe/Seite',
|
||||
DOI: 'DOI',
|
||||
topicKeywords: 'Themen/Schlüsselwörter',
|
||||
abstract: 'Zusammenfassung',
|
||||
topicsKeywords: 'Themen/Stichworte',
|
||||
},
|
||||
@ -343,7 +342,6 @@ const translation = {
|
||||
keywords: 'Schlüsselwörter',
|
||||
addKeyWord: 'Schlüsselwort hinzufügen',
|
||||
keywordError: 'Die maximale Länge des Schlüsselworts beträgt 20',
|
||||
characters: 'Zeichen',
|
||||
hitCount: 'Abrufanzahl',
|
||||
vectorHash: 'Vektor-Hash: ',
|
||||
questionPlaceholder: 'Frage hier hinzufügen',
|
||||
|
||||
@ -2,7 +2,6 @@ const translation = {
|
||||
title: 'Abruf-Test',
|
||||
desc: 'Testen Sie die Treffereffektivität des Wissens anhand des gegebenen Abfragetextes.',
|
||||
dateTimeFormat: 'MM/DD/YYYY hh:mm A',
|
||||
recents: 'Kürzlich',
|
||||
table: {
|
||||
header: {
|
||||
source: 'Quelle',
|
||||
|
||||
@ -70,7 +70,6 @@ const translation = {
|
||||
activated: 'Jetzt anmelden',
|
||||
adminInitPassword: 'Admin-Initialpasswort',
|
||||
validate: 'Validieren',
|
||||
sso: 'Mit SSO fortfahren',
|
||||
checkCode: {
|
||||
didNotReceiveCode: 'Sie haben den Code nicht erhalten?',
|
||||
verificationCodePlaceholder: 'Geben Sie den 6-stelligen Code ein',
|
||||
|
||||
@ -21,7 +21,6 @@ const translation = {
|
||||
resultEmpty: {
|
||||
title: 'Dieser Lauf gibt nur das JSON-Format aus',
|
||||
tipLeft: 'Bitte gehen Sie zum ',
|
||||
Link: 'Detailpanel',
|
||||
tipRight: 'ansehen.',
|
||||
link: 'Gruppe Detail',
|
||||
},
|
||||
|
||||
@ -54,7 +54,6 @@ const translation = {
|
||||
keyTooltip: 'Http Header Key, Sie können es bei "Authorization" belassen, wenn Sie nicht wissen, was es ist, oder auf einen benutzerdefinierten Wert setzen',
|
||||
types: {
|
||||
none: 'Keine',
|
||||
api_key: 'API-Key',
|
||||
apiKeyPlaceholder: 'HTTP-Headername für API-Key',
|
||||
apiValuePlaceholder: 'API-Key eingeben',
|
||||
api_key_header: 'Kopfzeile',
|
||||
|
||||
@ -104,10 +104,8 @@ const translation = {
|
||||
loadMore: 'Weitere Workflows laden',
|
||||
noHistory: 'Keine Geschichte',
|
||||
exportSVG: 'Als SVG exportieren',
|
||||
noExist: 'Keine solche Variable',
|
||||
versionHistory: 'Versionsverlauf',
|
||||
publishUpdate: 'Update veröffentlichen',
|
||||
referenceVar: 'Referenzvariable',
|
||||
exportImage: 'Bild exportieren',
|
||||
exportJPEG: 'Als JPEG exportieren',
|
||||
exitVersions: 'Ausgangsversionen',
|
||||
@ -222,7 +220,6 @@ const translation = {
|
||||
tabs: {
|
||||
'tools': 'Werkzeuge',
|
||||
'allTool': 'Alle',
|
||||
'builtInTool': 'Eingebaut',
|
||||
'customTool': 'Benutzerdefiniert',
|
||||
'workflowTool': 'Arbeitsablauf',
|
||||
'question-understand': 'Fragen verstehen',
|
||||
@ -587,7 +584,6 @@ const translation = {
|
||||
'not empty': 'ist nicht leer',
|
||||
'null': 'ist null',
|
||||
'not null': 'ist nicht null',
|
||||
'regex match': 'Regex-Übereinstimmung',
|
||||
'not exists': 'existiert nicht',
|
||||
'in': 'in',
|
||||
'all of': 'alle',
|
||||
@ -610,7 +606,6 @@ const translation = {
|
||||
},
|
||||
select: 'Auswählen',
|
||||
addSubVariable: 'Untervariable',
|
||||
condition: 'Bedingung',
|
||||
},
|
||||
variableAssigner: {
|
||||
title: 'Variablen zuweisen',
|
||||
|
||||
@ -57,6 +57,16 @@ const translation = {
|
||||
error: 'Import Error',
|
||||
ok: 'OK',
|
||||
},
|
||||
list: {
|
||||
delete: {
|
||||
title: 'Are you sure Delete?',
|
||||
},
|
||||
},
|
||||
batchAction: {
|
||||
selected: 'Selected',
|
||||
delete: 'Delete',
|
||||
cancel: 'Cancel',
|
||||
},
|
||||
errorMessage: {
|
||||
answerRequired: 'Answer is required',
|
||||
queryRequired: 'Question is required',
|
||||
|
||||
@ -227,21 +227,6 @@ const translation = {
|
||||
},
|
||||
},
|
||||
automatic: {
|
||||
title: 'Orquestación automatizada de aplicaciones',
|
||||
description: 'Describe tu escenario, Dify orquestará una aplicación para ti.',
|
||||
intendedAudience: '¿Quién es el público objetivo?',
|
||||
intendedAudiencePlaceHolder: 'p.ej. Estudiante',
|
||||
solveProblem: '¿Qué problemas esperan que la IA pueda resolver para ellos?',
|
||||
solveProblemPlaceHolder: 'p.ej. Extraer ideas y resumir información de informes y artículos largos',
|
||||
generate: 'Generar',
|
||||
audiencesRequired: 'Audiencia requerida',
|
||||
problemRequired: 'Problema requerido',
|
||||
resTitle: 'Hemos orquestado la siguiente aplicación para ti.',
|
||||
apply: 'Aplicar esta orquestación',
|
||||
noData: 'Describe tu caso de uso a la izquierda, la vista previa de la orquestación se mostrará aquí.',
|
||||
loading: 'Orquestando la aplicación para ti...',
|
||||
overwriteTitle: '¿Sobrescribir configuración existente?',
|
||||
overwriteMessage: 'Aplicar esta orquestación sobrescribirá la configuración existente.',
|
||||
},
|
||||
resetConfig: {
|
||||
title: '¿Confirmar restablecimiento?',
|
||||
|
||||
@ -27,21 +27,7 @@ const translation = {
|
||||
newApp: {
|
||||
startFromBlank: 'Crear desde cero',
|
||||
startFromTemplate: 'Crear desde plantilla',
|
||||
captionAppType: '¿Qué tipo de app quieres crear?',
|
||||
chatbotDescription: 'Crea una aplicación basada en chat. Esta app utiliza un formato de pregunta y respuesta, permitiendo múltiples rondas de conversación continua.',
|
||||
completionDescription: 'Crea una aplicación que genera texto de alta calidad basado en prompts, como la generación de artículos, resúmenes, traducciones y más.',
|
||||
completionWarning: 'Este tipo de app ya no será compatible.',
|
||||
agentDescription: 'Crea un Agente inteligente que puede elegir herramientas de forma autónoma para completar tareas',
|
||||
workflowDescription: 'Crea una aplicación que genera texto de alta calidad basado en flujos de trabajo con un alto grado de personalización. Es adecuado para usuarios experimentados.',
|
||||
workflowWarning: 'Actualmente en beta',
|
||||
chatbotType: 'Método de orquestación del Chatbot',
|
||||
basic: 'Básico',
|
||||
basicTip: 'Para principiantes, se puede cambiar a Chatflow más adelante',
|
||||
basicFor: 'PARA PRINCIPIANTES',
|
||||
basicDescription: 'La Orquestación Básica permite la orquestación de una app de Chatbot utilizando configuraciones simples, sin la capacidad de modificar los prompts incorporados. Es adecuado para principiantes.',
|
||||
advanced: 'Chatflow',
|
||||
advancedFor: 'Para usuarios avanzados',
|
||||
advancedDescription: 'La Orquestación de Flujo de Trabajo orquesta Chatbots en forma de flujos de trabajo, ofreciendo un alto grado de personalización, incluida la capacidad de editar los prompts incorporados. Es adecuado para usuarios experimentados.',
|
||||
captionName: 'Icono y nombre de la app',
|
||||
appNamePlaceholder: 'Asigna un nombre a tu app',
|
||||
captionDescription: 'Descripción',
|
||||
|
||||
@ -23,19 +23,14 @@ const translation = {
|
||||
contractSales: 'Contactar ventas',
|
||||
contractOwner: 'Contactar al administrador del equipo',
|
||||
startForFree: 'Empezar gratis',
|
||||
getStartedWith: 'Empezar con ',
|
||||
contactSales: 'Contactar Ventas',
|
||||
talkToSales: 'Hablar con Ventas',
|
||||
modelProviders: 'Proveedores de Modelos',
|
||||
teamMembers: 'Miembros del Equipo',
|
||||
annotationQuota: 'Cuota de Anotación',
|
||||
buildApps: 'Crear Aplicaciones',
|
||||
vectorSpace: 'Espacio Vectorial',
|
||||
vectorSpaceBillingTooltip: 'Cada 1MB puede almacenar aproximadamente 1.2 millones de caracteres de datos vectorizados (estimado utilizando OpenAI Embeddings, varía según los modelos).',
|
||||
vectorSpaceTooltip: 'El Espacio Vectorial es el sistema de memoria a largo plazo necesario para que los LLMs comprendan tus datos.',
|
||||
documentsUploadQuota: 'Cuota de Carga de Documentos',
|
||||
documentProcessingPriority: 'Prioridad de Procesamiento de Documentos',
|
||||
documentProcessingPriorityTip: 'Para una mayor prioridad de procesamiento de documentos, por favor actualiza tu plan.',
|
||||
documentProcessingPriorityUpgrade: 'Procesa más datos con mayor precisión y velocidad.',
|
||||
priority: {
|
||||
'standard': 'Estándar',
|
||||
@ -103,61 +98,52 @@ const translation = {
|
||||
sandbox: {
|
||||
name: 'Sandbox',
|
||||
description: 'Prueba gratuita de 200 veces GPT',
|
||||
includesTitle: 'Incluye:',
|
||||
for: 'Prueba gratuita de capacidades básicas',
|
||||
},
|
||||
professional: {
|
||||
name: 'Profesional',
|
||||
description: 'Para individuos y pequeños equipos que desean desbloquear más poder de manera asequible.',
|
||||
includesTitle: 'Todo en el plan gratuito, más:',
|
||||
for: 'Para desarrolladores independientes/equipos pequeños',
|
||||
},
|
||||
team: {
|
||||
name: 'Equipo',
|
||||
description: 'Colabora sin límites y disfruta de un rendimiento de primera categoría.',
|
||||
includesTitle: 'Todo en el plan Profesional, más:',
|
||||
for: 'Para equipos de tamaño mediano',
|
||||
},
|
||||
enterprise: {
|
||||
name: 'Empresa',
|
||||
description: 'Obtén capacidades completas y soporte para sistemas críticos a gran escala.',
|
||||
includesTitle: 'Todo en el plan Equipo, más:',
|
||||
features: {
|
||||
0: 'Soluciones de implementación escalables de nivel empresarial',
|
||||
7: 'Actualizaciones y Mantenimiento por Dify Oficialmente',
|
||||
8: 'Soporte Técnico Profesional',
|
||||
3: 'Múltiples Espacios de Trabajo y Gestión Empresarial',
|
||||
1: 'Autorización de Licencia Comercial',
|
||||
2: 'Características Exclusivas de la Empresa',
|
||||
5: 'SLA negociados por Dify Partners',
|
||||
4: 'SSO',
|
||||
6: 'Seguridad y Controles Avanzados',
|
||||
},
|
||||
btnText: 'Contactar ventas',
|
||||
for: 'Para equipos de gran tamaño',
|
||||
price: 'Personalizado',
|
||||
priceTip: 'Facturación Anual Solo',
|
||||
features: [
|
||||
'Soluciones de implementación escalables a nivel empresarial',
|
||||
'Autorización de licencia comercial',
|
||||
'Funciones exclusivas para empresas',
|
||||
'Múltiples espacios de trabajo y gestión empresarial',
|
||||
'SSO (inicio de sesión único)',
|
||||
'SLAs negociados con socios de Dify',
|
||||
'Seguridad y controles avanzados',
|
||||
'Actualizaciones y mantenimiento oficiales por parte de Dify',
|
||||
'Soporte técnico profesional',
|
||||
],
|
||||
},
|
||||
community: {
|
||||
features: {
|
||||
0: 'Todas las características principales se lanzaron bajo el repositorio público',
|
||||
2: 'Cumple con la Licencia de Código Abierto de Dify',
|
||||
1: 'Espacio de trabajo único',
|
||||
},
|
||||
includesTitle: 'Características gratuitas:',
|
||||
for: 'Para usuarios individuales, pequeños equipos o proyectos no comerciales',
|
||||
price: 'Gratis',
|
||||
btnText: 'Comienza con la Comunidad',
|
||||
name: 'Comunidad',
|
||||
description: 'Para usuarios individuales, pequeños equipos o proyectos no comerciales',
|
||||
features: [
|
||||
'Todas las funciones principales publicadas en el repositorio público',
|
||||
'Espacio de trabajo único',
|
||||
'Cumple con la licencia de código abierto de Dify',
|
||||
],
|
||||
},
|
||||
premium: {
|
||||
features: {
|
||||
0: 'Confiabilidad autogestionada por varios proveedores de nube',
|
||||
1: 'Espacio de trabajo único',
|
||||
3: 'Soporte prioritario por correo electrónico y chat',
|
||||
2: 'Personalización de logotipos y marcas de WebApp',
|
||||
},
|
||||
description: 'Para organizaciones y equipos de tamaño mediano',
|
||||
comingSoon: 'Soporte de Microsoft Azure y Google Cloud disponible próximamente',
|
||||
btnText: 'Obtén Premium en',
|
||||
@ -166,6 +152,12 @@ const translation = {
|
||||
includesTitle: 'Todo de Community, además:',
|
||||
name: 'Premium',
|
||||
for: 'Para organizaciones y equipos de tamaño mediano',
|
||||
features: [
|
||||
'Fiabilidad autogestionada mediante varios proveedores de nube',
|
||||
'Espacio de trabajo único',
|
||||
'Personalización del logotipo y la marca de la aplicación web',
|
||||
'Soporte prioritario por correo electrónico y chat',
|
||||
],
|
||||
},
|
||||
},
|
||||
vectorSpace: {
|
||||
@ -173,8 +165,6 @@ const translation = {
|
||||
fullSolution: 'Actualiza tu plan para obtener más espacio.',
|
||||
},
|
||||
apps: {
|
||||
fullTipLine1: 'Actualiza tu plan para',
|
||||
fullTipLine2: 'crear más aplicaciones.',
|
||||
fullTip1des: 'Has alcanzado el límite de aplicaciones de construcción en este plan',
|
||||
fullTip2des: 'Se recomienda limpiar las aplicaciones inactivas para liberar espacio de uso, o contactarnos.',
|
||||
fullTip1: 'Actualiza para crear más aplicaciones',
|
||||
|
||||
@ -201,7 +201,6 @@ const translation = {
|
||||
showAppLength: 'Mostrar {{length}} apps',
|
||||
delete: 'Eliminar cuenta',
|
||||
deleteTip: 'Eliminar tu cuenta borrará permanentemente todos tus datos y no se podrán recuperar.',
|
||||
deleteConfirmTip: 'Para confirmar, por favor envía lo siguiente desde tu correo electrónico registrado a ',
|
||||
account: 'Cuenta',
|
||||
myAccount: 'Mi Cuenta',
|
||||
studio: 'Estudio Dify',
|
||||
|
||||
@ -1,8 +1,6 @@
|
||||
const translation = {
|
||||
steps: {
|
||||
header: {
|
||||
creation: 'Crear conocimiento',
|
||||
update: 'Agregar datos',
|
||||
fallbackRoute: 'Conocimiento',
|
||||
},
|
||||
one: 'Elegir fuente de datos',
|
||||
|
||||
@ -342,7 +342,6 @@ const translation = {
|
||||
keywords: 'Palabras clave',
|
||||
addKeyWord: 'Agregar palabra clave',
|
||||
keywordError: 'La longitud máxima de la palabra clave es 20',
|
||||
characters: 'caracteres',
|
||||
hitCount: 'Cantidad de recuperación',
|
||||
vectorHash: 'Hash de vector: ',
|
||||
questionPlaceholder: 'agregar pregunta aquí',
|
||||
|
||||
@ -2,7 +2,6 @@ const translation = {
|
||||
title: 'Prueba de recuperación',
|
||||
desc: 'Prueba del efecto de impacto del conocimiento basado en el texto de consulta proporcionado.',
|
||||
dateTimeFormat: 'MM/DD/YYYY hh:mm A',
|
||||
recents: 'Recientes',
|
||||
table: {
|
||||
header: {
|
||||
source: 'Fuente',
|
||||
|
||||
@ -9,7 +9,6 @@ const translation = {
|
||||
namePlaceholder: 'Tu nombre de usuario',
|
||||
forget: '¿Olvidaste tu contraseña?',
|
||||
signBtn: 'Iniciar sesión',
|
||||
sso: 'Continuar con SSO',
|
||||
installBtn: 'Configurar',
|
||||
setAdminAccount: 'Configurando una cuenta de administrador',
|
||||
setAdminAccountDesc: 'Privilegios máximos para la cuenta de administrador, que se puede utilizar para crear aplicaciones y administrar proveedores de LLM, etc.',
|
||||
|
||||
@ -82,7 +82,6 @@ const translation = {
|
||||
keyTooltip: 'Clave del encabezado HTTP, puedes dejarla como "Authorization" si no tienes idea de qué es o configurarla con un valor personalizado',
|
||||
types: {
|
||||
none: 'Ninguno',
|
||||
api_key: 'Clave API',
|
||||
apiKeyPlaceholder: 'Nombre del encabezado HTTP para la Clave API',
|
||||
apiValuePlaceholder: 'Ingresa la Clave API',
|
||||
api_key_header: 'Encabezado',
|
||||
|
||||
@ -108,9 +108,7 @@ const translation = {
|
||||
exitVersions: 'Versiones de salida',
|
||||
exportJPEG: 'Exportar como JPEG',
|
||||
exportPNG: 'Exportar como PNG',
|
||||
referenceVar: 'Variable de referencia',
|
||||
publishUpdate: 'Publicar actualización',
|
||||
noExist: 'No existe tal variable',
|
||||
exportImage: 'Exportar imagen',
|
||||
needAnswerNode: 'Se debe agregar el nodo de respuesta',
|
||||
needEndNode: 'Se debe agregar el nodo Final',
|
||||
@ -222,7 +220,6 @@ const translation = {
|
||||
tabs: {
|
||||
'tools': 'Herramientas',
|
||||
'allTool': 'Todos',
|
||||
'builtInTool': 'Incorporadas',
|
||||
'customTool': 'Personalizadas',
|
||||
'workflowTool': 'Flujo de trabajo',
|
||||
'question-understand': 'Entender pregunta',
|
||||
@ -587,7 +584,6 @@ const translation = {
|
||||
'not empty': 'no está vacío',
|
||||
'null': 'es nulo',
|
||||
'not null': 'no es nulo',
|
||||
'regex match': 'Coincidencia de expresiones regulares',
|
||||
'not in': 'no en',
|
||||
'in': 'en',
|
||||
'exists': 'Existe',
|
||||
@ -610,7 +606,6 @@ const translation = {
|
||||
},
|
||||
select: 'Escoger',
|
||||
addSubVariable: 'Sub Variable',
|
||||
condition: 'Condición',
|
||||
},
|
||||
variableAssigner: {
|
||||
title: 'Asignar variables',
|
||||
@ -771,9 +766,6 @@ const translation = {
|
||||
showAuthor: 'Mostrar autor',
|
||||
},
|
||||
},
|
||||
tracing: {
|
||||
stopBy: 'Detenido por {{user}}',
|
||||
},
|
||||
docExtractor: {
|
||||
outputVars: {
|
||||
text: 'Texto extraído',
|
||||
@ -905,7 +897,7 @@ const translation = {
|
||||
},
|
||||
},
|
||||
tracing: {
|
||||
stopBy: 'Pásate por {{usuario}}',
|
||||
stopBy: 'Pásate por {{user}}',
|
||||
},
|
||||
variableReference: {
|
||||
noAvailableVars: 'No hay variables disponibles',
|
||||
|
||||
@ -222,7 +222,6 @@ const translation = {
|
||||
tabs: {
|
||||
'tools': 'ابزارها',
|
||||
'allTool': 'همه',
|
||||
'builtInTool': 'درونساخت',
|
||||
'customTool': 'سفارشی',
|
||||
'workflowTool': 'جریان کار',
|
||||
'question-understand': 'درک سوال',
|
||||
@ -587,7 +586,6 @@ const translation = {
|
||||
'not empty': 'خالی نیست',
|
||||
'null': 'خالی',
|
||||
'not null': 'خالی نیست',
|
||||
'regex match': 'مسابقه regex',
|
||||
'in': 'در',
|
||||
'not exists': 'وجود ندارد',
|
||||
'all of': 'همه از',
|
||||
|
||||
@ -222,7 +222,6 @@ const translation = {
|
||||
tabs: {
|
||||
'tools': 'Outils',
|
||||
'allTool': 'Tous',
|
||||
'builtInTool': 'Intégré',
|
||||
'customTool': 'Personnalisé',
|
||||
'workflowTool': 'Flux de travail',
|
||||
'question-understand': 'Compréhension des questions',
|
||||
@ -587,7 +586,6 @@ const translation = {
|
||||
'not empty': 'n\'est pas vide',
|
||||
'null': 'est nul',
|
||||
'not null': 'n\'est pas nul',
|
||||
'regex match': 'correspondance regex',
|
||||
'in': 'dans',
|
||||
'not in': 'pas dans',
|
||||
'exists': 'Existe',
|
||||
|
||||
@ -261,7 +261,7 @@ const translation = {
|
||||
noAccessPermission: 'वेब एप्लिकेशन तक पहुँचने की अनुमति नहीं है',
|
||||
maxActiveRequests: 'अधिकतम समवर्ती अनुरोध',
|
||||
maxActiveRequestsPlaceholder: 'असीमित के लिए 0 दर्ज करें',
|
||||
maxActiveRequestsTip: 'प्रति ऐप अधिकतम सक्रिय अनुरोधों की अधिकतम संख्या (असीमित के लिए 0)',
|
||||
maxActiveRequestsTip: 'प्रति ऐप सक्रिय अनुरोधों की अधिकतम संख्या (असीमित के लिए 0)',
|
||||
}
|
||||
|
||||
export default translation
|
||||
|
||||
@ -225,7 +225,6 @@ const translation = {
|
||||
tabs: {
|
||||
'tools': 'टूल्स',
|
||||
'allTool': 'सभी',
|
||||
'builtInTool': 'अंतर्निहित',
|
||||
'customTool': 'कस्टम',
|
||||
'workflowTool': 'कार्यप्रवाह',
|
||||
'question-understand': 'प्रश्न समझ',
|
||||
@ -602,7 +601,6 @@ const translation = {
|
||||
'not empty': 'खाली नहीं है',
|
||||
'null': 'शून्य है',
|
||||
'not null': 'शून्य नहीं है',
|
||||
'regex match': 'रेगेक्स मैच',
|
||||
'in': 'में',
|
||||
'all of': 'के सभी',
|
||||
'not exists': 'मौजूद नहीं है',
|
||||
|
||||
@ -227,7 +227,6 @@ const translation = {
|
||||
tabs: {
|
||||
'tools': 'Strumenti',
|
||||
'allTool': 'Tutti',
|
||||
'builtInTool': 'Integrato',
|
||||
'customTool': 'Personalizzato',
|
||||
'workflowTool': 'Flusso di lavoro',
|
||||
'question-understand': 'Comprensione Domanda',
|
||||
@ -606,7 +605,6 @@ const translation = {
|
||||
'not empty': 'non è vuoto',
|
||||
'null': 'è nullo',
|
||||
'not null': 'non è nullo',
|
||||
'regex match': 'Corrispondenza regex',
|
||||
'in': 'in',
|
||||
'all of': 'tutto di',
|
||||
'not in': 'non in',
|
||||
|
||||
@ -9,8 +9,6 @@ const translation = {
|
||||
table: {
|
||||
header: {
|
||||
question: '質問',
|
||||
match: 'マッチ',
|
||||
response: '応答',
|
||||
answer: '回答',
|
||||
createdAt: '作成日時',
|
||||
hits: 'ヒット数',
|
||||
@ -71,7 +69,6 @@ const translation = {
|
||||
noHitHistory: 'ヒット履歴はありません',
|
||||
},
|
||||
hitHistoryTable: {
|
||||
question: '質問',
|
||||
query: 'クエリ',
|
||||
match: '一致',
|
||||
response: '応答',
|
||||
@ -86,6 +83,16 @@ const translation = {
|
||||
configConfirmBtn: '保存',
|
||||
},
|
||||
embeddingModelSwitchTip: '注釈テキストのベクトル化モデルです。モデルを切り替えると再埋め込みが行われ、追加のコストが発生します。',
|
||||
list: {
|
||||
delete: {
|
||||
title: '本当に削除しますか?',
|
||||
},
|
||||
},
|
||||
batchAction: {
|
||||
cancel: 'キャンセル',
|
||||
delete: '削除する',
|
||||
selected: '選択された',
|
||||
},
|
||||
}
|
||||
|
||||
export default translation
|
||||
|
||||
@ -254,7 +254,6 @@ const translation = {
|
||||
noDataLine1: '左側に使用例を記入してください,',
|
||||
noDataLine2: 'オーケストレーションのプレビューがこちらに表示されます。',
|
||||
apply: '適用',
|
||||
noData: '左側にユースケースを入力すると、こちらでプレビューができます。',
|
||||
loading: 'アプリケーションを処理中です',
|
||||
overwriteTitle: '既存の設定を上書きしますか?',
|
||||
overwriteMessage: 'このプロンプトを適用すると、既存の設定が上書きされます。',
|
||||
@ -365,6 +364,7 @@ const translation = {
|
||||
'varName': '変数名',
|
||||
'labelName': 'ラベル名',
|
||||
'inputPlaceholder': '入力してください',
|
||||
'content': '内容',
|
||||
'required': '必須',
|
||||
'hide': '非表示',
|
||||
'file': {
|
||||
|
||||
@ -34,21 +34,7 @@ const translation = {
|
||||
newApp: {
|
||||
startFromBlank: '最初から作成',
|
||||
startFromTemplate: 'テンプレートから作成',
|
||||
captionAppType: 'どのタイプのアプリを作成しますか?',
|
||||
chatbotDescription: 'チャット形式のアプリケーションを構築します。このアプリは質問と回答の形式を使用し、複数のラウンドの継続的な会話を可能にします。',
|
||||
completionDescription: 'プロンプトに基づいて高品質のテキストを生成するアプリケーションを構築します。記事、要約、翻訳などを生成します。',
|
||||
completionWarning: 'この種類のアプリはもうサポートされなくなります。',
|
||||
agentDescription: 'タスクを自動的に完了するためのツールを選択できるインテリジェント エージェントを構築します',
|
||||
workflowDescription: '高度なカスタマイズが可能なワークフローに基づいて高品質のテキストを生成するアプリケーションを構築します。経験豊富なユーザー向けです。',
|
||||
workflowWarning: '現在ベータ版です',
|
||||
chatbotType: 'チャットボットのオーケストレーション方法',
|
||||
basic: '基本',
|
||||
basicTip: '初心者向け。後で「チャットフロー」に切り替えることができます',
|
||||
basicFor: '初心者向け',
|
||||
basicDescription: '基本オーケストレートは、組み込みのプロンプトを変更する機能がなく、簡単な設定を使用してチャットボット アプリをオーケストレートします。初心者向けです。',
|
||||
advanced: 'チャットフロー',
|
||||
advancedFor: '上級ユーザー向け',
|
||||
advancedDescription: 'ワークフロー オーケストレートは、ワークフロー形式でチャットボットをオーケストレートし、組み込みのプロンプトを編集する機能を含む高度なカスタマイズを提供します。経験豊富なユーザー向けです。',
|
||||
captionName: 'アプリのアイコンと名前',
|
||||
appNamePlaceholder: 'アプリ名を入力してください',
|
||||
captionDescription: '説明',
|
||||
|
||||
@ -215,7 +215,6 @@ const translation = {
|
||||
showAppLength: '{{length}}アプリを表示',
|
||||
delete: 'アカウントを削除',
|
||||
deleteTip: 'アカウントを削除すると、すべてのデータが完全に消去され、復元できなくなります。',
|
||||
deleteConfirmTip: '確認のため、登録したメールから次の内容をに送信してください ',
|
||||
account: 'アカウント',
|
||||
myAccount: 'マイアカウント',
|
||||
studio: 'スタジオ',
|
||||
|
||||
@ -9,7 +9,6 @@ const translation = {
|
||||
namePlaceholder: 'ユーザー名を入力してください',
|
||||
forget: 'パスワードをお忘れですか?',
|
||||
signBtn: 'サインイン',
|
||||
sso: 'SSO に続ける',
|
||||
installBtn: 'セットアップ',
|
||||
setAdminAccount: '管理者アカウントの設定',
|
||||
setAdminAccountDesc: 'アプリケーションの作成や LLM プロバイダの管理など、管理者アカウントの最大権限を設定します。',
|
||||
|
||||
@ -82,7 +82,6 @@ const translation = {
|
||||
keyTooltip: 'HTTP ヘッダーキー。アイデアがない場合は "Authorization" として残しておいてもかまいません。またはカスタム値に設定できます。',
|
||||
types: {
|
||||
none: 'なし',
|
||||
api_key: 'API キー',
|
||||
apiKeyPlaceholder: 'API キーの HTTP ヘッダー名',
|
||||
apiValuePlaceholder: 'API キーを入力してください',
|
||||
api_key_query: 'クエリパラメータ',
|
||||
|
||||
@ -213,7 +213,6 @@ const translation = {
|
||||
startRun: '実行開始',
|
||||
running: '実行中',
|
||||
testRunIteration: 'テスト実行(イテレーション)',
|
||||
testRunLoop: 'テスト実行(ループ)',
|
||||
back: '戻る',
|
||||
iteration: 'イテレーション',
|
||||
loop: 'ループ',
|
||||
@ -592,7 +591,6 @@ const translation = {
|
||||
'not empty': '空でない',
|
||||
'null': 'null',
|
||||
'not null': 'null でない',
|
||||
'regex match': '正規表現マッチ',
|
||||
'in': '含まれている',
|
||||
'not in': '含まれていない',
|
||||
'all of': 'すべての',
|
||||
@ -619,7 +617,6 @@ const translation = {
|
||||
variableAssigner: {
|
||||
title: '変数を代入する',
|
||||
outputType: '出力タイプ',
|
||||
outputVarType: '出力変数のタイプ',
|
||||
varNotSet: '変数が設定されていません',
|
||||
noVarTip: '代入された変数を追加してください',
|
||||
type: {
|
||||
|
||||
@ -227,21 +227,6 @@ const translation = {
|
||||
},
|
||||
},
|
||||
automatic: {
|
||||
title: '자동 어플리케이션 오케스트레이션',
|
||||
description: '시나리오를 설명하세요. Dify 가 어플리케이션을 자동으로 오케스트레이션 합니다.',
|
||||
intendedAudience: '누가 대상이 되는지 설명하세요.',
|
||||
intendedAudiencePlaceHolder: '예: 학생',
|
||||
solveProblem: '어떤 문제를 AI 가 해결할 것으로 예상하나요?',
|
||||
solveProblemPlaceHolder: '예: 학업 성적 평가',
|
||||
generate: '생성',
|
||||
audiencesRequired: '대상이 필요합니다',
|
||||
problemRequired: '문제가 필요합니다',
|
||||
resTitle: '다음 어플리케이션을 자동으로 오케스트레이션 했습니다.',
|
||||
apply: '이 오케스트레이션을 적용하기',
|
||||
noData: '왼쪽에 사용 예시를 기술하고, 오케스트레이션 미리보기가 여기에 나타납니다.',
|
||||
loading: '어플리케이션 오케스트레이션을 실행 중입니다...',
|
||||
overwriteTitle: '기존 구성을 덮어쓰시겠습니까?',
|
||||
overwriteMessage: '이 오케스트레이션을 적용하면 기존 구성이 덮어쓰여집니다.',
|
||||
},
|
||||
resetConfig: {
|
||||
title: '리셋을 확인하시겠습니까?',
|
||||
|
||||
@ -26,29 +26,10 @@ const translation = {
|
||||
newApp: {
|
||||
startFromBlank: '빈 상태로 시작',
|
||||
startFromTemplate: '템플릿에서 시작',
|
||||
captionAppType: '어떤 종류의 앱을 만들어 보시겠어요?',
|
||||
chatbotDescription:
|
||||
'대화형 어플리케이션을 만듭니다. 질문과 답변 형식을 사용하여 다단계 대화를 지원합니다.',
|
||||
completionDescription:
|
||||
'프롬프트를 기반으로 품질 높은 텍스트를 생성하는 어플리케이션을 만듭니다. 기사, 요약, 번역 등을 생성할 수 있습니다.',
|
||||
completionWarning: '이 종류의 앱은 더 이상 지원되지 않습니다.',
|
||||
agentDescription: '작업을 자동으로 완료하는 지능형 에이전트를 만듭니다.',
|
||||
workflowDescription:
|
||||
'고도로 사용자 지정 가능한 워크플로우에 기반한 고품질 텍스트 생성 어플리케이션을 만듭니다. 경험 있는 사용자를 위한 것입니다.',
|
||||
workflowWarning: '현재 베타 버전입니다.',
|
||||
chatbotType: '챗봇 오케스트레이션 방식',
|
||||
basic: '기본',
|
||||
basicTip: '초보자용. 나중에 Chatflow 로 전환할 수 있습니다.',
|
||||
basicFor: '초보자용',
|
||||
basicDescription:
|
||||
'기본 오케스트레이션은 내장된 프롬프트를 수정할 수 없고 간단한 설정을 사용하여 챗봇 앱을 오케스트레이션합니다. 초보자용입니다.',
|
||||
advanced: 'Chatflow',
|
||||
advancedFor: '고급 사용자용',
|
||||
advancedDescription:
|
||||
'워크플로우 오케스트레이션은 워크플로우 형식으로 챗봇을 오케스트레이션하며 내장된 프롬프트를 편집할 수 있는 고급 사용자 정의 기능을 제공합니다. 경험이 많은 사용자용입니다.',
|
||||
captionName: '앱 아이콘과 이름',
|
||||
appNamePlaceholder: '앱 이름을 입력하세요',
|
||||
captionDescription: '설명',
|
||||
workflowWarning: '현재 베타 버전입니다',
|
||||
appDescriptionPlaceholder: '앱 설명을 입력하세요',
|
||||
useTemplate: '이 템플릿 사용',
|
||||
previewDemo: '데모 미리보기',
|
||||
|
||||
@ -23,20 +23,14 @@ const translation = {
|
||||
contractSales: '영업팀에 문의하기',
|
||||
contractOwner: '팀 관리자에게 문의하기',
|
||||
startForFree: '무료로 시작하기',
|
||||
getStartedWith: '시작하기 ',
|
||||
contactSales: '영업팀에 문의하기',
|
||||
talkToSales: '영업팀과 상담하기',
|
||||
modelProviders: '모델 제공자',
|
||||
teamMembers: '팀 멤버',
|
||||
buildApps: '앱 만들기',
|
||||
vectorSpace: '벡터 공간',
|
||||
vectorSpaceBillingTooltip:
|
||||
'1MB 당 약 120 만 글자의 벡터화된 데이터를 저장할 수 있습니다 (OpenAI Embeddings 을 기반으로 추정되며 모델에 따라 다릅니다).',
|
||||
vectorSpaceTooltip:
|
||||
'벡터 공간은 LLM 이 데이터를 이해하는 데 필요한 장기 기억 시스템입니다.',
|
||||
documentProcessingPriority: '문서 처리 우선순위',
|
||||
documentProcessingPriorityTip:
|
||||
'더 높은 문서 처리 우선순위를 원하시면 요금제를 업그레이드하세요.',
|
||||
documentProcessingPriorityUpgrade:
|
||||
'더 높은 정확성과 빠른 속도로 데이터를 처리합니다.',
|
||||
priority: {
|
||||
@ -85,7 +79,6 @@ const translation = {
|
||||
'Dify 의 지식베이스 처리 기능을 호출하는 API 호출 수를 나타냅니다.',
|
||||
receiptInfo: '팀 소유자 및 팀 관리자만 구독 및 청구 정보를 볼 수 있습니다',
|
||||
annotationQuota: 'Annotation Quota(주석 할당량)',
|
||||
documentsUploadQuota: '문서 업로드 할당량',
|
||||
freeTrialTipPrefix: '요금제에 가입하고 ',
|
||||
comparePlanAndFeatures: '계획 및 기능 비교',
|
||||
documents: '{{count,number}} 지식 문서',
|
||||
@ -114,20 +107,17 @@ const translation = {
|
||||
sandbox: {
|
||||
name: '샌드박스',
|
||||
description: 'GPT 무료 체험 200 회',
|
||||
includesTitle: '포함된 항목:',
|
||||
for: '핵심 기능 무료 체험',
|
||||
},
|
||||
professional: {
|
||||
name: '프로페셔널',
|
||||
description:
|
||||
'개인 및 소규모 팀을 위해 더 많은 파워를 저렴한 가격에 제공합니다.',
|
||||
includesTitle: '무료 플랜에 추가로 포함된 항목:',
|
||||
for: '1인 개발자/소규모 팀을 위한',
|
||||
},
|
||||
team: {
|
||||
name: '팀',
|
||||
description: '제한 없이 협업하고 최고의 성능을 누리세요.',
|
||||
includesTitle: '프로페셔널 플랜에 추가로 포함된 항목:',
|
||||
for: '중간 규모 팀을 위한',
|
||||
},
|
||||
enterprise: {
|
||||
@ -135,42 +125,36 @@ const translation = {
|
||||
description:
|
||||
'대규모 미션 크리티컬 시스템을 위한 완전한 기능과 지원을 제공합니다.',
|
||||
includesTitle: '팀 플랜에 추가로 포함된 항목:',
|
||||
features: {
|
||||
2: '독점 기업 기능',
|
||||
1: '상업적 라이선스 승인',
|
||||
3: '다중 작업 공간 및 기업 관리',
|
||||
4: 'SSO',
|
||||
5: 'Dify 파트너에 의해 협상된 SLA',
|
||||
6: '고급 보안 및 제어',
|
||||
0: '기업급 확장 가능한 배포 솔루션',
|
||||
7: '디피 공식 업데이트 및 유지 관리',
|
||||
8: '전문 기술 지원',
|
||||
},
|
||||
price: '맞춤형',
|
||||
btnText: '판매 문의하기',
|
||||
for: '대규모 팀을 위해',
|
||||
priceTip: '연간 청구 전용',
|
||||
features: [
|
||||
'엔터프라이즈급 확장 가능한 배포 솔루션',
|
||||
'상업용 라이선스 인증',
|
||||
'전용 엔터프라이즈 기능',
|
||||
'다중 워크스페이스 및 엔터프라이즈 관리',
|
||||
'SSO(싱글 사인온)',
|
||||
'Dify 파트너와의 협상을 통한 SLA',
|
||||
'고급 보안 및 제어 기능',
|
||||
'Dify의 공식 업데이트 및 유지 관리',
|
||||
'전문 기술 지원',
|
||||
],
|
||||
},
|
||||
community: {
|
||||
features: {
|
||||
0: '모든 핵심 기능이 공개 저장소에 릴리스됨',
|
||||
2: 'Dify 오픈 소스 라이선스를 준수합니다.',
|
||||
1: '단일 작업 공간',
|
||||
},
|
||||
btnText: '커뮤니티 시작하기',
|
||||
description: '개인 사용자, 소규모 팀 또는 비상업적 프로젝트를 위한',
|
||||
name: '커뮤니티',
|
||||
price: '무료',
|
||||
includesTitle: '무료 기능:',
|
||||
for: '개인 사용자, 소규모 팀 또는 비상업적 프로젝트를 위한',
|
||||
features: [
|
||||
'모든 핵심 기능이 공개 저장소에 공개됨',
|
||||
'단일 워크스페이스',
|
||||
'Dify 오픈소스 라이선스를 준수함',
|
||||
],
|
||||
},
|
||||
premium: {
|
||||
features: {
|
||||
1: '단일 작업 공간',
|
||||
2: '웹앱 로고 및 브랜딩 맞춤화',
|
||||
3: '우선 이메일 및 채팅 지원',
|
||||
0: '다양한 클라우드 제공업체에 의한 자율 관리 신뢰성',
|
||||
},
|
||||
btnText: '프리미엄 받기',
|
||||
priceTip: '클라우드 마켓플레이스를 기반으로',
|
||||
name: '프리미엄',
|
||||
@ -179,6 +163,12 @@ const translation = {
|
||||
price: '확장 가능',
|
||||
for: '중규모 조직 및 팀을 위한',
|
||||
includesTitle: '커뮤니티의 모든 것, 여기에 추가로:',
|
||||
features: [
|
||||
'다양한 클라우드 제공업체를 통한 자가 관리 신뢰성',
|
||||
'단일 워크스페이스',
|
||||
'웹앱 로고 및 브랜딩 커스터마이징',
|
||||
'우선 이메일 및 채팅 지원',
|
||||
],
|
||||
},
|
||||
},
|
||||
vectorSpace: {
|
||||
@ -186,8 +176,6 @@ const translation = {
|
||||
fullSolution: '더 많은 공간을 얻으려면 요금제를 업그레이드하세요.',
|
||||
},
|
||||
apps: {
|
||||
fullTipLine1: '더 많은 앱을 생성하려면,',
|
||||
fullTipLine2: '요금제를 업그레이드하세요.',
|
||||
contactUs: '문의하기',
|
||||
fullTip1: '업그레이드하여 더 많은 앱을 만들기',
|
||||
fullTip2: '계획 한도에 도달했습니다.',
|
||||
|
||||
@ -193,7 +193,6 @@ const translation = {
|
||||
showAppLength: '{{length}}개의 앱 표시',
|
||||
delete: '계정 삭제',
|
||||
deleteTip: '계정을 삭제하면 모든 데이터가 영구적으로 지워지며 복구할 수 없습니다.',
|
||||
deleteConfirmTip: '확인하려면 등록된 이메일에서 다음 내용을 로 보내주세요 ',
|
||||
myAccount: '내 계정',
|
||||
studio: '디파이 스튜디오',
|
||||
account: '계정',
|
||||
|
||||
@ -1,8 +1,6 @@
|
||||
const translation = {
|
||||
steps: {
|
||||
header: {
|
||||
creation: '지식 생성',
|
||||
update: '데이터 추가',
|
||||
fallbackRoute: '지식',
|
||||
},
|
||||
one: '데이터 소스 선택',
|
||||
|
||||
@ -341,7 +341,6 @@ const translation = {
|
||||
keywords: '키워드',
|
||||
addKeyWord: '키워드 추가',
|
||||
keywordError: '키워드 최대 길이는 20 자입니다',
|
||||
characters: '문자',
|
||||
hitCount: '검색 횟수',
|
||||
vectorHash: '벡터 해시: ',
|
||||
questionPlaceholder: '질문을 입력하세요',
|
||||
|
||||
@ -2,7 +2,6 @@ const translation = {
|
||||
title: '검색 테스트',
|
||||
desc: '주어진 쿼리 텍스트에 기반하여 지식의 검색 효과를 테스트합니다.',
|
||||
dateTimeFormat: 'YYYY/MM/DD HH:mm',
|
||||
recents: '최근 결과',
|
||||
table: {
|
||||
header: {
|
||||
source: '소스',
|
||||
|
||||
@ -70,7 +70,6 @@ const translation = {
|
||||
activated: '지금 로그인하세요',
|
||||
adminInitPassword: '관리자 초기화 비밀번호',
|
||||
validate: '확인',
|
||||
sso: 'SSO 로 계속하기',
|
||||
checkCode: {
|
||||
verify: '확인',
|
||||
verificationCode: '인증 코드',
|
||||
|
||||
@ -82,7 +82,6 @@ const translation = {
|
||||
keyTooltip: 'HTTP 헤더 키입니다. 생각이 없으면 "Authorization"으로 남겨둘 수 있습니다. 또는 사용자 정의 값을 설정할 수 있습니다.',
|
||||
types: {
|
||||
none: '없음',
|
||||
api_key: 'API 키',
|
||||
apiKeyPlaceholder: 'API 키의 HTTP 헤더 이름',
|
||||
apiValuePlaceholder: 'API 키를 입력하세요',
|
||||
api_key_query: '쿼리 매개변수',
|
||||
|
||||
@ -111,11 +111,9 @@ const translation = {
|
||||
exportJPEG: 'JPEG 로 내보내기',
|
||||
exitVersions: '종료 버전',
|
||||
exportImage: '이미지 내보내기',
|
||||
noExist: '해당 변수가 없습니다.',
|
||||
exportSVG: 'SVG 로 내보내기',
|
||||
versionHistory: '버전 기록',
|
||||
exportPNG: 'PNG 로 내보내기',
|
||||
referenceVar: '참조 변수',
|
||||
addBlock: '노드 추가',
|
||||
needAnswerNode: '답변 노드를 추가해야 합니다.',
|
||||
needEndNode: '종단 노드를 추가해야 합니다.',
|
||||
@ -231,7 +229,6 @@ const translation = {
|
||||
tabs: {
|
||||
'tools': '도구',
|
||||
'allTool': '전체',
|
||||
'builtInTool': '내장',
|
||||
'customTool': '사용자 정의',
|
||||
'workflowTool': '워크플로우',
|
||||
'question-understand': '질문 이해',
|
||||
@ -617,7 +614,6 @@ const translation = {
|
||||
'not empty': '비어 있지 않음',
|
||||
'null': 'null 임',
|
||||
'not null': 'null 이 아님',
|
||||
'regex match': '정규식 일치',
|
||||
'in': '안으로',
|
||||
'exists': '존재',
|
||||
'all of': '모두의',
|
||||
@ -640,7 +636,6 @@ const translation = {
|
||||
},
|
||||
select: '고르다',
|
||||
addSubVariable: '하위 변수',
|
||||
condition: '조건',
|
||||
},
|
||||
variableAssigner: {
|
||||
title: '변수 할당',
|
||||
@ -761,8 +756,6 @@ const translation = {
|
||||
reasoningMode: '추론 모드',
|
||||
reasoningModeTip:
|
||||
'모델의 함수 호출 또는 프롬프트에 대한 지시 응답 능력을 기반으로 적절한 추론 모드를 선택할 수 있습니다.',
|
||||
isSuccess: '성공 여부. 성공 시 값은 1 이고, 실패 시 값은 0 입니다.',
|
||||
errorReason: '오류 원인',
|
||||
},
|
||||
iteration: {
|
||||
deleteTitle: '반복 노드를 삭제하시겠습니까?',
|
||||
|
||||
@ -222,7 +222,6 @@ const translation = {
|
||||
tabs: {
|
||||
'tools': 'Narzędzia',
|
||||
'allTool': 'Wszystkie',
|
||||
'builtInTool': 'Wbudowane',
|
||||
'customTool': 'Niestandardowe',
|
||||
'workflowTool': 'Przepływ pracy',
|
||||
'question-understand': 'Zrozumienie pytania',
|
||||
@ -587,7 +586,6 @@ const translation = {
|
||||
'not empty': 'nie jest pusty',
|
||||
'null': 'jest null',
|
||||
'not null': 'nie jest null',
|
||||
'regex match': 'Dopasowanie wyrażenia regularnego',
|
||||
'in': 'w',
|
||||
'not exists': 'nie istnieje',
|
||||
'exists': 'Istnieje',
|
||||
|
||||
@ -222,7 +222,6 @@ const translation = {
|
||||
tabs: {
|
||||
'tools': 'Ferramentas',
|
||||
'allTool': 'Todos',
|
||||
'builtInTool': 'Integrado',
|
||||
'customTool': 'Personalizado',
|
||||
'workflowTool': 'Fluxo de trabalho',
|
||||
'question-understand': 'Compreensão de perguntas',
|
||||
@ -587,7 +586,6 @@ const translation = {
|
||||
'not empty': 'não está vazio',
|
||||
'null': 'é nulo',
|
||||
'not null': 'não é nulo',
|
||||
'regex match': 'partida regex',
|
||||
'in': 'em',
|
||||
'not in': 'não em',
|
||||
'exists': 'Existe',
|
||||
|
||||
@ -222,7 +222,6 @@ const translation = {
|
||||
tabs: {
|
||||
'tools': 'Instrumente',
|
||||
'allTool': 'Toate',
|
||||
'builtInTool': 'Integrat',
|
||||
'customTool': 'Personalizat',
|
||||
'workflowTool': 'Flux de lucru',
|
||||
'question-understand': 'Înțelegerea întrebărilor',
|
||||
@ -587,7 +586,6 @@ const translation = {
|
||||
'not empty': 'nu este gol',
|
||||
'null': 'este null',
|
||||
'not null': 'nu este null',
|
||||
'regex match': 'potrivire regex',
|
||||
'in': 'în',
|
||||
'not in': 'nu în',
|
||||
'exists': 'Există',
|
||||
|
||||
@ -223,7 +223,6 @@ const translation = {
|
||||
'searchTool': 'Поиск инструмента',
|
||||
'tools': 'Инструменты',
|
||||
'allTool': 'Все',
|
||||
'builtInTool': 'Встроенные',
|
||||
'customTool': 'Пользовательские',
|
||||
'workflowTool': 'Рабочий процесс',
|
||||
'question-understand': 'Понимание вопроса',
|
||||
@ -587,7 +586,6 @@ const translation = {
|
||||
'not empty': 'не пусто',
|
||||
'null': 'null',
|
||||
'not null': 'не null',
|
||||
'regex match': 'Совпадение с регулярным выражением',
|
||||
'all of': 'все',
|
||||
'not in': 'не в',
|
||||
'not exists': 'не существует',
|
||||
|
||||
@ -223,7 +223,6 @@ const translation = {
|
||||
'searchTool': 'เครื่องมือค้นหา',
|
||||
'tools': 'เครื่อง มือ',
|
||||
'allTool': 'ทั้งหมด',
|
||||
'builtInTool': 'ในตัว',
|
||||
'customTool': 'ธรรมเนียม',
|
||||
'workflowTool': 'เวิร์กโฟลว์',
|
||||
'question-understand': 'คําถาม: เข้าใจ',
|
||||
|
||||
@ -350,6 +350,7 @@ const translation = {
|
||||
content: 'İçerik',
|
||||
required: 'Gerekli',
|
||||
errorMsg: {
|
||||
varNameRequired: 'Değişken adı gereklidir',
|
||||
labelNameRequired: 'Etiket adı gereklidir',
|
||||
varNameCanBeRepeat: 'Değişken adı tekrar edemez',
|
||||
atLeastOneOption: 'En az bir seçenek gereklidir',
|
||||
|
||||
@ -222,7 +222,6 @@ const translation = {
|
||||
tabs: {
|
||||
'tools': 'Araçlar',
|
||||
'allTool': 'Hepsi',
|
||||
'builtInTool': 'Yerleşik',
|
||||
'customTool': 'Özel',
|
||||
'workflowTool': 'Workflow',
|
||||
'question-understand': 'Soruyu Anlama',
|
||||
@ -588,7 +587,6 @@ const translation = {
|
||||
'not empty': 'boş değil',
|
||||
'null': 'null',
|
||||
'not null': 'null değil',
|
||||
'regex match': 'normal ifade maçı',
|
||||
'in': 'içinde',
|
||||
'not exists': 'mevcut değil',
|
||||
'all of': 'Tümü',
|
||||
|
||||
@ -222,7 +222,6 @@ const translation = {
|
||||
tabs: {
|
||||
'tools': 'Інструменти',
|
||||
'allTool': 'Усі',
|
||||
'builtInTool': 'Вбудовані',
|
||||
'customTool': 'Користувацькі',
|
||||
'workflowTool': 'Робочий потік',
|
||||
'question-understand': 'Розуміння питань',
|
||||
@ -587,7 +586,6 @@ const translation = {
|
||||
'not empty': 'не порожній',
|
||||
'null': 'є null',
|
||||
'not null': 'не є null',
|
||||
'regex match': 'Регулярний вираз збігу',
|
||||
'in': 'В',
|
||||
'all of': 'Всі з',
|
||||
'exists': 'Існує',
|
||||
|
||||
@ -222,7 +222,6 @@ const translation = {
|
||||
tabs: {
|
||||
'tools': 'Công cụ',
|
||||
'allTool': 'Tất cả',
|
||||
'builtInTool': 'Tích hợp sẵn',
|
||||
'customTool': 'Tùy chỉnh',
|
||||
'workflowTool': 'Quy trình làm việc',
|
||||
'question-understand': 'Hiểu câu hỏi',
|
||||
@ -587,7 +586,6 @@ const translation = {
|
||||
'not empty': 'không trống',
|
||||
'null': 'là null',
|
||||
'not null': 'không là null',
|
||||
'regex match': 'Trận đấu Regex',
|
||||
'exists': 'Tồn tại',
|
||||
'not exists': 'không tồn tại',
|
||||
'not in': 'không có trong',
|
||||
|
||||
@ -9,8 +9,6 @@ const translation = {
|
||||
table: {
|
||||
header: {
|
||||
question: '提问',
|
||||
match: '匹配',
|
||||
response: '回复',
|
||||
answer: '答案',
|
||||
createdAt: '创建时间',
|
||||
hits: '命中次数',
|
||||
@ -59,6 +57,16 @@ const translation = {
|
||||
error: '导入出错',
|
||||
ok: '确定',
|
||||
},
|
||||
list: {
|
||||
delete: {
|
||||
title: '确定删除吗?',
|
||||
},
|
||||
},
|
||||
batchAction: {
|
||||
selected: '已选择',
|
||||
delete: '删除',
|
||||
cancel: '取消',
|
||||
},
|
||||
errorMessage: {
|
||||
answerRequired: '回复不能为空',
|
||||
queryRequired: '提问不能为空',
|
||||
@ -71,7 +79,6 @@ const translation = {
|
||||
noHitHistory: '没有命中历史',
|
||||
},
|
||||
hitHistoryTable: {
|
||||
question: '问题',
|
||||
query: '提问',
|
||||
match: '匹配',
|
||||
response: '回复',
|
||||
|
||||
@ -254,7 +254,6 @@ const translation = {
|
||||
noDataLine1: '在左侧描述您的用例,',
|
||||
noDataLine2: '编排预览将在此处显示。',
|
||||
apply: '应用',
|
||||
noData: '在左侧描述您的用例,编排预览将在此处显示。',
|
||||
loading: '为您编排应用程序中…',
|
||||
overwriteTitle: '覆盖现有配置?',
|
||||
overwriteMessage: '应用此提示将覆盖现有配置。',
|
||||
|
||||
@ -35,7 +35,6 @@ const translation = {
|
||||
learnMore: '了解更多',
|
||||
startFromBlank: '创建空白应用',
|
||||
startFromTemplate: '从应用模版创建',
|
||||
captionAppType: '想要哪种应用类型?',
|
||||
foundResult: '{{count}} 个结果',
|
||||
foundResults: '{{count}} 个结果',
|
||||
noAppsFound: '未找到应用',
|
||||
@ -45,7 +44,6 @@ const translation = {
|
||||
chatbotUserDescription: '通过简单的配置快速搭建一个基于 LLM 的对话机器人。支持切换为 Chatflow 编排。',
|
||||
completionShortDescription: '用于文本生成任务的 AI 助手',
|
||||
completionUserDescription: '通过简单的配置快速搭建一个面向文本生成类任务的 AI 助手。',
|
||||
completionWarning: '该类型不久后将不再支持创建',
|
||||
agentShortDescription: '具备推理与自主工具调用的智能助手',
|
||||
agentUserDescription: '能够迭代式的规划推理、自主工具调用,直至完成任务目标的智能助手。',
|
||||
workflowShortDescription: '面向单轮自动化任务的编排工作流',
|
||||
|
||||
@ -77,7 +77,6 @@ const translation = {
|
||||
activated: '现在登录',
|
||||
adminInitPassword: '管理员初始化密码',
|
||||
validate: '验证',
|
||||
sso: '使用 SSO 继续',
|
||||
checkCode: {
|
||||
checkYourEmail: '验证您的电子邮件',
|
||||
tips: '验证码已经发送到您的邮箱 <strong>{{email}}</strong>',
|
||||
|
||||
@ -31,7 +31,6 @@ const translation = {
|
||||
title: {
|
||||
pickTime: '选择时间',
|
||||
},
|
||||
pickDate: '选择日期',
|
||||
defaultPlaceholder: '请选择时间...',
|
||||
}
|
||||
|
||||
|
||||
@ -214,7 +214,6 @@ const translation = {
|
||||
startRun: '开始运行',
|
||||
running: '运行中',
|
||||
testRunIteration: '测试运行迭代',
|
||||
testRunLoop: '测试运行循环',
|
||||
back: '返回',
|
||||
iteration: '迭代',
|
||||
loop: '循环',
|
||||
@ -600,8 +599,8 @@ const translation = {
|
||||
'not empty': '不为空',
|
||||
'null': '空',
|
||||
'not null': '不为空',
|
||||
'in': '是',
|
||||
'not in': '不是',
|
||||
'in': '在',
|
||||
'not in': '不在',
|
||||
'all of': '全部是',
|
||||
'exists': '存在',
|
||||
'not exists': '不存在',
|
||||
|
||||
@ -9,8 +9,6 @@ const translation = {
|
||||
table: {
|
||||
header: {
|
||||
question: '提問',
|
||||
match: '匹配',
|
||||
response: '回覆',
|
||||
answer: '答案',
|
||||
createdAt: '建立時間',
|
||||
hits: '命中次數',
|
||||
@ -71,7 +69,6 @@ const translation = {
|
||||
noHitHistory: '沒有命中歷史',
|
||||
},
|
||||
hitHistoryTable: {
|
||||
question: '問題',
|
||||
query: '提問',
|
||||
match: '匹配',
|
||||
response: '回覆',
|
||||
|
||||
@ -26,21 +26,7 @@ const translation = {
|
||||
newApp: {
|
||||
startFromBlank: '建立空白應用',
|
||||
startFromTemplate: '從應用模版建立',
|
||||
captionAppType: '想要哪種應用類型?',
|
||||
chatbotDescription: '使用大型語言模型構建聊天助手',
|
||||
completionDescription: '構建一個根據提示生成高品質文字的應用程式,例如生成文章、摘要、翻譯等。',
|
||||
completionWarning: '該類型不久後將不再支援建立',
|
||||
agentDescription: '構建一個智慧 Agent,可以自主選擇工具來完成任務',
|
||||
workflowDescription: '以工作流的形式編排生成型應用,提供更多的自訂設定。它適合有經驗的使用者。',
|
||||
workflowWarning: '正在進行 Beta 測試',
|
||||
chatbotType: '聊天助手編排方法',
|
||||
basic: '基礎編排',
|
||||
basicTip: '新手適用,可以切換成工作流編排',
|
||||
basicFor: '新手適用',
|
||||
basicDescription: '基本編排允許使用簡單的設定編排聊天機器人應用程式,而無需修改內建提示。它適合初學者。',
|
||||
advanced: '工作流編排',
|
||||
advancedFor: '進階使用者適用',
|
||||
advancedDescription: '工作流編排以工作流的形式編排聊天機器人,提供自訂設定,包括編輯內建提示的能力。它適合有經驗的使用者。',
|
||||
captionName: '應用名稱 & 圖示',
|
||||
appNamePlaceholder: '給你的應用起個名字',
|
||||
captionDescription: '描述',
|
||||
|
||||
@ -23,18 +23,13 @@ const translation = {
|
||||
contractOwner: '聯絡團隊管理員',
|
||||
free: '免費',
|
||||
startForFree: '免費開始',
|
||||
getStartedWith: '開始使用',
|
||||
contactSales: '聯絡銷售',
|
||||
talkToSales: '聯絡銷售',
|
||||
modelProviders: '支援的模型提供商',
|
||||
teamMembers: '團隊成員',
|
||||
buildApps: '構建應用程式數',
|
||||
vectorSpace: '向量空間',
|
||||
vectorSpaceTooltip: '向量空間是 LLMs 理解您的資料所需的長期記憶系統。',
|
||||
vectorSpaceBillingTooltip: '向量儲存是將知識庫向量化處理後為讓 LLMs 理解資料而使用的長期記憶儲存,1MB 大約能滿足 1.2 million character 的向量化後資料儲存(以 OpenAI Embedding 模型估算,不同模型計算方式有差異)。在向量化過程中,實際的壓縮或尺寸減小取決於內容的複雜性和冗餘性。',
|
||||
documentsUploadQuota: '文件上傳配額',
|
||||
documentProcessingPriority: '文件處理優先順序',
|
||||
documentProcessingPriorityTip: '如需更高的文件處理優先順序,請升級您的套餐',
|
||||
documentProcessingPriorityUpgrade: '以更快的速度、更高的精度處理更多的資料。',
|
||||
priority: {
|
||||
'standard': '標準',
|
||||
@ -103,19 +98,16 @@ const translation = {
|
||||
sandbox: {
|
||||
name: 'Sandbox',
|
||||
description: '200 次 GPT 免費試用',
|
||||
includesTitle: '包括:',
|
||||
for: '核心功能免費試用',
|
||||
},
|
||||
professional: {
|
||||
name: 'Professional',
|
||||
description: '讓個人和小團隊能夠以經濟實惠的方式釋放更多能力。',
|
||||
includesTitle: 'Sandbox 計劃中的一切,加上:',
|
||||
for: '適合獨立開發者/小型團隊',
|
||||
},
|
||||
team: {
|
||||
name: 'Team',
|
||||
description: '協作無限制並享受頂級效能。',
|
||||
includesTitle: 'Professional 計劃中的一切,加上:',
|
||||
for: '適用於中型團隊',
|
||||
},
|
||||
enterprise: {
|
||||
@ -123,15 +115,6 @@ const translation = {
|
||||
description: '獲得大規模關鍵任務系統的完整功能和支援。',
|
||||
includesTitle: 'Team 計劃中的一切,加上:',
|
||||
features: {
|
||||
1: '商業許可證授權',
|
||||
6: '先進安全與控制',
|
||||
3: '多個工作區及企業管理',
|
||||
2: '專屬企業功能',
|
||||
4: '單一登入',
|
||||
8: '專業技術支援',
|
||||
0: '企業級可擴展部署解決方案',
|
||||
7: 'Dify 官方的更新和維護',
|
||||
5: '由 Dify 合作夥伴協商的服務水平協議',
|
||||
},
|
||||
price: '自訂',
|
||||
btnText: '聯繫銷售',
|
||||
@ -140,9 +123,6 @@ const translation = {
|
||||
},
|
||||
community: {
|
||||
features: {
|
||||
0: '所有核心功能均在公共存儲庫下釋出',
|
||||
2: '遵循 Dify 開源許可證',
|
||||
1: '單一工作區域',
|
||||
},
|
||||
includesTitle: '免費功能:',
|
||||
btnText: '開始使用社區',
|
||||
@ -153,10 +133,6 @@ const translation = {
|
||||
},
|
||||
premium: {
|
||||
features: {
|
||||
2: '網頁應用程序標誌及品牌自定義',
|
||||
0: '各種雲端服務提供商的自我管理可靠性',
|
||||
1: '單一工作區域',
|
||||
3: '優先電子郵件及聊天支持',
|
||||
},
|
||||
for: '適用於中型組織和團隊',
|
||||
comingSoon: '微軟 Azure 與 Google Cloud 支持即將推出',
|
||||
@ -173,8 +149,6 @@ const translation = {
|
||||
fullSolution: '升級您的套餐以獲得更多空間。',
|
||||
},
|
||||
apps: {
|
||||
fullTipLine1: '升級您的套餐以',
|
||||
fullTipLine2: '構建更多的程式。',
|
||||
fullTip1: '升級以創建更多應用程序',
|
||||
fullTip2des: '建議清除不活躍的應用程式以釋放使用空間,或聯繫我們。',
|
||||
contactUs: '聯繫我們',
|
||||
|
||||
@ -197,7 +197,6 @@ const translation = {
|
||||
showAppLength: '顯示 {{length}} 個應用',
|
||||
delete: '刪除帳戶',
|
||||
deleteTip: '刪除您的帳戶將永久刪除您的所有資料並且無法恢復。',
|
||||
deleteConfirmTip: '請將以下內容從您的註冊電子郵件發送至 ',
|
||||
account: '帳戶',
|
||||
myAccount: '我的帳戶',
|
||||
studio: '工作室',
|
||||
|
||||
@ -1,8 +1,6 @@
|
||||
const translation = {
|
||||
steps: {
|
||||
header: {
|
||||
creation: '建立知識庫',
|
||||
update: '上傳檔案',
|
||||
fallbackRoute: '知識',
|
||||
},
|
||||
one: '選擇資料來源',
|
||||
|
||||
@ -341,7 +341,6 @@ const translation = {
|
||||
keywords: '關鍵詞',
|
||||
addKeyWord: '新增關鍵詞',
|
||||
keywordError: '關鍵詞最大長度為 20',
|
||||
characters: '字元',
|
||||
hitCount: '召回次數',
|
||||
vectorHash: '向量雜湊:',
|
||||
questionPlaceholder: '在這裡新增問題',
|
||||
|
||||
@ -2,7 +2,6 @@ const translation = {
|
||||
title: '召回測試',
|
||||
desc: '基於給定的查詢文字測試知識庫的召回效果。',
|
||||
dateTimeFormat: 'YYYY-MM-DD HH:mm',
|
||||
recents: '最近查詢',
|
||||
table: {
|
||||
header: {
|
||||
source: '資料來源',
|
||||
|
||||
@ -70,7 +70,6 @@ const translation = {
|
||||
activated: '現在登入',
|
||||
adminInitPassword: '管理員初始化密碼',
|
||||
validate: '驗證',
|
||||
sso: '繼續使用 SSO',
|
||||
checkCode: {
|
||||
verify: '驗證',
|
||||
resend: '發送',
|
||||
|
||||
@ -54,7 +54,6 @@ const translation = {
|
||||
keyTooltip: 'HTTP 頭部名稱,如果你不知道是什麼,可以將其保留為 Authorization 或設定為自定義值',
|
||||
types: {
|
||||
none: '無',
|
||||
api_key: 'API Key',
|
||||
apiKeyPlaceholder: 'HTTP 頭部名稱,用於傳遞 API Key',
|
||||
apiValuePlaceholder: '輸入 API Key',
|
||||
api_key_query: '查詢參數',
|
||||
|
||||
@ -107,10 +107,8 @@ const translation = {
|
||||
loadMore: '載入更多工作流',
|
||||
noHistory: '無歷史記錄',
|
||||
publishUpdate: '發布更新',
|
||||
referenceVar: '參考變量',
|
||||
exportSVG: '匯出為 SVG',
|
||||
exportPNG: '匯出為 PNG',
|
||||
noExist: '沒有這個變數',
|
||||
versionHistory: '版本歷史',
|
||||
exitVersions: '退出版本',
|
||||
exportImage: '匯出圖像',
|
||||
@ -224,7 +222,6 @@ const translation = {
|
||||
'blocks': '節點',
|
||||
'tools': '工具',
|
||||
'allTool': '全部',
|
||||
'builtInTool': '內置',
|
||||
'customTool': '自定義',
|
||||
'workflowTool': '工作流',
|
||||
'question-understand': '問題理解',
|
||||
@ -587,7 +584,6 @@ const translation = {
|
||||
'not empty': '不為空',
|
||||
'null': '空',
|
||||
'not null': '不為空',
|
||||
'regex match': '正則表達式匹配',
|
||||
'all of': '全部',
|
||||
'exists': '存在',
|
||||
'in': '在',
|
||||
@ -610,7 +606,6 @@ const translation = {
|
||||
},
|
||||
select: '選擇',
|
||||
addSubVariable: '子變數',
|
||||
condition: '條件',
|
||||
},
|
||||
variableAssigner: {
|
||||
title: '變量賦值',
|
||||
|
||||
@ -160,7 +160,7 @@
|
||||
"@faker-js/faker": "^9.0.3",
|
||||
"@happy-dom/jest-environment": "^17.4.4",
|
||||
"@next/bundle-analyzer": "^15.4.1",
|
||||
"@next/eslint-plugin-next": "~15.4.4",
|
||||
"@next/eslint-plugin-next": "~15.4.5",
|
||||
"@rgrove/parse-xml": "^4.1.0",
|
||||
"@storybook/addon-essentials": "8.5.0",
|
||||
"@storybook/addon-interactions": "8.5.0",
|
||||
@ -196,8 +196,8 @@
|
||||
"bing-translate-api": "^4.0.2",
|
||||
"code-inspector-plugin": "^0.18.1",
|
||||
"cross-env": "^7.0.3",
|
||||
"eslint": "^9.20.1",
|
||||
"eslint-config-next": "~15.4.4",
|
||||
"eslint": "^9.32.0",
|
||||
"eslint-config-next": "~15.4.5",
|
||||
"eslint-plugin-oxlint": "^1.6.0",
|
||||
"eslint-plugin-react-hooks": "^5.1.0",
|
||||
"eslint-plugin-react-refresh": "^0.4.19",
|
||||
@ -234,6 +234,7 @@
|
||||
},
|
||||
"pnpm": {
|
||||
"overrides": {
|
||||
"@eslint/plugin-kit@<0.3.4": "0.3.4",
|
||||
"esbuild@<0.25.0": "0.25.0",
|
||||
"pbkdf2@<3.1.3": "3.1.3",
|
||||
"vite@<6.2.7": "6.2.7",
|
||||
|
||||
567
web/pnpm-lock.yaml
generated
567
web/pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@ -38,6 +38,7 @@
|
||||
height: 43.75rem;
|
||||
max-height: calc(100vh - 6rem);
|
||||
border: none;
|
||||
border-radius: 1rem;
|
||||
z-index: 2147483640;
|
||||
overflow: hidden;
|
||||
user-select: none;
|
||||
@ -62,6 +63,7 @@
|
||||
height: 88%;
|
||||
max-height: calc(100vh - 6rem);
|
||||
border: none;
|
||||
border-radius: 1rem;
|
||||
z-index: 2147483640;
|
||||
overflow: hidden;
|
||||
user-select: none;
|
||||
|
||||
66
web/public/embed.min.js
vendored
66
web/public/embed.min.js
vendored
@ -1,42 +1,66 @@
|
||||
(()=>{let t="difyChatbotConfig",h="dify-chatbot-bubble-button",m="dify-chatbot-bubble-window",y=window[t],a=!1,l=`
|
||||
(function(){const configKey="difyChatbotConfig";const buttonId="dify-chatbot-bubble-button";const iframeId="dify-chatbot-bubble-window";const config=window[configKey];let isExpanded=false;const svgIcons=`<svg id="openIcon" width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M7.7586 2L16.2412 2C17.0462 1.99999 17.7105 1.99998 18.2517 2.04419C18.8138 2.09012 19.3305 2.18868 19.8159 2.43598C20.5685 2.81947 21.1804 3.43139 21.5639 4.18404C21.8112 4.66937 21.9098 5.18608 21.9557 5.74818C21.9999 6.28937 21.9999 6.95373 21.9999 7.7587L22 14.1376C22.0004 14.933 22.0007 15.5236 21.8636 16.0353C21.4937 17.4156 20.4155 18.4938 19.0352 18.8637C18.7277 18.9461 18.3917 18.9789 17.9999 18.9918L17.9999 20.371C18 20.6062 18 20.846 17.9822 21.0425C17.9651 21.2305 17.9199 21.5852 17.6722 21.8955C17.3872 22.2525 16.9551 22.4602 16.4983 22.4597C16.1013 22.4593 15.7961 22.273 15.6386 22.1689C15.474 22.06 15.2868 21.9102 15.1031 21.7632L12.69 19.8327C12.1714 19.4178 12.0174 19.3007 11.8575 19.219C11.697 19.137 11.5262 19.0771 11.3496 19.0408C11.1737 19.0047 10.9803 19 10.3162 19H7.75858C6.95362 19 6.28927 19 5.74808 18.9558C5.18598 18.9099 4.66928 18.8113 4.18394 18.564C3.43129 18.1805 2.81937 17.5686 2.43588 16.816C2.18859 16.3306 2.09002 15.8139 2.0441 15.2518C1.99988 14.7106 1.99989 14.0463 1.9999 13.2413V7.75868C1.99989 6.95372 1.99988 6.28936 2.0441 5.74818C2.09002 5.18608 2.18859 4.66937 2.43588 4.18404C2.81937 3.43139 3.43129 2.81947 4.18394 2.43598C4.66928 2.18868 5.18598 2.09012 5.74808 2.04419C6.28927 1.99998 6.95364 1.99999 7.7586 2ZM10.5073 7.5C10.5073 6.67157 9.83575 6 9.00732 6C8.1789 6 7.50732 6.67157 7.50732 7.5C7.50732 8.32843 8.1789 9 9.00732 9C9.83575 9 10.5073 8.32843 10.5073 7.5ZM16.6073 11.7001C16.1669 11.3697 15.5426 11.4577 15.2105 11.8959C15.1488 11.9746 15.081 12.0486 15.0119 12.1207C14.8646 12.2744 14.6432 12.4829 14.3566 12.6913C13.7796 13.111 12.9818 13.5001 12.0073 13.5001C11.0328 13.5001 10.235 13.111 9.65799 12.6913C9.37138 12.4829 9.15004 12.2744 9.00274 12.1207C8.93366 12.0486 8.86581 11.9745 8.80418 11.8959C8.472 11.4577 7.84775 11.3697 7.40732 11.7001C6.96549 12.0314 6.87595 12.6582 7.20732 13.1001C7.20479 13.0968 7.21072 13.1043 7.22094 13.1171C7.24532 13.1478 7.29407 13.2091 7.31068 13.2289C7.36932 13.2987 7.45232 13.3934 7.55877 13.5045C7.77084 13.7258 8.08075 14.0172 8.48165 14.3088C9.27958 14.8891 10.4818 15.5001 12.0073 15.5001C13.5328 15.5001 14.735 14.8891 15.533 14.3088C15.9339 14.0172 16.2438 13.7258 16.4559 13.5045C16.5623 13.3934 16.6453 13.2987 16.704 13.2289C16.7333 13.1939 16.7567 13.165 16.7739 13.1432C17.1193 12.6969 17.0729 12.0493 16.6073 11.7001ZM15.0073 6C15.8358 6 16.5073 6.67157 16.5073 7.5C16.5073 8.32843 15.8358 9 15.0073 9C14.1789 9 13.5073 8.32843 13.5073 7.5C13.5073 6.67157 14.1789 6 15.0073 6Z" fill="white"/>
|
||||
</svg>
|
||||
<svg id="closeIcon" style="display:none" width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M18 18L6 6M6 18L18 6" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</svg>
|
||||
`;const originalIframeStyleText=`
|
||||
position: absolute;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
top: unset;
|
||||
right: var(--${h}-right, 1rem); /* Align with dify-chatbot-bubble-button. */
|
||||
bottom: var(--${h}-bottom, 1rem); /* Align with dify-chatbot-bubble-button. */
|
||||
right: var(--${buttonId}-right, 1rem); /* Align with dify-chatbot-bubble-button. */
|
||||
bottom: var(--${buttonId}-bottom, 1rem); /* Align with dify-chatbot-bubble-button. */
|
||||
left: unset;
|
||||
width: 24rem;
|
||||
max-width: calc(100vw - 2rem);
|
||||
height: 43.75rem;
|
||||
max-height: calc(100vh - 6rem);
|
||||
border: none;
|
||||
border-radius: 1rem;
|
||||
z-index: 2147483640;
|
||||
overflow: hidden;
|
||||
user-select: none;
|
||||
transition-property: width, height;
|
||||
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
||||
transition-duration: 150ms;
|
||||
`;async function e(){let u=!1;if(y&&y.token){var e=new URLSearchParams({...await(async()=>{var e=y?.inputs||{};let n={};return await Promise.all(Object.entries(e).map(async([e,t])=>{n[e]=await i(t)})),n})(),...await(async()=>{var e=y?.systemVariables||{};let n={};return await Promise.all(Object.entries(e).map(async([e,t])=>{n["sys."+e]=await i(t)})),n})(),...await(async()=>{var e=y?.userVariables||{};let n={};return await Promise.all(Object.entries(e).map(async([e,t])=>{n["user."+e]=await i(t)})),n})()}),n=y.baseUrl||`https://${y.isDev?"dev.":""}udify.app`;let o=new URL(n).origin,t=`${n}/chatbot/${y.token}?`+e;n=s();async function i(e){e=(new TextEncoder).encode(e),e=new Response(new Blob([e]).stream().pipeThrough(new CompressionStream("gzip"))).arrayBuffer(),e=new Uint8Array(await e);return btoa(String.fromCharCode(...e))}function s(){var e=document.createElement("iframe");return e.allow="fullscreen;microphone",e.title="dify chatbot bubble window",e.id=m,e.src=t,e.style.cssText=l,e}function r(){var e,t,n;window.innerWidth<=640||(e=document.getElementById(m),t=document.getElementById(h),e&&t&&(t=t.getBoundingClientRect(),n=window.innerHeight/2,t.top+t.height/2<n?(e.style.top=`var(--${h}-bottom, 1rem)`,e.style.bottom="unset"):(e.style.bottom=`var(--${h}-bottom, 1rem)`,e.style.top="unset"),t.left+t.width/2<window.innerWidth/2?(e.style.left=`var(--${h}-right, 1rem)`,e.style.right="unset"):(e.style.right=`var(--${h}-right, 1rem)`,e.style.left="unset")))}function d(){let n=document.createElement("div");Object.entries(y.containerProps||{}).forEach(([e,t])=>{"className"===e?n.classList.add(...t.split(" ")):"style"===e?"object"==typeof t?Object.assign(n.style,t):n.style.cssText=t:"function"==typeof t?n.addEventListener(e.replace(/^on/,"").toLowerCase(),t):n[e]=t}),n.id=h;var e=document.createElement("style"),e=(document.head.appendChild(e),e.sheet.insertRule(`
|
||||
#${n.id} {
|
||||
`;const expandedIframeStyleText=`
|
||||
position: absolute;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
top: unset;
|
||||
right: var(--${buttonId}-right, 1rem); /* Align with dify-chatbot-bubble-button. */
|
||||
bottom: var(--${buttonId}-bottom, 1rem); /* Align with dify-chatbot-bubble-button. */
|
||||
left: unset;
|
||||
min-width: 24rem;
|
||||
width: 48%;
|
||||
max-width: 40rem; /* Match mobile breakpoint*/
|
||||
min-height: 43.75rem;
|
||||
height: 88%;
|
||||
max-height: calc(100vh - 6rem);
|
||||
border: none;
|
||||
border-radius: 1rem;
|
||||
z-index: 2147483640;
|
||||
overflow: hidden;
|
||||
user-select: none;
|
||||
transition-property: width, height;
|
||||
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
||||
transition-duration: 150ms;
|
||||
`;async function embedChatbot(){let isDragging=false;if(!config||!config.token){console.error(`${configKey} is empty or token is not provided`);return}async function compressAndEncodeBase64(input){const uint8Array=(new TextEncoder).encode(input);const compressedStream=new Response(new Blob([uint8Array]).stream().pipeThrough(new CompressionStream("gzip"))).arrayBuffer();const compressedUint8Array=new Uint8Array(await compressedStream);return btoa(String.fromCharCode(...compressedUint8Array))}async function getCompressedInputsFromConfig(){const inputs=config?.inputs||{};const compressedInputs={};await Promise.all(Object.entries(inputs).map(async([key,value])=>{compressedInputs[key]=await compressAndEncodeBase64(value)}));return compressedInputs}async function getCompressedSystemVariablesFromConfig(){const systemVariables=config?.systemVariables||{};const compressedSystemVariables={};await Promise.all(Object.entries(systemVariables).map(async([key,value])=>{compressedSystemVariables[`sys.${key}`]=await compressAndEncodeBase64(value)}));return compressedSystemVariables}async function getCompressedUserVariablesFromConfig(){const userVariables=config?.userVariables||{};const compressedUserVariables={};await Promise.all(Object.entries(userVariables).map(async([key,value])=>{compressedUserVariables[`user.${key}`]=await compressAndEncodeBase64(value)}));return compressedUserVariables}const params=new URLSearchParams({...await getCompressedInputsFromConfig(),...await getCompressedSystemVariablesFromConfig(),...await getCompressedUserVariablesFromConfig()});const baseUrl=config.baseUrl||`https://${config.isDev?"dev.":""}udify.app`;const targetOrigin=new URL(baseUrl).origin;const iframeUrl=`${baseUrl}/chatbot/${config.token}?${params}`;const preloadedIframe=createIframe();preloadedIframe.style.display="none";document.body.appendChild(preloadedIframe);if(iframeUrl.length>2048){console.error("The URL is too long, please reduce the number of inputs to prevent the bot from failing to load")}function createIframe(){const iframe=document.createElement("iframe");iframe.allow="fullscreen;microphone";iframe.title="dify chatbot bubble window";iframe.id=iframeId;iframe.src=iframeUrl;iframe.style.cssText=originalIframeStyleText;return iframe}function resetIframePosition(){if(window.innerWidth<=640)return;const targetIframe=document.getElementById(iframeId);const targetButton=document.getElementById(buttonId);if(targetIframe&&targetButton){const buttonRect=targetButton.getBoundingClientRect();const viewportCenterY=window.innerHeight/2;const buttonCenterY=buttonRect.top+buttonRect.height/2;if(buttonCenterY<viewportCenterY){targetIframe.style.top=`var(--${buttonId}-bottom, 1rem)`;targetIframe.style.bottom="unset"}else{targetIframe.style.bottom=`var(--${buttonId}-bottom, 1rem)`;targetIframe.style.top="unset"}const viewportCenterX=window.innerWidth/2;const buttonCenterX=buttonRect.left+buttonRect.width/2;if(buttonCenterX<viewportCenterX){targetIframe.style.left=`var(--${buttonId}-right, 1rem)`;targetIframe.style.right="unset"}else{targetIframe.style.right=`var(--${buttonId}-right, 1rem)`;targetIframe.style.left="unset"}}}function toggleExpand(){isExpanded=!isExpanded;const targetIframe=document.getElementById(iframeId);if(!targetIframe)return;if(isExpanded){targetIframe.style.cssText=expandedIframeStyleText}else{targetIframe.style.cssText=originalIframeStyleText}resetIframePosition()}window.addEventListener("message",event=>{if(event.origin!==targetOrigin)return;const targetIframe=document.getElementById(iframeId);if(!targetIframe||event.source!==targetIframe.contentWindow)return;if(event.data.type==="dify-chatbot-iframe-ready"){targetIframe.contentWindow?.postMessage({type:"dify-chatbot-config",payload:{isToggledByButton:true,isDraggable:!!config.draggable}},targetOrigin)}if(event.data.type==="dify-chatbot-expand-change"){toggleExpand()}});function createButton(){const containerDiv=document.createElement("div");Object.entries(config.containerProps||{}).forEach(([key,value])=>{if(key==="className"){containerDiv.classList.add(...value.split(" "))}else if(key==="style"){if(typeof value==="object"){Object.assign(containerDiv.style,value)}else{containerDiv.style.cssText=value}}else if(typeof value==="function"){containerDiv.addEventListener(key.replace(/^on/,"").toLowerCase(),value)}else{containerDiv[key]=value}});containerDiv.id=buttonId;const styleSheet=document.createElement("style");document.head.appendChild(styleSheet);styleSheet.sheet.insertRule(`
|
||||
#${containerDiv.id} {
|
||||
position: fixed;
|
||||
bottom: var(--${n.id}-bottom, 1rem);
|
||||
right: var(--${n.id}-right, 1rem);
|
||||
left: var(--${n.id}-left, unset);
|
||||
top: var(--${n.id}-top, unset);
|
||||
width: var(--${n.id}-width, 48px);
|
||||
height: var(--${n.id}-height, 48px);
|
||||
border-radius: var(--${n.id}-border-radius, 25px);
|
||||
background-color: var(--${n.id}-bg-color, #155EEF);
|
||||
box-shadow: var(--${n.id}-box-shadow, rgba(0, 0, 0, 0.2) 0px 4px 8px 0px);
|
||||
bottom: var(--${containerDiv.id}-bottom, 1rem);
|
||||
right: var(--${containerDiv.id}-right, 1rem);
|
||||
left: var(--${containerDiv.id}-left, unset);
|
||||
top: var(--${containerDiv.id}-top, unset);
|
||||
width: var(--${containerDiv.id}-width, 48px);
|
||||
height: var(--${containerDiv.id}-height, 48px);
|
||||
border-radius: var(--${containerDiv.id}-border-radius, 25px);
|
||||
background-color: var(--${containerDiv.id}-bg-color, #155EEF);
|
||||
box-shadow: var(--${containerDiv.id}-box-shadow, rgba(0, 0, 0, 0.2) 0px 4px 8px 0px);
|
||||
cursor: pointer;
|
||||
z-index: 2147483647;
|
||||
}
|
||||
`),document.createElement("div"));function t(){var e;u||((e=document.getElementById(m))?(e.style.display="none"===e.style.display?"block":"none","none"===e.style.display?p("open"):p("close"),"none"===e.style.display?document.removeEventListener("keydown",b):document.addEventListener("keydown",b),r()):(n.appendChild(s()),r(),this.title="Exit (ESC)",p("close"),document.addEventListener("keydown",b)))}if(e.style.cssText="position: relative; display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; z-index: 2147483647;",e.innerHTML=`<svg id="openIcon" width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M7.7586 2L16.2412 2C17.0462 1.99999 17.7105 1.99998 18.2517 2.04419C18.8138 2.09012 19.3305 2.18868 19.8159 2.43598C20.5685 2.81947 21.1804 3.43139 21.5639 4.18404C21.8112 4.66937 21.9098 5.18608 21.9557 5.74818C21.9999 6.28937 21.9999 6.95373 21.9999 7.7587L22 14.1376C22.0004 14.933 22.0007 15.5236 21.8636 16.0353C21.4937 17.4156 20.4155 18.4938 19.0352 18.8637C18.7277 18.9461 18.3917 18.9789 17.9999 18.9918L17.9999 20.371C18 20.6062 18 20.846 17.9822 21.0425C17.9651 21.2305 17.9199 21.5852 17.6722 21.8955C17.3872 22.2525 16.9551 22.4602 16.4983 22.4597C16.1013 22.4593 15.7961 22.273 15.6386 22.1689C15.474 22.06 15.2868 21.9102 15.1031 21.7632L12.69 19.8327C12.1714 19.4178 12.0174 19.3007 11.8575 19.219C11.697 19.137 11.5262 19.0771 11.3496 19.0408C11.1737 19.0047 10.9803 19 10.3162 19H7.75858C6.95362 19 6.28927 19 5.74808 18.9558C5.18598 18.9099 4.66928 18.8113 4.18394 18.564C3.43129 18.1805 2.81937 17.5686 2.43588 16.816C2.18859 16.3306 2.09002 15.8139 2.0441 15.2518C1.99988 14.7106 1.99989 14.0463 1.9999 13.2413V7.75868C1.99989 6.95372 1.99988 6.28936 2.0441 5.74818C2.09002 5.18608 2.18859 4.66937 2.43588 4.18404C2.81937 3.43139 3.43129 2.81947 4.18394 2.43598C4.66928 2.18868 5.18598 2.09012 5.74808 2.04419C6.28927 1.99998 6.95364 1.99999 7.7586 2ZM10.5073 7.5C10.5073 6.67157 9.83575 6 9.00732 6C8.1789 6 7.50732 6.67157 7.50732 7.5C7.50732 8.32843 8.1789 9 9.00732 9C9.83575 9 10.5073 8.32843 10.5073 7.5ZM16.6073 11.7001C16.1669 11.3697 15.5426 11.4577 15.2105 11.8959C15.1488 11.9746 15.081 12.0486 15.0119 12.1207C14.8646 12.2744 14.6432 12.4829 14.3566 12.6913C13.7796 13.111 12.9818 13.5001 12.0073 13.5001C11.0328 13.5001 10.235 13.111 9.65799 12.6913C9.37138 12.4829 9.15004 12.2744 9.00274 12.1207C8.93366 12.0486 8.86581 11.9745 8.80418 11.8959C8.472 11.4577 7.84775 11.3697 7.40732 11.7001C6.96549 12.0314 6.87595 12.6582 7.20732 13.1001C7.20479 13.0968 7.21072 13.1043 7.22094 13.1171C7.24532 13.1478 7.29407 13.2091 7.31068 13.2289C7.36932 13.2987 7.45232 13.3934 7.55877 13.5045C7.77084 13.7258 8.08075 14.0172 8.48165 14.3088C9.27958 14.8891 10.4818 15.5001 12.0073 15.5001C13.5328 15.5001 14.735 14.8891 15.533 14.3088C15.9339 14.0172 16.2438 13.7258 16.4559 13.5045C16.5623 13.3934 16.6453 13.2987 16.704 13.2289C16.7333 13.1939 16.7567 13.165 16.7739 13.1432C17.1193 12.6969 17.0729 12.0493 16.6073 11.7001ZM15.0073 6C15.8358 6 16.5073 6.67157 16.5073 7.5C16.5073 8.32843 15.8358 9 15.0073 9C14.1789 9 13.5073 8.32843 13.5073 7.5C13.5073 6.67157 14.1789 6 15.0073 6Z" fill="white"/>
|
||||
</svg>
|
||||
<svg id="closeIcon" style="display:none" width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M18 18L6 6M6 18L18 6" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</svg>
|
||||
`,n.appendChild(e),document.body.appendChild(n),n.addEventListener("click",t),n.addEventListener("touchend",e=>{e.preventDefault(),t()},{passive:!1}),y.draggable){var a=n;var l=y.dragAxis||"both";let s,r,t,d;function o(e){u=!1,d=("touchstart"===e.type?(s=e.touches[0].clientX-a.offsetLeft,r=e.touches[0].clientY-a.offsetTop,t=e.touches[0].clientX,e.touches[0]):(s=e.clientX-a.offsetLeft,r=e.clientY-a.offsetTop,t=e.clientX,e)).clientY,document.addEventListener("mousemove",i),document.addEventListener("touchmove",i,{passive:!1}),document.addEventListener("mouseup",c),document.addEventListener("touchend",c),e.preventDefault()}function i(n){var o="touchmove"===n.type?n.touches[0]:n,i=o.clientX-t,o=o.clientY-d;if(u=8<Math.abs(i)||8<Math.abs(o)?!0:u){a.style.transition="none",a.style.cursor="grabbing";i=document.getElementById(m);i&&(i.style.display="none",p("open"));let e,t;t="touchmove"===n.type?(e=n.touches[0].clientX-s,window.innerHeight-n.touches[0].clientY-r):(e=n.clientX-s,window.innerHeight-n.clientY-r);o=a.getBoundingClientRect(),i=window.innerWidth-o.width,n=window.innerHeight-o.height;"x"!==l&&"both"!==l||a.style.setProperty(`--${h}-left`,Math.max(0,Math.min(e,i))+"px"),"y"!==l&&"both"!==l||a.style.setProperty(`--${h}-bottom`,Math.max(0,Math.min(t,n))+"px")}}function c(){setTimeout(()=>{u=!1},0),a.style.transition="",a.style.cursor="pointer",document.removeEventListener("mousemove",i),document.removeEventListener("touchmove",i),document.removeEventListener("mouseup",c),document.removeEventListener("touchend",c)}a.addEventListener("mousedown",o),a.addEventListener("touchstart",o)}}n.style.display="none",document.body.appendChild(n),2048<t.length&&console.error("The URL is too long, please reduce the number of inputs to prevent the bot from failing to load"),window.addEventListener("message",e=>{var t,n;e.origin===o&&(t=document.getElementById(m))&&e.source===t.contentWindow&&("dify-chatbot-iframe-ready"===e.data.type&&t.contentWindow?.postMessage({type:"dify-chatbot-config",payload:{isToggledByButton:!0,isDraggable:!!y.draggable}},o),"dify-chatbot-expand-change"===e.data.type)&&(a=!a,n=document.getElementById(m))&&(a?n.style.cssText="\n position: absolute;\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n top: unset;\n right: var(--dify-chatbot-bubble-button-right, 1rem); /* Align with dify-chatbot-bubble-button. */\n bottom: var(--dify-chatbot-bubble-button-bottom, 1rem); /* Align with dify-chatbot-bubble-button. */\n left: unset;\n min-width: 24rem;\n width: 48%;\n max-width: 40rem; /* Match mobile breakpoint*/\n min-height: 43.75rem;\n height: 88%;\n max-height: calc(100vh - 6rem);\n border: none;\n z-index: 2147483640;\n overflow: hidden;\n user-select: none;\n transition-property: width, height;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n ":n.style.cssText=l,r())}),document.getElementById(h)||d()}else console.error(t+" is empty or token is not provided")}function p(e="open"){"open"===e?(document.getElementById("openIcon").style.display="block",document.getElementById("closeIcon").style.display="none"):(document.getElementById("openIcon").style.display="none",document.getElementById("closeIcon").style.display="block")}function b(e){"Escape"===e.key&&(e=document.getElementById(m))&&"none"!==e.style.display&&(e.style.display="none",p("open"))}h,h,document.addEventListener("keydown",b),y?.dynamicScript?e():document.body.onload=e})();
|
||||
`);const displayDiv=document.createElement("div");displayDiv.style.cssText="position: relative; display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; z-index: 2147483647;";displayDiv.innerHTML=svgIcons;containerDiv.appendChild(displayDiv);document.body.appendChild(containerDiv);containerDiv.addEventListener("click",handleClick);containerDiv.addEventListener("touchend",event=>{event.preventDefault();handleClick()},{passive:false});function handleClick(){if(isDragging)return;const targetIframe=document.getElementById(iframeId);if(!targetIframe){containerDiv.appendChild(createIframe());resetIframePosition();this.title="Exit (ESC)";setSvgIcon("close");document.addEventListener("keydown",handleEscKey);return}targetIframe.style.display=targetIframe.style.display==="none"?"block":"none";targetIframe.style.display==="none"?setSvgIcon("open"):setSvgIcon("close");if(targetIframe.style.display==="none"){document.removeEventListener("keydown",handleEscKey)}else{document.addEventListener("keydown",handleEscKey)}resetIframePosition()}if(config.draggable){enableDragging(containerDiv,config.dragAxis||"both")}}function enableDragging(element,axis){let startX,startY,startClientX,startClientY;element.addEventListener("mousedown",startDragging);element.addEventListener("touchstart",startDragging);function startDragging(e){isDragging=false;if(e.type==="touchstart"){startX=e.touches[0].clientX-element.offsetLeft;startY=e.touches[0].clientY-element.offsetTop;startClientX=e.touches[0].clientX;startClientY=e.touches[0].clientY}else{startX=e.clientX-element.offsetLeft;startY=e.clientY-element.offsetTop;startClientX=e.clientX;startClientY=e.clientY}document.addEventListener("mousemove",drag);document.addEventListener("touchmove",drag,{passive:false});document.addEventListener("mouseup",stopDragging);document.addEventListener("touchend",stopDragging);e.preventDefault()}function drag(e){const touch=e.type==="touchmove"?e.touches[0]:e;const deltaX=touch.clientX-startClientX;const deltaY=touch.clientY-startClientY;if(Math.abs(deltaX)>8||Math.abs(deltaY)>8){isDragging=true}if(!isDragging)return;element.style.transition="none";element.style.cursor="grabbing";const targetIframe=document.getElementById(iframeId);if(targetIframe){targetIframe.style.display="none";setSvgIcon("open")}let newLeft,newBottom;if(e.type==="touchmove"){newLeft=e.touches[0].clientX-startX;newBottom=window.innerHeight-e.touches[0].clientY-startY}else{newLeft=e.clientX-startX;newBottom=window.innerHeight-e.clientY-startY}const elementRect=element.getBoundingClientRect();const maxX=window.innerWidth-elementRect.width;const maxY=window.innerHeight-elementRect.height;if(axis==="x"||axis==="both"){element.style.setProperty(`--${buttonId}-left`,`${Math.max(0,Math.min(newLeft,maxX))}px`)}if(axis==="y"||axis==="both"){element.style.setProperty(`--${buttonId}-bottom`,`${Math.max(0,Math.min(newBottom,maxY))}px`)}}function stopDragging(){setTimeout(()=>{isDragging=false},0);element.style.transition="";element.style.cursor="pointer";document.removeEventListener("mousemove",drag);document.removeEventListener("touchmove",drag);document.removeEventListener("mouseup",stopDragging);document.removeEventListener("touchend",stopDragging)}}if(!document.getElementById(buttonId)){createButton()}}function setSvgIcon(type="open"){if(type==="open"){document.getElementById("openIcon").style.display="block";document.getElementById("closeIcon").style.display="none"}else{document.getElementById("openIcon").style.display="none";document.getElementById("closeIcon").style.display="block"}}function handleEscKey(event){if(event.key==="Escape"){const targetIframe=document.getElementById(iframeId);if(targetIframe&&targetIframe.style.display!=="none"){targetIframe.style.display="none";setSvgIcon("open")}}}document.addEventListener("keydown",handleEscKey);if(config?.dynamicScript){embedChatbot()}else{document.body.onload=embedChatbot}})();
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user