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
b640ae3d
authored
Sep 16, 2014
by
Őry Máté
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard: show owner in place of hostname if it's not me
closes #268
parent
a4a15f95
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
2 deletions
+8
-2
circle/dashboard/static/dashboard/dashboard.js
+2
-1
circle/dashboard/templates/dashboard/index-vm.html
+4
-1
circle/dashboard/views.py
+2
-0
No files found.
circle/dashboard/static/dashboard/dashboard.js
View file @
b640ae3d
...
...
@@ -234,6 +234,7 @@ $(function () {
'host'
:
result
[
i
].
host
,
'icon'
:
result
[
i
].
icon
,
'status'
:
result
[
i
].
status
,
'owner'
:
result
[
i
].
owner
,
});
}
});
...
...
@@ -251,7 +252,7 @@ $(function () {
search_result
.
sort
(
compareVmByFav
);
for
(
var
i
=
0
;
i
<
5
&&
i
<
search_result
.
length
;
i
++
)
html
+=
generateVmHTML
(
search_result
[
i
].
pk
,
search_result
[
i
].
name
,
search_result
[
i
].
host
,
search_result
[
i
].
icon
,
search_result
[
i
].
owner
?
search_result
[
i
].
owner
:
search_result
[
i
].
host
,
search_result
[
i
].
icon
,
search_result
[
i
].
status
,
search_result
[
i
].
fav
,
(
search_result
.
length
<
5
));
if
(
search_result
.
length
==
0
)
...
...
circle/dashboard/templates/dashboard/index-vm.html
View file @
b640ae3d
...
...
@@ -25,7 +25,10 @@
<i
class=
"fa {{ i.get_status_icon }}"
title=
"{{ i.get_status_display }}"
></i>
{{ i.name }}
</span>
<small
class=
"text-muted"
>
{{ i.short_hostname }}
</small>
<small
class=
"text-muted"
>
{% if i.owner == request.user %}{{ i.short_hostname }}
{% else %}{{i.owner.profile.get_display_name}}{% endif %}
</small>
<div
class=
"pull-right dashboard-vm-favourite"
data-vm=
"{{ i.pk }}"
>
{% if i.fav %}
<i
class=
"fa fa-star text-primary title-favourite"
title=
"{% trans "
Unfavourite
"
%}"
></i>
...
...
circle/dashboard/views.py
View file @
b640ae3d
...
...
@@ -1890,6 +1890,8 @@ class VmList(LoginRequiredMixin, FilterMixin, ListView):
'icon'
:
i
.
get_status_icon
(),
'host'
:
i
.
short_hostname
,
'status'
:
i
.
get_status_display
(),
'owner'
:
(
i
.
owner
.
profile
.
get_display_name
()
if
i
.
owner
!=
self
.
request
.
user
else
None
),
'fav'
:
i
.
pk
in
favs
,
}
for
i
in
instances
]
return
HttpResponse
(
...
...
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