chg: [server UI v0.2] add name type, fix #3

pull/8/head
Terrtia 2019-02-12 10:19:18 +01:00
parent e9ca36f525
commit 938183056f
No known key found for this signature in database
GPG Key ID: 1E1B1F50D84613D0
1 changed files with 6 additions and 1 deletions

View File

@ -126,10 +126,15 @@ def _json_daily_uuid_stats():
def _json_daily_type_stats():
date = datetime.datetime.now().strftime("%Y%m%d")
daily_uuid = redis_server_metadata.zrange('daily_type:{}'.format(date), 0, -1, withscores=True)
json_type_description = get_json_type_description()
data_daily_uuid = []
for result in daily_uuid:
data_daily_uuid.append({"key": result[0], "value": int(result[1])})
try:
type_description = json_type_description[int(result[0])]['description']
except:
type_description = 'Please update your web server'
data_daily_uuid.append({"key": '{}: {}'.format(result[0], type_description), "value": int(result[1])})
return jsonify(data_daily_uuid)