How to use the opennms.Model.OnmsSituationFeedback function in opennms

To help you get started, we’ve selected a few opennms examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github OpenNMS / opennms-helm / src / panels / alarm-table / alarm_details.js View on Github external
clone(feedback) {
    let cloned  = [];
    for (var i = 0; i < feedback.length; i++) {
      let fb = new Model.OnmsSituationFeedback();
      fb.situationKey = feedback[i].situationKey;
      fb.situationFingerprint = feedback[i].situationFingerprint;
      fb.alarmKey = feedback[i].alarmKey;
      fb.feedbackType = feedback[i].feedbackType;
      fb.reason = feedback[i].reason;
      fb.rootCause = feedback[i].rootCause;
      fb.tags = feedback[i].tags;
      fb.user = feedback[i].user;
      cloned.push(fb);
    }
    return cloned;
  }
github OpenNMS / opennms-helm / src / panels / alarm-table / alarm_details.js View on Github external
initalizeFeeback() {
    this.$scope.feedbackCorrectCount = 0;
    this.$scope.feedbackIncorrectCount = 0;
    let feedback = [];
    for (let alarm of this.$scope.alarm.relatedAlarms) {
      let alarmFeedback = new Model.OnmsSituationFeedback();
      alarmFeedback.situationKey = this.$scope.alarm.reductionKey;
      alarmFeedback.situationFingerprint = this.fingerPrint(this.$scope.alarm);
      alarmFeedback.alarmKey = alarm.reductionKey;
      alarmFeedback.feedbackType = Model.FeedbackTypes.CORRECT;
      alarmFeedback.reason = "ALL_CORRECT";
      alarmFeedback.rootCause = false;
      alarmFeedback.tags = [];
      alarmFeedback.timestamp = 0;
      alarmFeedback.user = this.contextSrv.user.login;
      feedback.push(alarmFeedback);
      this.$scope.feedbackCorrectCount++;
    }
    return feedback;
  }