mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-14 10:36:54 -07:00
- Improved the RetryHandler.
- Made the tester buttons on the settings pages a bit more robust and added an indication when it's testing (spinner)
This commit is contained in:
parent
96abba49f7
commit
741a4ae75c
20 changed files with 232 additions and 149 deletions
|
@ -153,10 +153,17 @@
|
|||
url = createBaseUrl(base, url);
|
||||
$.ajax({
|
||||
type: "Get",
|
||||
url: "getusers",
|
||||
url: url,
|
||||
dataType: "json",
|
||||
success: function (response) {
|
||||
if (response.length > 1) {
|
||||
|
||||
$('#users').html("");
|
||||
if(!response.result){
|
||||
generateNotify(response.message,"danger");
|
||||
$('#users').append("<option>Error!</option>");
|
||||
return;
|
||||
}
|
||||
if (response.users.length > 1) {
|
||||
$(response).each(function () {
|
||||
$('#users').append("<option>" + this + "</option>");
|
||||
});
|
||||
|
@ -167,6 +174,8 @@
|
|||
error: function (e) {
|
||||
console.log(e);
|
||||
generateNotify("Something went wrong!", "danger");
|
||||
$('#users').html("");
|
||||
$('#users').append("<option>Error!</option>");
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -88,7 +88,7 @@
|
|||
|
||||
<div class="form-group">
|
||||
<div>
|
||||
<button id="testCp" type="submit" class="btn btn-primary-outline">Test Connectivity</button>
|
||||
<button id="testCp" type="submit" class="btn btn-primary-outline">Test Connectivity <div id="spinner"> </div></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -170,6 +170,8 @@
|
|||
e.preventDefault();
|
||||
var $form = $("#mainForm");
|
||||
var url = createBaseUrl(baseUrl,"/test/cp");
|
||||
$('#spinner').attr("class", "fa fa-spinner fa-spin");
|
||||
|
||||
$.ajax({
|
||||
type: $form.prop("method"),
|
||||
url: url,
|
||||
|
@ -178,15 +180,18 @@
|
|||
success: function (response) {
|
||||
console.log(response);
|
||||
if (response.result === true) {
|
||||
$('#spinner').attr("class", "fa fa-check");
|
||||
generateNotify(response.message, "success");
|
||||
$('#authToken').val(response.authToken);
|
||||
} else {
|
||||
generateNotify(response.message, "warning");
|
||||
$('#spinner').attr("class", "fa fa-times");
|
||||
}
|
||||
},
|
||||
error: function (e) {
|
||||
console.log(e);
|
||||
generateNotify("Something went wrong!", "danger");
|
||||
generateNotify("Something went wrong!", "danger");
|
||||
$('#spinner').attr("class", "fa fa-times");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
|
@ -106,7 +106,7 @@
|
|||
|
||||
<div class="form-group">
|
||||
<div>
|
||||
<button id="testEmail" type="submit" class="btn btn-primary-outline">Test</button>
|
||||
<button id="testEmail" type="submit" class="btn btn-primary-outline">Test <div id="spinner"></div></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -150,7 +150,8 @@
|
|||
});
|
||||
});
|
||||
|
||||
$('#testEmail').click(function (e) {
|
||||
$('#testEmail').click(function (e) {
|
||||
$('#spinner').attr("class", "fa fa-spinner fa-spin");
|
||||
|
||||
var url = createBaseUrl(base, '/admin/testemailnotification');
|
||||
e.preventDefault();
|
||||
|
@ -167,13 +168,16 @@
|
|||
dataType: "json",
|
||||
success: function (response) {
|
||||
if (response.result === true) {
|
||||
$('#spinner').attr("class", "fa fa-check");
|
||||
generateNotify(response.message, "success");
|
||||
} else {
|
||||
$('#spinner').attr("class", "fa fa-times");
|
||||
generateNotify(response.message, "warning");
|
||||
}
|
||||
},
|
||||
error: function (e) {
|
||||
console.log(e);
|
||||
$('#spinner').attr("class", "fa fa-times");
|
||||
generateNotify("Something went wrong!", "danger");
|
||||
}
|
||||
});
|
||||
|
|
|
@ -75,7 +75,7 @@
|
|||
|
||||
<div class="form-group">
|
||||
<div>
|
||||
<button id="testHeadphones" type="submit" class="btn btn-primary-outline">Test Connectivity</button>
|
||||
<button id="testHeadphones" type="submit" class="btn btn-primary-outline">Test Connectivity <div id="spinner"></div></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -96,6 +96,8 @@
|
|||
|
||||
var base = '@Html.GetBaseUrl()';
|
||||
$('#testHeadphones').click(function (e) {
|
||||
|
||||
$('#spinner').attr("class", "fa fa-spinner fa-spin");
|
||||
e.preventDefault();
|
||||
var $form = $("#mainForm");
|
||||
var url = createBaseUrl(base, '/test/headphones');
|
||||
|
@ -107,13 +109,16 @@
|
|||
success: function (response) {
|
||||
console.log(response);
|
||||
if (response.result === true) {
|
||||
$('#spinner').attr("class", "fa fa-check");
|
||||
generateNotify(response.message, "success");
|
||||
} else {
|
||||
$('#spinner').attr("class", "fa fa-times");
|
||||
generateNotify(response.message, "warning");
|
||||
}
|
||||
},
|
||||
error: function (e) {
|
||||
console.log(e);
|
||||
$('#spinner').attr("class", "fa fa-times");
|
||||
generateNotify("Something went wrong!", "danger");
|
||||
}
|
||||
});
|
||||
|
|
|
@ -52,7 +52,7 @@
|
|||
</div>
|
||||
<div class="form-group">
|
||||
<div>
|
||||
<button id="testPlex" type="submit" class="btn btn-primary-outline">Test Connectivity</button>
|
||||
<button id="testPlex" type="submit" class="btn btn-primary-outline">Test Connectivity <div id="spinner"></div></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -69,25 +69,34 @@
|
|||
<script>
|
||||
$(function () {
|
||||
var base = '@Html.GetBaseUrl()';
|
||||
|
||||
$('#testPlex').click(function (e) {
|
||||
e.preventDefault();
|
||||
var url = createBaseUrl(base, '/test/plex');
|
||||
var $form = $("#mainForm");
|
||||
|
||||
$('#spinner').attr("class", "fa fa-spinner fa-spin");
|
||||
$.ajax({
|
||||
type: $form.prop("method"),
|
||||
url: url,
|
||||
data: $form.serialize(),
|
||||
dataType: "json",
|
||||
success: function (response) {
|
||||
$('#spinner').attr("class", "");
|
||||
console.log(response);
|
||||
if (response.result === true) {
|
||||
generateNotify(response.message, "success");
|
||||
|
||||
$('#spinner').attr("class", "fa fa-check");
|
||||
$('#authToken').val(response.authToken);
|
||||
} else {
|
||||
generateNotify(response.message, "warning");
|
||||
$('#spinner').attr("class", "fa fa-times");
|
||||
}
|
||||
},
|
||||
error: function (e) {
|
||||
|
||||
$('#spinner').attr("class", "fa fa-times");
|
||||
console.log(e);
|
||||
generateNotify("Something went wrong!", "danger");
|
||||
}
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
|
||||
<div class="form-group">
|
||||
<div>
|
||||
<button id="testPushbullet" type="submit" class="btn btn-primary-outline">Test</button>
|
||||
<button id="testPushbullet" type="submit" class="btn btn-primary-outline">Test <div id="spinner"></div></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -56,6 +56,8 @@
|
|||
$(function () {
|
||||
var base = '@Html.GetBaseUrl()';
|
||||
$('#save').click(function (e) {
|
||||
|
||||
$('#spinner').attr("class", "fa fa-spinner fa-spin");
|
||||
e.preventDefault();
|
||||
|
||||
var $form = $("#mainForm");
|
||||
|
@ -67,12 +69,15 @@
|
|||
success: function (response) {
|
||||
if (response.result === true) {
|
||||
generateNotify(response.message, "success");
|
||||
$('#spinner').attr("class", "fa fa-check");
|
||||
} else {
|
||||
generateNotify(response.message, "warning");
|
||||
$('#spinner').attr("class", "fa fa-times");
|
||||
}
|
||||
},
|
||||
error: function (e) {
|
||||
console.log(e);
|
||||
$('#spinner').attr("class", "fa fa-times");
|
||||
generateNotify("Something went wrong!", "danger");
|
||||
}
|
||||
});
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
|
||||
<div class="form-group">
|
||||
<div>
|
||||
<button id="testPushover" type="submit" class="btn btn-primary-outline">Test</button>
|
||||
<button id="testPushover" type="submit" class="btn btn-primary-outline">Test <div id="spinner"></div></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -59,6 +59,7 @@
|
|||
$('#save').click(function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
$('#spinner').attr("class", "fa fa-spinner fa-spin");
|
||||
var $form = $("#mainForm");
|
||||
$.ajax({
|
||||
type: $form.prop("method"),
|
||||
|
@ -68,13 +69,16 @@
|
|||
success: function (response) {
|
||||
if (response.result === true) {
|
||||
generateNotify(response.message, "success");
|
||||
$('#spinner').attr("class", "fa fa-check");
|
||||
} else {
|
||||
generateNotify(response.message, "warning");
|
||||
$('#spinner').attr("class", "fa fa-times");
|
||||
}
|
||||
},
|
||||
error: function (e) {
|
||||
console.log(e);
|
||||
generateNotify("Something went wrong!", "danger");
|
||||
$('#spinner').attr("class", "fa fa-times");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
|
@ -86,7 +86,7 @@
|
|||
|
||||
<div class="form-group">
|
||||
<div>
|
||||
<button id="testSickRage" type="submit" class="btn btn-primary-outline">Test Connectivity</button>
|
||||
<button id="testSickRage" type="submit" class="btn btn-primary-outline">Test Connectivity <div id="spinner"></div></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -147,6 +147,8 @@
|
|||
});
|
||||
|
||||
$('#testSickRage').click(function (e) {
|
||||
|
||||
$('#spinner').attr("class", "fa fa-spinner fa-spin");
|
||||
e.preventDefault();
|
||||
var qualityProfile = $("#profiles option:selected").val();
|
||||
|
||||
|
@ -165,13 +167,16 @@
|
|||
console.log(response);
|
||||
if (response.result === true) {
|
||||
generateNotify(response.message, "success");
|
||||
$('#spinner').attr("class", "fa fa-check");
|
||||
} else {
|
||||
generateNotify(response.message, "warning");
|
||||
$('#spinner').attr("class", "fa fa-times");
|
||||
}
|
||||
},
|
||||
error: function (e) {
|
||||
console.log(e);
|
||||
generateNotify("Something went wrong!", "danger");
|
||||
$('#spinner').attr("class", "fa fa-times");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
|
@ -73,7 +73,7 @@
|
|||
</div>
|
||||
<div class="form-group">
|
||||
<div>
|
||||
<button type="submit" id="getProfiles" class="btn btn-primary-outline">Get Quality Profiles</button>
|
||||
<button type="submit" id="getProfiles" class="btn btn-primary-outline">Get Quality Profiles <div id="getSpinner"/></button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
@ -109,7 +109,7 @@
|
|||
</div>
|
||||
<div class="form-group">
|
||||
<div>
|
||||
<button id="testSonarr" type="submit" class="btn btn-primary-outline">Test Connectivity</button>
|
||||
<button id="testSonarr" type="submit" class="btn btn-primary-outline">Test Connectivity <div id="spinner"/></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -200,17 +200,22 @@
|
|||
});
|
||||
|
||||
$('#getProfiles').click(function (e) {
|
||||
|
||||
$('#getSpinner').attr("class", "fa fa-spinner fa-spin");
|
||||
e.preventDefault();
|
||||
if (!$('#Ip').val()) {
|
||||
generateNotify("Please enter a valid IP/Hostname.", "warning");
|
||||
$('#getSpinner').attr("class", "fa fa-times");
|
||||
return;
|
||||
}
|
||||
if (!$('#portNumber').val()) {
|
||||
generateNotify("Please enter a valid Port Number.", "warning");
|
||||
$('#getSpinner').attr("class", "fa fa-times");
|
||||
return;
|
||||
}
|
||||
if (!$('#ApiKey').val()) {
|
||||
generateNotify("Please enter a valid ApiKey.", "warning");
|
||||
$('#getSpinner').attr("class", "fa fa-times");
|
||||
return;
|
||||
}
|
||||
var $form = $("#mainForm");
|
||||
|
@ -221,11 +226,13 @@
|
|||
dataType: "json",
|
||||
success: function (response) {
|
||||
response.forEach(function (result) {
|
||||
$('#getSpinner').attr("class", "fa fa-check");
|
||||
$("#select").append("<option value='" + result.id + "'>" + result.name + "</option>");
|
||||
});
|
||||
},
|
||||
error: function (e) {
|
||||
console.log(e);
|
||||
$('#getSpinner').attr("class", "fa fa-times");
|
||||
generateNotify("Something went wrong!", "danger");
|
||||
}
|
||||
});
|
||||
|
@ -233,6 +240,8 @@
|
|||
|
||||
var base = '@Html.GetBaseUrl()';
|
||||
$('#testSonarr').click(function (e) {
|
||||
|
||||
$('#spinner').attr("class", "fa fa-spinner fa-spin");
|
||||
e.preventDefault();
|
||||
var qualityProfile = $("#profiles option:selected").val();
|
||||
|
||||
|
@ -251,13 +260,16 @@
|
|||
console.log(response);
|
||||
if (response.result === true) {
|
||||
generateNotify(response.message, "success");
|
||||
$('#spinner').attr("class", "fa fa-check");
|
||||
} else {
|
||||
generateNotify(response.message, "warning");
|
||||
$('#spinner').attr("class", "fa fa-times");
|
||||
}
|
||||
},
|
||||
error: function (e) {
|
||||
console.log(e);
|
||||
generateNotify("Something went wrong!", "danger");
|
||||
$('#spinner').attr("class", "fa fa-times");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
<br/><br/>
|
||||
<input class="btn btn-success-outline" type="submit" value="Login"/>
|
||||
<input type="hidden" id="DateTimeOffset" name="DateTimeOffset" />
|
||||
<input type="hidden" id="redirect" name="redirect" value="@Model.Redirect"/>
|
||||
</form>
|
||||
@if (!Model.AdminExists)
|
||||
{
|
||||
|
|
|
@ -45,7 +45,8 @@
|
|||
|
||||
@if (!Context.CurrentUser.IsAuthenticated())
|
||||
{
|
||||
<li><a href="@url/login"><i class="fa fa-user"></i> Admin</a></li>
|
||||
|
||||
<li><a href="@url/login?redirect=@Context.Request.Path"><i class="fa fa-user"></i> Admin</a></li>
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue