Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gelencsér Szabolcs
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
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
Show 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 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 }}) -
{% if not d.is_downloading %}
{% if
d.ready
%}
{
{ d.size|filesize }
}
{% if
not d.failed
%}
{
% if d.size %}{{ d.size|filesize }}{% endif %
}
{% 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 %}
{% 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
}}"
...
...
circle/storage/models.py
View file @
9f1c4d56
...
...
@@ -193,6 +193,9 @@ class Disk(AclBase, TimeStampedModel):
result
=
celery
.
AsyncResult
(
id
=
task
)
return
result
.
info
.
get
(
"percent"
)
def
get_latest_activity_result
(
self
):
return
self
.
activity_log
.
latest
(
"pk"
)
.
result
@property
def
is_deletable
(
self
):
"""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