From ba09d0ded1d3422e9cd163de2a368952a82748fd Mon Sep 17 00:00:00 2001 From: Ethan Date: Sun, 4 Feb 2018 17:00:29 -0800 Subject: [PATCH 1/3] Treats custom tab (e.g., Logs) content as text, instead of HTML. Fixes #331. --- .../resources/com/netflix/exhibitor/core/ui/js/exhibitor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exhibitor-core/src/main/resources/com/netflix/exhibitor/core/ui/js/exhibitor.js b/exhibitor-core/src/main/resources/com/netflix/exhibitor/core/ui/js/exhibitor.js index e9a5e3fb..5e2b1346 100644 --- a/exhibitor-core/src/main/resources/com/netflix/exhibitor/core/ui/js/exhibitor.js +++ b/exhibitor-core/src/main/resources/com/netflix/exhibitor/core/ui/js/exhibitor.js @@ -459,7 +459,7 @@ function refreshCurrentTab() { var index = selected - BUILTIN_TAB_QTY; if ( (customTabs[index].type === "simple") || customTabs[index].firstTime ) { - $("#" + customTabs[index].contentId).load(customTabs[index].url); + $.get(customTabs[index].url, function( data ) { $("#" + customTabs[index].contentId).text(data); }); customTabs[index].firstTime = false; } } From 38fae1eb696155aefac6287622da41cf5fdeb12f Mon Sep 17 00:00:00 2001 From: Ethan Date: Sun, 4 Feb 2018 22:03:57 -0800 Subject: [PATCH 2/3] Fixes a possible regression: A creator of a UITab may designate the tab to serve HTML content. This is reflected in the "html" variable of the corresponding UITabSpec. The previous commit for issue #331 would have rendered all custom tab content as plain text, which may have ruined someone's day if they were hoping that their custom tab's content would render as HTML. This change renders custom tab content as text or HTML depending on the "html" variable. For the Log tab, the content is plain text. --- .../com/netflix/exhibitor/core/ui/js/exhibitor.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/exhibitor-core/src/main/resources/com/netflix/exhibitor/core/ui/js/exhibitor.js b/exhibitor-core/src/main/resources/com/netflix/exhibitor/core/ui/js/exhibitor.js index 5e2b1346..37a7c498 100644 --- a/exhibitor-core/src/main/resources/com/netflix/exhibitor/core/ui/js/exhibitor.js +++ b/exhibitor-core/src/main/resources/com/netflix/exhibitor/core/ui/js/exhibitor.js @@ -459,7 +459,16 @@ function refreshCurrentTab() { var index = selected - BUILTIN_TAB_QTY; if ( (customTabs[index].type === "simple") || customTabs[index].firstTime ) { - $.get(customTabs[index].url, function( data ) { $("#" + customTabs[index].contentId).text(data); }); + $.get(customTabs[index].url, + function( data ) { + var destination = $("#" + customTabs[index].contentId); + if ( customTabs[index].html === true ) { + destination.html(data); + } else { + destination.text(data); + } + } + ); customTabs[index].firstTime = false; } } @@ -600,6 +609,7 @@ $(function () tabData.contentId = 'tabs-custom-content' + i; tabData.url = uiTabSpec[i].url; tabData.type = uiTabSpec[i].type; + tabData.html = uiTabSpec[i].html; tabData.firstTime = true; customTabs[i] = tabData; From f9ffc677546a35fbb3f3e1bf654870594ce2a3c7 Mon Sep 17 00:00:00 2001 From: Ethan Date: Mon, 5 Feb 2018 22:38:01 -0800 Subject: [PATCH 3/3] Adds a blank line to trigger a Travis rebuild. --- .../main/resources/com/netflix/exhibitor/core/ui/js/exhibitor.js | 1 + 1 file changed, 1 insertion(+) diff --git a/exhibitor-core/src/main/resources/com/netflix/exhibitor/core/ui/js/exhibitor.js b/exhibitor-core/src/main/resources/com/netflix/exhibitor/core/ui/js/exhibitor.js index 37a7c498..d544b75c 100644 --- a/exhibitor-core/src/main/resources/com/netflix/exhibitor/core/ui/js/exhibitor.js +++ b/exhibitor-core/src/main/resources/com/netflix/exhibitor/core/ui/js/exhibitor.js @@ -469,6 +469,7 @@ function refreshCurrentTab() } } ); + customTabs[index].firstTime = false; } }