Return-Path: X-Original-To: apmail-ambari-commits-archive@www.apache.org Delivered-To: apmail-ambari-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E8420176A4 for ; Mon, 20 Apr 2015 11:56:10 +0000 (UTC) Received: (qmail 99624 invoked by uid 500); 20 Apr 2015 11:56:10 -0000 Delivered-To: apmail-ambari-commits-archive@ambari.apache.org Received: (qmail 99595 invoked by uid 500); 20 Apr 2015 11:56:10 -0000 Mailing-List: contact commits-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ambari-dev@ambari.apache.org Delivered-To: mailing list commits@ambari.apache.org Received: (qmail 99586 invoked by uid 99); 20 Apr 2015 11:56:10 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 20 Apr 2015 11:56:10 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 9BDECE0663; Mon, 20 Apr 2015 11:56:10 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: onechiporenko@apache.org To: commits@ambari.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: ambari git commit: AMBARI-10593. YARN CPU vCore values returned by not being shown in UI (onechiporenko) Date: Mon, 20 Apr 2015 11:56:10 +0000 (UTC) Repository: ambari Updated Branches: refs/heads/trunk d36d89464 -> e5cfe183f AMBARI-10593. YARN CPU vCore values returned by not being shown in UI (onechiporenko) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/e5cfe183 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/e5cfe183 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/e5cfe183 Branch: refs/heads/trunk Commit: e5cfe183f87ca0a8fa93d8797f360338893927a5 Parents: d36d894 Author: Oleg Nechiporenko Authored: Mon Apr 20 14:20:23 2015 +0300 Committer: Oleg Nechiporenko Committed: Mon Apr 20 14:55:36 2015 +0300 ---------------------------------------------------------------------- .../YARN/2.1.0.2.0/configuration/yarn-site.xml | 2 +- .../widgets/slider_config_widget_view.js | 46 +++++++++++--------- 2 files changed, 27 insertions(+), 21 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/e5cfe183/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/configuration/yarn-site.xml ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/configuration/yarn-site.xml b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/configuration/yarn-site.xml index 9b338ae..ed59973 100644 --- a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/configuration/yarn-site.xml +++ b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/configuration/yarn-site.xml @@ -100,7 +100,7 @@ 0 5120 MB - 250 + 256 http://git-wip-us.apache.org/repos/asf/ambari/blob/e5cfe183/ambari-web/app/views/common/configs/widgets/slider_config_widget_view.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/common/configs/widgets/slider_config_widget_view.js b/ambari-web/app/views/common/configs/widgets/slider_config_widget_view.js index d1f0b05..228f6e2 100644 --- a/ambari-web/app/views/common/configs/widgets/slider_config_widget_view.js +++ b/ambari-web/app/views/common/configs/widgets/slider_config_widget_view.js @@ -253,26 +253,32 @@ App.SliderConfigWidgetView = App.ConfigWidgetView.extend({ ticks.forEach(function (tick, index) { ticksLabels.push(index % 2 === 0 ? tick + ' ' + self.get('unitLabel') : ''); }); - // process additional tick for default value if it not defined in previous computation - if (!ticks.contains(defaultValue)) { - // push default value - ticks.push(defaultValue); - // and resort array - ticks = ticks.sort(function(a,b) { return a-b; }); - defaultValueId = ticks.indexOf(defaultValue); - // to save nice tick labels layout we should add new tick value which is mirrored by index to default value - defaultValueMirroredId = ticks.length - defaultValueId; - // push empty label for default value tick - ticksLabels.insertAt(defaultValueId, ''); - // push empty to mirrored position - ticksLabels.insertAt(defaultValueMirroredId, ''); - // for saving correct sliding need to add value to mirrored position which is average between previous - // and next value - ticks.insertAt(defaultValueMirroredId, (ticks[defaultValueMirroredId] + ticks[defaultValueMirroredId - 1])/2); - // get new index for default value - defaultValueId = ticks.indexOf(defaultValue); - } else { - defaultValueId = ticks.indexOf(defaultValue); + + // default-value marker should be added only if defaultValue is in range [min, max] + if (defaultValue <= this.get('maxMirrorValue') && defaultValue >= this.get('minMirrorValue')) { + // process additional tick for default value if it not defined in previous computation + if (!ticks.contains(defaultValue)) { + // push default value + ticks.push(defaultValue); + // and resort array + ticks = ticks.sort(function (a, b) { + return a - b; + }); + defaultValueId = ticks.indexOf(defaultValue); + // to save nice tick labels layout we should add new tick value which is mirrored by index to default value + defaultValueMirroredId = ticks.length - defaultValueId; + // push empty label for default value tick + ticksLabels.insertAt(defaultValueId, ''); + // push empty to mirrored position + ticksLabels.insertAt(defaultValueMirroredId, ''); + // for saving correct sliding need to add value to mirrored position which is average between previous + // and next value + ticks.insertAt(defaultValueMirroredId, (ticks[defaultValueMirroredId] + ticks[defaultValueMirroredId - 1]) / 2); + // get new index for default value + defaultValueId = ticks.indexOf(defaultValue); + } else { + defaultValueId = ticks.indexOf(defaultValue); + } } var slider = new Slider(this.$('input.slider-input')[0], { value: this.get('mirrorValue'),