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
fa743214
authored
Oct 21, 2020
by
Szeberényi Imre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding Send alt-ctrl... from console
Adding template_name filer to vm-list
parent
ba6e96a6
Pipeline
#1345
failed with stage
in 0 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
41 additions
and
11 deletions
+41
-11
circle/dashboard/static/dashboard/vm-console.js
+12
-2
circle/dashboard/templates/dashboard/template-edit.html
+1
-1
circle/dashboard/templates/dashboard/vm-detail/console.html
+18
-3
circle/dashboard/views/graph.py
+1
-1
circle/dashboard/views/vm.py
+9
-4
No files found.
circle/dashboard/static/dashboard/vm-console.js
View file @
fa743214
...
...
@@ -22,8 +22,18 @@ $(function() {
$
(
"#vm-info-pane"
).
fadeIn
();
$
(
"#vm-detail-pane"
).
removeClass
(
"col-md-12"
).
addClass
(
"col-md-8"
);
});
$
(
'#sendCtrlAltDelButton'
).
click
(
function
()
{
rfb
.
sendCtrlAltDel
();
return
false
;});
$
(
'#sendCtrlAltButton'
).
click
(
function
()
{
var
fn
=
Number
(
$
(
'#chooseCtrlAlt'
).
val
());
if
(
fn
==
0
)
{
rfb
.
sendCtrlAltDel
();
i
}
else
{
rfb
.
sendCtrlAltCombine
(
fn
-
1
);
}
return
false
;});
// rfb.sendCtrlAltDel(); return false;});
// $('#sendCtrlAltCombine').change(function() {
// var fn = Number($('#sendCtrlAltCombine').val())-1;
// rfb.sendCtrlAltCombine(fn); return false;});
$
(
'#sendPasswordButton'
).
click
(
function
()
{
var
pw
=
$
(
"#vm-details-pw-input"
).
val
();
for
(
var
i
=
0
;
i
<
pw
.
length
;
i
++
)
{
...
...
circle/dashboard/templates/dashboard/template-edit.html
View file @
fa743214
...
...
@@ -155,7 +155,7 @@
{% for d in disks %}
<li>
<i
class=
"fa fa-file"
></i>
{{ d.name }} (#{{ d.id }})
{{ d.
file
name }} (#{{ d.id }})
<a
href=
"{% url "
dashboard
.
views
.
disk-remove
"
pk=
d.pk
%}?
next=
{{
request
.
path
}}"
data-disk-pk=
"{{ d.pk }}"
class=
"btn btn-xs btn-danger pull-right disk-remove"
{%
if
not
long_remove
%}
title=
"{% trans "
Remove
"
%}"{%
endif
%}
>
...
...
circle/dashboard/templates/dashboard/vm-detail/console.html
View file @
fa743214
...
...
@@ -10,13 +10,28 @@
<div
class=
"col-xs-7"
>
<div
class=
"btn-toolbar"
>
{% if perms.vm.access_console %}
<button
id=
"sendCtrlAlt
Del
Button"
class=
"btn btn-danger btn-sm"
>
{% trans "Send
Ctrl+Alt+Del
" %}
<button
id=
"sendCtrlAltButton"
class=
"btn btn-danger btn-sm"
>
{% trans "Send" %}
</button>
<select
id=
"chooseCtrlAlt"
class=
"btn btn-danger btn-sm"
>
<option
value=
"0"
>
Ctrl+Alt+Delete
</option>
<option
value=
"1"
>
Ctrl+Alt+F1
</option>
<option
value=
"2"
>
Ctrl+Alt+F2
</option>
<option
value=
"3"
>
Ctrl+Alt+F3
</option>
<option
value=
"4"
>
Ctrl+Alt+F4
</option>
<option
value=
"5"
>
Ctrl+Alt+F5
</option>
<option
value=
"6"
>
Ctrl+Alt+F6
</option>
<option
value=
"7"
>
Ctrl+Alt+F7
</option>
<option
value=
"8"
>
Ctrl+Alt+F8
</option>
<option
value=
"9"
>
Ctrl+Alt+F9
</option>
<option
value=
"10"
>
Ctrl+Alt+F10
</option>
<option
value=
"11"
>
Ctrl+Alt+F11
</option>
<option
value=
"12"
>
Ctrl+Alt+F12
</option>
</select>
<button
id=
"sendPasswordButton"
class=
"btn btn-default btn-sm"
>
{% trans "Type password" %}
</button>
{% endif %}
{% endif %}
</div>
</div>
<div
class=
"col-xs-5 text-right"
>
...
...
circle/dashboard/views/graph.py
View file @
fa743214
...
...
@@ -212,7 +212,7 @@ class Cpu(object):
if
isinstance
(
self
.
obj
,
Node
):
return
(
0
,
105
)
else
:
return
(
0
,
self
.
obj
.
num_cores
*
10
0
+
5
)
return
(
0
,
self
.
obj
.
num_cores
*
105
)
register_graph
(
Cpu
,
'cpu'
,
VmGraphView
)
...
...
circle/dashboard/views/vm.py
View file @
fa743214
...
...
@@ -937,6 +937,7 @@ class VmList(LoginRequiredMixin, FilterMixin, ListView):
'tags'
:
"tags__name__in"
,
# for search string
'owner'
:
"owner__username"
,
'template'
:
"template__pk"
,
'template_name'
:
"template__name__istartswith"
,
}
def
get_context_data
(
self
,
*
args
,
**
kwargs
):
...
...
@@ -1018,10 +1019,14 @@ class VmList(LoginRequiredMixin, FilterMixin, ListView):
in
[
i
.
name
for
i
in
Instance
.
_meta
.
fields
]
+
[
"pk"
]):
queryset
=
queryset
.
order_by
(
sort
)
filters
,
excludes
=
self
.
get_queryset_filters
()
return
queryset
.
filter
(
**
filters
)
.
exclude
(
**
excludes
)
.
prefetch_related
(
"owner"
,
"node"
,
"owner__profile"
,
"interface_set"
,
"lease"
,
"interface_set__host"
)
.
distinct
()
try
:
filters
,
excludes
=
self
.
get_queryset_filters
()
queryset
=
queryset
.
filter
(
**
filters
)
.
exclude
(
**
excludes
)
.
distinct
()
except
ValueError
:
messages
.
error
(
self
.
request
,
_
(
"Error during filtering."
))
return
queryset
.
prefetch_related
(
"owner"
,
"node"
,
"owner__profile"
,
"lease"
,
"interface_set"
,
"interface_set__host"
,
"template"
)
.
distinct
()
class
VmCreate
(
LoginRequiredMixin
,
TemplateView
):
...
...
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