diff options
author | d-volution <49024624+d-volution@users.noreply.github.com> | 2023-09-25 21:42:27 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-25 19:42:27 +0000 |
commit | 9940c91ebf22dcb11db60949a8378e3eb635b0c7 (patch) | |
tree | 8b597619c1ba5be35c3ce0162ca90b90b2f90385 | |
parent | 80a577b025ff83f476c3052850acd0d34e001525 (diff) |
gui: Scroll to bottom by clicking message in log viewer (#9128)
-rw-r--r-- | gui/default/syncthing/core/logViewerModalView.html | 2 | ||||
-rwxr-xr-x | gui/default/syncthing/core/syncthingController.js | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/gui/default/syncthing/core/logViewerModalView.html b/gui/default/syncthing/core/logViewerModalView.html index f958cc0005..184a0ecc89 100644 --- a/gui/default/syncthing/core/logViewerModalView.html +++ b/gui/default/syncthing/core/logViewerModalView.html @@ -9,7 +9,7 @@ <div id="log-viewer-log" class="tab-pane in active"> <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> - <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 id="log-viewer-facilities" class="tab-pane"> diff --git a/gui/default/syncthing/core/syncthingController.js b/gui/default/syncthing/core/syncthingController.js index efbdbba172..b09965f9f8 100755 --- a/gui/default/syncthing/core/syncthingController.js +++ b/gui/default/syncthing/core/syncthingController.js @@ -1430,6 +1430,11 @@ angular.module('syncthing.core') // Browser events do not cause redraw, trigger manually. $scope.$apply(); }, + scrollToBottom: function () { + var textArea = $('#logViewerText'); + var scrollHeight = textArea.prop('scrollHeight'); + textArea.prop('scrollTop', scrollHeight); + }, timer: null, entries: [], paused: false, |