feat: Enhance FAQ import functionality and UI improvements

- Added support for tracking the status of FAQ import tasks, including progress indicators for ongoing imports.
- Introduced new localization strings for processing tasks and batch operations in multiple languages.
- Updated the FAQ entry manager to display import progress and improved user feedback during the import process.
- Enhanced the KnowledgeBase component to reflect the processing state of knowledge items, improving user experience during document uploads.
- Implemented batch deletion functionality for chunks, streamlining the management of knowledge base content.
This commit is contained in:
wizardchen
2025-11-23 17:32:50 +08:00
parent e853605cea
commit 057cfd9eb0
46 changed files with 3672 additions and 1400 deletions
-12
View File
@@ -84,8 +84,6 @@ func (h *TenantHandler) CreateTenant(c *gin.Context) {
func (h *TenantHandler) GetTenant(c *gin.Context) {
ctx := c.Request.Context()
logger.Info(ctx, "Start retrieving tenant")
id, err := strconv.ParseUint(c.Param("id"), 10, 64)
if err != nil {
logger.Errorf(ctx, "Invalid tenant ID: %s", c.Param("id"))
@@ -93,8 +91,6 @@ func (h *TenantHandler) GetTenant(c *gin.Context) {
return
}
logger.Infof(ctx, "Retrieving tenant, ID: %d", id)
tenant, err := h.service.GetTenantByID(ctx, uint(id))
if err != nil {
// Check if this is an application-specific error
@@ -108,7 +104,6 @@ func (h *TenantHandler) GetTenant(c *gin.Context) {
return
}
logger.Infof(ctx, "Retrieved tenant successfully, ID: %d, Name: %s", tenant.ID, tenant.Name)
c.JSON(http.StatusOK, gin.H{
"success": true,
"data": tenant,
@@ -207,8 +202,6 @@ func (h *TenantHandler) DeleteTenant(c *gin.Context) {
func (h *TenantHandler) ListTenants(c *gin.Context) {
ctx := c.Request.Context()
logger.Info(ctx, "Start retrieving tenant list")
tenants, err := h.service.ListTenants(ctx)
if err != nil {
// Check if this is an application-specific error
@@ -222,7 +215,6 @@ func (h *TenantHandler) ListTenants(c *gin.Context) {
return
}
logger.Infof(ctx, "Retrieved tenant list successfully, Total: %d tenants", len(tenants))
c.JSON(http.StatusOK, gin.H{
"success": true,
"data": gin.H{
@@ -246,8 +238,6 @@ type AgentConfigRequest struct {
// This is the global agent configuration that applies to all sessions by default
func (h *TenantHandler) GetTenantAgentConfig(c *gin.Context) {
ctx := c.Request.Context()
logger.Info(ctx, "Start retrieving tenant agent config")
tenant := ctx.Value(types.TenantInfoContextKey).(*types.Tenant)
if tenant == nil {
logger.Error(ctx, "Tenant is empty")
@@ -558,8 +548,6 @@ func validateConversationConfig(req *types.ConversationConfig) error {
// This is the global conversation configuration that applies to normal mode sessions by default
func (h *TenantHandler) GetTenantConversationConfig(c *gin.Context) {
ctx := c.Request.Context()
logger.Info(ctx, "Start retrieving tenant conversation config")
tenant := ctx.Value(types.TenantInfoContextKey).(*types.Tenant)
if tenant == nil {
logger.Error(ctx, "Tenant is empty")