feat: Add MinIO and graph database status handling with localization updates
- Introduced a new boolean field for MinIO status in the system info API response. - Updated localization files in English, Russian, and Chinese to include warnings and instructions related to MinIO and graph database configurations. - Enhanced the KBAdvancedSettings component to display alerts and disable options based on the status of MinIO and graph database. - Implemented logic to check system status on component mount and adjust settings accordingly.
This commit is contained in:
@@ -30,6 +30,7 @@ type GetSystemInfoResponse struct {
|
||||
KeywordIndexEngine string `json:"keyword_index_engine,omitempty"`
|
||||
VectorStoreEngine string `json:"vector_store_engine,omitempty"`
|
||||
GraphDatabaseEngine string `json:"graph_database_engine,omitempty"`
|
||||
MinioEnabled bool `json:"minio_enabled,omitempty"`
|
||||
}
|
||||
|
||||
// 编译时注入的版本信息
|
||||
@@ -53,6 +54,9 @@ func (h *SystemHandler) GetSystemInfo(c *gin.Context) {
|
||||
// Get graph database engine from NEO4J_ENABLE
|
||||
graphDatabaseEngine := h.getGraphDatabaseEngine()
|
||||
|
||||
// Get MinIO enabled status
|
||||
minioEnabled := h.isMinioEnabled()
|
||||
|
||||
response := GetSystemInfoResponse{
|
||||
Version: Version,
|
||||
CommitID: CommitID,
|
||||
@@ -61,6 +65,7 @@ func (h *SystemHandler) GetSystemInfo(c *gin.Context) {
|
||||
KeywordIndexEngine: keywordIndexEngine,
|
||||
VectorStoreEngine: vectorStoreEngine,
|
||||
GraphDatabaseEngine: graphDatabaseEngine,
|
||||
MinioEnabled: minioEnabled,
|
||||
}
|
||||
|
||||
logger.Info(ctx, "System info retrieved successfully")
|
||||
@@ -131,3 +136,13 @@ func (h *SystemHandler) getGraphDatabaseEngine() string {
|
||||
}
|
||||
return "未启用"
|
||||
}
|
||||
|
||||
// isMinioEnabled checks if MinIO is enabled
|
||||
func (h *SystemHandler) isMinioEnabled() bool {
|
||||
// Check if all required MinIO environment variables are set
|
||||
endpoint := os.Getenv("MINIO_ENDPOINT")
|
||||
accessKeyID := os.Getenv("MINIO_ACCESS_KEY_ID")
|
||||
secretAccessKey := os.Getenv("MINIO_SECRET_ACCESS_KEY")
|
||||
|
||||
return endpoint != "" && accessKeyID != "" && secretAccessKey != ""
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user