summaryrefslogtreecommitdiffstats
path: root/app/access-control/controllers/user-accounts-modal-settings.html
blob: d48809fd554bbcccfcb7fddcc65b1a5e2ab27b73 (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
<div class="uib-modal__content  modal__local-users-settings">
  <div class="modal-header">
    <h2 class="modal-title" id="dialog_label">Account policy settings</h2>
    <button type="button" class="btn  btn--close  float-right" ng-click="$dismiss()" aria-label="Close">
      <icon file="icon-close.svg" aria-hidden="true"></icon>
    </button>
  </div>
  <form name="form">
    <div class="modal-body">
      <div class="row">
        <div class="column medium-6">
            <!-- Max login attempts -->
            <div class="field-group-container">
              <label for="maxLogin">Max failed login attempts</label>
              <p class="label__helper-text">Value must be between <span class="nowrap">0 – 65535</span></p>
              <input id="maxLogin"
                     name="maxLogin"
                     type="number"
                     required
                     min="0"
                     max="65535"
                     ng-model="modalCtrl.settings.maxLogin" />
              <div ng-if="form.maxLogin.$invalid && form.maxLogin.$dirty" class="form__validation-message">
                <span ng-show="form.maxLogin.$error.required">
                  Field is required</span>
                <span ng-show="form.maxLogin.$error.min || form.maxLogin.$error.max">
                  Value must be between <span class="nowrap">1 - 65535</span></span>
              </div>
            </div>
        </div>
        <div class="column medium-6">
          <!-- User unlock method -->
          <fieldset class="field-group-container">
            <legend>User unlock method</legend>
            <!-- Automatic radio option -->
            <label class="radio-label">
              <input name="lockoutMethod"
                     type="radio"
                     ng-value="1"
                     ng-model="modalCtrl.settings.lockoutMethod">
              Automatic after timeout
            </label>
            <!-- Automatic timeout value -->
            <div class="field-group-container  radio-option__input-field-group">
              <label for="lockoutMethod1">Timeout duration (seconds)</label>
              <p class="label__helper-text" id="lockoutMethod1Helper">Must be at least 1</p>
              <input id="lockoutMethod1"
                     name="timeoutDuration"
                     type="number"
                     aria-describedby="lockoutMethod1Helper"
                     ng-min="modalCtrl.settings.lockoutMethod ? 1 : null"
                     ng-disabled="!modalCtrl.settings.lockoutMethod"
                     ng-required="modalCtrl.settings.lockoutMethod"
                     ng-model="modalCtrl.settings.timeoutDuration"/>
              <div ng-if="form.timeoutDuration.$invalid && form.timeoutDuration.$touched" class="form__validation-message">
                <span ng-show="form.timeoutDuration.$error.required">
                  Field is required</span>
                <span ng-show="form.timeoutDuration.$error.min">
                  Value must be at least 1</span>
              </div>
            </div>
            <!-- Manual radio option -->
            <label class="radio-label">
              <input name="lockoutMethod"
                     type="radio"
                     ng-value="0"
                     ng-model="modalCtrl.settings.lockoutMethod">
              Manual
            </label>
          </fieldset>
        </div>
      </div>
    </div>
    <div class="modal-footer">
      <button class="btn btn-secondary" ng-click="$dismiss()" type="button">Cancel</button>
      <button class="btn btn-primary"
              type="submit"
              ng-click="$close(form)"
              ng-disabled="form.$invalid || form.$pristine"
              ng-class="{'disabled': form.$invalid}">
        Save
      </button>
    </div>
  </form>
</div>
OpenPOWER on IntegriCloud