refactor(api): switch to dify_config in controllers/console (#6485)

This commit is contained in:
Shoya SHIRAKI
2024-07-21 02:11:40 +09:00
committed by GitHub
parent f73a3a58ae
commit c57b3931d5
10 changed files with 38 additions and 30 deletions

View File

@@ -3,9 +3,10 @@ import json
import logging
import requests
from flask import current_app
from flask_restful import Resource, reqparse
from configs import dify_config
from . import api
@@ -15,16 +16,16 @@ class VersionApi(Resource):
parser = reqparse.RequestParser()
parser.add_argument('current_version', type=str, required=True, location='args')
args = parser.parse_args()
check_update_url = current_app.config['CHECK_UPDATE_URL']
check_update_url = dify_config.CHECK_UPDATE_URL
result = {
'version': current_app.config['CURRENT_VERSION'],
'version': dify_config.CURRENT_VERSION,
'release_date': '',
'release_notes': '',
'can_auto_update': False,
'features': {
'can_replace_logo': current_app.config['CAN_REPLACE_LOGO'],
'model_load_balancing_enabled': current_app.config['MODEL_LB_ENABLED']
'can_replace_logo': dify_config.CAN_REPLACE_LOGO,
'model_load_balancing_enabled': dify_config.MODEL_LB_ENABLED
}
}