You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by nc...@apache.org on 2016/02/23 15:07:13 UTC

[07/12] ambari git commit: AMBARI-15096 Edit WEB Alert should show Critical for Connection Timeout (Joe Wang via rzang)

AMBARI-15096 Edit WEB Alert should show Critical for Connection Timeout (Joe Wang via rzang)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/7091250a
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/7091250a
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/7091250a

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 7091250a932bbb5cd4edc2d4c421f64abc710a13
Parents: d741e43
Author: Richard Zang <rz...@apache.org>
Authored: Mon Feb 22 16:00:54 2016 -0800
Committer: Richard Zang <rz...@apache.org>
Committed: Mon Feb 22 16:00:54 2016 -0800

----------------------------------------------------------------------
 .../main/alerts/definition_configs_controller.js    | 16 ++++++++++++++--
 ambari-web/app/models/alerts/alert_config.js        | 13 -------------
 ambari-web/app/styles/alerts.less                   |  5 +++--
 .../main/alerts/configs/alert_config_parameter.hbs  | 10 +++++-----
 4 files changed, 22 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/7091250a/ambari-web/app/controllers/main/alerts/definition_configs_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/alerts/definition_configs_controller.js b/ambari-web/app/controllers/main/alerts/definition_configs_controller.js
index 1b7fecf..e9f6726 100644
--- a/ambari-web/app/controllers/main/alerts/definition_configs_controller.js
+++ b/ambari-web/app/controllers/main/alerts/definition_configs_controller.js
@@ -16,6 +16,8 @@
  * limitations under the License.
  */
 
+var numericUtils = require('utils/number_utils');
+
 App.MainAlertDefinitionConfigsController = Em.Controller.extend({
 
   name: 'mainAlertDefinitionConfigsController',
@@ -289,8 +291,18 @@ App.MainAlertDefinitionConfigsController = Em.Controller.extend({
         text: isWizard ? '' : this.getThresholdsProperty('critical', 'text'),
         value: isWizard ? '' : this.getThresholdsProperty('critical', 'value')
       }),
-      App.AlertConfigProperties.ConnectionTimeout.create({
-        value: alertDefinition.get('uri.connectionTimeout')
+      App.AlertConfigProperties.Parameter.create({
+        value: alertDefinition.get('uri.connectionTimeout'),
+        threshold: "CRITICAL",
+        name: 'connection_timeout',
+        label: 'Connection Timeout',
+        displayType: 'parameter',
+        apiProperty: 'source.uri.connection_timeout',
+        units: 'Seconds',
+        isValid: function () {
+          var value = this.get('value');
+          return numericUtils.isPositiveNumber(value);
+        }.property('value')
       })
     ]);
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/7091250a/ambari-web/app/models/alerts/alert_config.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/models/alerts/alert_config.js b/ambari-web/app/models/alerts/alert_config.js
index 867b45a..2ef21a6 100644
--- a/ambari-web/app/models/alerts/alert_config.js
+++ b/ambari-web/app/models/alerts/alert_config.js
@@ -431,19 +431,6 @@ App.AlertConfigProperties = {
     }.property('value')
   }),
 
-  ConnectionTimeout: App.AlertConfigProperty.extend({
-    name: 'connection_timeout',
-    label: 'Connection Timeout',
-    displayType: 'textField',
-    classNames: 'alert-connection-timeout',
-    apiProperty: 'source.uri.connection_timeout',
-    unit: 'Seconds',
-    isValid: function () {
-      var value = this.get('value');
-      return numericUtils.isPositiveNumber(value);
-    }.property('value')
-  }),
-
   DefaultPort: App.AlertConfigProperty.extend({
     name: 'default_port',
     label: 'Default Port',

http://git-wip-us.apache.org/repos/asf/ambari/blob/7091250a/ambari-web/app/styles/alerts.less
----------------------------------------------------------------------
diff --git a/ambari-web/app/styles/alerts.less b/ambari-web/app/styles/alerts.less
index 1b8d5f4..d4e5d27 100644
--- a/ambari-web/app/styles/alerts.less
+++ b/ambari-web/app/styles/alerts.less
@@ -324,7 +324,7 @@
     padding-right: 13px;
   }
 
-  .alert-interval-input, .alert-connection-timeout {
+  .alert-interval-input {
     input {
       width: 20%;
     }
@@ -338,7 +338,8 @@
 
   .badge-container {
     height: 26px;
-    .alert-threshold-badge {
+    .alert-threshold-badge,
+    .alert-parameter-badge {
       line-height: 26px;
       height: 26px;
     }

http://git-wip-us.apache.org/repos/asf/ambari/blob/7091250a/ambari-web/app/templates/main/alerts/configs/alert_config_parameter.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/alerts/configs/alert_config_parameter.hbs b/ambari-web/app/templates/main/alerts/configs/alert_config_parameter.hbs
index 608dc59..c7364e9 100644
--- a/ambari-web/app/templates/main/alerts/configs/alert_config_parameter.hbs
+++ b/ambari-web/app/templates/main/alerts/configs/alert_config_parameter.hbs
@@ -17,13 +17,13 @@
 }}
 
 <div>
-  {{#if view.property.threshold}}
-    <div class="span2 badge-container">
+  <div class="span2 badge-container">
+    {{#if view.property.threshold}}
       <span {{bindAttr class="view.property.badgeCssClass :alert-parameter-badge :alert-state-single-host view.property.threshold:label"}}>
         {{view.property.badge}}
-        </span>&nbsp;
-    </div>
-  {{/if}}
+      </span>&nbsp;
+    {{/if}}
+  </div>
   <div rel="parameter-tooltip" {{bindAttr data-original-title="view.property.description" class="view.bigInput:span12:span3 view.property.units:input-append view.property.thresholdNotExists:stuck-left"}}>
     {{view Em.TextField valueBinding="view.property.value" disabledBinding="view.property.isDisabled" class ="view.bigInput:span12:span7"}}
     {{#if view.property.units}}