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
from store.api import StoreApi
from django.db import transaction
from datetime import datetime
import logging
import subprocess, tempfile, os, stat, re, base64, struct
......@@ -178,7 +179,11 @@ class Share(models.Model):
help_text=_('Maximal count of instances launchable by a single user.'))
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):
running = Instance.objects.all().exclude(state='DONE').filter(share=self)
if user:
......
......@@ -37,6 +37,7 @@
<div class="details">
<div class="details-container">
<ul>
<<<<<<< Updated upstream
<li class="os-{{s.template.os_type}}">
{% trans "System" %}:
<span class="value">{{s.template.system}}</span>
......@@ -44,21 +45,24 @@
</li>
<li class="type">
{% 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 class="share-type">
{% trans "Type" %}:
<span class="value">{{s.type }}</span>
</li>
<li class="memory">
{% trans "Memory" %}:
<span class="value">
{% blocktrans with m=s.template.instance_type.RAM %}{{m}} MiB{% endblocktrans %}
({% if s.get_type.suspend %}
<span class="suspend"
title="{% blocktrans with time=s.get_type.suspend %}Suspend after {{time}}.{%endblocktrans%}">
{{s.get_type.suspendx|timeuntil}}
</span>
</li>
<li class="cpu">
{% trans "CPU cores" %}:
<span class="value">{{s.template.instance_type.CPU}}</span>
{%endif%}{% if s.get_type.delete %}<span class="delete"
title="{% blocktrans with time=s.get_type.delete %}Delete after {{time}}.{%endblocktrans%}">
{{s.get_type.deletex|timeuntil}}</span>{%endif%})
</li>
<li class="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