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
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
...
@@ -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
:
...
...
one/templates/home.html
View file @
33c6219a
...
@@ -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" %}:
...
...
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