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
7 years ago
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
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
4 deletions
+13
-4
circle/dashboard/templates/dashboard/storage-list/column-storage-used_percent.html
+9
-2
circle/storage/models.py
+4
-2
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 %}
This diff is collapsed.
Click to expand it.
circle/storage/models.py
View file @
c58f5c34
...
...
@@ -119,9 +119,11 @@ class DataStore(Model):
@property
def
used_percent
(
self
):
stats
=
self
.
get_statistics
()
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
...
...
This diff is collapsed.
Click to expand it.
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