Kaynağa Gözat

AMBARI-11026. Alerts: do not expose subject + body for SNMP traps (akovalenko)

Aleksandr Kovalenko 10 yıl önce
ebeveyn
işleme
0f4aea1491

+ 2 - 14
ambari-web/app/controllers/main/alerts/manage_alert_notifications_controller.js

@@ -126,16 +126,6 @@ App.ManageAlertNotificationsController = Em.Controller.extend({
       value: '',
       defaultValue: ''
     },
-    OIDSubject: {
-      label: Em.I18n.t('alerts.actions.manage_alert_notifications_popup.OIDSubject'),
-      value: '',
-      defaultValue: ''
-    },
-    OIDBody: {
-      label: Em.I18n.t('alerts.actions.manage_alert_notifications_popup.OIDBody'),
-      value: '',
-      defaultValue: ''
-    },
     community: {
       label: Em.I18n.t('alerts.actions.manage_alert_notifications_popup.community'),
       value: '',
@@ -346,8 +336,6 @@ App.ManageAlertNotificationsController = Em.Controller.extend({
     inputFields.set('emailFrom.value', selectedAlertNotification.get('properties')['mail.smtp.from']);
     inputFields.set('version.value', selectedAlertNotification.get('properties')['ambari.dispatch.snmp.version']);
     inputFields.set('OIDs.value', selectedAlertNotification.get('properties')['ambari.dispatch.snmp.oids.trap']);
-    inputFields.set('OIDSubject.value', selectedAlertNotification.get('properties')['ambari.dispatch.snmp.oids.subject']);
-    inputFields.set('OIDBody.value', selectedAlertNotification.get('properties')['ambari.dispatch.snmp.oids.body']);
     inputFields.set('community.value', selectedAlertNotification.get('properties')['ambari.dispatch.snmp.community']);
     inputFields.set('host.value', selectedAlertNotification.get('properties')['ambari.dispatch.recipients'] ?
       selectedAlertNotification.get('properties')['ambari.dispatch.recipients'].join(', ') : '');
@@ -665,8 +653,8 @@ App.ManageAlertNotificationsController = Em.Controller.extend({
     } else {
       properties['ambari.dispatch.snmp.version'] = inputFields.get('version.value');
       properties['ambari.dispatch.snmp.oids.trap'] = inputFields.get('OIDs.value');
-      properties['ambari.dispatch.snmp.oids.subject'] = inputFields.get('OIDSubject.value');
-      properties['ambari.dispatch.snmp.oids.body'] = inputFields.get('OIDBody.value');
+      properties['ambari.dispatch.snmp.oids.subject'] = inputFields.get('OIDs.value');
+      properties['ambari.dispatch.snmp.oids.body'] = inputFields.get('OIDs.value');
       properties['ambari.dispatch.snmp.community'] = inputFields.get('community.value');
       properties['ambari.dispatch.recipients'] = inputFields.get('host.value').replace(/\s/g, '').split(',');
       properties['ambari.dispatch.snmp.port'] = inputFields.get('port.value');

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

@@ -2028,9 +2028,7 @@ Em.I18n.translations = {
   'alerts.actions.manage_alert_notifications_popup.SMTPSTARTTLS':'Start TLS',
   'alerts.actions.manage_alert_notifications_popup.emailFrom':'Email From',
   'alerts.actions.manage_alert_notifications_popup.version':'Version',
-  'alerts.actions.manage_alert_notifications_popup.OIDs':'OIDs',
-  'alerts.actions.manage_alert_notifications_popup.OIDSubject':'OID Subject',
-  'alerts.actions.manage_alert_notifications_popup.OIDBody':'OID Body',
+  'alerts.actions.manage_alert_notifications_popup.OIDs':'OID',
   'alerts.actions.manage_alert_notifications_popup.community':'Community',
   'alerts.actions.manage_alert_notifications_popup.host':'Hosts',
   'alerts.actions.manage_alert_notifications_popup.port':'Port',

+ 0 - 14
ambari-web/app/templates/main/alerts/create_alert_notification.hbs

@@ -200,20 +200,6 @@
             {{view Em.TextField valueBinding="controller.inputFields.OIDs.value" class="input-xlarge"}}
           </div>
       </div>
-      <div class="control-group">
-          <label class="control-label">{{controller.inputFields.OIDSubject.label}}</label>
-
-          <div class="controls">
-            {{view Em.TextField valueBinding="controller.inputFields.OIDSubject.value" class="input-xlarge"}}
-          </div>
-      </div>
-      <div class="control-group">
-          <label class="control-label">{{controller.inputFields.OIDBody.label}}</label>
-
-          <div class="controls">
-            {{view Em.TextField valueBinding="controller.inputFields.OIDBody.value" class="input-xlarge"}}
-          </div>
-      </div>
 
       <div class="control-group">
         <label class="control-label">{{controller.inputFields.community.label}}</label>

+ 0 - 22
ambari-web/test/controllers/main/alerts/manage_alert_notifications_controller_test.js

@@ -249,12 +249,6 @@ describe('App.ManageAlertNotificationsController', function () {
         OIDs: {
           value: ''
         },
-        OIDSubject: {
-          value: ''
-        },
-        OIDBody: {
-          value: ''
-        },
         community: {
           value: ''
         },
@@ -324,8 +318,6 @@ describe('App.ManageAlertNotificationsController', function () {
         },
         version: {},
         OIDs: {},
-        OIDSubject: {},
-        OIDBody: {},
         community: {},
         host: {
           value: 'test1@test.test, test2@test.test'
@@ -355,8 +347,6 @@ describe('App.ManageAlertNotificationsController', function () {
           'customName': 'customValue',
           'ambari.dispatch.snmp.version': 'SNMPv1',
           'ambari.dispatch.snmp.oids.trap': '1',
-          'ambari.dispatch.snmp.oids.subject': 'OID Subject',
-          'ambari.dispatch.snmp.oids.body': 'OID Body',
           'ambari.dispatch.snmp.community': 'snmp',
           'ambari.dispatch.snmp.port': 161
 
@@ -418,12 +408,6 @@ describe('App.ManageAlertNotificationsController', function () {
         OIDs: {
           value: ''
         },
-        OIDSubject: {
-          value: ''
-        },
-        OIDBody: {
-          value: ''
-        },
         community: {
           value: ''
         },
@@ -485,12 +469,6 @@ describe('App.ManageAlertNotificationsController', function () {
         OIDs: {
           value: '1'
         },
-        OIDSubject: {
-          value: 'OID Subject'
-        },
-        OIDBody: {
-          value:'OID Body'
-        },
         community: {
           value: 'snmp'
         },