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
9f1c4d56
authored
Mar 18, 2014
by
Kálmán Viktor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard: use failed property to detect failed disks
parent
cc8c734f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
4 deletions
+7
-4
circle/dashboard/templates/dashboard/_disk-list-element.html
+4
-4
circle/storage/models.py
+3
-0
No files found.
circle/dashboard/templates/dashboard/_disk-list-element.html
View file @
9f1c4d56
{% load i18n %}
{% load i18n %}
{% load sizefieldtags %}
{% load sizefieldtags %}
<i
class=
"{% if d.is_downloading %}icon-refresh icon-spin{% else %}icon-file{% if
not d.ready
%}"
style=
"color: #d9534f;{% endif %}{% endif %}"
></i>
<i
class=
"{% if d.is_downloading %}icon-refresh icon-spin{% else %}icon-file{% if
d.failed
%}"
style=
"color: #d9534f;{% endif %}{% endif %}"
></i>
{{ d.name }} (#{{ d.id }}) -
{{ d.name }} (#{{ d.id }}) -
{% if not d.is_downloading %}
{% if not d.is_downloading %}
{% if
d.ready
%}
{% if
not d.failed
%}
{
{ d.size|filesize }
}
{
% if d.size %}{{ d.size|filesize }}{% endif %
}
{% else %}
{% else %}
<div
class=
"label label-danger"
>
failed
</div>
<div
class=
"label label-danger"
{%
if
user
.
is_superuser
%}
title=
"{{ d.get_latest_activity_result }}"
{%
endif
%}
>
failed
</div>
{% endif %}
{% endif %}
{% else %}
<span
class=
"disk-list-disk-percentage"
data-disk-pk=
"{{ d.pk }}"
>
{{ d.get_download_percentage }}
</span>
%{% endif %}
{% else %}
<span
class=
"disk-list-disk-percentage"
data-disk-pk=
"{{ d.pk }}"
>
{{ d.get_download_percentage }}
</span>
%{% endif %}
<a
href=
"{% url "
dashboard
.
views
.
disk-remove
"
pk=
d.pk
%}?
next=
{{
request
.
path
}}"
<a
href=
"{% url "
dashboard
.
views
.
disk-remove
"
pk=
d.pk
%}?
next=
{{
request
.
path
}}"
...
...
circle/storage/models.py
View file @
9f1c4d56
...
@@ -193,6 +193,9 @@ class Disk(AclBase, TimeStampedModel):
...
@@ -193,6 +193,9 @@ class Disk(AclBase, TimeStampedModel):
result
=
celery
.
AsyncResult
(
id
=
task
)
result
=
celery
.
AsyncResult
(
id
=
task
)
return
result
.
info
.
get
(
"percent"
)
return
result
.
info
.
get
(
"percent"
)
def
get_latest_activity_result
(
self
):
return
self
.
activity_log
.
latest
(
"pk"
)
.
result
@property
@property
def
is_deletable
(
self
):
def
is_deletable
(
self
):
"""True if the associated file can be deleted.
"""True if the associated file can be deleted.
...
...
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