Kaynağa Gözat

AMBARI-5595. Flume Summary: message should be appeared if there is no records in the table. (akovalenko)

Aleksandr Kovalenko 11 yıl önce
ebeveyn
işleme
8471f06b4c

+ 1 - 0
ambari-web/app/messages.js

@@ -1094,6 +1094,7 @@ Em.I18n.translations = {
   'services.service.summary.flume.stopAgent': 'Stop Agent',
   'services.service.summary.flume.stop.context': 'Stop Flume Agent {0}',
   'services.service.summary.flume.start.context': 'Start Flume Agent {0}',
+  'services.service.summary.flume.noAgents': 'No Flume Agents to display',
 
   'services.service.info.metrics.flume.channelFillPercent':'Channel Fill Percentage',
   'services.service.info.metrics.flume.channelSize':'Channel Size',

+ 4 - 0
ambari-web/app/styles/application.less

@@ -6340,6 +6340,10 @@ i.icon-asterisks {
     .agent-row {
       cursor: pointer;
     }
+    .empty-label {
+      border-top: 1px solid #dddddd;
+      text-align: center
+    }
   }
   .flume-agents-actions {
     margin: 0 5px 5px 0;

+ 31 - 23
ambari-web/app/templates/main/service/services/flume.hbs

@@ -51,30 +51,38 @@
           {{/view}}
           </thead>
           <tbody>
-          {{#each agent in view.pageContent}}
-            {{#view view.agentView contentBinding="agent"}}
-              <td class="agent-status">
-                <span {{bindAttr class="agent.healthClass"}}></span>
+          {{#if view.pageContent}}
+            {{#each agent in view.pageContent}}
+              {{#view view.agentView contentBinding="agent"}}
+                <td class="agent-status">
+                  <span {{bindAttr class="agent.healthClass"}}></span>
+                </td>
+                <td class="agent-name">
+                  {{agent.name}}
+                </td>
+                <td class="agent-host-name">
+                  <a href="javascript:void(null)" {{action showDetails agent.host}}>
+                    {{agent.host.hostName}}
+                  </a>
+                </td>
+                <td>
+                  {{agent.sourcesCount}}
+                </td>
+                <td>
+                  {{agent.channelsCount}}
+                </td>
+                <td>
+                  {{agent.sinksCount}}
+                </td>
+              {{/view}}
+            {{/each}}
+          {{else}}
+            <tr>
+              <td colspan="6" class="empty-label">
+                {{t services.service.summary.flume.noAgents}}
               </td>
-              <td class="agent-name">
-                {{agent.name}}
-              </td>
-              <td class="agent-host-name">
-                <a href="javascript:void(null)" {{action showDetails agent.host}}>
-                  {{agent.host.hostName}}
-                </a>
-              </td>
-              <td>
-                {{agent.sourcesCount}}
-              </td>
-              <td>
-                {{agent.channelsCount}}
-              </td>
-              <td>
-                {{agent.sinksCount}}
-              </td>
-            {{/view}}
-          {{/each}}
+            </tr>
+          {{/if}}
           </tbody>
         </table>
       </div>