Commit 33c6219a by Őry Máté

webui: add details to new-vm dialog

parent d9e3534b
...@@ -16,6 +16,7 @@ from django.db.models.signals import post_delete, pre_delete ...@@ -16,6 +16,7 @@ from django.db.models.signals import post_delete, pre_delete
from store.api import StoreApi from store.api import StoreApi
from django.db import transaction from django.db import transaction
from datetime import datetime
import logging import logging
import subprocess, tempfile, os, stat, re, base64, struct import subprocess, tempfile, os, stat, re, base64, struct
...@@ -178,7 +179,11 @@ class Share(models.Model): ...@@ -178,7 +179,11 @@ class Share(models.Model):
help_text=_('Maximal count of instances launchable by a single user.')) help_text=_('Maximal count of instances launchable by a single user.'))
owner = models.ForeignKey(User, null=True, blank=True) owner = models.ForeignKey(User, null=True, blank=True)
def get_type(self):
t = TYPES[self.type]
t['deletex'] = datetime.now() + td(seconds=1) + t['delete'] if t['delete'] else None
t['suspendx'] = datetime.now() + td(seconds=1) + t['suspend'] if t['suspend'] else None
return t
def get_running_or_stopped(self, user=None): def get_running_or_stopped(self, user=None):
running = Instance.objects.all().exclude(state='DONE').filter(share=self) running = Instance.objects.all().exclude(state='DONE').filter(share=self)
if user: if user:
......
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
<div class="details"> <div class="details">
<div class="details-container"> <div class="details-container">
<ul> <ul>
<<<<<<< Updated upstream
<li class="os-{{s.template.os_type}}"> <li class="os-{{s.template.os_type}}">
{% trans "System" %}: {% trans "System" %}:
<span class="value">{{s.template.system}}</span> <span class="value">{{s.template.system}}</span>
...@@ -44,21 +45,24 @@ ...@@ -44,21 +45,24 @@
</li> </li>
<li class="type"> <li class="type">
{% trans "Size" %}: {% trans "Size" %}:
<span class="value">{{s.template.instance_type.name}}</span> <span class="value">
{{s.template.instance_type.name}}
<span class="cpu">{{s.template.instance_type.CPU}}</span>
<span class="memory">{{s.template.instance_type.RAM}}</span>
<span class="credit">{{s.template.instance_type.credit}}</span>
</span>
</li> </li>
<li class="share-type"> <li class="share-type">
{% trans "Type" %}: {% trans "Type" %}:
<span class="value">{{s.type }}</span> <span class="value">{{s.type }}</span>
</li> ({% if s.get_type.suspend %}
<li class="memory"> <span class="suspend"
{% trans "Memory" %}: title="{% blocktrans with time=s.get_type.suspend %}Suspend after {{time}}.{%endblocktrans%}">
<span class="value"> {{s.get_type.suspendx|timeuntil}}
{% blocktrans with m=s.template.instance_type.RAM %}{{m}} MiB{% endblocktrans %}
</span> </span>
</li> {%endif%}{% if s.get_type.delete %}<span class="delete"
<li class="cpu"> title="{% blocktrans with time=s.get_type.delete %}Delete after {{time}}.{%endblocktrans%}">
{% trans "CPU cores" %}: {{s.get_type.deletex|timeuntil}}</span>{%endif%})
<span class="value">{{s.template.instance_type.CPU}}</span>
</li> </li>
<li class="description"> <li class="description">
{% trans "Description" %}: {% trans "Description" %}:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment