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') {
@@ -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();
}, },
}, '↓'), }, '↓'),