fix the order sort and include the machine seed
This commit is contained in:
parent
9db5a448b0
commit
7fbbe5c6d0
5 changed files with 13 additions and 14 deletions
|
@ -89,7 +89,6 @@ if app.config['DEBUG'] == 1:
|
|||
file_handler.setFormatter(logging.Formatter('%(asctime)s %(levelname)s: %(message)s [in %(pathname)s:%(lineno)d]'))
|
||||
app.logger.addHandler(file_handler)
|
||||
app.logger.setLevel(logging.DEBUG)
|
||||
#app.logger.info('Proxadmin started.')
|
||||
|
||||
@app.errorhandler(403)
|
||||
def forbidden(e):
|
||||
|
|
|
@ -38,8 +38,8 @@ def index():
|
|||
@fresh_login_required
|
||||
@admin_required
|
||||
def list_orders():
|
||||
NewOrders = Order.query.filter_by(status='new').all()
|
||||
AcceptedOrders = Order.query.filter_by(status='accepted').all()
|
||||
NewOrders = Order.query.filter_by(status='new').order_by(Order.date_created.asc()).all()
|
||||
AcceptedOrders = Order.query.filter_by(status='accepted').order_by(Order.date_created.asc()).all()
|
||||
return render_template('admin/list_orders.html', neworders=NewOrders, oldorders=AcceptedOrders)
|
||||
|
||||
@admin.route("/listdeployments", methods=['GET'])
|
||||
|
|
|
@ -232,6 +232,7 @@ class Order(db.Model):
|
|||
__tablename__ = 'orders'
|
||||
pid = db.Column(db.Integer, primary_key=True)
|
||||
user_id = db.Column(db.ForeignKey('users.pid')) #FK
|
||||
date_created = db.Column(db.DateTime, default=datetime.utcnow)
|
||||
status = db.Column(db.String)
|
||||
recipe_id = db.Column(db.ForeignKey('recipes.pid')) #FK
|
||||
region_id = db.Column(db.ForeignKey('regions.pid')) #FK
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
################################################################################
|
||||
|
||||
d-i debian-installer/locale string en_US.UTF-8
|
||||
d-i localechooser/supported-locales multiselect en_US.UTF-8, de_DE.UTF-8
|
||||
d-i localechooser/supported-locales multiselect en_US.UTF-8, bg_BG.UTF-8
|
||||
d-i localechooser/translation/warn-light boolean true
|
||||
d-i localechooser/translation/warn-severe boolean true
|
||||
d-i console-setup/ask_detect boolean false
|
||||
|
@ -104,15 +104,13 @@ d-i apt-setup/security_path string /ubuntu
|
|||
tasksel tasksel/first multiselect server
|
||||
|
||||
# Individual additional packages to install
|
||||
d-i pkgsel/include string \
|
||||
apt-transport-https \
|
||||
curl \
|
||||
openssh-server
|
||||
d-i pkgsel/include string apt-transport-https curl openssh-server python
|
||||
|
||||
# see https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1317602
|
||||
#d-i pkgsel/upgrade select none
|
||||
d-i pgsel/upgrade select full-upgrade
|
||||
|
||||
d-i pkgsel/language-packs multiselect de, en
|
||||
d-i pkgsel/language-packs multiselect en, bg
|
||||
d-i pkgsel/update-policy select unattended-upgrades
|
||||
|
||||
################################################################################
|
||||
|
@ -127,7 +125,7 @@ d-i grub-installer/with_other_os boolean true
|
|||
################################################################################
|
||||
|
||||
d-i finish-install/reboot_in_progress note
|
||||
d-i debian-installer/exit/poweroff boolean true
|
||||
#d-i debian-installer/exit/poweroff boolean true
|
||||
|
||||
################################################################################
|
||||
### X configuration
|
||||
|
@ -145,3 +143,4 @@ xserver-xorg xserver-xorg/config/monitor/mode-list select 1024x768 @ 60 Hz
|
|||
################################################################################
|
||||
|
||||
d-i preseed/late_command string in-target /bin/sh -c 'wget -q -O - https://www.datapoint.bg/static/datapoint.sh | bash'
|
||||
|
||||
|
|
|
@ -79,12 +79,12 @@ def vmcreate(orderid):
|
|||
data = { 'clientid': str(order.user_id),
|
||||
'clientemail': str(order.owner.email),
|
||||
'hostname': 'c' + str(order.user_id) + '-' + str(order.parameter1),
|
||||
'region': str(order.region.name),
|
||||
'slave': str(selectedslave.name),
|
||||
'region': str(order.region.name),
|
||||
'type': 'kvm',
|
||||
'cpu': str(int(order.parameter2)),
|
||||
'mem': str(int(order.parameter3)),
|
||||
'hdd': str(int(order.parameter4)),
|
||||
'cpu': str(int(float(order.parameter2))),
|
||||
'mem': str(int(float(order.parameter3))),
|
||||
'hdd': str(int(float(order.parameter4))),
|
||||
'net0if': 'vmbr7'
|
||||
}
|
||||
try:
|
||||
|
|
Loading…
Reference in a new issue