mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
Admin: add 'show version' (#11079)
### What problem does this PR solve? ``` admin> show version; show_version +-----------------------+ | version | +-----------------------+ | v0.21.0-241-gc6cf58d5 | +-----------------------+ admin> \q Goodbye! ``` ### Type of change - [x] New Feature (non-breaking change which adds functionality) --------- Signed-off-by: Jin Hai <haijin.chn@gmail.com>
This commit is contained in:
@ -24,6 +24,7 @@ from responses import success_response, error_response
|
||||
from services import UserMgr, ServiceMgr, UserServiceMgr
|
||||
from roles import RoleMgr
|
||||
from api.common.exceptions import AdminException
|
||||
from common.versions import get_ragflow_version
|
||||
|
||||
admin_bp = Blueprint('admin', __name__, url_prefix='/api/v1/admin')
|
||||
|
||||
@ -369,3 +370,13 @@ def get_user_permission(user_name: str):
|
||||
return success_response(res)
|
||||
except Exception as e:
|
||||
return error_response(str(e), 500)
|
||||
|
||||
@admin_bp.route('/version', methods=['GET'])
|
||||
@login_required
|
||||
@check_admin_auth
|
||||
def show_version():
|
||||
try:
|
||||
res = {"version": get_ragflow_version()}
|
||||
return success_response(res)
|
||||
except Exception as e:
|
||||
return error_response(str(e), 500)
|
||||
|
||||
Reference in New Issue
Block a user