Repository: ambari Updated Branches: refs/heads/branch-1.7.0 b13c8c00f -> 6850d77c4
AMBARI-7692. Slider View: UI should hide metrics section if graphs have no data. (onechiporenko) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/6850d77c Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/6850d77c Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/6850d77c Branch: refs/heads/branch-1.7.0 Commit: 6850d77c4b76a669c264fc56a64e307e2ce94791 Parents: b13c8c0 Author: Oleg Nechiporenko <onechipore...@apache.org> Authored: Wed Oct 8 19:10:56 2014 +0300 Committer: Oleg Nechiporenko <onechipore...@apache.org> Committed: Wed Oct 8 19:10:56 2014 +0300 ---------------------------------------------------------------------- .../resources/ui/app/assets/data/apps/apps.json | 6 +- .../ui/app/assets/data/metrics/metric.json | 3756 +++++------------- .../src/main/resources/ui/app/helpers/helper.js | 4 +- .../main/resources/ui/app/models/slider_app.js | 10 +- .../ui/app/templates/slider_app/summary.hbs | 40 +- .../resources/ui/app/views/common/chart_view.js | 12 +- .../views/slider_app/metrics/app_metric_view.js | 18 +- .../ui/app/views/slider_app/summary_view.js | 80 +- .../ui/test/unit/models/slider_app_test.js | 4 +- .../unit/views/slider_app/summary_view_test.js | 68 + 10 files changed, 1109 insertions(+), 2889 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/6850d77c/contrib/views/slider/src/main/resources/ui/app/assets/data/apps/apps.json ---------------------------------------------------------------------- diff --git a/contrib/views/slider/src/main/resources/ui/app/assets/data/apps/apps.json b/contrib/views/slider/src/main/resources/ui/app/assets/data/apps/apps.json index 29760c0..1802c5a 100644 --- a/contrib/views/slider/src/main/resources/ui/app/assets/data/apps/apps.json +++ b/contrib/views/slider/src/main/resources/ui/app/assets/data/apps/apps.json @@ -18,6 +18,10 @@ "version" : "1.0.0", "view_name" : "SLIDER", "yarnId" : "application_1409333994422_0005", + "supportedMetrics" : [ + "firstMetric", + "secondMetric" + ], "alerts" : { "detail" : [ { @@ -1313,4 +1317,4 @@ } } ] -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/ambari/blob/6850d77c/contrib/views/slider/src/main/resources/ui/app/assets/data/metrics/metric.json ---------------------------------------------------------------------- diff --git a/contrib/views/slider/src/main/resources/ui/app/assets/data/metrics/metric.json b/contrib/views/slider/src/main/resources/ui/app/assets/data/metrics/metric.json index a6eafd0..3f215f9 100644 --- a/contrib/views/slider/src/main/resources/ui/app/assets/data/metrics/metric.json +++ b/contrib/views/slider/src/main/resources/ui/app/assets/data/metrics/metric.json @@ -1,2818 +1,946 @@ { "metrics" : { - "dfs" : { - "FSNamesystem" : { - "CapacityRemainingGB" : [ - [ - 5.0, - 1401351555 - ], - [ - 5.0, - 1401351570 - ], - [ - 5.0, - 1401351585 - ], - [ - 5.0, - 1401351600 - ], - [ - 5.0, - 1401351615 - ], - [ - 5.0, - 1401351630 - ], - [ - 5.0, - 1401351645 - ], - [ - 5.0, - 1401351660 - ], - [ - 5.0, - 1401351675 - ], - [ - 5.0, - 1401351690 - ], - [ - 5.0, - 1401351705 - ], - [ - 5.0, - 1401351720 - ], - [ - 5.0, - 1401351735 - ], - [ - 5.0, - 1401351750 - ], - [ - 5.0, - 1401351765 - ], - [ - 5.0, - 1401351780 - ], - [ - 5.0, - 1401351795 - ], - [ - 5.0, - 1401351810 - ], - [ - 5.0, - 1401351825 - ], - [ - 5.0, - 1401351840 - ], - [ - 5.0, - 1401351855 - ], - [ - 5.0, - 1401351870 - ], - [ - 5.0, - 1401351885 - ], - [ - 5.0, - 1401351900 - ], - [ - 5.0, - 1401351915 - ], - [ - 5.0, - 1401351930 - ], - [ - 5.0, - 1401351945 - ], - [ - 5.0, - 1401351960 - ], - [ - 5.0, - 1401351975 - ], - [ - 5.0, - 1401351990 - ], - [ - 5.0, - 1401352005 - ], - [ - 5.0, - 1401352020 - ], - [ - 5.0, - 1401352035 - ], - [ - 5.0, - 1401352050 - ], - [ - 5.0, - 1401352065 - ], - [ - 5.0, - 1401352080 - ], - [ - 5.0, - 1401352095 - ], - [ - 5.0, - 1401352110 - ], - [ - 5.0, - 1401352125 - ], - [ - 5.0, - 1401352140 - ], - [ - 5.0, - 1401352155 - ], - [ - 5.0, - 1401352170 - ], - [ - 5.0, - 1401352185 - ], - [ - 5.0, - 1401352200 - ], - [ - 5.0, - 1401352215 - ], - [ - 5.0, - 1401352230 - ], - [ - 5.0, - 1401352245 - ], - [ - 5.0, - 1401352260 - ], - [ - 5.0, - 1401352275 - ], - [ - 5.0, - 1401352290 - ], - [ - 5.0, - 1401352305 - ], - [ - 5.0, - 1401352320 - ], - [ - 5.0, - 1401352335 - ], - [ - 5.0, - 1401352350 - ], - [ - 5.0, - 1401352365 - ], - [ - 5.0, - 1401352380 - ], - [ - 5.0, - 1401352395 - ], - [ - 5.0, - 1401352410 - ], - [ - 5.0, - 1401352425 - ], - [ - 5.0, - 1401352440 - ], - [ - 5.0, - 1401352455 - ], - [ - 5.0, - 1401352470 - ], - [ - 5.0, - 1401352485 - ], - [ - 5.0, - 1401352500 - ], - [ - 5.0, - 1401352515 - ], - [ - 5.0, - 1401352530 - ], - [ - 5.0, - 1401352545 - ], - [ - 5.0, - 1401352560 - ], - [ - 5.0, - 1401352575 - ], - [ - 5.0, - 1401352590 - ], - [ - 5.0, - 1401352605 - ], - [ - 5.0, - 1401352620 - ], - [ - 5.0, - 1401352635 - ], - [ - 5.0, - 1401352650 - ], - [ - 5.0, - 1401352665 - ], - [ - 5.0, - 1401352680 - ], - [ - 5.0, - 1401352695 - ], - [ - 5.0, - 1401352710 - ], - [ - 5.0, - 1401352725 - ], - [ - 5.0, - 1401352740 - ], - [ - 5.0, - 1401352755 - ], - [ - 5.0, - 1401352770 - ], - [ - 5.0, - 1401352785 - ], - [ - 5.0, - 1401352800 - ], - [ - 5.0, - 1401352815 - ], - [ - 5.0, - 1401352830 - ], - [ - 5.0, - 1401352845 - ], - [ - 5.0, - 1401352860 - ], - [ - 5.0, - 1401352875 - ], - [ - 5.0, - 1401352890 - ], - [ - 5.0, - 1401352905 - ], - [ - 5.0, - 1401352920 - ], - [ - 5.0, - 1401352935 - ], - [ - 5.0, - 1401352950 - ], - [ - 5.0, - 1401352965 - ], - [ - 5.0, - 1401352980 - ], - [ - 5.0, - 1401352995 - ], - [ - 5.0, - 1401353010 - ], - [ - 5.0, - 1401353025 - ], - [ - 5.0, - 1401353040 - ], - [ - 5.0, - 1401353055 - ], - [ - 5.0, - 1401353070 - ], - [ - 5.0, - 1401353085 - ], - [ - 5.0, - 1401353100 - ], - [ - 5.0, - 1401353115 - ], - [ - 5.0, - 1401353130 - ], - [ - 5.0, - 1401353145 - ], - [ - 5.0, - 1401353160 - ], - [ - 5.0, - 1401353175 - ], - [ - 5.0, - 1401353190 - ], - [ - 5.0, - 1401353205 - ], - [ - 5.0, - 1401353220 - ], - [ - 5.0, - 1401353235 - ], - [ - 5.0, - 1401353250 - ], - [ - 5.0, - 1401353265 - ], - [ - 5.0, - 1401353280 - ], - [ - 5.0, - 1401353295 - ], - [ - 5.0, - 1401353310 - ], - [ - 5.0, - 1401353325 - ], - [ - 5.0, - 1401353340 - ], - [ - 5.0, - 1401353355 - ], - [ - 5.0, - 1401353370 - ], - [ - 5.0, - 1401353385 - ], - [ - 5.0, - 1401353400 - ], - [ - 5.0, - 1401353415 - ], - [ - 5.0, - 1401353430 - ], - [ - 5.0, - 1401353445 - ], - [ - 5.0, - 1401353460 - ], - [ - 5.0, - 1401353475 - ], - [ - 5.0, - 1401353490 - ], - [ - 5.0, - 1401353505 - ], - [ - 5.0, - 1401353520 - ], - [ - 5.0, - 1401353535 - ], - [ - 5.0, - 1401353550 - ], - [ - 5.0, - 1401353565 - ], - [ - 5.0, - 1401353580 - ], - [ - 5.0, - 1401353595 - ], - [ - 5.0, - 1401353610 - ], - [ - 5.0, - 1401353625 - ], - [ - 5.0, - 1401353640 - ], - [ - 5.0, - 1401353655 - ], - [ - 5.0, - 1401353670 - ], - [ - 5.0, - 1401353685 - ], - [ - 5.0, - 1401353700 - ], - [ - 5.0, - 1401353715 - ], - [ - 5.0, - 1401353730 - ], - [ - 5.0, - 1401353745 - ], - [ - 5.0, - 1401353760 - ], - [ - 5.0, - 1401353775 - ], - [ - 5.0, - 1401353790 - ], - [ - 5.0, - 1401353805 - ], - [ - 5.0, - 1401353820 - ], - [ - 5.0, - 1401353835 - ], - [ - 5.0, - 1401353850 - ], - [ - 5.0, - 1401353865 - ], - [ - 5.0, - 1401353880 - ], - [ - 5.0, - 1401353895 - ], - [ - 5.0, - 1401353910 - ], - [ - 5.0, - 1401353925 - ], - [ - 5.0, - 1401353940 - ], - [ - 5.0, - 1401353955 - ], - [ - 5.0, - 1401353970 - ], - [ - 5.0, - 1401353985 - ], - [ - 5.0, - 1401354000 - ], - [ - 5.0, - 1401354015 - ], - [ - 5.0, - 1401354030 - ], - [ - 5.0, - 1401354045 - ], - [ - 5.0, - 1401354060 - ], - [ - 5.0, - 1401354075 - ], - [ - 5.0, - 1401354090 - ], - [ - 5.0, - 1401354105 - ], - [ - 5.0, - 1401354120 - ], - [ - 5.0, - 1401354135 - ], - [ - 5.0, - 1401354150 - ], - [ - 5.0, - 1401354165 - ], - [ - 5.0, - 1401354180 - ], - [ - 5.0, - 1401354195 - ], - [ - 5.0, - 1401354210 - ], - [ - 5.0, - 1401354225 - ], - [ - 5.0, - 1401354240 - ], - [ - 5.0, - 1401354255 - ], - [ - 5.0, - 1401354270 - ], - [ - 5.0, - 1401354285 - ], - [ - 5.0, - 1401354300 - ], - [ - 5.0, - 1401354315 - ], - [ - 5.0, - 1401354330 - ], - [ - 5.0, - 1401354345 - ], - [ - 5.0, - 1401354360 - ], - [ - 5.0, - 1401354375 - ], - [ - 5.0, - 1401354390 - ], - [ - 5.0, - 1401354405 - ], - [ - 5.0, - 1401354420 - ], - [ - 5.0, - 1401354435 - ], - [ - 5.0, - 1401354450 - ], - [ - 5.0, - 1401354465 - ], - [ - 5.0, - 1401354480 - ], - [ - 5.0, - 1401354495 - ], - [ - 5.0, - 1401354510 - ], - [ - 5.0, - 1401354525 - ], - [ - 5.0, - 1401354540 - ], - [ - 5.0, - 1401354555 - ], - [ - 5.0, - 1401354570 - ], - [ - 5.0, - 1401354585 - ], - [ - 5.0, - 1401354600 - ], - [ - 5.0, - 1401354615 - ], - [ - 5.0, - 1401354630 - ], - [ - 5.0, - 1401354645 - ], - [ - 5.0, - 1401354660 - ], - [ - 5.0, - 1401354675 - ], - [ - 5.0, - 1401354690 - ], - [ - 5.0, - 1401354705 - ], - [ - 5.0, - 1401354720 - ], - [ - 5.0, - 1401354735 - ], - [ - 5.0, - 1401354750 - ], - [ - 5.0, - 1401354765 - ], - [ - 5.0, - 1401354780 - ], - [ - 5.0, - 1401354795 - ], - [ - 5.0, - 1401354810 - ], - [ - 5.0, - 1401354825 - ], - [ - 5.0, - 1401354840 - ], - [ - 5.0, - 1401354855 - ], - [ - 5.0, - 1401354870 - ], - [ - 5.0, - 1401354885 - ], - [ - 5.0, - 1401354900 - ], - [ - 5.0, - 1401354915 - ], - [ - 5.0, - 1401354930 - ], - [ - 5.0, - 1401354945 - ], - [ - 5.0, - 1401354960 - ], - [ - 5.0, - 1401354975 - ], - [ - 5.0, - 1401354990 - ], - [ - 5.0, - 1401355005 - ], - [ - 5.0, - 1401355020 - ], - [ - 5.0, - 1401355035 - ], - [ - 5.0, - 1401355050 - ], - [ - 5.0, - 1401355065 - ] - ], - "CapacityTotalGB" : [ - [ - 9.0, - 1401351555 - ], - [ - 9.0, - 1401351570 - ], - [ - 9.0, - 1401351585 - ], - [ - 9.0, - 1401351600 - ], - [ - 9.0, - 1401351615 - ], - [ - 9.0, - 1401351630 - ], - [ - 9.0, - 1401351645 - ], - [ - 9.0, - 1401351660 - ], - [ - 9.0, - 1401351675 - ], - [ - 9.0, - 1401351690 - ], - [ - 9.0, - 1401351705 - ], - [ - 9.0, - 1401351720 - ], - [ - 9.0, - 1401351735 - ], - [ - 9.0, - 1401351750 - ], - [ - 9.0, - 1401351765 - ], - [ - 9.0, - 1401351780 - ], - [ - 9.0, - 1401351795 - ], - [ - 9.0, - 1401351810 - ], - [ - 9.0, - 1401351825 - ], - [ - 9.0, - 1401351840 - ], - [ - 9.0, - 1401351855 - ], - [ - 9.0, - 1401351870 - ], - [ - 9.0, - 1401351885 - ], - [ - 9.0, - 1401351900 - ], - [ - 9.0, - 1401351915 - ], - [ - 9.0, - 1401351930 - ], - [ - 9.0, - 1401351945 - ], - [ - 9.0, - 1401351960 - ], - [ - 9.0, - 1401351975 - ], - [ - 9.0, - 1401351990 - ], - [ - 9.0, - 1401352005 - ], - [ - 9.0, - 1401352020 - ], - [ - 9.0, - 1401352035 - ], - [ - 9.0, - 1401352050 - ], - [ - 9.0, - 1401352065 - ], - [ - 9.0, - 1401352080 - ], - [ - 9.0, - 1401352095 - ], - [ - 9.0, - 1401352110 - ], - [ - 9.0, - 1401352125 - ], - [ - 9.0, - 1401352140 - ], - [ - 9.0, - 1401352155 - ], - [ - 9.0, - 1401352170 - ], - [ - 9.0, - 1401352185 - ], - [ - 9.0, - 1401352200 - ], - [ - 9.0, - 1401352215 - ], - [ - 9.0, - 1401352230 - ], - [ - 9.0, - 1401352245 - ], - [ - 9.0, - 1401352260 - ], - [ - 9.0, - 1401352275 - ], - [ - 9.0, - 1401352290 - ], - [ - 9.0, - 1401352305 - ], - [ - 9.0, - 1401352320 - ], - [ - 9.0, - 1401352335 - ], - [ - 9.0, - 1401352350 - ], - [ - 9.0, - 1401352365 - ], - [ - 9.0, - 1401352380 - ], - [ - 9.0, - 1401352395 - ], - [ - 9.0, - 1401352410 - ], - [ - 9.0, - 1401352425 - ], - [ - 9.0, - 1401352440 - ], - [ - 9.0, - 1401352455 - ], - [ - 9.0, - 1401352470 - ], - [ - 9.0, - 1401352485 - ], - [ - 9.0, - 1401352500 - ], - [ - 9.0, - 1401352515 - ], - [ - 9.0, - 1401352530 - ], - [ - 9.0, - 1401352545 - ], - [ - 9.0, - 1401352560 - ], - [ - 9.0, - 1401352575 - ], - [ - 9.0, - 1401352590 - ], - [ - 9.0, - 1401352605 - ], - [ - 9.0, - 1401352620 - ], - [ - 9.0, - 1401352635 - ], - [ - 9.0, - 1401352650 - ], - [ - 9.0, - 1401352665 - ], - [ - 9.0, - 1401352680 - ], - [ - 9.0, - 1401352695 - ], - [ - 9.0, - 1401352710 - ], - [ - 9.0, - 1401352725 - ], - [ - 9.0, - 1401352740 - ], - [ - 9.0, - 1401352755 - ], - [ - 9.0, - 1401352770 - ], - [ - 9.0, - 1401352785 - ], - [ - 9.0, - 1401352800 - ], - [ - 9.0, - 1401352815 - ], - [ - 9.0, - 1401352830 - ], - [ - 9.0, - 1401352845 - ], - [ - 9.0, - 1401352860 - ], - [ - 9.0, - 1401352875 - ], - [ - 9.0, - 1401352890 - ], - [ - 9.0, - 1401352905 - ], - [ - 9.0, - 1401352920 - ], - [ - 9.0, - 1401352935 - ], - [ - 9.0, - 1401352950 - ], - [ - 9.0, - 1401352965 - ], - [ - 9.0, - 1401352980 - ], - [ - 9.0, - 1401352995 - ], - [ - 9.0, - 1401353010 - ], - [ - 9.0, - 1401353025 - ], - [ - 9.0, - 1401353040 - ], - [ - 9.0, - 1401353055 - ], - [ - 9.0, - 1401353070 - ], - [ - 9.0, - 1401353085 - ], - [ - 9.0, - 1401353100 - ], - [ - 9.0, - 1401353115 - ], - [ - 9.0, - 1401353130 - ], - [ - 9.0, - 1401353145 - ], - [ - 9.0, - 1401353160 - ], - [ - 9.0, - 1401353175 - ], - [ - 9.0, - 1401353190 - ], - [ - 9.0, - 1401353205 - ], - [ - 9.0, - 1401353220 - ], - [ - 9.0, - 1401353235 - ], - [ - 9.0, - 1401353250 - ], - [ - 9.0, - 1401353265 - ], - [ - 9.0, - 1401353280 - ], - [ - 9.0, - 1401353295 - ], - [ - 9.0, - 1401353310 - ], - [ - 9.0, - 1401353325 - ], - [ - 9.0, - 1401353340 - ], - [ - 9.0, - 1401353355 - ], - [ - 9.0, - 1401353370 - ], - [ - 9.0, - 1401353385 - ], - [ - 9.0, - 1401353400 - ], - [ - 9.0, - 1401353415 - ], - [ - 9.0, - 1401353430 - ], - [ - 9.0, - 1401353445 - ], - [ - 9.0, - 1401353460 - ], - [ - 9.0, - 1401353475 - ], - [ - 9.0, - 1401353490 - ], - [ - 9.0, - 1401353505 - ], - [ - 9.0, - 1401353520 - ], - [ - 9.0, - 1401353535 - ], - [ - 9.0, - 1401353550 - ], - [ - 9.0, - 1401353565 - ], - [ - 9.0, - 1401353580 - ], - [ - 9.0, - 1401353595 - ], - [ - 9.0, - 1401353610 - ], - [ - 9.0, - 1401353625 - ], - [ - 9.0, - 1401353640 - ], - [ - 9.0, - 1401353655 - ], - [ - 9.0, - 1401353670 - ], - [ - 9.0, - 1401353685 - ], - [ - 9.0, - 1401353700 - ], - [ - 9.0, - 1401353715 - ], - [ - 9.0, - 1401353730 - ], - [ - 9.0, - 1401353745 - ], - [ - 9.0, - 1401353760 - ], - [ - 9.0, - 1401353775 - ], - [ - 9.0, - 1401353790 - ], - [ - 9.0, - 1401353805 - ], - [ - 9.0, - 1401353820 - ], - [ - 9.0, - 1401353835 - ], - [ - 9.0, - 1401353850 - ], - [ - 9.0, - 1401353865 - ], - [ - 9.0, - 1401353880 - ], - [ - 9.0, - 1401353895 - ], - [ - 9.0, - 1401353910 - ], - [ - 9.0, - 1401353925 - ], - [ - 9.0, - 1401353940 - ], - [ - 9.0, - 1401353955 - ], - [ - 9.0, - 1401353970 - ], - [ - 9.0, - 1401353985 - ], - [ - 9.0, - 1401354000 - ], - [ - 9.0, - 1401354015 - ], - [ - 9.0, - 1401354030 - ], - [ - 9.0, - 1401354045 - ], - [ - 9.0, - 1401354060 - ], - [ - 9.0, - 1401354075 - ], - [ - 9.0, - 1401354090 - ], - [ - 9.0, - 1401354105 - ], - [ - 9.0, - 1401354120 - ], - [ - 9.0, - 1401354135 - ], - [ - 9.0, - 1401354150 - ], - [ - 9.0, - 1401354165 - ], - [ - 9.0, - 1401354180 - ], - [ - 9.0, - 1401354195 - ], - [ - 9.0, - 1401354210 - ], - [ - 9.0, - 1401354225 - ], - [ - 9.0, - 1401354240 - ], - [ - 9.0, - 1401354255 - ], - [ - 9.0, - 1401354270 - ], - [ - 9.0, - 1401354285 - ], - [ - 9.0, - 1401354300 - ], - [ - 9.0, - 1401354315 - ], - [ - 9.0, - 1401354330 - ], - [ - 9.0, - 1401354345 - ], - [ - 9.0, - 1401354360 - ], - [ - 9.0, - 1401354375 - ], - [ - 9.0, - 1401354390 - ], - [ - 9.0, - 1401354405 - ], - [ - 9.0, - 1401354420 - ], - [ - 9.0, - 1401354435 - ], - [ - 9.0, - 1401354450 - ], - [ - 9.0, - 1401354465 - ], - [ - 9.0, - 1401354480 - ], - [ - 9.0, - 1401354495 - ], - [ - 9.0, - 1401354510 - ], - [ - 9.0, - 1401354525 - ], - [ - 9.0, - 1401354540 - ], - [ - 9.0, - 1401354555 - ], - [ - 9.0, - 1401354570 - ], - [ - 9.0, - 1401354585 - ], - [ - 9.0, - 1401354600 - ], - [ - 9.0, - 1401354615 - ], - [ - 9.0, - 1401354630 - ], - [ - 9.0, - 1401354645 - ], - [ - 9.0, - 1401354660 - ], - [ - 9.0, - 1401354675 - ], - [ - 9.0, - 1401354690 - ], - [ - 9.0, - 1401354705 - ], - [ - 9.0, - 1401354720 - ], - [ - 9.0, - 1401354735 - ], - [ - 9.0, - 1401354750 - ], - [ - 9.0, - 1401354765 - ], - [ - 9.0, - 1401354780 - ], - [ - 9.0, - 1401354795 - ], - [ - 9.0, - 1401354810 - ], - [ - 9.0, - 1401354825 - ], - [ - 9.0, - 1401354840 - ], - [ - 9.0, - 1401354855 - ], - [ - 9.0, - 1401354870 - ], - [ - 9.0, - 1401354885 - ], - [ - 9.0, - 1401354900 - ], - [ - 9.0, - 1401354915 - ], - [ - 9.0, - 1401354930 - ], - [ - 9.0, - 1401354945 - ], - [ - 9.0, - 1401354960 - ], - [ - 9.0, - 1401354975 - ], - [ - 9.0, - 1401354990 - ], - [ - 9.0, - 1401355005 - ] - ], - "CapacityUsedGB" : [ - [ - 0.0, - 1401351555 - ], - [ - 0.0, - 1401351570 - ], - [ - 0.0, - 1401351585 - ], - [ - 0.0, - 1401351600 - ], - [ - 0.0, - 1401351615 - ], - [ - 0.0, - 1401351630 - ], - [ - 0.0, - 1401351645 - ], - [ - 0.0, - 1401351660 - ], - [ - 0.0, - 1401351675 - ], - [ - 0.0, - 1401351690 - ], - [ - 0.0, - 1401351705 - ], - [ - 0.0, - 1401351720 - ], - [ - 0.0, - 1401351735 - ], - [ - 0.0, - 1401351750 - ], - [ - 0.0, - 1401351765 - ], - [ - 0.0, - 1401351780 - ], - [ - 0.0, - 1401351795 - ], - [ - 0.0, - 1401351810 - ], - [ - 0.0, - 1401351825 - ], - [ - 0.0, - 1401351840 - ], - [ - 0.0, - 1401351855 - ], - [ - 0.0, - 1401351870 - ], - [ - 0.0, - 1401351885 - ], - [ - 0.0, - 1401351900 - ], - [ - 0.0, - 1401351915 - ], - [ - 0.0, - 1401351930 - ], - [ - 0.0, - 1401351945 - ], - [ - 0.0, - 1401351960 - ], - [ - 0.0, - 1401351975 - ], - [ - 0.0, - 1401351990 - ], - [ - 0.0, - 1401352005 - ], - [ - 0.0, - 1401352020 - ], - [ - 0.0, - 1401352035 - ], - [ - 0.0, - 1401352050 - ], - [ - 0.0, - 1401352065 - ], - [ - 0.0, - 1401352080 - ], - [ - 0.0, - 1401352095 - ], - [ - 0.0, - 1401352110 - ], - [ - 0.0, - 1401352125 - ], - [ - 0.0, - 1401352140 - ], - [ - 0.0, - 1401352155 - ], - [ - 0.0, - 1401352170 - ], - [ - 0.0, - 1401352185 - ], - [ - 0.0, - 1401352200 - ], - [ - 0.0, - 1401352215 - ], - [ - 0.0, - 1401352230 - ], - [ - 0.0, - 1401352245 - ], - [ - 0.0, - 1401352260 - ], - [ - 0.0, - 1401352275 - ], - [ - 0.0, - 1401352290 - ], - [ - 0.0, - 1401352305 - ], - [ - 0.0, - 1401352320 - ], - [ - 0.0, - 1401352335 - ], - [ - 0.0, - 1401352350 - ], - [ - 0.0, - 1401352365 - ], - [ - 0.0, - 1401352380 - ], - [ - 0.0, - 1401352395 - ], - [ - 0.0, - 1401352410 - ], - [ - 0.0, - 1401352425 - ], - [ - 0.0, - 1401352440 - ], - [ - 0.0, - 1401352455 - ], - [ - 0.0, - 1401352470 - ], - [ - 0.0, - 1401352485 - ], - [ - 0.0, - 1401352500 - ], - [ - 0.0, - 1401352515 - ], - [ - 0.0, - 1401352530 - ], - [ - 0.0, - 1401352545 - ], - [ - 0.0, - 1401352560 - ], - [ - 0.0, - 1401352575 - ], - [ - 0.0, - 1401352590 - ], - [ - 0.0, - 1401352605 - ], - [ - 0.0, - 1401352620 - ], - [ - 0.0, - 1401352635 - ], - [ - 0.0, - 1401352650 - ], - [ - 0.0, - 1401352665 - ], - [ - 0.0, - 1401352680 - ], - [ - 0.0, - 1401352695 - ], - [ - 0.0, - 1401352710 - ], - [ - 0.0, - 1401352725 - ], - [ - 0.0, - 1401352740 - ], - [ - 0.0, - 1401352755 - ], - [ - 0.0, - 1401352770 - ], - [ - 0.0, - 1401352785 - ], - [ - 0.0, - 1401352800 - ], - [ - 0.0, - 1401352815 - ], - [ - 0.0, - 1401352830 - ], - [ - 0.0, - 1401352845 - ], - [ - 0.0, - 1401352860 - ], - [ - 0.0, - 1401352875 - ], - [ - 0.0, - 1401352890 - ], - [ - 0.0, - 1401352905 - ], - [ - 0.0, - 1401352920 - ], - [ - 0.0, - 1401352935 - ], - [ - 0.0, - 1401352950 - ], - [ - 0.0, - 1401352965 - ], - [ - 0.0, - 1401352980 - ], - [ - 0.0, - 1401352995 - ], - [ - 0.0, - 1401353010 - ], - [ - 0.0, - 1401353025 - ], - [ - 0.0, - 1401353040 - ], - [ - 0.0, - 1401353055 - ], - [ - 0.0, - 1401353070 - ], - [ - 0.0, - 1401353085 - ], - [ - 0.0, - 1401353100 - ], - [ - 0.0, - 1401353115 - ], - [ - 0.0, - 1401353130 - ], - [ - 0.0, - 1401353145 - ], - [ - 0.0, - 1401353160 - ], - [ - 0.0, - 1401353175 - ], - [ - 0.0, - 1401353190 - ], - [ - 0.0, - 1401353205 - ], - [ - 0.0, - 1401353220 - ], - [ - 0.0, - 1401353235 - ], - [ - 0.0, - 1401353250 - ], - [ - 0.0, - 1401353265 - ], - [ - 0.0, - 1401353280 - ], - [ - 0.0, - 1401353295 - ], - [ - 0.0, - 1401353310 - ], - [ - 0.0, - 1401353325 - ], - [ - 0.0, - 1401353340 - ], - [ - 0.0, - 1401353355 - ], - [ - 0.0, - 1401353370 - ], - [ - 0.0, - 1401353385 - ], - [ - 0.0, - 1401353400 - ], - [ - 0.0, - 1401353415 - ], - [ - 0.0, - 1401353430 - ], - [ - 0.0, - 1401353445 - ], - [ - 0.0, - 1401353460 - ], - [ - 0.0, - 1401353475 - ], - [ - 0.0, - 1401353490 - ], - [ - 0.0, - 1401353505 - ], - [ - 0.0, - 1401353520 - ], - [ - 0.0, - 1401353535 - ], - [ - 0.0, - 1401353550 - ], - [ - 0.0, - 1401353565 - ], - [ - 0.0, - 1401353580 - ], - [ - 0.0, - 1401353595 - ], - [ - 0.0, - 1401353610 - ], - [ - 0.0, - 1401353625 - ], - [ - 0.0, - 1401353640 - ], - [ - 0.0, - 1401353655 - ], - [ - 0.0, - 1401353670 - ], - [ - 0.0, - 1401353685 - ], - [ - 0.0, - 1401353700 - ], - [ - 0.0, - 1401353715 - ], - [ - 0.0, - 1401353730 - ], - [ - 0.0, - 1401353745 - ], - [ - 0.0, - 1401353760 - ], - [ - 0.0, - 1401353775 - ], - [ - 0.0, - 1401353790 - ], - [ - 0.0, - 1401353805 - ], - [ - 0.0, - 1401353820 - ], - [ - 0.0, - 1401353835 - ], - [ - 0.0, - 1401353850 - ], - [ - 0.0, - 1401353865 - ], - [ - 0.0, - 1401353880 - ], - [ - 0.0, - 1401353895 - ], - [ - 0.0, - 1401353910 - ], - [ - 0.0, - 1401353925 - ], - [ - 0.0, - 1401353940 - ], - [ - 0.0, - 1401353955 - ], - [ - 0.0, - 1401353970 - ], - [ - 0.0, - 1401353985 - ], - [ - 0.0, - 1401354000 - ], - [ - 0.0, - 1401354015 - ], - [ - 0.0, - 1401354030 - ], - [ - 0.0, - 1401354045 - ], - [ - 0.0, - 1401354060 - ], - [ - 0.0, - 1401354075 - ], - [ - 0.0, - 1401354090 - ], - [ - 0.0, - 1401354105 - ], - [ - 0.0, - 1401354120 - ], - [ - 0.0, - 1401354135 - ], - [ - 0.0, - 1401354150 - ], - [ - 0.0, - 1401354165 - ], - [ - 0.0, - 1401354180 - ], - [ - 0.0, - 1401354195 - ], - [ - 0.0, - 1401354210 - ], - [ - 0.0, - 1401354225 - ], - [ - 0.0, - 1401354240 - ], - [ - 0.0, - 1401354255 - ], - [ - 0.0, - 1401354270 - ], - [ - 0.0, - 1401354285 - ], - [ - 0.0, - 1401354300 - ], - [ - 0.0, - 1401354315 - ], - [ - 0.0, - 1401354330 - ], - [ - 0.0, - 1401354345 - ], - [ - 0.0, - 1401354360 - ], - [ - 0.0, - 1401354375 - ], - [ - 0.0, - 1401354390 - ], - [ - 0.0, - 1401354405 - ], - [ - 0.0, - 1401354420 - ], - [ - 0.0, - 1401354435 - ], - [ - 0.0, - 1401354450 - ], - [ - 0.0, - 1401354465 - ], - [ - 0.0, - 1401354480 - ], - [ - 0.0, - 1401354495 - ], - [ - 0.0, - 1401354510 - ], - [ - 0.0, - 1401354525 - ], - [ - 0.0, - 1401354540 - ], - [ - 0.0, - 1401354555 - ], - [ - 0.0, - 1401354570 - ], - [ - 0.0, - 1401354585 - ], - [ - 0.0, - 1401354600 - ], - [ - 0.0, - 1401354615 - ], - [ - 0.0, - 1401354630 - ], - [ - 0.0, - 1401354645 - ], - [ - 0.0, - 1401354660 - ], - [ - 0.0, - 1401354675 - ], - [ - 0.0, - 1401354690 - ], - [ - 0.0, - 1401354705 - ], - [ - 0.0, - 1401354720 - ], - [ - 0.0, - 1401354735 - ], - [ - 0.0, - 1401354750 - ], - [ - 0.0, - 1401354765 - ], - [ - 0.0, - 1401354780 - ], - [ - 0.0, - 1401354795 - ], - [ - 0.0, - 1401354810 - ], - [ - 0.0, - 1401354825 - ], - [ - 0.0, - 1401354840 - ], - [ - 0.0, - 1401354855 - ], - [ - 0.0, - 1401354870 - ], - [ - 0.0, - 1401354885 - ], - [ - 0.0, - 1401354900 - ], - [ - 0.0, - 1401354915 - ], - [ - 0.0, - 1401354930 - ], - [ - 0.0, - 1401354945 - ], - [ - 0.0, - 1401354960 - ], - [ - 0.0, - 1401354975 - ], - [ - 0.0, - 1401354990 - ], - [ - 0.0, - 1401355005 - ], - [ - 0.0, - 1401355020 - ], - [ - 0.0, - 1401355035 - ], - [ - 0.0, - 1401355050 - ], - [ - 0.0, - 1401355065 - ] - ] - } - } + "firstMetric" : [ + [ + 5.0, + 1401351555 + ], + [ + 5.0, + 1401351570 + ], + [ + 5.0, + 1401351585 + ], + [ + 5.0, + 1401351600 + ], + [ + 5.0, + 1401351615 + ], + [ + 5.0, + 1401351630 + ], + [ + 5.0, + 1401351645 + ], + [ + 5.0, + 1401351660 + ], + [ + 5.0, + 1401351675 + ], + [ + 5.0, + 1401351690 + ], + [ + 5.0, + 1401351705 + ], + [ + 5.0, + 1401351720 + ], + [ + 5.0, + 1401351735 + ], + [ + 5.0, + 1401351750 + ], + [ + 5.0, + 1401351765 + ], + [ + 5.0, + 1401351780 + ], + [ + 5.0, + 1401351795 + ], + [ + 5.0, + 1401351810 + ], + [ + 5.0, + 1401351825 + ], + [ + 5.0, + 1401351840 + ], + [ + 5.0, + 1401351855 + ], + [ + 5.0, + 1401351870 + ], + [ + 5.0, + 1401351885 + ], + [ + 5.0, + 1401351900 + ], + [ + 5.0, + 1401351915 + ], + [ + 5.0, + 1401351930 + ], + [ + 5.0, + 1401351945 + ], + [ + 5.0, + 1401351960 + ], + [ + 5.0, + 1401351975 + ], + [ + 5.0, + 1401351990 + ], + [ + 5.0, + 1401352005 + ], + [ + 5.0, + 1401352020 + ], + [ + 5.0, + 1401352035 + ], + [ + 5.0, + 1401352050 + ], + [ + 5.0, + 1401352065 + ], + [ + 5.0, + 1401352080 + ], + [ + 5.0, + 1401352095 + ], + [ + 5.0, + 1401352110 + ], + [ + 5.0, + 1401352125 + ], + [ + 5.0, + 1401352140 + ], + [ + 5.0, + 1401352155 + ], + [ + 5.0, + 1401352170 + ], + [ + 5.0, + 1401352185 + ], + [ + 5.0, + 1401352200 + ], + [ + 5.0, + 1401352215 + ], + [ + 5.0, + 1401352230 + ], + [ + 5.0, + 1401352245 + ], + [ + 5.0, + 1401352260 + ], + [ + 5.0, + 1401352275 + ], + [ + 5.0, + 1401352290 + ], + [ + 5.0, + 1401352305 + ], + [ + 5.0, + 1401352320 + ], + [ + 5.0, + 1401352335 + ], + [ + 5.0, + 1401352350 + ], + [ + 5.0, + 1401352365 + ], + [ + 5.0, + 1401352380 + ], + [ + 5.0, + 1401352395 + ], + [ + 5.0, + 1401352410 + ], + [ + 5.0, + 1401352425 + ], + [ + 5.0, + 1401352440 + ], + [ + 5.0, + 1401352455 + ], + [ + 5.0, + 1401352470 + ], + [ + 5.0, + 1401352485 + ], + [ + 5.0, + 1401352500 + ], + [ + 5.0, + 1401352515 + ], + [ + 5.0, + 1401352530 + ], + [ + 5.0, + 1401352545 + ], + [ + 5.0, + 1401352560 + ], + [ + 5.0, + 1401352575 + ], + [ + 5.0, + 1401352590 + ], + [ + 5.0, + 1401352605 + ], + [ + 5.0, + 1401352620 + ], + [ + 5.0, + 1401352635 + ], + [ + 5.0, + 1401352650 + ], + [ + 5.0, + 1401352665 + ], + [ + 5.0, + 1401352680 + ], + [ + 5.0, + 1401352695 + ], + [ + 5.0, + 1401352710 + ], + [ + 5.0, + 1401352725 + ], + [ + 5.0, + 1401352740 + ], + [ + 5.0, + 1401352755 + ], + [ + 5.0, + 1401352770 + ], + [ + 5.0, + 1401352785 + ], + [ + 5.0, + 1401352800 + ], + [ + 5.0, + 1401352815 + ], + [ + 5.0, + 1401352830 + ], + [ + 5.0, + 1401352845 + ], + [ + 5.0, + 1401352860 + ], + [ + 5.0, + 1401352875 + ], + [ + 5.0, + 1401352890 + ], + [ + 5.0, + 1401352905 + ], + [ + 5.0, + 1401352920 + ], + [ + 5.0, + 1401352935 + ], + [ + 5.0, + 1401352950 + ], + [ + 5.0, + 1401352965 + ], + [ + 5.0, + 1401352980 + ], + [ + 5.0, + 1401352995 + ], + [ + 5.0, + 1401353010 + ], + [ + 5.0, + 1401353025 + ], + [ + 5.0, + 1401353040 + ], + [ + 5.0, + 1401353055 + ], + [ + 5.0, + 1401353070 + ], + [ + 5.0, + 1401353085 + ], + [ + 5.0, + 1401353100 + ], + [ + 5.0, + 1401353115 + ], + [ + 5.0, + 1401353130 + ], + [ + 5.0, + 1401353145 + ], + [ + 5.0, + 1401353160 + ], + [ + 5.0, + 1401353175 + ], + [ + 5.0, + 1401353190 + ], + [ + 5.0, + 1401353205 + ], + [ + 5.0, + 1401353220 + ], + [ + 5.0, + 1401353235 + ], + [ + 5.0, + 1401353250 + ], + [ + 5.0, + 1401353265 + ], + [ + 5.0, + 1401353280 + ], + [ + 5.0, + 1401353295 + ], + [ + 5.0, + 1401353310 + ], + [ + 5.0, + 1401353325 + ], + [ + 5.0, + 1401353340 + ], + [ + 5.0, + 1401353355 + ], + [ + 5.0, + 1401353370 + ], + [ + 5.0, + 1401353385 + ], + [ + 5.0, + 1401353400 + ], + [ + 5.0, + 1401353415 + ], + [ + 5.0, + 1401353430 + ], + [ + 5.0, + 1401353445 + ], + [ + 5.0, + 1401353460 + ], + [ + 5.0, + 1401353475 + ], + [ + 5.0, + 1401353490 + ], + [ + 5.0, + 1401353505 + ], + [ + 5.0, + 1401353520 + ], + [ + 5.0, + 1401353535 + ], + [ + 5.0, + 1401353550 + ], + [ + 5.0, + 1401353565 + ], + [ + 5.0, + 1401353580 + ], + [ + 5.0, + 1401353595 + ], + [ + 5.0, + 1401353610 + ], + [ + 5.0, + 1401353625 + ], + [ + 5.0, + 1401353640 + ], + [ + 5.0, + 1401353655 + ], + [ + 5.0, + 1401353670 + ], + [ + 5.0, + 1401353685 + ], + [ + 5.0, + 1401353700 + ], + [ + 5.0, + 1401353715 + ], + [ + 5.0, + 1401353730 + ], + [ + 5.0, + 1401353745 + ], + [ + 5.0, + 1401353760 + ], + [ + 5.0, + 1401353775 + ], + [ + 5.0, + 1401353790 + ], + [ + 5.0, + 1401353805 + ], + [ + 5.0, + 1401353820 + ], + [ + 5.0, + 1401353835 + ], + [ + 5.0, + 1401353850 + ], + [ + 5.0, + 1401353865 + ], + [ + 5.0, + 1401353880 + ], + [ + 5.0, + 1401353895 + ], + [ + 5.0, + 1401353910 + ], + [ + 5.0, + 1401353925 + ], + [ + 5.0, + 1401353940 + ], + [ + 5.0, + 1401353955 + ], + [ + 5.0, + 1401353970 + ], + [ + 5.0, + 1401353985 + ], + [ + 5.0, + 1401354000 + ], + [ + 5.0, + 1401354015 + ], + [ + 5.0, + 1401354030 + ], + [ + 5.0, + 1401354045 + ], + [ + 5.0, + 1401354060 + ], + [ + 5.0, + 1401354075 + ], + [ + 5.0, + 1401354090 + ], + [ + 5.0, + 1401354105 + ], + [ + 5.0, + 1401354120 + ], + [ + 5.0, + 1401354135 + ], + [ + 5.0, + 1401354150 + ], + [ + 5.0, + 1401354165 + ], + [ + 5.0, + 1401354180 + ], + [ + 5.0, + 1401354195 + ], + [ + 5.0, + 1401354210 + ], + [ + 5.0, + 1401354225 + ], + [ + 5.0, + 1401354240 + ], + [ + 5.0, + 1401354255 + ], + [ + 5.0, + 1401354270 + ], + [ + 5.0, + 1401354285 + ], + [ + 5.0, + 1401354300 + ], + [ + 5.0, + 1401354315 + ], + [ + 5.0, + 1401354330 + ], + [ + 5.0, + 1401354345 + ], + [ + 5.0, + 1401354360 + ], + [ + 5.0, + 1401354375 + ], + [ + 5.0, + 1401354390 + ], + [ + 5.0, + 1401354405 + ], + [ + 5.0, + 1401354420 + ], + [ + 5.0, + 1401354435 + ], + [ + 5.0, + 1401354450 + ], + [ + 5.0, + 1401354465 + ], + [ + 5.0, + 1401354480 + ], + [ + 5.0, + 1401354495 + ], + [ + 5.0, + 1401354510 + ], + [ + 5.0, + 1401354525 + ], + [ + 5.0, + 1401354540 + ], + [ + 5.0, + 1401354555 + ], + [ + 5.0, + 1401354570 + ], + [ + 5.0, + 1401354585 + ], + [ + 5.0, + 1401354600 + ], + [ + 5.0, + 1401354615 + ], + [ + 5.0, + 1401354630 + ], + [ + 5.0, + 1401354645 + ], + [ + 5.0, + 1401354660 + ], + [ + 5.0, + 1401354675 + ], + [ + 5.0, + 1401354690 + ], + [ + 5.0, + 1401354705 + ], + [ + 5.0, + 1401354720 + ], + [ + 5.0, + 1401354735 + ], + [ + 5.0, + 1401354750 + ], + [ + 5.0, + 1401354765 + ], + [ + 5.0, + 1401354780 + ], + [ + 5.0, + 1401354795 + ], + [ + 5.0, + 1401354810 + ], + [ + 5.0, + 1401354825 + ], + [ + 5.0, + 1401354840 + ], + [ + 5.0, + 1401354855 + ], + [ + 5.0, + 1401354870 + ], + [ + 5.0, + 1401354885 + ], + [ + 5.0, + 1401354900 + ], + [ + 5.0, + 1401354915 + ], + [ + 5.0, + 1401354930 + ], + [ + 5.0, + 1401354945 + ], + [ + 5.0, + 1401354960 + ], + [ + 5.0, + 1401354975 + ], + [ + 5.0, + 1401354990 + ], + [ + 5.0, + 1401355005 + ], + [ + 5.0, + 1401355020 + ], + [ + 5.0, + 1401355035 + ], + [ + 5.0, + 1401355050 + ], + [ + 5.0, + 1401355065 + ] + ] } } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ambari/blob/6850d77c/contrib/views/slider/src/main/resources/ui/app/helpers/helper.js ---------------------------------------------------------------------- diff --git a/contrib/views/slider/src/main/resources/ui/app/helpers/helper.js b/contrib/views/slider/src/main/resources/ui/app/helpers/helper.js index 58c5e55..5b8bf8d 100644 --- a/contrib/views/slider/src/main/resources/ui/app/helpers/helper.js +++ b/contrib/views/slider/src/main/resources/ui/app/helpers/helper.js @@ -79,7 +79,7 @@ App.registerBoundHelper('formatWordBreak', Em.View.extend({ result: function() { var d = this.get('devider'); var r = new RegExp('\\'+d,"g"); - return this.get('content') && this.get('content').replace(r, d+'<wbr />'); + return this.get('content') && this.get('content').toString().replace(r, d+'<wbr />'); }.property('content') })); @@ -166,4 +166,4 @@ DS.attr.transforms = { * {{input name="new" placeholderTranslation="any"}} * </code> **/ -Em.TextField.reopen(Em.I18n.TranslateableAttributes); \ No newline at end of file +Em.TextField.reopen(Em.I18n.TranslateableAttributes); http://git-wip-us.apache.org/repos/asf/ambari/blob/6850d77c/contrib/views/slider/src/main/resources/ui/app/models/slider_app.js ---------------------------------------------------------------------- diff --git a/contrib/views/slider/src/main/resources/ui/app/models/slider_app.js b/contrib/views/slider/src/main/resources/ui/app/models/slider_app.js index 1692c66..7b0e397 100644 --- a/contrib/views/slider/src/main/resources/ui/app/models/slider_app.js +++ b/contrib/views/slider/src/main/resources/ui/app/models/slider_app.js @@ -129,7 +129,10 @@ App.SliderApp = DS.Model.extend({ supportedMetricNames: DS.attr('string'), - // Config categories, that should be hidden on app page + /** + * Config categories, that should be hidden on app page + * @type {string[]} + */ hiddenCategories: [], /** @@ -141,15 +144,16 @@ App.SliderApp = DS.Model.extend({ /** * Display metrics only for running apps + * Also don't display if metrics don't exist * @type {boolean} */ showMetrics: function () { - var global = this.get('configs')['global']; + if (!this.get('supportedMetricNames.length')) return false; if (App.get('gangliaHost') != null) { return true; } return App.SliderApp.Status.running === this.get('status'); - }.property('status', 'configs'), + }.property('status', 'configs', 'supportedMetricNames'), /** * Map object to array http://git-wip-us.apache.org/repos/asf/ambari/blob/6850d77c/contrib/views/slider/src/main/resources/ui/app/templates/slider_app/summary.hbs ---------------------------------------------------------------------- diff --git a/contrib/views/slider/src/main/resources/ui/app/templates/slider_app/summary.hbs b/contrib/views/slider/src/main/resources/ui/app/templates/slider_app/summary.hbs index a00e265..dfa3d4f 100644 --- a/contrib/views/slider/src/main/resources/ui/app/templates/slider_app/summary.hbs +++ b/contrib/views/slider/src/main/resources/ui/app/templates/slider_app/summary.hbs @@ -95,21 +95,22 @@ <table class="table no-borders table-condensed"> <tbody> {{#if controller.model.doNotShowComponentsAndAlerts}} - <tr> - <td>{{t sliderApp.summary.no.components}}</td> - </tr> + <tr> + <td>{{t sliderApp.summary.no.components}}</td> + </tr> {{else}} {{#each controller.model.components}} - <tr> - <td><span {{bind-attr class="isRunning:icon-ok-sign:icon-warning-sign :status"}}></span> {{componentName}}</td> - <td> - {{#if url}} - <a {{bind-attr href="url"}} target="_blank">{{host}}</a> - {{else}} - {{host}} - {{/if}} - </td> - </tr> + <tr> + <td><span {{bind-attr class="isRunning:icon-ok-sign:icon-warning-sign :status"}}></span> {{componentName}} + </td> + <td> + {{#if url}} + <a {{bind-attr href="url"}} target="_blank">{{host}}</a> + {{else}} + {{host}} + {{/if}} + </td> + </tr> {{/each}} {{/if}} </tbody> @@ -117,8 +118,9 @@ {{/bs-panel}} </div> </div> + {{#if controller.model.showMetrics}} - <div class="panel panel-default"> + <div {{bind-attr class="view.graphsNotEmpty:visible:hidden :panel :panel-default"}}> <div class="panel-heading"> {{t common.metrics}} <div class="btn-group pull-right panel-link"> @@ -130,11 +132,11 @@ </div> </div> <div class="panel-body"> - <div class="row"> - {{#each graph in view.graphs}} - <div class="col-md-3">{{view graph.view}}</div> - {{/each}} - </div> + <div class="row"> + {{#each graph in view.graphs}} + <div class="col-md-3">{{view graph.view}}</div> + {{/each}} + </div> </div> </div> {{/if}} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ambari/blob/6850d77c/contrib/views/slider/src/main/resources/ui/app/views/common/chart_view.js ---------------------------------------------------------------------- diff --git a/contrib/views/slider/src/main/resources/ui/app/views/common/chart_view.js b/contrib/views/slider/src/main/resources/ui/app/views/common/chart_view.js index c3cf900..037e413 100644 --- a/contrib/views/slider/src/main/resources/ui/app/views/common/chart_view.js +++ b/contrib/views/slider/src/main/resources/ui/app/views/common/chart_view.js @@ -188,12 +188,8 @@ App.ChartView = Ember.View.extend({ return {}; }, - loadDataErrorCallback: function(xhr, textStatus, errorThrown) { + loadDataErrorCallback: function() { this.set('isReady', true); - if (xhr.readyState == 4 && xhr.status) { - textStatus = xhr.status + " " + textStatus; - } - this._showMessage('warn', Em.I18n.t('common.error'), textStatus + ' ' + errorThrown); this.set('isPopup', false); this.set('hasData', false); }, @@ -371,12 +367,8 @@ App.ChartView = Ember.View.extend({ this.set('isReady', true); //if Axis X time interval is default(60 minutes) if(this.get('timeUnitSeconds') === 3600){ - this._showMessage('info', this.t('graphs.noData.title'), this.t('graphs.noData.message')); this.set('hasData', false); } - else { - this._showMessage('info', this.t('graphs.noData.title'), this.t('graphs.noDataAtTime.message')); - } this.set('isPopup', false); } }, @@ -916,4 +908,4 @@ App.ChartView.CreateRateFormatter = function (unitsPrefix, valueFormatter) { value = valueFormatter(value) + suffix; return value; }; -}; \ No newline at end of file +}; http://git-wip-us.apache.org/repos/asf/ambari/blob/6850d77c/contrib/views/slider/src/main/resources/ui/app/views/slider_app/metrics/app_metric_view.js ---------------------------------------------------------------------- diff --git a/contrib/views/slider/src/main/resources/ui/app/views/slider_app/metrics/app_metric_view.js b/contrib/views/slider/src/main/resources/ui/app/views/slider_app/metrics/app_metric_view.js index 6baea38..b208baa 100644 --- a/contrib/views/slider/src/main/resources/ui/app/views/slider_app/metrics/app_metric_view.js +++ b/contrib/views/slider/src/main/resources/ui/app/views/slider_app/metrics/app_metric_view.js @@ -30,11 +30,11 @@ App.AppMetricView = App.ChartView.extend(App.RunPeriodically, { metricName: null, - id : function() { + id: function () { return 'graph_' + this.get('app.id') + this.get('metricName'); }.property('app.id', 'metricName'), - title: function() { + title: function () { return this.get('metricName').humanize(); }.property('metricName'), @@ -43,8 +43,8 @@ App.AppMetricView = App.ChartView.extend(App.RunPeriodically, { renderer: 'line', ajaxIndex: 'metrics', - - getDataForAjaxRequest: function() { + + getDataForAjaxRequest: function () { return { id: this.get('app.id'), metric: this.get('metricName') @@ -56,9 +56,8 @@ App.AppMetricView = App.ChartView.extend(App.RunPeriodically, { seriesArray = [], metricName = this.get('metricName'), metrics = Ember.get(jsonData, 'metrics'); - if (!Ember.isNone(metrics)) { - Ember.keys(metrics).forEach(function() { + Ember.keys(metrics).forEach(function () { var seriesData = metrics[metricName]; if (seriesData) { var s = self.transformData(seriesData, metricName); @@ -66,6 +65,13 @@ App.AppMetricView = App.ChartView.extend(App.RunPeriodically, { } }); } + this.get('parentView.graphs').findBy('metricName', metricName).set('dataExists', !!seriesArray.length); return seriesArray; + }, + + loadDataErrorCallback: function() { + this.set('isReady', true); + this.get('parentView.graphs').findBy('metricName', this.get('metricName')).set('dataExists', false); } + }); \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ambari/blob/6850d77c/contrib/views/slider/src/main/resources/ui/app/views/slider_app/summary_view.js ---------------------------------------------------------------------- diff --git a/contrib/views/slider/src/main/resources/ui/app/views/slider_app/summary_view.js b/contrib/views/slider/src/main/resources/ui/app/views/slider_app/summary_view.js index 3c429cb..9c92b16 100644 --- a/contrib/views/slider/src/main/resources/ui/app/views/slider_app/summary_view.js +++ b/contrib/views/slider/src/main/resources/ui/app/views/slider_app/summary_view.js @@ -27,35 +27,61 @@ App.SliderAppSummaryView = Ember.View.extend({ * [ * { * id: string, + * dataExists: bool, + * metricName: string, * view: App.AppMetricView * }, * { * id: string, + * dataExists: bool, + * metricName: string, * view: App.AppMetricView * }, * .... * ] * </code> - * @type {{object}[][]} + * @type {{object}[]} */ graphs: [], - + + /** + * Determine if at least one graph contains some data to show + * @type {bool} + */ + graphsNotEmpty: function () { + return this.get('graphs').isAny('dataExists', true); + }.property('graphs.@each.dataExists'), + + /** + * Ganglia url + * If <code>model.quickLinks</code> has `app.ganglia` element, it's used + * Otherwise - <code>App.gangliaHost</code> is used + * @type {string} + */ + gangliaUrl: function () { + var g = this.get('controller.model.quickLinks').findBy('label', 'app.ganglia'); + if (g) { + return g.get('url'); + } + return 'http://' + App.get('gangliaHost') + '/ganglia'; + }.property('App.gangliaHost', 'controller.model.quicklin...@each.url'), + /** * Update <code>graphs</code>-list when <code>model</code> is updated * New metrics are pushed to <code>graphs</code> (not set new list to <code>graphs</code>!) to prevent page flickering * @method updateGraphs */ - updateGraphs: function() { + updateGraphs: function () { var model = this.get('controller.model'), existingGraphs = this.get('graphs'), graphsBeenChanged = false; if (model) { - var currentGraphIds = []; - var supportedMetrics = model.get('supportedMetricNames'); + var currentGraphIds = [], + supportedMetrics = model.get('supportedMetricNames'); if (supportedMetrics) { var appId = model.get('id'); - supportedMetrics.split(',').forEach(function(metricName) { + supportedMetrics.split(',').forEach(function (metricName) { var graphId = metricName + '_' + appId; currentGraphIds.push(graphId); if (!existingGraphs.isAny('id', graphId)) { @@ -64,17 +90,19 @@ App.SliderAppSummaryView = Ember.View.extend({ app: model, metricName: metricName }); - existingGraphs.push({ - id : graphId, - view : view - }); + existingGraphs.push(Em.Object.create({ + id: graphId, + view: view, + dataExists: false, + metricName: metricName + })); } }); } // Delete not existed graphs - existingGraphs = existingGraphs.filter(function(existingGraph) { - graphsBeenChanged = graphsBeenChanged || !currentGraphIds.contains(existingGraph.id); - return currentGraphIds.contains(existingGraph.id); + existingGraphs = existingGraphs.filter(function (existingGraph) { + graphsBeenChanged = graphsBeenChanged || !currentGraphIds.contains(existingGraph.get('id')); + return currentGraphIds.contains(existingGraph.get('id')); }); if (graphsBeenChanged) { this.set('graphs', existingGraphs); @@ -82,23 +110,9 @@ App.SliderAppSummaryView = Ember.View.extend({ } }.observes('controller.model.supportedMetricNames'), - /** - * Ganglia url - * If <code>model.quickLinks</code> has `app.ganglia` element, it's used - * Otherwise - <code>App.gangliaHost</code> is used - * @type {string} - */ - gangliaUrl: function () { - var g = this.get('controller.model.quickLinks').findBy('label', 'app.ganglia'); - if (g) { - return g.get('url'); - } - return 'http://' + App.get('gangliaHost') + '/ganglia'; - }.property('App.gangliaHost', 'controller.model.quicklin...@each.url'), - - didInsertElement: function() { + didInsertElement: function () { var self = this; - Em.run.next(function() { + Em.run.next(function () { self.fitPanels(); }); }, @@ -109,10 +123,10 @@ App.SliderAppSummaryView = Ember.View.extend({ */ fitPanels: function () { var panelSummary = this.$('.panel-summary'), - panelSummaryBody = panelSummary.find('.panel-body'), - columnRight = this.$('.column-right'), - panelAlerts = columnRight.find('.panel-alerts'), - panelComponents = columnRight.find('.panel-components'); + panelSummaryBody = panelSummary.find('.panel-body'), + columnRight = this.$('.column-right'), + panelAlerts = columnRight.find('.panel-alerts'), + panelComponents = columnRight.find('.panel-components'); if (panelSummary.height() < panelSummaryBody.height()) { panelSummary.height(panelSummaryBody.height()); } http://git-wip-us.apache.org/repos/asf/ambari/blob/6850d77c/contrib/views/slider/src/main/resources/ui/test/unit/models/slider_app_test.js ---------------------------------------------------------------------- diff --git a/contrib/views/slider/src/main/resources/ui/test/unit/models/slider_app_test.js b/contrib/views/slider/src/main/resources/ui/test/unit/models/slider_app_test.js index 0d9e2df..06ff0da 100644 --- a/contrib/views/slider/src/main/resources/ui/test/unit/models/slider_app_test.js +++ b/contrib/views/slider/src/main/resources/ui/test/unit/models/slider_app_test.js @@ -52,10 +52,12 @@ test('doNotShowComponentsAndAlerts', function () { test('showMetrics', function () { - var sliderApp = this.subject({name: 'p1', configs: {}}); + var sliderApp = this.subject({name: 'p1', configs: {}, supportedMetricNames: ''}); + equal(sliderApp.get('showMetrics'), false, 'should be false if supportedMetricNames is not provided'); Em.run(function () { App.set('gangliaHost', 'some_host'); + sliderApp.set('supportedMetricNames', 'some'); }); equal(sliderApp.get('showMetrics'), true, 'should be true if App.gangliaHost is provided'); http://git-wip-us.apache.org/repos/asf/ambari/blob/6850d77c/contrib/views/slider/src/main/resources/ui/test/unit/views/slider_app/summary_view_test.js ---------------------------------------------------------------------- diff --git a/contrib/views/slider/src/main/resources/ui/test/unit/views/slider_app/summary_view_test.js b/contrib/views/slider/src/main/resources/ui/test/unit/views/slider_app/summary_view_test.js new file mode 100644 index 0000000..3ccdfba --- /dev/null +++ b/contrib/views/slider/src/main/resources/ui/test/unit/views/slider_app/summary_view_test.js @@ -0,0 +1,68 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +moduleFor('view:SliderAppSummary', 'App.SliderAppSummaryView', { + + needs: [ + 'view:AppMetric', + 'view:Chart' + ], + + setup: function () { + Em.run(App, App.advanceReadiness); + }, + + teardown: function () { + App.reset(); + } + +}); + +test('graphsNotEmpty', function () { + + var sliderAppSummaryView = this.subject({ + controller: { + model: Em.Object.create({ + supportedMetricNames: '' + }) + } + }); + Em.run(function () { + sliderAppSummaryView.set('controller.model.supportedMetricNames', 'firstMetric,secondMetric'); + var v = sliderAppSummaryView.createChildView(sliderAppSummaryView.get('graphs')[0].view); + v._refreshGraph({ + "metrics": { + "firstMetric": [ + [ + 5.0, + 1401351555 + ] + ]} + }); + sliderAppSummaryView.createChildView(sliderAppSummaryView.get('graphs')[1].view); + }); + ok(sliderAppSummaryView.get('graphsNotEmpty'), 'One graph has metrics'); + + Em.run(function () { + var v = sliderAppSummaryView.createChildView(sliderAppSummaryView.get('graphs')[0].view); + v._refreshGraph({ + "metrics": {} + }); + }); + equal(sliderAppSummaryView.get('graphsNotEmpty'), false, 'No one graph has metrics'); +});