simplify TaskViewer refresh code

This commit is contained in:
Dietmar Maurer 2011-10-11 12:48:28 +02:00
parent 8c5bc535f9
commit ee9fe4959f

View File

@ -103,21 +103,15 @@ Ext.define('PVE.window.TaskViewer', {
border: false
});
var lastStatus = 'unknown';
me.mon(statstore, 'load', function() {
var status = statgrid.getObjectValue('status');
store.load();
if (status === 'stopped') {
statstore.stopUpdate();
}
if (status === 'running' || lastStatus === 'running') {
store.load();
}
lastStatus = status;
stop_btn1.setDisabled(status !== 'running');
stop_btn2.setDisabled(status !== 'running');
});