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
4097a8a3
authored
Aug 20, 2014
by
Bach Dániel
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'issue-vm-list' into 'master'
Issue Vm List
parents
c1f12679
4d522c12
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
9 deletions
+9
-9
circle/dashboard/forms.py
+4
-4
circle/dashboard/static/dashboard/dashboard.js
+1
-1
circle/dashboard/views.py
+4
-4
No files found.
circle/dashboard/forms.py
View file @
4097a8a3
...
@@ -1161,9 +1161,9 @@ class VmResourcesForm(forms.ModelForm):
...
@@ -1161,9 +1161,9 @@ class VmResourcesForm(forms.ModelForm):
vm_search_choices
=
(
vm_search_choices
=
(
(
0
,
_
(
"owned"
)),
(
"owned"
,
_
(
"owned"
)),
(
1
,
_
(
"shared"
)),
(
"shared"
,
_
(
"shared"
)),
(
2
,
_
(
"all"
)),
(
"all"
,
_
(
"all"
)),
)
)
...
@@ -1182,5 +1182,5 @@ class VmListSearchForm(forms.Form):
...
@@ -1182,5 +1182,5 @@ class VmListSearchForm(forms.Form):
# set initial value, otherwise it would be overwritten by request.GET
# set initial value, otherwise it would be overwritten by request.GET
if
not
self
.
data
.
get
(
"stype"
):
if
not
self
.
data
.
get
(
"stype"
):
data
=
self
.
data
.
copy
()
data
=
self
.
data
.
copy
()
data
[
'stype'
]
=
2
data
[
'stype'
]
=
"all"
self
.
data
=
data
self
.
data
=
data
circle/dashboard/static/dashboard/dashboard.js
View file @
4097a8a3
...
@@ -262,7 +262,7 @@ $(function () {
...
@@ -262,7 +262,7 @@ $(function () {
$
(
"#dashboard-vm-search-form"
).
submit
(
function
()
{
$
(
"#dashboard-vm-search-form"
).
submit
(
function
()
{
var
vm_list_items
=
$
(
"#dashboard-vm-list .list-group-item"
);
var
vm_list_items
=
$
(
"#dashboard-vm-list .list-group-item"
);
if
(
vm_list_items
.
length
==
1
)
{
if
(
vm_list_items
.
length
==
1
&&
vm_list_items
.
first
().
prop
(
"href"
)
)
{
window
.
location
.
href
=
vm_list_items
.
first
().
prop
(
"href"
);
window
.
location
.
href
=
vm_list_items
.
first
().
prop
(
"href"
);
return
false
;
return
false
;
}
}
...
...
circle/dashboard/views.py
View file @
4097a8a3
...
@@ -1628,10 +1628,10 @@ class VmList(LoginRequiredMixin, FilterMixin, ListView):
...
@@ -1628,10 +1628,10 @@ class VmList(LoginRequiredMixin, FilterMixin, ListView):
def
create_default_queryset
(
self
):
def
create_default_queryset
(
self
):
cleaned_data
=
self
.
search_form
.
cleaned_data
cleaned_data
=
self
.
search_form
.
cleaned_data
stype
=
cleaned_data
.
get
(
'stype'
,
2
)
stype
=
cleaned_data
.
get
(
'stype'
,
"all"
)
superuser
=
stype
==
2
superuser
=
stype
==
"all"
shared
=
stype
==
1
shared
=
stype
==
"shared"
level
=
"owner"
if
stype
==
0
else
"user"
level
=
"owner"
if
stype
==
"owned"
else
"user"
queryset
=
Instance
.
get_objects_with_level
(
queryset
=
Instance
.
get_objects_with_level
(
level
,
self
.
request
.
user
,
level
,
self
.
request
.
user
,
group_also
=
shared
,
disregard_superuser
=
not
superuser
,
group_also
=
shared
,
disregard_superuser
=
not
superuser
,
...
...
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