summaryrefslogtreecommitdiffstats
path: root/app/configuration/controllers/snmp-controller.html
blob: 6280a82efd567f6cc2c198953c913cec12a08291 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<loader loading="loading"></loader>
<div id="configuration-snmp" class="page">
  <h1 class="page-title">SNMP settings</h1>
  <section class="section">
    <p class="section-content">
      Set the Simple Network Management Protocol (SNMP) with a host name or IP
      address and a port.
    </p>
  </section>
  <section class="section">
    <div class="section-header">
      <h2 class="section-title">Managers</h2>
    </div>
    <div class="section-content">
      <p class="manager_group empty" ng-if="managers.length < 1">
        No managers have been added yet.
      </p>
    </div>
    <form id="snmp__form" name="snmp__form" novalidate>
      <div class="section-content">
        <div
          class="row manager_group"
          ng-form="manager_group"
          ng-repeat="manager in managers track by $index">
          <div class="small-12 medium-5 large-4 form__field snmp-field">
            <label
              for="snmp-manager{{ $index + 1 }}-address"
              class="content-label">
              Host name or IP Address
            </label>
            <input
              id="snmp-manager{{ $index + 1 }}-address"
              name="snmp-manager{{ $index + 1 }}-address"
              type="text"
              ng-change="manager.updateAddress=true"
              ng-model="manager.address"
              required/>
            <div
              ng-messages="manager_group['snmp-manager'+($index+1)+'-address'].$error"
              class="form-error"
              ng-class="{'visible': manager_group['snmp-manager'+($index+1)+'-address'].$touched || submitted}">
              <p ng-message="required" role="alert">Field is required</p>
            </div>
          </div>
          <div class="small-9 medium-5 large-4 form__field snmp-field">
            <label for="snmp-manager{{ $index + 1 }}-port" class="content-label">Port</label>
            <input
              id="snmp-manager{{ $index + 1 }}-port"
              name="snmp-manager{{ $index + 1 }}-port"
              type="number"
              min="0"
              max="65535"
              step="1"
              ng-change="manager.updatePort=true"
              ng-model="manager.port"
              required/>
            <div
              ng-messages="manager_group['snmp-manager'+($index+1)+'-port'].$error"
              class="form-error"
              ng-class="{'visible': manager_group['snmp-manager'+($index+1)+'-port'].$touched || submitted}">
              <p ng-message="required" role="alert">Value must be between 0 - 65,535</p>
            </div>
          </div>
          <div class="small-3 medium-2 large-4 snmp-field">
            <button
              class="btn btn-tertiary trash_button"
              type="button"
              ng-click="removeSNMPManager($index)"
              aria-label="Remove">
              <icon file="icon-trashcan.svg" aria-hidden="true"></icon>
            </button>
          </div>
        </div>
      </div>
      <div class="section-content">
        <button
          class="btn btn-tertiary btn-add-manager"
          type="button"
          ng-click="submitted=false; addNewSNMPManager();">
          <icon file="icon-plus.svg" aria-hidden="true"></icon>Add manager
        </button>
      </div>
      <div class="form__actions">
        <button
          type="submit"
          class="btn btn-primary"
          ng-click="submitted=true;  snmp__form.$valid && setSNMP();">
          Save settings
        </button>
        <button type="button" class="btn btn-secondary" ng-click="refresh()">
          Cancel
        </button>
      </div>
    </form>
  </section>
</div>
OpenPOWER on IntegriCloud