Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gutyán Gábor
/
circlestack
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
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
Commit
05dec61d
authored
Aug 30, 2014
by
Kálmán Viktor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard: search for deleted vms
parent
f8bac858
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
34 additions
and
2 deletions
+34
-2
circle/dashboard/forms.py
+6
-1
circle/dashboard/static/dashboard/dashboard.css
+6
-0
circle/dashboard/static/dashboard/vm-list.js
+9
-0
circle/dashboard/templates/dashboard/vm-list.html
+6
-0
circle/dashboard/views.py
+7
-1
No files found.
circle/dashboard/forms.py
View file @
05dec61d
...
...
@@ -1174,7 +1174,12 @@ class VmListSearchForm(forms.Form):
}))
stype
=
forms
.
ChoiceField
(
vm_search_choices
,
widget
=
forms
.
Select
(
attrs
=
{
'class'
:
"btn btn-default input-tags"
,
'class'
:
"btn btn-default form-control input-tags"
,
'style'
:
"min-width: 80px;"
,
}))
include_deleted
=
forms
.
BooleanField
(
widget
=
forms
.
CheckboxInput
(
attrs
=
{
'id'
:
"vm-list-search-checkbox"
,
}))
def
__init__
(
self
,
*
args
,
**
kwargs
):
...
...
circle/dashboard/static/dashboard/dashboard.css
View file @
05dec61d
...
...
@@ -940,3 +940,9 @@ textarea[name="list-new-namelist"] {
#vm-list-search
,
#vm-mass-ops
{
margin-top
:
8px
;
}
#vm-list-search-checkbox
{
margin-top
:
-1px
;
display
:
inline-block
;
vertical-align
:
middle
;
}
circle/dashboard/static/dashboard/vm-list.js
View file @
05dec61d
...
...
@@ -166,6 +166,15 @@ $(function() {
if
(
checkStatusUpdate
())
{
updateStatuses
(
1
);
}
$
(
"#vm-list-search-checkbox-span"
).
css
(
"cursor"
,
"pointer"
);
$
(
"#vm-list-search-checkbox-span"
).
click
(
function
(
e
)
{
if
(
e
.
target
.
type
===
"checkbox"
)
return
;
var
checkbox
=
$
(
this
).
find
(
"input"
);
checkbox
.
prop
(
"checked"
,
!
checkbox
.
prop
(
"checked"
));
return
false
;
});
});
...
...
circle/dashboard/templates/dashboard/vm-list.html
View file @
05dec61d
...
...
@@ -33,6 +33,12 @@
{{ search_form.s }}
<div
class=
"input-group-btn"
>
{{ search_form.stype }}
</div>
<span
class=
"input-group-addon input-tags"
title=
"{% trans "
Include
deleted
VMs
"
%}"
id=
"vm-list-search-checkbox-span"
data-container=
"body"
>
{{ search_form.include_deleted }}
</span>
<div
class=
"input-group-btn"
>
<button
type=
"submit"
class=
"btn btn-primary input-tags"
>
<i
class=
"fa fa-search"
></i>
</button>
...
...
circle/dashboard/views.py
View file @
05dec61d
...
...
@@ -1835,10 +1835,16 @@ class VmList(LoginRequiredMixin, FilterMixin, ListView):
content_type
=
"application/json"
,
)
def
create_acl_queryset
(
self
,
model
):
queryset
=
super
(
VmList
,
self
)
.
create_acl_queryset
(
model
)
if
not
self
.
search_form
.
cleaned_data
.
get
(
"include_deleted"
):
queryset
=
queryset
.
filter
(
destroyed_at
=
None
)
return
queryset
def
get_queryset
(
self
):
logger
.
debug
(
'VmList.get_queryset() called. User:
%
s'
,
unicode
(
self
.
request
.
user
))
queryset
=
self
.
create_acl_queryset
(
Instance
)
.
filter
(
destroyed_at
=
None
)
queryset
=
self
.
create_acl_queryset
(
Instance
)
self
.
create_fake_get
()
sort
=
self
.
request
.
GET
.
get
(
"sort"
)
...
...
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