Commit d98d8f35 authored by Dietmar Maurer's avatar Dietmar Maurer

fix LogViewer updates

Seems ExtJS onShow/onHide wrappers does not work for panels.
parent 90c352e7
pve-manager (2.0-24) unstable; urgency=low
* fix log viewer (correctly refresh display)
-- Proxmox Support Team <support@proxmox.com> Tue, 14 Feb 2012 09:01:07 +0100
pve-manager (2.0-23) unstable; urgency=low
* fix openvz live migration
......
......@@ -2,7 +2,7 @@ RELEASE=2.0
VERSION=2.0
PACKAGE=pve-manager
PACKAGERELEASE=23
PACKAGERELEASE=24
BINDIR=${DESTDIR}/usr/bin
PERLLIBDIR=${DESTDIR}/usr/share/perl5
......
......@@ -116,11 +116,13 @@ Ext.define('PVE.panel.LogView', {
}
var viewEnd = parseInt(((top + me.getHeight())/ me.lineHeight) + 1, 10);
var info = me.viewInfo;
if (info && !force) {
if (viewStart >= info.start && viewEnd <= info.end) {
return;
}
}
var line = parseInt((top / me.lineHeight) - (me.pageSize / 2) + 10, 10);
if (line < 0) {
line = 0;
......@@ -143,21 +145,24 @@ Ext.define('PVE.panel.LogView', {
}, 20);
},
onShow: function() {
/*jslint confusion: true */
initComponent : function() {
var me = this;
me.callParent(arguments);
var target = me.getTargetEl();
target.dom.scrollTop = me.savedScrollTop;
if (!me.url) {
throw "no url specified";
}
me.dataCmp = Ext.create('Ext.Component', {
style: 'font:normal 11px tahoma, arial, verdana, sans-serif;' +
'line-height: ' + me.lineHeight.toString() + 'px; white-space: pre;'
});
me.task = Ext.TaskManager.start({
run: function() {
if (!me.scrollToEnd || !me.viewInfo) {
if (!me.isVisible() || !me.scrollToEnd || !me.viewInfo) {
return;
}
var maxDown = me.getMaxDown();
if (maxDown > 0) {
return;
......@@ -167,48 +172,30 @@ Ext.define('PVE.panel.LogView', {
},
interval: 1000
});
},
onHide: function() {
var me = this;
var target = me.getTargetEl();
// Hack: chrome reset scrollTop to 0, so we save/restore
me.savedScrollTop = target.dom.scrollTop;
if (me.task) {
Ext.TaskManager.stop(me.task);
}
me.callParent(arguments);
},
onDestroy: function() {
var me = this;
if (me.task) {
Ext.TaskManager.stop(me.task);
}
me.callParent(arguments);
},
initComponent : function() {
var me = this;
if (!me.url) {
throw "no url specified";
}
me.dataCmp = Ext.create('Ext.Component', {
style: 'font:normal 11px tahoma, arial, verdana, sans-serif;' +
'line-height: ' + me.lineHeight.toString() + 'px; white-space: pre;'
});
Ext.apply(me, {
autoScroll: true,
layout: 'auto',
items: me.dataCmp,
bodyStyle: 'padding: 5px;'
bodyStyle: 'padding: 5px;',
listeners: {
show: function() {
var target = me.getTargetEl();
if (target && target.dom) {
target.dom.scrollTop = me.savedScrollTop;
}
},
beforehide: function() {
// Hack: chrome reset scrollTop to 0, so we save/restore
var target = me.getTargetEl();
if (target && target.dom) {
me.savedScrollTop = target.dom.scrollTop;
}
},
destroy: function() {
Ext.TaskManager.stop(me.task);
}
}
});
me.callParent();
......
......@@ -121,7 +121,9 @@ Ext.define('PVE.window.TaskViewer', {
}]
});
me.callParent();
me.callParent();
logView.fireEvent('show', logView);
}
});
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