Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
pve-manager
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
pve-manager
Commits
bab91d08
Commit
bab91d08
authored
Dec 09, 2013
by
Dietmar Maurer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use a split-button for the console
parent
b170d4b0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
22 deletions
+42
-22
Config.js
www/manager/qemu/Config.js
+42
-22
No files found.
www/manager/qemu/Config.js
View file @
bab91d08
...
...
@@ -110,29 +110,50 @@ Ext.define('PVE.qemu.Config', {
var
vmname
=
me
.
pveSelNode
.
data
.
name
;
var
consoleBtn
=
Ext
.
create
(
'
Ext.Button
'
,
{
text
:
gettext
(
'
Console
'
),
disabled
:
!
caps
.
vms
[
'
VM.Console
'
],
handler
:
function
()
{
PVE
.
Utils
.
openConoleWindow
(
'
kvm
'
,
vmid
,
nodename
,
vmname
);
var
spice
=
false
;
var
openSpiceConsole
=
function
(
vmid
,
nodename
,
vmname
){
Ext
.
core
.
DomHelper
.
append
(
document
.
body
,
{
tag
:
'
iframe
'
,
id
:
'
downloadIframe
'
,
frameBorder
:
0
,
width
:
0
,
height
:
0
,
css
:
'
display:none;visibility:hidden;height:0px;
'
,
src
:
'
/api2/spiceconfig/nodes/
'
+
nodename
+
'
/qemu/
'
+
vmid
+
'
/spiceproxy?proxy=
'
+
encodeURIComponent
(
window
.
location
.
hostname
)
});
};
var
spiceMenu
=
Ext
.
create
(
'
Ext.menu.Item
'
,
{
text
:
'
SPICE
'
,
handler
:
function
(){
openSpiceConsole
(
vmid
,
nodename
,
vmname
);
}
});
var
spiceBtn
=
Ext
.
create
(
'
Ext.Button
'
,
{
text
:
'
SPICE
'
,
var
consoleBtn
=
Ext
.
create
(
'
Ext.button.Split
'
,
{
text
:
gettext
(
'
Console
'
)
,
disabled
:
!
caps
.
vms
[
'
VM.Console
'
],
handler
:
function
()
{
Ext
.
core
.
DomHelper
.
append
(
document
.
body
,
{
tag
:
'
iframe
'
,
id
:
'
downloadIframe
'
,
frameBorder
:
0
,
width
:
0
,
height
:
0
,
css
:
'
display:none;visibility:hidden;height:0px;
'
,
src
:
'
/api2/spiceconfig/nodes/
'
+
nodename
+
'
/qemu/
'
+
vmid
+
'
/spiceproxy?proxy=
'
+
encodeURIComponent
(
window
.
location
.
hostname
)
});
}
if
(
spice
)
{
openSpiceConsole
(
vmid
,
nodename
,
vmname
);
}
else
{
PVE
.
Utils
.
openConoleWindow
(
'
kvm
'
,
vmid
,
nodename
,
vmname
);
}
},
menu
:
new
Ext
.
menu
.
Menu
({
items
:
[
{
text
:
'
VNC
'
,
handler
:
function
(){
PVE
.
Utils
.
openConoleWindow
(
'
kvm
'
,
vmid
,
nodename
,
vmname
);
}
},
spiceMenu
]
})
});
var
descr
=
vmid
+
"
(
"
+
(
vmname
?
"
'
"
+
vmname
+
"
'
"
:
"
'VM
"
+
vmid
+
"
'
"
)
+
"
)
"
;
...
...
@@ -141,7 +162,7 @@ Ext.define('PVE.qemu.Config', {
title
:
Ext
.
String
.
format
(
gettext
(
"
Virtual Machine {0} on node {1}
"
),
descr
,
"
'
"
+
nodename
+
"
'
"
),
hstateid
:
'
kvmtab
'
,
tbar
:
[
resumeBtn
,
startBtn
,
shutdownBtn
,
stopBtn
,
resetBtn
,
removeBtn
,
migrateBtn
,
consoleBtn
,
spiceBtn
],
removeBtn
,
migrateBtn
,
consoleBtn
],
defaults
:
{
statusStore
:
me
.
statusStore
},
items
:
[
{
...
...
@@ -207,7 +228,6 @@ Ext.define('PVE.qemu.Config', {
var
status
;
var
qmpstatus
;
var
template
;
var
spice
;
if
(
!
success
)
{
me
.
workspace
.
checkVmMigration
(
me
.
pveSelNode
);
...
...
@@ -233,9 +253,9 @@ Ext.define('PVE.qemu.Config', {
resumeBtn
.
setVisible
(
false
);
}
spiceBtn
.
setVisible
(
spice
);
spiceMenu
.
setVisible
(
spice
);
spiceMenu
.
setDisabled
(
!
caps
.
vms
[
'
VM.Console
'
]
||
status
!==
'
running
'
);
spiceBtn
.
setDisabled
(
!
caps
.
vms
[
'
VM.Console
'
]
||
status
!==
'
running
'
);
startBtn
.
setDisabled
(
!
caps
.
vms
[
'
VM.PowerMgmt
'
]
||
status
===
'
running
'
||
template
);
resetBtn
.
setDisabled
(
!
caps
.
vms
[
'
VM.PowerMgmt
'
]
||
status
!==
'
running
'
||
template
);
shutdownBtn
.
setDisabled
(
!
caps
.
vms
[
'
VM.PowerMgmt
'
]
||
status
!==
'
running
'
);
...
...
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