From 800f3948702be34a56ee5395b0ad1fa003e99372 Mon Sep 17 00:00:00 2001 From: Benjamin Neff Date: Mon, 31 Oct 2022 01:08:34 +0100 Subject: Show ports on pods list otherwise pods with different ports (or without port) all look the same, like if they are duplicates --- app/assets/javascripts/app/views/pod_entry_view.js | 1 + app/assets/templates/pod_table_entry_tpl.jst.hbs | 2 +- spec/javascripts/app/views/pod_entry_view_spec.js | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/app/views/pod_entry_view.js b/app/assets/javascripts/app/views/pod_entry_view.js index 5e45267d1..3d3d098ab 100644 --- a/app/assets/javascripts/app/views/pod_entry_view.js +++ b/app/assets/javascripts/app/views/pod_entry_view.js @@ -27,6 +27,7 @@ app.views.PodEntry = app.views.Base.extend({ presenter: function() { return _.extend({}, this.defaultPresenter(), { /* jshint camelcase: false */ + hasPort: (this.model.get("port") >= 0), is_unchecked: (this.model.get("status")==="unchecked"), has_no_errors: (this.model.get("status")==="no_errors"), has_errors: (this.model.get("status")!=="no_errors"), diff --git a/app/assets/templates/pod_table_entry_tpl.jst.hbs b/app/assets/templates/pod_table_entry_tpl.jst.hbs index 3c2bb0605..76940a4a5 100644 --- a/app/assets/templates/pod_table_entry_tpl.jst.hbs +++ b/app/assets/templates/pod_table_entry_tpl.jst.hbs @@ -7,7 +7,7 @@ {{/if}} -{{host}} +{{host}}{{#if hasPort}}:{{port}}{{/if}} diff --git a/spec/javascripts/app/views/pod_entry_view_spec.js b/spec/javascripts/app/views/pod_entry_view_spec.js index c7b6f8968..8840cd022 100644 --- a/spec/javascripts/app/views/pod_entry_view_spec.js +++ b/spec/javascripts/app/views/pod_entry_view_spec.js @@ -36,6 +36,7 @@ describe("app.views.PodEntry", function() { var actual = this.view.presenter(); expect(actual).toEqual(jasmine.objectContaining({ /* jshint camelcase: false */ + hasPort: false, is_unchecked: false, has_no_errors: true, has_errors: false, -- cgit v1.2.3