Commit e8b4b4ff authored by Dietmar Maurer's avatar Dietmar Maurer

add task history to VM panel

parent 01c47656
...@@ -43,6 +43,10 @@ __PACKAGE__->register_method({ ...@@ -43,6 +43,10 @@ __PACKAGE__->register_method({
type => 'string', type => 'string',
optional => 1, optional => 1,
}, },
vmid => get_standard_option('pve-vmid', {
description => "Only list tasks for this VM.",
optional => 1
}),
errors => { errors => {
type => 'boolean', type => 'boolean',
optional => 1, optional => 1,
...@@ -91,6 +95,8 @@ __PACKAGE__->register_method({ ...@@ -91,6 +95,8 @@ __PACKAGE__->register_method({
return if $errors && $status && $status eq 'OK'; return if $errors && $status && $status eq 'OK';
return if $param->{vmid} && (!$task->{id} || $task->{id} ne $param->{vmid});
return if $count++ < $start; return if $count++ < $start;
return if $limit <= 0; return if $limit <= 0;
......
...@@ -3,6 +3,8 @@ Ext.define('PVE.node.Tasks', { ...@@ -3,6 +3,8 @@ Ext.define('PVE.node.Tasks', {
alias: ['widget.pveNodeTasks'], alias: ['widget.pveNodeTasks'],
vmidFilter: 0,
initComponent : function() { initComponent : function() {
var me = this; var me = this;
...@@ -27,16 +29,25 @@ Ext.define('PVE.node.Tasks', { ...@@ -27,16 +29,25 @@ Ext.define('PVE.node.Tasks', {
var userfilter = ''; var userfilter = '';
var filter_errors = 0; var filter_errors = 0;
// fixme: scroller update fails var updateProxyParams = function() {
// http://www.sencha.com/forum/showthread.php?133677-scroller-does-not-adjust-to-the-filtered-grid-data&p=602887
var reload_task = new Ext.util.DelayedTask(function() {
var params = { var params = {
errors: filter_errors errors: filter_errors
}; };
if (userfilter) { if (userfilter) {
params.userfilter = userfilter; params.userfilter = userfilter;
} }
if (me.vmidFilter) {
params.vmid = me.vmidFilter;
}
store.proxy.extraParams = params; store.proxy.extraParams = params;
};
updateProxyParams();
// fixme: scroller update fails
// http://www.sencha.com/forum/showthread.php?133677-scroller-does-not-adjust-to-the-filtered-grid-data&p=602887
var reload_task = new Ext.util.DelayedTask(function() {
updateProxyParams();
store.filter(); store.filter();
}); });
......
...@@ -143,6 +143,12 @@ Ext.define('PVE.openvz.Config', { ...@@ -143,6 +143,12 @@ Ext.define('PVE.openvz.Config', {
itemId: 'options', itemId: 'options',
xtype: 'pveOpenVZOptions' xtype: 'pveOpenVZOptions'
}, },
{
title: 'Task History',
itemId: 'tasks',
xtype: 'pveNodeTasks',
vmidFilter: vmid
},
{ {
title: 'UBC', title: 'UBC',
itemId: 'ubc', itemId: 'ubc',
......
...@@ -141,6 +141,12 @@ Ext.define('PVE.qemu.Config', { ...@@ -141,6 +141,12 @@ Ext.define('PVE.qemu.Config', {
title: gettext('Options'), title: gettext('Options'),
itemId: 'options', itemId: 'options',
xtype: 'PVE.qemu.Options' xtype: 'PVE.qemu.Options'
},
{
title: 'Task History',
itemId: 'tasks',
xtype: 'pveNodeTasks',
vmidFilter: vmid
} }
] ]
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment