mirror of https://github.com/Ombi-app/Ombi
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.
134 lines
4.6 KiB
134 lines
4.6 KiB
8 years ago
|
@using Ombi.UI.Helpers
|
||
|
@inherits Nancy.ViewEngines.Razor.NancyRazorViewBase<Ombi.Core.SettingModels.SystemSettings>
|
||
8 years ago
|
@Html.Partial("Shared/Partial/_Sidebar")
|
||
8 years ago
|
<div id="lightbox" style="display:none"></div>
|
||
9 years ago
|
<div class="col-sm-8 col-sm-push-1">
|
||
|
<fieldset>
|
||
|
<legend>Status</legend>
|
||
|
|
||
|
|
||
|
<div class="form-group">
|
||
8 years ago
|
<label class="control-label">Current Version: </label>
|
||
|
<label class="control-label">@Model.Status.CurrentVersion</label>
|
||
9 years ago
|
</div>
|
||
8 years ago
|
|
||
8 years ago
|
@if (Model.Status.UpdateAvailable)
|
||
|
{
|
||
8 years ago
|
<div class="form-group">
|
||
8 years ago
|
<label class="control-label">New Version: </label>
|
||
|
<label class="control-label">@Model.Status.NewVersion</label>
|
||
|
</div>
|
||
|
}
|
||
8 years ago
|
|
||
8 years ago
|
<form id="mainForm" method="post" action="save">
|
||
8 years ago
|
|
||
8 years ago
|
<div class="form-group">
|
||
|
<label for="select" class="control-label">Code Branch</label>
|
||
|
<div id="branches">
|
||
|
<select class="form-control form-control-custom" id="select">
|
||
|
@foreach (var b in Model.BranchDropdown)
|
||
|
{
|
||
|
if (b.Selected)
|
||
|
{
|
||
|
<option selected='selected' value='@b.Value'>@b.Name</option>
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
<option value='@b.Value'>@b.Name</option>
|
||
|
}
|
||
|
}
|
||
|
</select>
|
||
8 years ago
|
</div>
|
||
|
</div>
|
||
|
<button id="saveSettings" class="btn btn-success-outline">Save</button>
|
||
|
</form>
|
||
|
|
||
|
|
||
9 years ago
|
<div class="form-group">
|
||
|
<label class="control-label">Update Available: </label>
|
||
8 years ago
|
@if (Model.Status.UpdateAvailable)
|
||
9 years ago
|
{
|
||
8 years ago
|
<label class="control-label"><a href="@Model.Status.UpdateUri" target="_blank"><i class="fa fa-check"></i></a></label>
|
||
9 years ago
|
<br />
|
||
8 years ago
|
<input id="args" class="form-control form-control-custom " placeholder="optional launch arguments e.g. /etc/mono /opt/PlexRequests.exe">
|
||
|
<br/>
|
||
8 years ago
|
<button id="autoUpdate" class="btn btn-success-outline">Automatic Update (beta) <i class="fa fa-download"></i></button>
|
||
9 years ago
|
}
|
||
|
else
|
||
|
{
|
||
|
<label class="control-label"><i class="fa fa-times"></i></label>
|
||
|
}
|
||
|
|
||
|
</div>
|
||
|
|
||
8 years ago
|
@if (Model.Status.UpdateAvailable)
|
||
9 years ago
|
{
|
||
|
<h2>
|
||
8 years ago
|
<a href="@Model.Status.DownloadUri">@Model.Status.ReleaseTitle</a>
|
||
9 years ago
|
</h2>
|
||
|
<hr />
|
||
|
<label>Release Notes:</label>
|
||
8 years ago
|
@Html.Raw(Model.Status.ReleaseNotes)
|
||
9 years ago
|
}
|
||
|
|
||
|
|
||
|
</fieldset>
|
||
|
</div>
|
||
|
|
||
|
<script>
|
||
|
|
||
|
var base = '@Html.GetBaseUrl()';
|
||
|
$('#autoUpdate')
|
||
|
.click(function (e) {
|
||
|
e.preventDefault();
|
||
|
$('body').append("<i class=\"fa fa-spinner fa-spin fa-5x fa-fw\" style=\"position: absolute; top: 20%; left: 50%;\"></i>");
|
||
|
$('#autoUpdate').prop("disabled", "disabled");
|
||
8 years ago
|
document.getElementById("lightbox").style.display = "";
|
||
9 years ago
|
var count = 0;
|
||
|
setInterval(function () {
|
||
|
count++;
|
||
|
var dots = new Array(count % 10).join('.');
|
||
|
document.getElementById('autoUpdate').innerHTML = "Updating" + dots;
|
||
|
}, 1000);
|
||
|
|
||
|
$.ajax({
|
||
|
type: "Post",
|
||
|
url: "autoupdate",
|
||
8 years ago
|
data: {
|
||
|
url: "@Model.Status.DownloadUri",
|
||
|
args: $('#args').val()
|
||
|
},
|
||
9 years ago
|
dataType: "json",
|
||
|
error: function () {
|
||
|
setTimeout(
|
||
|
function () {
|
||
|
location.reload();
|
||
|
}, 30000);
|
||
|
}
|
||
|
});
|
||
|
});
|
||
8 years ago
|
|
||
|
$('#saveSettings').click(function (e) {
|
||
|
e.preventDefault();
|
||
|
var $form = $("#mainForm");
|
||
8 years ago
|
|
||
|
var branches = $("#branches option:selected").val();
|
||
|
|
||
|
var data = $form.serialize();
|
||
|
data = data + "&branch=" + branches;
|
||
8 years ago
|
$.ajax({
|
||
|
type: $form.prop("method"),
|
||
|
url: $form.prop("action"),
|
||
8 years ago
|
data: data,
|
||
8 years ago
|
dataType: "json",
|
||
|
success: function (response) {
|
||
|
if (response.result === true) {
|
||
|
generateNotify(response.message, "success");
|
||
|
|
||
|
} else {
|
||
|
generateNotify(response.message, "warning");
|
||
|
}
|
||
|
}
|
||
|
});
|
||
|
});
|
||
9 years ago
|
</script>
|