gui: Scroll to bottom by clicking message in log viewer (#9128)
This commit is contained in:
@@ -9,7 +9,7 @@
|
|||||||
<div id="log-viewer-log" class="tab-pane in active">
|
<div id="log-viewer-log" class="tab-pane in active">
|
||||||
<label translate ng-if="logging.logEntries.length == 0">Loading...</label>
|
<label translate ng-if="logging.logEntries.length == 0">Loading...</label>
|
||||||
<textarea id="logViewerText" class="form-control" rows="20" ng-if="logging.logEntries.length != 0" readonly style="font-family: Consolas, monospace; font-size: 11px; overflow: auto;">{{ logging.content() }}</textarea>
|
<textarea id="logViewerText" class="form-control" rows="20" ng-if="logging.logEntries.length != 0" readonly style="font-family: Consolas, monospace; font-size: 11px; overflow: auto;">{{ logging.content() }}</textarea>
|
||||||
<p translate class="help-block" ng-style="{'visibility': logging.paused ? 'visible' : 'hidden'}">Log tailing paused. Scroll to the bottom to continue.</p>
|
<a href="" translate class="help-block" ng-style="{'visibility': logging.paused ? 'visible' : 'hidden'}" ng-click="logging.scrollToBottom()" style="text-decoration: none">Log tailing paused. Scroll to the bottom to continue.</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="log-viewer-facilities" class="tab-pane">
|
<div id="log-viewer-facilities" class="tab-pane">
|
||||||
|
|||||||
@@ -1430,6 +1430,11 @@ angular.module('syncthing.core')
|
|||||||
// Browser events do not cause redraw, trigger manually.
|
// Browser events do not cause redraw, trigger manually.
|
||||||
$scope.$apply();
|
$scope.$apply();
|
||||||
},
|
},
|
||||||
|
scrollToBottom: function () {
|
||||||
|
var textArea = $('#logViewerText');
|
||||||
|
var scrollHeight = textArea.prop('scrollHeight');
|
||||||
|
textArea.prop('scrollTop', scrollHeight);
|
||||||
|
},
|
||||||
timer: null,
|
timer: null,
|
||||||
entries: [],
|
entries: [],
|
||||||
paused: false,
|
paused: false,
|
||||||
|
|||||||
Reference in New Issue
Block a user