diff --git a/pkg/dashboard/handlers/helmHandlers.go b/pkg/dashboard/handlers/helmHandlers.go index 305b434..08b6162 100644 --- a/pkg/dashboard/handlers/helmHandlers.go +++ b/pkg/dashboard/handlers/helmHandlers.go @@ -250,7 +250,6 @@ func (h *HelmHandler) RepoCharts(c *gin.Context) { return } - // TODO: enrich with installed enrichRepoChartsWithInstalled(charts, installed) sort.Slice(charts, func(i, j int) bool { @@ -580,18 +579,30 @@ func (h *HelmHandler) repoFromArtifactHub(name string) (string, error) { } sort.SliceStable(results, func(i, j int) bool { + ri, rj := results[i], results[j] + // we prefer official repos - if results[i].Repository.Official && !results[j].Repository.Official { + if ri.Repository.Official && !rj.Repository.Official { return true } // or from verified publishers - if results[i].Repository.VerifiedPublisher && !results[j].Repository.VerifiedPublisher { + if ri.Repository.VerifiedPublisher && !rj.Repository.VerifiedPublisher { return true } // or just more popular - return results[i].Stars > results[j].Stars + if ri.Stars > rj.Stars { + return true + } + + // or with more recent app version + + if semver.Compare("v"+ri.AppVersion, "v"+rj.AppVersion) > 0 { + return true + } + + return false }) r := results[0] diff --git a/pkg/dashboard/static/details-view.js b/pkg/dashboard/static/details-view.js index b1c07ef..c8e09c2 100644 --- a/pkg/dashboard/static/details-view.js +++ b/pkg/dashboard/static/details-view.js @@ -196,7 +196,7 @@ function showResources(namespace, chart, revision) { const statusBlock = resBlock.find(".res-status"); statusBlock.empty().append(badge).attr("title", data.status.phase) const statusMessage = getStatusMessage(data.status) - resBlock.find(".res-statusmsg").html("" + (statusMessage ? statusMessage : '') + "") + resBlock.find(".res-statusmsg").html("" + (statusMessage ? statusMessage : '') + "") if (badge.text() !== "NotFound" && revision == $("#specRev").data("last-rev")) { resBlock.find(".res-actions") @@ -215,6 +215,10 @@ function showResources(namespace, chart, revision) { }) } } + + if (badge.hasClass("bg-danger")) { + resBlock.find(".res-statusmsg").append("Troubleshoot in Komodor ") + } }) } }) diff --git a/pkg/dashboard/static/index.html b/pkg/dashboard/static/index.html index aff332d..f077c8f 100644 --- a/pkg/dashboard/static/index.html +++ b/pkg/dashboard/static/index.html @@ -69,9 +69,15 @@
ResourceType