Skip to content

Commit

Permalink
Fix system status display
Browse files Browse the repository at this point in the history
  • Loading branch information
yuzhichang committed Nov 25, 2024
1 parent 1466456 commit 94a1879
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
6 changes: 3 additions & 3 deletions api/apps/system_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,10 @@ def status():
res = {}
st = timer()
try:
res["doc_store"] = settings.docStoreConn.health()
res["doc_store"]["elapsed"] = "{:.1f}".format((timer() - st) * 1000.0)
res["doc_engine"] = settings.docStoreConn.health()
res["doc_engine"]["elapsed"] = "{:.1f}".format((timer() - st) * 1000.0)
except Exception as e:
res["doc_store"] = {
res["doc_engine"] = {
"type": "unknown",
"status": "red",
"elapsed": "{:.1f}".format((timer() - st) * 1000.0),
Expand Down
3 changes: 1 addition & 2 deletions rag/utils/infinity_conn.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,9 @@ def health(self) -> dict:
inf_conn = self.connPool.get_conn()
res = inf_conn.show_current_node()
self.connPool.release_conn(inf_conn)
color = "green" if res.error_code == 0 else "red"
res2 = {
"type": "infinity",
"status": f"{res.role} {color}",
"status": "green" if res.error_code == 0 and res.server_status == "started" else "red",
"error": res.error_msg,
}
return res2
Expand Down
4 changes: 2 additions & 2 deletions web/src/pages/user-setting/setting-system/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ enum Status {
}

const TitleMap = {
doc_store: 'Elasticsearch',
doc_engine: 'Doc Engine',
storage: 'Object Storage',
redis: 'Redis',
database: 'Database',
Expand All @@ -33,7 +33,7 @@ const TitleMap = {

const IconMap = {
es: 'es',
doc_store: 'storage',
doc_engine: 'storage',
redis: 'redis',
storage: 'minio',
database: 'database',
Expand Down

0 comments on commit 94a1879

Please sign in to comment.