* [bug#58309,done,0.5h] fix Screen flashes when viewing events.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
window.initComponent = function (instanceID)
|
||||
window.initComponent = function(instanceID)
|
||||
{
|
||||
toggleLoading('#events-panel', true);
|
||||
const $picker = $('[name=component]').zui('picker');
|
||||
@@ -8,20 +8,21 @@ window.initComponent = function (instanceID)
|
||||
{
|
||||
toggleLoading('#events-panel', false);
|
||||
$picker.render({items: items});
|
||||
if (typeof (items) !== 'undefined') $picker.$.setValue(items.component);
|
||||
if (typeof items !== 'undefined') $picker.$.setValue(items.component);
|
||||
if (items.length === 1) $('#component-events').addClass('hidden');
|
||||
showEvents(instanceID);
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
window.showEvents = function (instanceID, noEventTip)
|
||||
window.showEvents = function(instanceID, noEventTip)
|
||||
{
|
||||
const instanceComponent = $('[name=component]').val();
|
||||
if (instanceComponent === '') return;
|
||||
const target = $.createLink('instance', 'showEvents', 'id=' + instanceID + "&component=" + instanceComponent);
|
||||
if(instanceComponent === '') return;
|
||||
const target = $.createLink('instance', 'showEvents', 'id=' + instanceID);
|
||||
let formData = {};
|
||||
formData.component = instanceComponent;
|
||||
toggleLoading('#events-panel', true);
|
||||
$.getJSON(target, function (resp)
|
||||
$.post(target, formData, function(resp)
|
||||
{
|
||||
toggleLoading('#events-panel', false);
|
||||
$('#events-content').removeClass('dtable-empty-tip flex');
|
||||
@@ -31,7 +32,7 @@ window.showEvents = function (instanceID, noEventTip)
|
||||
$('#events-content').addClass('dtable-empty-tip flex');
|
||||
return;
|
||||
}
|
||||
$('#events-content').html(resp.data.map(item => item.lastSeen + ' ' + item.type + ' ' + item.reason + ' ' + item.object + ' ' + item.message).join('\n'));
|
||||
$('#events-content')[0].scrollTop = $('#events-content')[0].scrollHeight;
|
||||
$('#events-content').html(resp.data.map(item => item.lastSeen + ' ' + item.type + ' ' + item.reason + ' ' + item.object + ' ' + item.message).join('\n'));
|
||||
$('#events-content')[0].scrollTop = $('#events-content')[0].scrollHeight;
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user