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
bde85e58
authored
Feb 27, 2014
by
Őry Máté
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard, vm: move is_console_available logic to model
parent
2fc3ff12
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
2 deletions
+5
-2
circle/dashboard/templates/dashboard/vm-detail.html
+2
-2
circle/vm/models/instance.py
+3
-0
No files found.
circle/dashboard/templates/dashboard/vm-detail.html
View file @
bde85e58
...
...
@@ -113,8 +113,8 @@
<i
class=
"icon-tasks icon-2x"
></i><br>
{% trans "Resources" %}
</a>
</li>
<li
{%
if
instance
.
state
!=
"
RUNNING
"
%}
class=
"disabled"
{%
endif
%}
>
<a
href=
"#
{% if instance.state == "
RUNNING
"
%}
console
"
data-toggle=
"pill{% endif %}
"
data-target=
"#_console"
class=
"text-center"
>
<li
{%
if
not
instance
.
is_console_available
%}
class=
"disabled"
{%
endif
%}
>
<a
href=
"#
console"
data-toggle=
"pill
"
data-target=
"#_console"
class=
"text-center"
>
<i
class=
"icon-desktop icon-2x"
></i><br>
{% trans "Console" %}
</a></li>
<li>
...
...
circle/vm/models/instance.py
View file @
bde85e58
...
...
@@ -270,6 +270,9 @@ class Instance(AclBase, VirtualMachineDescModel, TimeStampedModel):
act
=
None
return
'NOSTATE'
if
act
is
None
else
act
.
resultant_state
def
is_console_available
(
self
):
return
self
.
state
in
(
'RUNNING'
,
)
def
manual_state_change
(
self
,
new_state
,
reason
=
None
,
user
=
None
):
# TODO cancel concurrent activity (if exists)
act
=
InstanceActivity
.
create
(
code_suffix
=
'manual_state_change'
,
...
...
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