Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE3
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
5
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
A prog2-höz tartozó friss repo anyagok itt elérhetőek:
https://git.iit.bme.hu/
Commit
d5d3e15b
authored
Dec 31, 2022
by
Karsa Zoltán István
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
style datastore page
parent
53fd6dee
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
4 deletions
+27
-4
circle/dashboard/templates/dashboard/storage/detail.html
+23
-1
circle/dashboard/views/storage.py
+3
-2
circle/storage/models.py
+1
-1
No files found.
circle/dashboard/templates/dashboard/storage/detail.html
View file @
d5d3e15b
...
...
@@ -9,11 +9,33 @@
{% block content %}
<div
class=
"row"
>
<div
class=
"col-md-12"
>
<div
class=
"panel panel-default"
>
<div
class=
"panel-body"
>
{% for ds in stores %}
{% if ds.name == name %}
<a
href=
"#"
class=
"badge badge-success"
>
<i
class=
"fa fa-database"
></i>
{{ ds.hostname }}/{{ ds.name }}
</a>
{% else %}
<a
href=
"#"
class=
"badge badge-primary"
>
{{ ds.hostname }}/{{ ds.name }}
</a>
{% endif %}
{% empty %}
{% trans "None" %}
{% endfor %}
</div>
</div>
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-md-5"
>
<div
class=
"panel panel-default"
>
<div
class=
"panel-heading"
>
<h3
class=
"no-margin"
><i
class=
"fa fa-database"
></i>
{% trans "Datastore" %}
</h3>
<h3
class=
"no-margin"
><i
class=
"fa fa-database"
></i>
{
{ name }} {
% trans "Datastore" %}
</h3>
</div>
<div
class=
"panel-body"
>
{% crispy form %}
...
...
circle/dashboard/views/storage.py
View file @
d5d3e15b
...
...
@@ -50,11 +50,12 @@ class StorageDetail(SuperuserRequiredMixin, UpdateView):
def
get_context_data
(
self
,
**
kwargs
):
context
=
super
(
StorageDetail
,
self
)
.
get_context_data
(
**
kwargs
)
context
[
"stores"
]
=
DataStore
.
objects
.
all
()
ds
=
self
.
get_object
()
try
:
context
[
'name'
]
=
ds
.
name
context
[
'stats'
]
=
self
.
_get_stats
()
context
[
'
missing_disks
'
]
=
ds
.
get_missing_disks
()
context
[
'
g
'
]
=
ds
.
get_missing_disks
()
context
[
'orphan_disks'
]
=
ds
.
get_orphan_disks
()
except
WorkerNotFound
:
messages
.
error
(
self
.
request
,
_
(
"The DataStore is offline."
))
...
...
circle/storage/models.py
View file @
d5d3e15b
...
...
@@ -110,7 +110,7 @@ class DataStore(Model):
queue_name
=
self
.
get_remote_queue_name
(
'storage'
,
"slow"
)
files
=
set
(
storage_tasks
.
list_files
.
apply_async
(
args
=
[
self
.
path
],
queue
=
queue_name
)
.
get
(
timeout
=
timeout
))
disks
=
Disk
.
objects
.
filter
(
destroyed__isnull
=
True
,
is_ready
=
True
)
disks
=
Disk
.
objects
.
filter
(
destroyed__isnull
=
True
,
is_ready
=
True
,
datastore
=
self
)
return
disks
.
exclude
(
filename__in
=
files
)
@method_cache
(
120
)
...
...
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