mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-23 22:25:09 -04:00
New: After an update the update page will redirect to a success or failure page, depending on the result.
Fix: Notifications will attempt to reconnect to NzbDrone after it is shutdown.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
@model NzbDrone.Web.Models.UpdateModel
|
||||
@{ViewBag.Title = "Update";}
|
||||
|
||||
@if (Model.UpdatePackage == null)
|
||||
{
|
||||
<h2>
|
||||
@@ -9,7 +10,7 @@ else
|
||||
{
|
||||
<h2>
|
||||
Available Update: @Model.UpdatePackage.Version
|
||||
@Ajax.ActionLink("Update", "StartUpdate", "Update", null)
|
||||
@Ajax.ActionLink("Update", "StartUpdate", "Update", new AjaxOptions{ OnSuccess = "updateStarted" })
|
||||
</h2>
|
||||
}
|
||||
@if (Model.LogFiles.Count != 0)
|
||||
@@ -26,3 +27,33 @@ else
|
||||
</div>
|
||||
}
|
||||
}
|
||||
|
||||
@section Scripts
|
||||
{
|
||||
<script type="text/javascript">
|
||||
function updateStarted() {
|
||||
var errors = 0;
|
||||
|
||||
//Pool the server every 5 seconds for a change in state
|
||||
$.doTimeout('updateStarted', 5000, function () {
|
||||
$.ajax({
|
||||
url: '/Health/Index',
|
||||
type: "GET",
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
//Handle the first error that occured
|
||||
errors++;
|
||||
},
|
||||
success: function (data, textStatus, jqXHR) {
|
||||
if (errors > 0) {
|
||||
//Kill the timer, redirect
|
||||
$.doTimeout('updateStarted');
|
||||
window.location = '/Update/Post?expectedVersion=@Model.UpdatePackage.Version';
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return true;
|
||||
});
|
||||
}
|
||||
</script>
|
||||
}
|
||||
Reference in New Issue
Block a user