diff --git a/app/auth/routes.py b/app/auth/routes.py index e0c1858..647916b 100644 --- a/app/auth/routes.py +++ b/app/auth/routes.py @@ -210,8 +210,7 @@ def password_reset_request(): 'auth/email/reset_password', user=user, token=token, next=request.args.get('next')) - flash('An email with instructions to reset your password has been ' - 'sent to you.') + flash('An email with instructions to reset your password has been sent to you.') return redirect(url_for('auth.login')) return render_template('auth/reset_password.html', form=form) diff --git a/app/main/routes.py b/app/main/routes.py index d2ef055..4478cc1 100644 --- a/app/main/routes.py +++ b/app/main/routes.py @@ -96,6 +96,6 @@ def dashboard(): send_email(current_app.config['MAIL_USERNAME'], 'Cube {} is unreachable'.format(cubeid), 'vmanager/email/adm_unreachable', user=current_user, cubeid=cubeid ) - current_app.logger.info('[{}] Enabled deployments: {}, services: {}, domains: {}, addresses: {}'.format(current_user.email, inv_deployments_list, inv_services_list, inv_domains_list, inv_addresses_list )) + #current_app.logger.info('[{}] Enabled deployments: {}, services: {}, domains: {}, addresses: {}'.format(current_user.email, inv_deployments_list, inv_services_list, inv_domains_list, inv_addresses_list )) return render_template('main/dashboard.html', rrd=rrd, status=statuses, inv_deployments=inv_deployments, inv_services=inv_services, inv_domains=inv_domains, inv_addresses=inv_addresses, region=regions) diff --git a/app/models.py b/app/models.py index 4106eb2..57c9047 100644 --- a/app/models.py +++ b/app/models.py @@ -230,15 +230,15 @@ class Deployment(db.Model): warning = db.Column(db.Boolean, default=False) enabled = db.Column(db.Boolean, default=True) cancelled = db.Column(db.Boolean, default=False) - protected = db.Column(db.Boolean, default=False) #machines with this False will be autodeleted after the warning period is over. - connected = db.Column(db.Boolean, default=False) #requires: protected=True, indicate that a connection is enabled + machine_id = db.Column(db.BigInteger) #cubeid machine_alias = db.Column(db.String) #dns name machine_cpu = db.Column(db.Integer) machine_mem = db.Column(db.Integer) machine_hdd = db.Column(db.Integer) machine_addresses = db.relationship('Address', backref='deployments', lazy='dynamic') + discount = db.Column(db.Integer) class Service(db.Model): __tablename__ = 'services' diff --git a/app/smanager/routes.py b/app/smanager/routes.py index 27d1741..fc27056 100644 --- a/app/smanager/routes.py +++ b/app/smanager/routes.py @@ -65,7 +65,7 @@ def activate(itemid=0): db.session.add(transaction) db.session.commit() - owner.wallet = owner.wallet - price + owner.wallet = owner.wallet - total db.session.commit() if owner.is_administrator: diff --git a/app/static/images/serverroom.jpg b/app/static/images/serverroom.jpg new file mode 100644 index 0000000..282e979 Binary files /dev/null and b/app/static/images/serverroom.jpg differ diff --git a/app/templates/admin/list_deployments.html b/app/templates/admin/list_deployments.html index e76db00..8e04410 100644 --- a/app/templates/admin/list_deployments.html +++ b/app/templates/admin/list_deployments.html @@ -43,7 +43,11 @@
- -
- | -- | -- | -- - | -- - | -- | -- | -|||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
{% if deploy.enabled == True %}{% else %}{% endif %} {{ deploy.machine_alias }} | -{{ deploy.machine_cpu }} {% if deploy.machine_cpu > 1 %}cores{% else %}core{% endif %} | -{{ deploy.machine_mem }} MB | -{{ deploy.machine_hdd }} GB | -- | + + | ||||||||
{% if deploy.protected == True %}{% else %}{% endif %}{{ deploy.machine_alias }} | -{% for addr in deploy.machine_addresses %} {% endfor %} | -{{ deploy.machine_cpu }} {% if deploy.machine_cpu > 1 %}cores{% else %}core{% endif %} | -{{ deploy.machine_mem }} MB | -{{ deploy.machine_hdd }} GB | -{% if status[deploy.machine_id] == 'running' %}
+ ok
+ {% endif %}
+ {% if deploy.protected == True %}{% endif %} {% if status[deploy.machine_id] == 'running' %}{% else %}{% endif %}{{ deploy.machine_alias }}
+
+
+
+
+
+
+
+
+ + {% if status[deploy.machine_id] == 'running' %} {% else %} {% endif %} - {% if status[deploy.machine_id] == 'running' %}{% endif %} |
- {% if deploy.warning == True %}
- - {% else %} - | {{ deploy.daysleft }} day(s) | - {% endif %} -
+ CPU {{ deploy.machine_cpu }} {% if deploy.machine_cpu > 1 %}cores{% else %}core{% endif %}
+
+ Memory {{ deploy.machine_mem }} MB:
+
+ {% for addr in deploy.machine_addresses %}
+ Network {{ addr.ip }}:
+
+ {% endfor %}
+ Hard Disk IOPS: {{ deploy.machine_hdd }} GB
+
+
+ {% if deploy.enabled == False %} + + {% endif %} + {% if deploy.warning == True %} + + {% else %} + Time Left: {{ deploy.daysleft }} day(s) + {% endif %} +
+