----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/57265/ -----------------------------------------------------------
(Updated 六月 9, 2017, 9:59 a.m.) Review request for Ambari, Aleksandr Kovalenko, Zhe (Joe) Wang, and Yusaku Sako. Summary (updated) ----------------- null in heapmap page Bugs: AMBARI-20290 https://issues.apache.org/jira/browse/AMBARI-20290 Repository: ambari Description ------- The value, which obtained from method "this.get('displayName')" with name attribute and is inside of method "drawWidget", is always null. Probably should use "this.get('displayName')" method to assign the obtained value to "this.get('content.widgetName')". The heatmap cann't load as follows: setMetric: function (view, host) { var selectedMetric = this.get('controller.selectedMetric'); if (selectedMetric) { var metricName = selectedMetric.get('name'); var h2vMap = selectedMetric.get('hostToValueMap'); if (h2vMap && metricName) { var value = h2vMap[host.hostName]; if (Em.isNone(value)) { value = this.t('charts.heatmap.unknown'); } else { if (metricName == 'Garbage Collection Time') { value = date.timingFormat(parseInt(value)); } else { if (isNaN(value)) { value = this.t('charts.heatmap.unknown'); } else { value = value + selectedMetric.get('units'); } } } view.set('details.metricName', metricName); view.set('details.metricValue', value); } } }, because the metricName is always null, the if condition cannot execute. Diffs ----- ambari-web/app/views/common/widget/heatmap_widget_view.js a7a919b Diff: https://reviews.apache.org/r/57265/diff/1/ Testing ------- done it File Attachments ---------------- AMBARI-20290.patch https://reviews.apache.org/media/uploaded/files/2017/03/03/6f22b669-2cd5-4cd7-ae66-693a736811b0__AMBARI-20290.patch before.png https://reviews.apache.org/media/uploaded/files/2017/03/10/db183b48-6294-4103-9811-3d3c34f20a79__before.png after.png https://reviews.apache.org/media/uploaded/files/2017/03/10/2aeda32b-6d2f-40ee-91cd-16a85dc20aca__after.png Thanks, zhangxiaolu zhangxiaolu