diff --git a/client/src/components/apps/appstats.vue b/client/src/components/apps/appstats.vue
index 2bee4fdaa..116770c0e 100644
--- a/client/src/components/apps/appstats.vue
+++ b/client/src/components/apps/appstats.vue
@@ -14,7 +14,7 @@
{{ $t('app.domains') }} |
- -
+
-
{{ host.host }}
mdi-open-in-new
diff --git a/client/src/components/apps/detail.vue b/client/src/components/apps/detail.vue
index bbb3da7f6..535e3aa81 100644
--- a/client/src/components/apps/detail.vue
+++ b/client/src/components/apps/detail.vue
@@ -74,7 +74,7 @@
-
+
@@ -177,7 +177,7 @@ export default defineComponent({
});
},
ActionOpenApp() {
- window.open(`https://${this.appData.spec.ingress.hosts[0].host}`, '_blank');
+ window.open(`https://${this.appData.spec.ingress?.hosts?.[0]?.host}`, '_blank');
},
ActionEditApp() {
this.$router.push(`/pipeline/${this.pipeline}/${this.phase}/apps/${this.app}`);
diff --git a/client/src/components/pipelines/appcard.vue b/client/src/components/pipelines/appcard.vue
index 4c416947a..ba0e5ed4d 100644
--- a/client/src/components/pipelines/appcard.vue
+++ b/client/src/components/pipelines/appcard.vue
@@ -89,7 +89,7 @@
-
+
{
- for (var i = 0; i < response.data.length; i++) {
- if (response.data[i].cpu.percentage != null && response.data[i].memory.percentage != null) {
- this.metricsDisplay = "bars";
- }
- if (
- (response.data[i].cpu.percentage == null && response.data[i].memory.percentage == null) &&
- (response.data[i].cpu.usage != null && response.data[i].memory.usage != null)
- ){
- this.metricsDisplay = "table";
- }
- }
- this.metrics = response.data;
+ const metrics = Array.isArray(response.data) ? response.data : [];
+ const allMetricsHavePercentages = metrics.length > 0 && metrics.every(
+ (metric: Metric) =>
+ metric.cpu.percentage != null &&
+ metric.memory.percentage != null
+ );
+ const hasUsageMetrics = metrics.some(
+ (metric: Metric) =>
+ metric.cpu.usage != null &&
+ metric.memory.usage != null
+ );
+
+ this.metricsDisplay = allMetricsHavePercentages
+ ? "bars"
+ : hasUsageMetrics
+ ? "table"
+ : "dots";
+ this.metrics = metrics;
})
.catch(error => {
console.log(error);
|