Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gutyán Gábor
/
circlestack
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
cd68ac0d
authored
Feb 07, 2014
by
Kálmán Viktor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard: os for instances without template
parent
3dfc4f4c
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
1 deletions
+21
-1
circle/dashboard/templates/dashboard/vm-detail/home.html
+1
-1
circle/dashboard/views.py
+2
-0
circle/vm/models/instance.py
+18
-0
No files found.
circle/dashboard/templates/dashboard/vm-detail/home.html
View file @
cd68ac0d
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
<div
class=
"col-md-4"
>
<div
class=
"col-md-4"
>
<dl>
<dl>
<dt>
System:
</dt>
<dt>
System:
</dt>
<dd><i
class=
"icon-{{
instance.template.os_type }}"
></i>
{{ instance.templat
e.system }}
</dd>
<dd><i
class=
"icon-{{
os_type_icon }}"
></i>
{{ instanc
e.system }}
</dd>
<dt
style=
"margin-top: 5px;"
>
Description:
</dt>
<dt
style=
"margin-top: 5px;"
>
Description:
</dt>
<dd><small>
{{ instance.description }}
</small></dd>
<dd><small>
{{ instance.description }}
</small></dd>
</dl>
</dl>
...
...
circle/dashboard/views.py
View file @
cd68ac0d
...
@@ -156,6 +156,8 @@ class VmDetailView(CheckedDetailView):
...
@@ -156,6 +156,8 @@ class VmDetailView(CheckedDetailView):
context
[
'forms'
]
=
{
context
[
'forms'
]
=
{
'disk_add_form'
:
DiskAddForm
(
prefix
=
"disk"
),
'disk_add_form'
:
DiskAddForm
(
prefix
=
"disk"
),
}
}
context
[
'os_type_icon'
]
=
instance
.
os_type
.
replace
(
"unknown"
,
"question"
)
return
context
return
context
def
post
(
self
,
request
,
*
args
,
**
kwargs
):
def
post
(
self
,
request
,
*
args
,
**
kwargs
):
...
...
circle/vm/models/instance.py
View file @
cd68ac0d
...
@@ -380,6 +380,24 @@ class Instance(AclBase, VirtualMachineDescModel, TimeStampedModel):
...
@@ -380,6 +380,24 @@ class Instance(AclBase, VirtualMachineDescModel, TimeStampedModel):
else
:
else
:
return
timedelta
()
# zero
return
timedelta
()
# zero
@property
def
os_type
(
self
):
"""Get the type of the instance's operating system.
"""
if
self
.
template
is
None
:
return
"unknown"
else
:
return
self
.
template
.
os_type
@property
def
system
(
self
):
"""Get the instance's operating system.
"""
if
self
.
template
is
None
:
return
_
(
"Unknown"
)
else
:
return
self
.
template
.
system
def
get_age
(
self
):
def
get_age
(
self
):
"""Deprecated. Use uptime instead.
"""Deprecated. Use uptime instead.
...
...
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