fix address list

This commit is contained in:
deflax 2018-01-29 18:29:35 +02:00
parent d7246f30ed
commit fabc3c130d
4 changed files with 24 additions and 12 deletions

View file

@ -30,6 +30,10 @@ def chat():
#def about():
# return render_template('main/aboutus.html')
@main.route('/domaincheck', methods=['GET'])
def domaincheck():
return render_template('main/domaincheck.html')
@main.route("/terms", methods=['GET'])
def terms():
return render_template('main/terms.html')

View file

@ -22,6 +22,7 @@
<th>Server</th>
<th>Region</th>
<th>rDNS</th>
<th>Assignee</th>
</tr>
</thead>
<tbody>
@ -44,6 +45,11 @@
{% else %}
<td></td>
{% endif %}
{% if address.user_id != None %}
<td><a href="{{ url_for('admin.dashboard', user_pid=address.user_id) }}">{{ address.owner.email }}</a></td>
{% else %}
<td></td>
{% endif %}
{% endfor %}
</tr>
</tbody>

View file

@ -16,13 +16,13 @@
<table class="table table-hover table-striped table-condensed cf">
<thead>
<tr>
<th>Owner</th>
<th>Alias</th>
<th>CPU</th>
<th>Mem</th>
<th>HDD</th>
<th>Last Charged</th>
<th>Days Left</th>
<th>Owner</th>
</tr>
</thead>
<tbody>
@ -36,7 +36,6 @@
<tr>
{% endif %}
{% endif %}
<td><a href="{{ url_for('admin.dashboard', user_pid=deploy.user_id) }}">{{ deploy.owner.email }}</a></td>
<td><a class="rrd" data-toggle="tooltip" title="Protected: {{ deploy.protected }}<br />Online: {{ deploy.connected }}<br />ID: {{ deploy.machine_id }}"><b>{% if deploy.protected == True %}<font color="green">{% else %}<font color="red">{% endif %}{{ deploy.machine_alias }}</font></b></a></td>
<td>{{ deploy.machine_cpu }}</td>
<td>{{ deploy.machine_mem }} MB</td>
@ -47,6 +46,7 @@
<td>{{ moment(deploy.date_last_charge).format('lll') }} ({{ moment(deploy.date_last_charge).fromNow() }})</td>
{% endif %}
<td>{{ deploy.daysleft }}</td>
<td><a href="{{ url_for('admin.dashboard', user_pid=deploy.user_id) }}">{{ deploy.owner.email }}</a></td>
{% endfor %}
</tbody>
</table>

View file

@ -36,16 +36,18 @@ def slavetables():
selected_slave = Server.query.filter_by(name=str(postdata['slavename'])).first()
if selected_slave == None:
return jsonify({'status': 'slave_not_found'})
addrlist = {}
try:
deploylist = selected_slave.inv_deployments.all()
addresslist = {}
for deploy in deploylist:
addresslist[str(deploy.machine_id)] = {}
addresses = deploy.inv_addresses.first()
deploy_address_list = []
for address in addresses:
deploy_address_list.append(address.ip)
addresslist[deploy.vlan] = deploy_address_list
return jsonify(addresslist)
pubvlanlist = deploy.inv_pubvlans.all()
for pubvlan in pubvlanlist:
if pubvlan.pubaddr != None:
addrlist[str(pubvlan.pubaddr.ip)] = str(pubvlan.vlan_id)
addrlist['status'] = 'ok'
except:
addrlist['status'] = 'tables_gen_error'
return jsonify(addrlist)
@vmanager.route('/createvm', methods=['GET', 'POST'])
@login_required