feat(datasource): implement data source management functionality

- Added a new API for managing data sources, including CRUD operations and connection validation.
- Introduced UI components for data source settings, sync logs, and editor dialog, enhancing user experience in managing external data sources.
- Updated localization files to support new data source features in multiple languages.
- Implemented cron expression humanization for better scheduling visibility.
- Enhanced knowledge base editor to include data source management options.
This commit is contained in:
wizardchen
2026-03-27 15:02:40 +08:00
committed by lyingbug
parent ed393c4683
commit adabf8e089
44 changed files with 8159 additions and 42 deletions
+4 -5
View File
@@ -63,14 +63,13 @@ func (r *tenantRepository) SearchTenants(ctx context.Context, keyword string, te
// Build search conditions
if tenantID > 0 && keyword != "" {
// When both tenantID and keyword are provided, use OR to match either
query = query.Where("id = ? OR name LIKE ? OR description LIKE ?", tenantID, "%"+keyword+"%", "%"+keyword+"%")
escaped := escapeLikeKeyword(keyword)
query = query.Where("id = ? OR name LIKE ? OR description LIKE ?", tenantID, "%"+escaped+"%", "%"+escaped+"%")
} else if tenantID > 0 {
// Filter by tenant ID only
query = query.Where("id = ?", tenantID)
} else if keyword != "" {
// Filter by keyword only (search in name and description)
query = query.Where("name LIKE ? OR description LIKE ?", "%"+keyword+"%", "%"+keyword+"%")
escaped := escapeLikeKeyword(keyword)
query = query.Where("name LIKE ? OR description LIKE ?", "%"+escaped+"%", "%"+escaped+"%")
}
// Count total