mirror of https://github.com/Jackett/Jackett
parent
d22820080f
commit
73458bb953
|
@ -567,20 +567,7 @@ function addIndexer(indexerId, displayNotification) {
|
||||||
doNotify("Configuration failed: " + data.error, "danger", "glyphicon glyphicon-alert");
|
doNotify("Configuration failed: " + data.error, "danger", "glyphicon glyphicon-alert");
|
||||||
}
|
}
|
||||||
}).fail(function (data) {
|
}).fail(function (data) {
|
||||||
var indexEnd = 2048 - "https://github.com/Jackett/Jackett/issues/new?template=bug_report.yml&title=[".length - indexerId.length - "] ".length - " (Config)".length; // keep url <= 2k #5104
|
doErrorNotify(indexerId, data.responseJSON.error, "configuring");
|
||||||
if (data.responseJSON.error !== undefined) {
|
|
||||||
var githubrepo = "Jackett/Jackett";
|
|
||||||
var githubtext = "this indexer";
|
|
||||||
var githubtemplate = "?template=bug_report.yml&"
|
|
||||||
if (data.responseJSON.error.includes("check FlareSolverr logs") || data.responseJSON.error.includes("cookies provided by FlareSolverr are not valid")) {
|
|
||||||
githubrepo = "FlareSolverr/FlareSolverr";
|
|
||||||
githubtext = "FlareSolverr";
|
|
||||||
githubtemplate = "?"
|
|
||||||
}
|
|
||||||
doNotify("An error occurred while configuring this indexer<br /><b>" + data.responseJSON.error.substring(0, indexEnd) + "</b><br /><i><a href=\"https://github.com/" + githubrepo + "/issues/new" + githubtemplate + "title=[" + indexerId + "] " + data.responseJSON.error.substring(0, indexEnd) + " (Config)\" target=\"_blank\">Click here to open an issue on GitHub for " + githubtext + ".</a><i>", "danger", "glyphicon glyphicon-alert", false);
|
|
||||||
} else {
|
|
||||||
doNotify("An error occurred while configuring this indexer, is Jackett server running ?", "danger", "glyphicon glyphicon-alert");
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -736,20 +723,7 @@ function testIndexer(id, notifyResult) {
|
||||||
}
|
}
|
||||||
}).fail(function (data) {
|
}).fail(function (data) {
|
||||||
updateTestState(id, "error", data.error, indexers);
|
updateTestState(id, "error", data.error, indexers);
|
||||||
if (data.responseJSON.error !== undefined && notifyResult) {
|
doErrorNotify(id, data.responseJSON.error, "testing");
|
||||||
var indexEnd = 2048 - "https://github.com/Jackett/Jackett/issues/new?template=bug_report.yml&title=[".length - id.length - "] ".length - " (Test)".length; // keep url <= 2k #5104
|
|
||||||
var githubrepo = "Jackett/Jackett";
|
|
||||||
var githubtext = "this indexer";
|
|
||||||
var githubtemplate = "?template=bug_report.yml&"
|
|
||||||
if (data.responseJSON.error.includes("check FlareSolverr logs") || data.responseJSON.error.includes("cookies provided by FlareSolverr are not valid")) {
|
|
||||||
githubrepo = "FlareSolverr/FlareSolverr";
|
|
||||||
githubtext = "FlareSolverr";
|
|
||||||
githubtemplate = "?"
|
|
||||||
}
|
|
||||||
doNotify("An error occurred while testing this indexer<br /><b>" + data.responseJSON.error.substring(0, indexEnd) + "</b><br /><i><a href=\"https://github.com/" + githubrepo + "/issues/new" + githubtemplate + "title=[" + id + "] " + data.responseJSON.error.substring(0, indexEnd) + " (Test)\" target=\"_blank\">Click here to open an issue on GitHub for " + githubtext + ".</a><i>", "danger", "glyphicon glyphicon-alert", false);
|
|
||||||
} else {
|
|
||||||
doNotify("An error occurred while testing indexers, please take a look at indexers with failed test for more informations.", "danger", "glyphicon glyphicon-alert");
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -911,12 +885,7 @@ function populateSetupForm(indexerId, name, config, caps, link, alternativesitel
|
||||||
doNotify("Configuration failed: " + data.error, "danger", "glyphicon glyphicon-alert");
|
doNotify("Configuration failed: " + data.error, "danger", "glyphicon glyphicon-alert");
|
||||||
}
|
}
|
||||||
}).fail(function (data) {
|
}).fail(function (data) {
|
||||||
if (data.responseJSON.error !== undefined) {
|
doErrorNotify(indexerId, data.responseJSON.error, "updating");
|
||||||
var indexEnd = 2048 - "https://github.com/Jackett/Jackett/issues/new?template=bug_report.yml&title=[".length - indexerId.length - "] ".length - " (Config)".length; // keep url <= 2k #5104
|
|
||||||
doNotify("An error occurred while updating this indexer<br /><b>" + data.responseJSON.error.substring(0, indexEnd) + "</b><br /><i><a href=\"https://github.com/Jackett/Jackett/issues/new?template=bug_report.yml&title=[" + indexerId + "] " + data.responseJSON.error.substring(0, indexEnd) + " (Config)\" target=\"_blank\">Click here to open an issue on GitHub for this indexer.</a><i>", "danger", "glyphicon glyphicon-alert", false);
|
|
||||||
} else {
|
|
||||||
doNotify("An error occurred while updating this indexer, request to Jackett server failed, is server running ?", "danger", "glyphicon glyphicon-alert");
|
|
||||||
}
|
|
||||||
}).always(function () {
|
}).always(function () {
|
||||||
$goButton.html(originalBtnText);
|
$goButton.html(originalBtnText);
|
||||||
$goButton.prop('disabled', false);
|
$goButton.prop('disabled', false);
|
||||||
|
@ -940,6 +909,29 @@ function resolveUrl(baseUrl, url) {
|
||||||
return url;
|
return url;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function doErrorNotify(indexerId, errorMessage, errorEvent) {
|
||||||
|
if (errorMessage !== undefined) {
|
||||||
|
var githubRepo = "Jackett/Jackett";
|
||||||
|
var githubText = "this indexer";
|
||||||
|
var githubTemplate = "?template=bug_report.yml&"
|
||||||
|
if (errorMessage.includes("FlareSolverr")) {
|
||||||
|
githubRepo = "FlareSolverr/FlareSolverr";
|
||||||
|
githubText = "FlareSolverr";
|
||||||
|
githubTemplate = "?"
|
||||||
|
}
|
||||||
|
var githubUrl = "https://github.com/" + githubRepo + "/issues/new" + githubTemplate + "title=[" + indexerId + "] (" + errorEvent + ")";
|
||||||
|
var indexEnd = 2000 - githubUrl.length; // keep url <= 2k #5104
|
||||||
|
var htmlEscapedError = $("<div>").text(errorMessage.substring(0, indexEnd)).html();
|
||||||
|
var urlEscapedError = encodeURIComponent(errorMessage.substring(0, indexEnd));
|
||||||
|
doNotify("An error occurred while " + errorEvent + " this indexer<br /><b>" + htmlEscapedError + "</b><br />" +
|
||||||
|
"<i><a href=\"" + githubUrl + " " + urlEscapedError + "\" target=\"_blank\">Click here to open an issue on GitHub for " + githubText + ".</a><i>",
|
||||||
|
"danger", "glyphicon glyphicon-alert", false);
|
||||||
|
} else {
|
||||||
|
doNotify("An error occurred while " + errorEvent + " indexers, please take a look at indexers with failed test for more information.",
|
||||||
|
"danger", "glyphicon glyphicon-alert");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function doNotify(message, type, icon, autoHide) {
|
function doNotify(message, type, icon, autoHide) {
|
||||||
if (typeof autoHide === "undefined" || autoHide === null)
|
if (typeof autoHide === "undefined" || autoHide === null)
|
||||||
autoHide = true;
|
autoHide = true;
|
||||||
|
|
|
@ -750,6 +750,6 @@
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script type="text/javascript" src="../libs/api.js?changed=2017083001"></script>
|
<script type="text/javascript" src="../libs/api.js?changed=2017083001"></script>
|
||||||
<script type="text/javascript" src="../custom.js?changed=2022012602"></script>
|
<script type="text/javascript" src="../custom.js?changed=20220417"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
Loading…
Reference in New Issue