Commit 99b581c6 by tarokkk

webui: Added suspend and delete time

parent 8653eae5
...@@ -50,6 +50,8 @@ ...@@ -50,6 +50,8 @@
<ul> <ul>
<li class="name">{% trans "Hostname" %}: <span class="value">{{i.name}}</span><div class="clear"></div></li> <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="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="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}}: <li class="type">{% trans "Size" %}: <span class="value">{{i.template.instance_type.name}}:
<span class="cpu">{{i.template.instance_type.CPU}}</span> <span class="cpu">{{i.template.instance_type.CPU}}</span>
......
...@@ -226,7 +226,16 @@ def vm_new(request, template=None, share=None, redir=True): ...@@ -226,7 +226,16 @@ def vm_new(request, template=None, share=None, redir=True):
try: try:
#Gány quota #Gány quota
if share == None or (share != None and share.get_running() < share.instance_limit) or extra: 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 = 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: if redir:
return redirect(i) return redirect(i)
else: 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