瀏覽代碼

HUE-9249 [browser] Trim impala query and protect when missing

Romain 5 年之前
父節點
當前提交
f52078fb53
共有 1 個文件被更改,包括 8 次插入1 次删除
  1. 8 1
      apps/jobbrowser/src/jobbrowser/templates/job_browser.mako

+ 8 - 1
apps/jobbrowser/src/jobbrowser/templates/job_browser.mako

@@ -1628,7 +1628,14 @@ ${ commonheader("Job Browser", "jobbrowser", user, request) | n,unicode }
           <pre data-bind="visible:!properties.plan || !properties.plan().plan_json || !properties.plan().plan_json.plan_nodes.length" >${ _('The selected tab has no data') }</pre>
         </div>
         <div class="tab-pane" id="queries-page-stmt${ SUFFIX }" data-profile="plan">
-          <pre data-bind="highlight: { value: (properties.plan && properties.plan().stmt) || _('The selected tab has no data'), formatted: true, dialect: 'impala' }"/>
+          <!-- ko if: properties.plan && properties.plan().stmt -->
+            <pre data-bind="highlight: { value: properties.plan().stmt.trim(), formatted: true, dialect: 'impala' }"/>
+          <!-- /ko -->
+          <!-- ko ifnot: properties.plan && properties.plan().stmt -->
+            <pre>
+              ${ _('The selected tab has no data') }
+            </pre>
+          <!-- /ko -->
         </div>
         <div class="tab-pane" id="queries-page-plan-text${ SUFFIX }" data-profile="plan">
           <pre data-bind="text: (properties.plan && properties.plan().plan) || _('The selected tab has no data')"/>