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
f5c5dcfa
Commit
f5c5dcfa
authored
Nov 09, 2011
by
Dietmar Maurer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add monitor GUI
parent
e0a6a274
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
117 additions
and
0 deletions
+117
-0
Makefile
www/manager/Makefile
+1
-0
Config.js
www/manager/qemu/Config.js
+5
-0
Monitor.js
www/manager/qemu/Monitor.js
+111
-0
No files found.
www/manager/Makefile
View file @
f5c5dcfa
...
...
@@ -75,6 +75,7 @@ JSSRC= \
node/Config.js
\
qemu/StatusView.js
\
qemu/Migrate.js
\
qemu/Monitor.js
\
qemu/Summary.js
\
qemu/OSTypeEdit.js
\
qemu/ProcessorEdit.js
\
...
...
www/manager/qemu/Config.js
View file @
f5c5dcfa
...
...
@@ -37,6 +37,11 @@ Ext.define('PVE.qemu.Config', {
itemId
:
'
options
'
,
xtype
:
'
PVE.qemu.Options
'
},
{
title
:
'
Monitor
'
,
itemId
:
'
monitor
'
,
xtype
:
'
pveQemuMonitor
'
},
/*
{
xtype: 'pveKVMConsole',
...
...
www/manager/qemu/Monitor.js
0 → 100644
View file @
f5c5dcfa
Ext
.
define
(
'
PVE.qemu.Monitor
'
,
{
extend
:
'
Ext.panel.Panel
'
,
alias
:
'
widget.pveQemuMonitor
'
,
maxLines
:
500
,
initComponent
:
function
()
{
var
me
=
this
;
var
nodename
=
me
.
pveSelNode
.
data
.
node
;
if
(
!
nodename
)
{
throw
"
no node name specified
"
;
}
var
vmid
=
me
.
pveSelNode
.
data
.
vmid
;
if
(
!
vmid
)
{
throw
"
no VM ID specified
"
;
}
var
lines
=
[];
var
textbox
=
Ext
.
createWidget
(
'
panel
'
,
{
region
:
'
center
'
,
xtype
:
'
panel
'
,
autoScroll
:
true
,
border
:
true
,
margins
:
'
5 5 5 5
'
,
bodyStyle
:
'
font-family: monospace;white-space: pre;
'
});
var
scrollToEnd
=
function
()
{
var
el
=
textbox
.
getTargetEl
();
var
dom
=
Ext
.
getDom
(
el
);
dom
.
scrollTop
=
dom
.
scrollHeight
-
dom
.
clientHeight
;
}
var
refresh
=
function
()
{
textbox
.
update
(
lines
.
join
(
'
\n
'
));
scrollToEnd
();
};
var
addLine
=
function
(
line
)
{
lines
.
push
(
line
);
if
(
lines
.
length
>
me
.
maxLines
)
{
lines
.
shift
();
}
};
var
executeCmd
=
function
(
cmd
)
{
addLine
(
"
#
"
+
Ext
.
htmlEncode
(
cmd
));
refresh
();
PVE
.
Utils
.
API2Request
({
params
:
{
command
:
cmd
},
url
:
'
/nodes/
'
+
nodename
+
'
/qemu/
'
+
vmid
+
"
/monitor
"
,
method
:
'
POST
'
,
waitMsgTarget
:
me
,
success
:
function
(
response
,
opts
)
{
var
res
=
response
.
result
.
data
;
Ext
.
Array
.
each
(
res
.
split
(
'
\n
'
),
function
(
line
)
{
addLine
(
Ext
.
htmlEncode
(
line
));
});
refresh
();
},
failure
:
function
(
response
,
opts
)
{
Ext
.
Msg
.
alert
(
'
Error
'
,
response
.
htmlStatus
);
}
});
};
Ext
.
apply
(
me
,
{
layout
:
{
type
:
'
border
'
},
border
:
false
,
items
:
[
textbox
,
{
region
:
'
south
'
,
margins
:
'
0 5 5 5
'
,
border
:
false
,
xtype
:
'
textfield
'
,
name
:
'
cmd
'
,
value
:
''
,
fieldStyle
:
'
font-family: monospace;
'
,
allowBlank
:
true
,
listeners
:
{
afterrender
:
function
(
f
)
{
f
.
focus
(
false
);
addLine
(
"
Type 'help' for help.
"
);
refresh
();
},
specialkey
:
function
(
f
,
e
)
{
if
(
e
.
getKey
()
===
e
.
ENTER
)
{
var
cmd
=
f
.
getValue
();
f
.
setValue
(
''
);
executeCmd
(
cmd
);
}
}
}
}
],
listeners
:
{
show
:
function
()
{
var
field
=
me
.
query
(
'
textfield[name="cmd"]
'
)[
0
];
field
.
focus
(
false
,
true
);
}
}
});
me
.
callParent
();
}
});
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