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 @@
- komodor.io +
+ Komodor + + Upgrade your HELM experience - Free +
+ Auth & RBAC, k8s events, troubleshooting and more +
+
@@ -89,7 +95,9 @@ -
Charts developers: you can also add local directories as chart source. Use --local-chart CLI switch to specify it.
+
Charts developers: you can also add local directories as chart source. Use + --local-chart CLI switch to specify it. +
@@ -305,6 +313,8 @@

+
+ Hint: Komodor has the same HELM capabilities, with enterprise features and support. Sign up for free.

ResourceType

- - +
+ See more details in Komodor + +
diff --git a/pkg/dashboard/static/komodor-icon.png b/pkg/dashboard/static/komodor-icon.png new file mode 100644 index 0000000..5444eb2 Binary files /dev/null and b/pkg/dashboard/static/komodor-icon.png differ diff --git a/pkg/dashboard/static/list-view.js b/pkg/dashboard/static/list-view.js index 77ab274..48adb43 100644 --- a/pkg/dashboard/static/list-view.js +++ b/pkg/dashboard/static/list-view.js @@ -89,13 +89,17 @@ function buildChartCard(elm) { } if (isNewerVersion(elm.chartVersion, data[0].version)) { - const icon = $("") + const icon = $("") if (data[0].isSuggestedRepo) { icon.addClass("bi-arrow-up-circle") } else { icon.addClass("bi-arrow-up-circle-fill") } card.find(".rel-name span").append(icon) + + const tooltipTriggerList = card.find('[data-bs-toggle="tooltip"]') + const tooltipList = [...tooltipTriggerList].map(tooltipTriggerEl => new bootstrap.Tooltip(tooltipTriggerEl)) + sendStats('upgradeIconShown', {'isProbable': data[0].isSuggestedRepo}) } }) diff --git a/pkg/dashboard/static/scripts.js b/pkg/dashboard/static/scripts.js index 1aa77b4..b3cbdad 100644 --- a/pkg/dashboard/static/scripts.js +++ b/pkg/dashboard/static/scripts.js @@ -356,4 +356,6 @@ function setFilteredNamespaces(filteredNamespaces) { } else if (filteredNamespaces.length !== 0) { setHashParam("filteredNamespace", filteredNamespaces.join('+')) } -} \ No newline at end of file +} + +const KomodorCTALink="https://www.komodor.com/helm-dash/?utm_campaign=Helm%20Dashboard%20%7C%20CTA&utm_source=helm-dash&utm_medium=cta&utm_content=helm-dash" \ No newline at end of file