luci-app: updated log.

This commit is contained in:
gSpot
2024-03-07 01:06:28 +03:00
parent c044d303c5
commit f37502d22f
@@ -875,6 +875,14 @@ return baseclass.extend({
return this.reloadLog(Number(this.tailValue), true); return this.reloadLog(Number(this.tailValue), true);
}, },
scrollToTop() {
this.logWrapper.scrollIntoView(true);
},
scrollToBottom() {
this.logWrapper.scrollIntoView(false);
},
load() { load() {
this.restoreSettingsFromLocalStorage(); this.restoreSettingsFromLocalStorage();
if(typeof(this.getLogHash) != 'function') { if(typeof(this.getLogHash) != 'function') {
@@ -997,10 +1005,10 @@ return baseclass.extend({
}, _('Download log')); }, _('Download log'));
this.refreshBtn = E('button', { this.refreshBtn = E('button', {
'title' : _('Refresh log'), 'title': _('Refresh log'),
'class' : 'cbi-button btn log-side-btn', 'class': 'cbi-button btn log-side-btn',
'style' : `visibility:${(this.autoRefreshValue) ? 'hidden' : 'visible'}`, 'style': `visibility:${(this.autoRefreshValue) ? 'hidden' : 'visible'}`,
'click' : ui.createHandlerFn(this, function(ev) { 'click': ui.createHandlerFn(this, function(ev) {
ev.target.blur(); ev.target.blur();
return this.updateLog(); return this.updateLog();
}), }),
@@ -1018,7 +1026,13 @@ return baseclass.extend({
if(this.fastTailValue > 0) { if(this.fastTailValue > 0) {
this.fastTailValue += this.fastTailIncrement; this.fastTailValue += this.fastTailIncrement;
}; };
return this.reloadLog(this.fastTailValue); return this.reloadLog(this.fastTailValue)/*.then(() => {
if(this.logSortingValue == 'desc') {
this.scrollToBottom();
} else {
this.scrollToTop();
};
});*/
}), }),
}, `+${this.fastTailIncrement}`); }, `+${this.fastTailIncrement}`);
@@ -1060,7 +1074,7 @@ return baseclass.extend({
'class': 'cbi-button btn log-side-btn', 'class': 'cbi-button btn log-side-btn',
'style': 'margin-top:10px !important', 'style': 'margin-top:10px !important',
'click': ev => { 'click': ev => {
document.getElementById('logTitle').scrollIntoView(true); this.scrollToTop();
ev.target.blur(); ev.target.blur();
}, },
}, '↑'), }, '↑'),
@@ -1068,7 +1082,7 @@ return baseclass.extend({
'class': 'cbi-button btn log-side-btn', 'class': 'cbi-button btn log-side-btn',
'style': 'margin-top:1px !important', 'style': 'margin-top:1px !important',
'click': ev => { 'click': ev => {
this.logWrapper.scrollIntoView(false); this.scrollToBottom();
ev.target.blur(); ev.target.blur();
}, },
}, '↓'), }, '↓'),