summaryrefslogtreecommitdiffstats
path: root/app/configuration/controllers/date-time-controller.html
blob: 23a93d28fa94cdb84d1163a964459f2b81ba7dee (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
<loader loading="loading"></loader>
<div id="configuration-date-time">
  <div class="row column">
    <h1>Date and time settings</h1>
  </div>
  <form class="time__form" role="form" action="">
    <div class="page-header">
      <h2 class="bold h4">Set date and time manually or configure a Network Time Protocol (NTP) Server</h2>
    </div>
    <fieldset>
      <div class="column large-8">
        <div class="row column">
          <label class="control-radio" for="ntp-time">Obtain Automatically from a Network Time Protocol (NTP) Server
            <input type="radio" id="ntp-time" ng-model="time.mode" value="NTP">
            <span class="control__indicator control__indicator-on"></span>
          </label>
        </div>
        <div class="row column date-time__ntp-servers-wrap">
          <fieldset class="date-time__ntp-servers" ng-repeat="server in ntp.servers track by $index">
            <label for="ntp-server{{$index+1}}">NTP Server Address {{$index+1}} <span ng-if="$first">(Primary)</span></label>
            <div class="inline">
              <input id="ntp-server{{$index+1}}" type="text" ng-readonly="time.mode != 'NTP'" ng-model="server" ng-blur="ntp.servers[$index] = server" set-focus-on-new-input/>
            </div>
            <button class="date-time__dns-remove inline" ng-click="removeNTPField($index)">Remove</button>
          </fieldset>
        </div>
        <div class="row column date-time__ntp-servers-wrap">
          <button type="button" class="btn-primary block" ng-click="addNTPField()">Add new NTP server</button>
        </div>
        <div class="row column">
          <label class="control-radio" for="manual-time">Manually set date and time
            <input type="radio" id="manual-time" ng-model="time.mode" value="Manual"/>
            <span class="control__indicator control__indicator-on"></span>
          </label>
        </div>
        <ul class="date-time__metadata-wrapper">
          <li class="date-time__metadata-block">
            <p class="content-label">BMC <span ng-if="time.owner != 'Split'">and Host</span> Time</p>
            <div class="inline">
              <input type="date" ng-model="bmc.date" ng-readonly="time.mode == 'NTP'" min="2018-01-01" max="2099-12-31"/>
              <input type="time" ng-model="bmc.date" ng-readonly="time.mode == 'NTP'" />
              <p class="courier-bold">{{bmc.timezone}}</p>
            </div>
          </li>
          <li class="date-time__metadata-block" ng-if="time.owner == 'Split'">
            <p class="content-label">Host Time</p>
            <div class="inline">
              <!--- Ideally, would just use one input, datetime-local, but datetime-local is not supported on Firefox.--->
              <input type="date" ng-model="host.date" min="2018-01-01" max="2099-12-31"/>
              <input type="time" ng-model="host.date"/>
              <p class="courier-bold">{{host.timezone}}</p>
            </div>
          </li>
          <li class="date-time__metadata-block">
          <label class="content-label">Time Owner</label>
          <select ng-model="time.owner" class="date-time__owner-dropdown">
            <option class="courier-bold" ng-repeat="owner in timeOwners">{{owner}}</option>
          </select>
          </li>
        </ul>
      </div>
    </fieldset>
    <div class="time__submit-wrapper">
      <button type="button" class="btn-primary inline" ng-click="setTime()">Save settings</button>
      <button type="button" class="btn-secondary inline" ng-click="refresh()">Cancel</button>
    </div>
    <p class="success-msg" ng-show="success" role="alert">Success! Time changed!</p>
    <p class="set_time_error error-msg" ng-show="error" role="alert">Error setting time!</p>
  </form>
</div>
OpenPOWER on IntegriCloud