You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Ombi/Old/Ombi.UI/Views/FaultQueue/RequestFaultQueue.cshtml

97 lines
2.9 KiB

@inherits Nancy.ViewEngines.Razor.NancyRazorViewBase<IEnumerable<Ombi.UI.Models.FaultedRequestsViewModel>>
@Html.Partial("Shared/Partial/_Sidebar")
<div class="col-sm-8 col-sm-push-1">
<fieldset>
<legend>Request Fault Queue</legend>
<table class="table table-striped table-hover table-responsive table-condensed">
<thead>
<tr>
<th>
Request Title
</th>
<th>
Type
</th>
<th>
Fault Type
</th>
<th>
LastRetry
</th>
<th>
Error Description
</th>
<th>
Delete
</th>
</tr>
</thead>
<tbody>
@foreach (var m in Model)
{
<tr>
<td>
@m.Title
</td>
<td>
@m.Type
</td>
<td>
@m.FaultType
</td>
<td>
@m.LastRetry
</td>
<td>
@m.Message
</td>
<td class="delete" id="@m.Id"><i class="fa fa-times"></i></td>
</tr>
}
</tbody>
</table>
</fieldset>
</div>
<script>
$(function () {
$('.refresh').click(function (e) {
var id = e.currentTarget.id;
var ev = $(e.currentTarget.children[0]);
ev.addClass("fa-spin");
var url = createLocalUrl("/admin/deleteFault");
$.ajax({
type: 'POST',
data: { key: id },
url: url,
dataType: "json",
success: function (response) {
if (response.result === true) {
generateNotify("Success!", "success");
ev.removeClass("fa-spin");
ev.addClass("fa-check");
} else {
generateNotify(response.message, "warning");
ev.removeClass("fa-spin");
ev.addClass("fa-exclamation");
}
},
error: function (e) {
console.log(e);
generateNotify("Something went wrong!", "danger");
ev.removeClass("fa-spin");
ev.addClass("fa-exclamation");
}
});
});
});
</script>