添加选择baseline参数
This commit is contained in:
parent
934a186987
commit
2898568579
|
@ -62,7 +62,11 @@ def charts():
|
||||||
@app.route('/metrics', methods=['GET'])
|
@app.route('/metrics', methods=['GET'])
|
||||||
def metrics():
|
def metrics():
|
||||||
type = request.args.get('type')
|
type = request.args.get('type')
|
||||||
baselines = Baseline.select().order_by(Baseline.rank.desc()).limit(3)
|
baseline = request.args.get('baseline')
|
||||||
|
if baseline is None:
|
||||||
|
baselines = Baseline.select().order_by(Baseline.rank.desc()).limit(3)
|
||||||
|
else:
|
||||||
|
baselines = Baseline.select().where(Baseline.rank <= baseline).order_by(Baseline.rank.desc()).limit(3)
|
||||||
metrics = {}
|
metrics = {}
|
||||||
for i in range(len(baselines)):
|
for i in range(len(baselines)):
|
||||||
baseline = baselines[i]
|
baseline = baselines[i]
|
||||||
|
|
Loading…
Reference in New Issue