change the deployment misc tab to information

This commit is contained in:
deflax 2018-03-02 02:48:16 +02:00
parent 2c5d46d4b3
commit 12110949b3
3 changed files with 12 additions and 5 deletions

View file

@ -38,7 +38,7 @@ def index():
@fresh_login_required @fresh_login_required
@admin_required @admin_required
def list_orders(): def list_orders():
AllOrders = Order.query.all() AllOrders = Order.query.filter_by(status='new').all()
return render_template('admin/list_orders.html', orders=AllOrders) return render_template('admin/list_orders.html', orders=AllOrders)
@admin.route("/listdeployments", methods=['GET']) @admin.route("/listdeployments", methods=['GET'])

View file

@ -26,7 +26,7 @@ def deploy():
form = OrderForm() form = OrderForm()
if form.validate_on_submit(): if form.validate_on_submit():
recipe = Recipe.query.filter_by(category='deploy').first() recipe = Recipe.query.filter_by(category='deploy').first()
new_order = Order(user_id=int(current_user.pid), recipe_id=int(recipe.pid), parameter1=str(form.alias.data), parameter2=str(form.cpu.data), parameter3=str(form.memory.data), parameter4=str(form.storage.data)) new_order = Order(user_id=int(current_user.pid), recipe_id=int(recipe.pid), parameter1=str(form.alias.data), parameter2=str(form.cpu.data), parameter3=str(form.memory.data), parameter4=str(form.storage.data), status='new')
db.session.add(new_order) db.session.add(new_order)
db.session.commit() db.session.commit()
send_email(current_app.config['MAIL_USERNAME'], 'New order from {}'.format(current_user.email), send_email(current_app.config['MAIL_USERNAME'], 'New order from {}'.format(current_user.email),

View file

@ -23,7 +23,7 @@
<ul class="nav nav-tabs"> <ul class="nav nav-tabs">
<li class="active"><a data-toggle="tab" href="#controls{{ deploy.machine_id }}">Control</a></li> <li class="active"><a data-toggle="tab" href="#controls{{ deploy.machine_id }}">Control</a></li>
<li><a data-toggle="tab" href="#graphs{{ deploy.machine_id }}">Monitoring</a></li> <li><a data-toggle="tab" href="#graphs{{ deploy.machine_id }}">Monitoring</a></li>
<li><a data-toggle="tab" href="#misc{{ deploy.machine_id }}">Misc.</a></li> <li><a data-toggle="tab" href="#nfo{{ deploy.machine_id }}">Information</a></li>
</ul> </ul>
<div class="tab-content"> <div class="tab-content">
@ -82,11 +82,18 @@
</p> </p>
</div> </div>
<div id="misc{{ deploy.machine_id }}" class="tab-pane fade"> <div id="nfo{{ deploy.machine_id }}" class="tab-pane fade">
<p> <p>
Unit: {{ deploy.machine_id }}<br /> <br />
Date Created: {{ moment(deploy.date_created).format('lll') }}<br />
{% if deploy.period == 1 %}
{{ deploy.period }} month payment cycle<br />
{% else %}
{{ deploy.period }} months payment cycle<br />
{% endif %}
State: {{ status[deploy.machine_id] }}<br /> State: {{ status[deploy.machine_id] }}<br />
Protected: {{ deploy.protected }}<br /> Protected: {{ deploy.protected }}<br />
</p> </p>
</div> </div>