Query ArtifactHub for repo suggestion (#225)

* Query ArtifactHub for repo suggestion

* Refactor & improve

* Add notice on local chart support
This commit is contained in:
Andrey Pokhilko
2023-03-02 10:22:32 +00:00
committed by GitHub
parent 679d31e4ab
commit bbb425bfea
7 changed files with 182 additions and 3 deletions

View File

@@ -2,6 +2,13 @@ function loadRepoView() {
$("#sectionRepo .repo-details").hide()
$("#sectionRepo").show()
$("#repoAddModal input[name=name]").val(getHashParam("suggestRepo"))
$("#repoAddModal input[name=url]").val(getHashParam("suggestRepoUrl"))
if (getHashParam("suggestRepo")) {
$("#sectionRepo .repo-list .btn").click()
}
$.getJSON("/api/helm/repositories").fail(function (xhr) {
reportError("Failed to get list of repositories", xhr)
sendStats('Get repo', {'status': 'fail'});
@@ -85,6 +92,8 @@ $("#inputSearch").keyup(function () {
})
$("#sectionRepo .repo-list .btn").click(function () {
setHashParam("suggestRepo", null)
setHashParam("suggestRepoUrl", null)
const myModal = new bootstrap.Modal(document.getElementById('repoAddModal'), {});
myModal.show()
})