Commit 99b581c6 by tarokkk

webui: Added suspend and delete time

parent 8653eae5
......@@ -50,6 +50,8 @@
<ul>
<li class="name">{% trans "Hostname" %}: <span class="value">{{i.name}}</span><div class="clear"></div></li>
<li class="os-{{i.template.os_type}}">{% trans "System" %}: <span class="value">{{i.template.system}}</span><div class="clear"></div></li>
<li class="template">{% trans "Type" %}: <span class="value">{{i.share.type}}</span><div class="clear"></div></li>
<li class="template">{% trans "Share" %}: <span class="value">{{i.share.name}}</span><div class="clear"></div></li>
<li class="template">{% trans "Template" %}: <span class="value">{{i.template.name}}</span><div class="clear"></div></li>
<li class="type">{% trans "Size" %}: <span class="value">{{i.template.instance_type.name}}:
<span class="cpu">{{i.template.instance_type.CPU}}</span>
......
......@@ -226,7 +226,16 @@ def vm_new(request, template=None, share=None, redir=True):
try:
#Gány quota
if share == None or (share != None and share.get_running() < share.instance_limit) or extra:
time_of_suspend = None
time_of_delete = None
if TYPES[share.type]['suspend']:
time_of_suspend = TYPES[share.type]['suspend']+datetime.now()
if TYPES[share.type]['delete']:
time_of_delete = TYPES[share.type]['delete']+datetime.now()
i = Instance.submit(base, request.user, extra=extra, share=share)
i.time_of_suspend = time_of_suspend
i.time_of_delete = time_of_delete
i.save()
if redir:
return redirect(i)
else:
......
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