mirror of
https://github.com/gSpotx2f/ruantiblock_openwrt.git
synced 2026-05-14 22:50:58 +00:00
luci-app: updated log.
This commit is contained in:
@@ -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();
|
||||||
},
|
},
|
||||||
}, '↓'),
|
}, '↓'),
|
||||||
|
|||||||
Reference in New Issue
Block a user