Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
94
Merge Requests
10
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
A prog2-höz tartozó friss repo anyagok itt elérhetőek:
https://git.iit.bme.hu/
Commit
33c6219a
authored
Feb 12, 2013
by
Őry Máté
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
webui: add details to new-vm dialog
parent
d9e3534b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
11 deletions
+20
-11
one/models.py
+6
-1
one/templates/home.html
+14
-10
No files found.
one/models.py
View file @
33c6219a
...
...
@@ -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
:
...
...
one/templates/home.html
View file @
33c6219a
...
...
@@ -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" %}:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment