Skip to content

Commit

Permalink
Update UI: Allow to shortcut search to show already received results
Browse files Browse the repository at this point in the history
Closes #914
  • Loading branch information
theotherp committed Jan 22, 2024
1 parent 5cec4be commit f4ae0c7
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions core/src/main/resources/changelog.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#@formatter:off
- version: "v5.3.7"
date: "2024-01-22"
changes:
- type: "feature"
text: "When you're making a search in the UI you can now choose to show the already received results. Until now you had to either wait, possibly until an indexer ran into a timeout or cancel without seeing any results at all. See #914"
Expand Down
2 changes: 2 additions & 0 deletions core/src/main/resources/static/js/nzbhydra.js
Original file line number Diff line number Diff line change
Expand Up @@ -11506,6 +11506,7 @@ function SearchUpdateModalInstanceCtrl($scope, $interval, SearchService, $uibMod
$scope.indexersSelected = 0;
$scope.indexersFinished = 0;
$scope.buttonText = "Cancel";
$scope.buttonTooltip = "Cancel search and return to search mask";
$scope.btnType = "btn-danger";

var socket = new SockJS(bootstrapped.baseUrl + 'websocket');
Expand All @@ -11526,6 +11527,7 @@ function SearchUpdateModalInstanceCtrl($scope, $interval, SearchService, $uibMod
}
if ($scope.indexersFinished > 0) {
$scope.buttonText = "Show results";
$scope.buttonTooltip = "Show results that have already been loaded";
$scope.btnType = "btn-warning";
}
if (data.messages) {
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/resources/static/js/nzbhydra.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions core/src/main/resources/static/js/templates.js

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion core/ui-src/html/search-state.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
<div class="modal-header">
<h3 style="display: inline-block" class="modal-title">Searching... please wait</h3>
<button class="btn {{btnType}}" type="button" ng-click="shortcutSearch()"
uib-tooltip="Show results that have already been loaded"
uib-tooltip="{{buttonTooltip}}"
tooltip-placement="top"
tooltip-trigger="mouseenter"
style="position: absolute; right: 18px"
>{{buttonText}}
</button>
</div>

<div class="modal-body" style="text-align: left;">
<img src="static/img/spinner.gif" ng-if="!messages && !indexerSelectionFinished"/>

Expand Down
2 changes: 2 additions & 0 deletions core/ui-src/js/search-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,7 @@ function SearchUpdateModalInstanceCtrl($scope, $interval, SearchService, $uibMod
$scope.indexersSelected = 0;
$scope.indexersFinished = 0;
$scope.buttonText = "Cancel";
$scope.buttonTooltip = "Cancel search and return to search mask";
$scope.btnType = "btn-danger";

var socket = new SockJS(bootstrapped.baseUrl + 'websocket');
Expand All @@ -445,6 +446,7 @@ function SearchUpdateModalInstanceCtrl($scope, $interval, SearchService, $uibMod
}
if ($scope.indexersFinished > 0) {
$scope.buttonText = "Show results";
$scope.buttonTooltip = "Show results that have already been loaded";
$scope.btnType = "btn-warning";
}
if (data.messages) {
Expand Down

0 comments on commit f4ae0c7

Please sign in to comment.