mirror of
https://github.com/cwinfo/powerdns-admin.git
synced 2024-11-14 01:20:27 +00:00
Fixed all domains being visible to all users on dashboard.
This commit is contained in:
parent
6999b7ed67
commit
31bf6e10ef
@ -31,8 +31,8 @@
|
|||||||
<!-- small box -->
|
<!-- small box -->
|
||||||
<div class="small-box bg-aqua">
|
<div class="small-box bg-aqua">
|
||||||
<div class="inner">
|
<div class="inner">
|
||||||
<h3>{{ domains|length }}</h3>
|
<h3>{{ domain_count }}</h3>
|
||||||
<p>{% if domains|length > 1 %}Domains{% else %}Domain{% endif %}</p>
|
<p>{% if domain_count > 1 %}Domains{% else %}Domain{% endif %}</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="icon">
|
<div class="icon">
|
||||||
<i class="fa fa-book"></i>
|
<i class="fa fa-book"></i>
|
||||||
|
@ -136,7 +136,7 @@ def dashboard():
|
|||||||
domains = User(id=current_user.id).get_domain()
|
domains = User(id=current_user.id).get_domain()
|
||||||
|
|
||||||
# stats for dashboard
|
# stats for dashboard
|
||||||
domains = Domain.query.all()
|
domain_count = Domain.query.count()
|
||||||
users = User.query.all()
|
users = User.query.all()
|
||||||
history_number = History.query.count()
|
history_number = History.query.count()
|
||||||
history = History.query.limit(4)
|
history = History.query.limit(4)
|
||||||
@ -146,7 +146,7 @@ def dashboard():
|
|||||||
uptime = filter(lambda uptime: uptime['name'] == 'uptime', statistics)[0]['value']
|
uptime = filter(lambda uptime: uptime['name'] == 'uptime', statistics)[0]['value']
|
||||||
else:
|
else:
|
||||||
uptime = 0
|
uptime = 0
|
||||||
return render_template('dashboard.html', domains=domains, users=users, history_number=history_number, uptime=uptime, histories=history)
|
return render_template('dashboard.html', domains=domains, domain_count=domain_count, users=users, history_number=history_number, uptime=uptime, histories=history)
|
||||||
|
|
||||||
|
|
||||||
@app.route('/domain/<string:domain_name>', methods=['GET', 'POST'])
|
@app.route('/domain/<string:domain_name>', methods=['GET', 'POST'])
|
||||||
|
Loading…
Reference in New Issue
Block a user