mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-21 13:53:19 -07:00
parent
9121af0042
commit
7fc26df599
19 changed files with 262 additions and 128 deletions
|
@ -81,13 +81,13 @@
|
|||
|
||||
<div class="form-group">
|
||||
<div>
|
||||
<button type="submit" id="getRootFolders" class="btn btn-primary-outline">Get RootFolders <div id="getRootFolderSpinner" /></button>
|
||||
<button type="submit" id="getRootFolders" class="btn btn-primary-outline">Get Root Folders <div id="getRootFolderSpinner" /></button>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="selectRootFolder" class="control-label">Root Folders</label>
|
||||
<label for="selectRootFolder" class="control-label">Default Root Folders</label>
|
||||
<div id="rootFolders">
|
||||
<select class="form-control form-control-custom" id="selectRootFolder"></select>
|
||||
|
||||
|
@ -176,37 +176,38 @@
|
|||
</text>
|
||||
}
|
||||
|
||||
@if (!string.IsNullOrEmpty(Model.RootFolder))
|
||||
@if (!string.IsNullOrEmpty(Model.RootPath))
|
||||
{
|
||||
<text>
|
||||
|
||||
console.log('Hit root folders..');
|
||||
console.log('Hit root folders..');
|
||||
|
||||
var rootFolderSelected = @Model.RootFolder;
|
||||
if (!rootFolderSelected) {
|
||||
return;
|
||||
}
|
||||
var $form = $("#mainForm");
|
||||
$.ajax({
|
||||
type: $form.prop("method"),
|
||||
data: $form.serialize(),
|
||||
url: "sonarrrootfolders",
|
||||
dataType: "json",
|
||||
success: function(response) {
|
||||
response.forEach(function(result) {
|
||||
if (result.id == rootFolderSelected) {
|
||||
$("#selectRootFolder").append("<option selected='selected' value='" + result.id + "'>" + result.path + "</option>");
|
||||
} else {
|
||||
$("#selectRootFolder").append("<option value='" + result.id + "'>" + result.path + "</option>");
|
||||
}
|
||||
});
|
||||
},
|
||||
error: function(e) {
|
||||
console.log(e);
|
||||
generateNotify("Something went wrong!", "danger");
|
||||
}
|
||||
});
|
||||
</text>
|
||||
var rootFolderSelected = @Model.RootPath;
|
||||
if (!rootFolderSelected) {
|
||||
return;
|
||||
}
|
||||
var $form = $("#mainForm");
|
||||
$.ajax({
|
||||
type: $form.prop("method"),
|
||||
data: $form.serialize(),
|
||||
url: "sonarrrootfolders",
|
||||
dataType: "json",
|
||||
success: function(response) {
|
||||
response.forEach(function(result) {
|
||||
$('#selectedRootFolder').html("");
|
||||
if (result.id == rootFolderSelected) {
|
||||
$("#selectRootFolder").append("<option selected='selected' value='" + result.id + "'>" + result.path + "</option>");
|
||||
} else {
|
||||
$("#selectRootFolder").append("<option value='" + result.id + "'>" + result.path + "</option>");
|
||||
}
|
||||
});
|
||||
},
|
||||
error: function(e) {
|
||||
console.log(e);
|
||||
generateNotify("Something went wrong!", "danger");
|
||||
}
|
||||
});
|
||||
</text>
|
||||
}
|
||||
|
||||
|
||||
|
@ -218,11 +219,12 @@
|
|||
return;
|
||||
}
|
||||
var qualityProfile = $("#profiles option:selected").val();
|
||||
var rootFolder = $("#rootFolders option:selected").val();
|
||||
|
||||
var $form = $("#mainForm");
|
||||
|
||||
var data = $form.serialize();
|
||||
data = data + "&qualityProfile=" + qualityProfile;
|
||||
data = data + "&qualityProfile=" + qualityProfile + "&rootPath=" + rootFolder;
|
||||
|
||||
$.ajax({
|
||||
type: $form.prop("method"),
|
||||
|
|
|
@ -244,6 +244,11 @@
|
|||
<div>@UI.Requests_RequestedBy: {{requestedUsers}}</div>
|
||||
{{/if}}
|
||||
<div>@UI.Requests_RequestedDate: {{requestedDate}}</div>
|
||||
{{#if admin}}
|
||||
{{#if currentRootPath}}
|
||||
<div>Root Path: {{currentRootPath}}</div>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
<div>
|
||||
{{#if_eq issueId 0}}
|
||||
@*Nothing*@
|
||||
|
@ -275,6 +280,28 @@
|
|||
<button id="{{requestId}}" custom-button="{{requestId}}" style="text-align: right" class="btn btn-sm btn-success-outline approve" type="submit"><i class="fa fa-plus"></i> @UI.Common_Approve</button>
|
||||
{{/if_eq}}
|
||||
</form>
|
||||
|
||||
|
||||
<form method="POST" action="@formAction/requests/changeRootFolder" id="changeFolder{{requestId}}">
|
||||
<input name="requestId" type="text" value="{{requestId}}" hidden="hidden" />
|
||||
{{#if_eq hasRootFolders true}}
|
||||
<div class="btn-group btn-split">
|
||||
<button type="button" class="btn btn-sm btn-success-outline approve" id="{{requestId}}" custom-button="{{requestId}}">@*<i class="fa fa-plus"></i>*@ Change Root Folder</button>
|
||||
<button type="button" class="btn btn-success-outline dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
<span class="caret"></span>
|
||||
<span class="sr-only">@UI.Requests_ToggleDropdown</span>
|
||||
</button>
|
||||
<ul class="dropdown-menu">
|
||||
{{#each rootFolders}}
|
||||
<li><a href="#" class="change-root-folder" id="{{id}}">{{path}}</a></li>
|
||||
{{/each}}
|
||||
</ul>
|
||||
</div>
|
||||
{{/if_eq}}
|
||||
</form>
|
||||
|
||||
|
||||
|
||||
{{#unless denied}}
|
||||
<form method="POST" action="@formAction/approval/deny" id="deny{{requestId}}">
|
||||
<input name="requestId" type="text" value="{{requestId}}" hidden="hidden" />
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue