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
c58f5c34
authored
Dec 11, 2017
by
Fukász Rómeó Ervin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard, storage: fix WorkerNotFound on StorageList when DataStore is offline
parent
64bafc82
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
3 deletions
+12
-3
circle/dashboard/templates/dashboard/storage-list/column-storage-used_percent.html
+9
-2
circle/storage/models.py
+3
-1
No files found.
circle/dashboard/templates/dashboard/storage-list/column-storage-used_percent.html
View file @
c58f5c34
{% load i18n %}
{% with record.used_percent as used_percent %}
{% if used_percent
<
0
%}
<
div
>
{% trans 'The DataStore is offline.' %}
</div>
{% else %}
<div
class=
"progress"
>
{% with record.used_percent as used_percent %}
<div
class=
"progress-bar progress-bar-stripped
{% if used_percent < 80 %}progress-bar-success
{% elif used_percent < 90 %}progress-bar-warning
...
...
@@ -7,5 +13,6 @@
role=
"progressbar"
style=
"min-width: 30px; width: {{ used_percent }}%"
>
{{ used_percent }}%
</div>
{% endwith %}
</div>
{% endif %}
{% endwith %}
circle/storage/models.py
View file @
c58f5c34
...
...
@@ -119,9 +119,11 @@ class DataStore(Model):
@property
def
used_percent
(
self
):
try
:
stats
=
self
.
get_statistics
()
except
WorkerNotFound
:
return
-
1
# invalid value for unreachable
free_percent
=
float
(
stats
[
'free_percent'
])
return
int
(
100
-
free_percent
)
@property
...
...
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