1a1d238f3SIftekharul Islam<loader loading="dataService.loading || loading"></loader>
2*e368108fSDixsie Wolmers<div id="power-operations" class="power-operations">
3cd789508SIftekharul Islam  <div class="row column">
4e126be7aSMichael Davis    <h1>Server power operations</h1>
5706b75b3SMichael Davis    <div class="power__current-status page-header">
6edf1ab46Sbeccabroek      <h2 class="inline">Current status</h2>
7*e368108fSDixsie Wolmers      <div class="power__status-log inline float-right">
8*e368108fSDixsie Wolmers        Last power operation at
9*e368108fSDixsie Wolmers        <span class="courier-bold">{{ powerTime | localeDate }}</span>
10*e368108fSDixsie Wolmers      </div>
11*e368108fSDixsie Wolmers    </div>
12*e368108fSDixsie Wolmers  </div>
13*e368108fSDixsie Wolmers  <!-- Power Indicator Bar -->
14*e368108fSDixsie Wolmers  <div class="row column">
15*e368108fSDixsie Wolmers    <div id="power-indicator-bar" class="power__indicator-bar"
16*e368108fSDixsie Wolmers      ng-class="{'power__state-on': dataService.server_state == 'Running', 'power__state-off': dataService.server_state == 'Off', 'power__state-indet': dataService.server_state == 'Standby', 'power__state-error': dataService.server_state == 'Quiesced'}">
17*e368108fSDixsie Wolmers      <p class="inline">
18*e368108fSDixsie Wolmers        {{ dataService.hostname }} - {{ dataService.server_id }}
19*e368108fSDixsie Wolmers      </p>
20*e368108fSDixsie Wolmers      <h3 class="power__state inline no-margin h3">
21*e368108fSDixsie Wolmers        <span>{{ dataService.server_state | quiescedToError }}</span>
22*e368108fSDixsie Wolmers      </h3>
23cd789508SIftekharul Islam    </div>
24cd789508SIftekharul Islam  </div>
25cd789508SIftekharul Islam  <div class="row column">
26*e368108fSDixsie Wolmers    <!-- Boot Settings Column -->
27*e368108fSDixsie Wolmers    <div class="large-4 columns boot-options-wrapper">
28*e368108fSDixsie Wolmers      <form id="host-boot-settings" name="hostBootSettings" class="host-boot-settings" novalidate>
29*e368108fSDixsie Wolmers        <h2 class="subhead boot-options">Host OS boot settings</h2>
30*e368108fSDixsie Wolmers        <div class="boot-settings-form">
31*e368108fSDixsie Wolmers          <div class="boot-options">
32*e368108fSDixsie Wolmers            <label for="boot-selected">
33*e368108fSDixsie Wolmers              Boot setting override</label>
34*e368108fSDixsie Wolmers            <select id="boot-selected" name="bootSelected" id="boot-selected" ng-disabled="dataService.server_unreachable || bootOverrideError"
35*e368108fSDixsie Wolmers              ng-model="boot.BootSourceOverrideTarget">
36*e368108fSDixsie Wolmers              <option class="courier-bold" value="{{bootSource}}" ng-repeat="bootSource in bootSources">
37*e368108fSDixsie Wolmers                {{ bootSource }}
38*e368108fSDixsie Wolmers              </option>
39*e368108fSDixsie Wolmers            </select>
40*e368108fSDixsie Wolmers          <div class="boot-options one-time-boot-setting">
41*e368108fSDixsie Wolmers            <div class="align-self-center">
42*e368108fSDixsie Wolmers              <label class="control-check" id="one-time-label"> <span class="inline boot-checkbox">Enable one time boot</span>
43*e368108fSDixsie Wolmers                <input type="checkbox" name="oneTime"
44*e368108fSDixsie Wolmers                  ng-disabled="dataService.server_unreachable || bootOverrideError || boot.BootSourceOverrideTarget =='None' " ng-model="boot.oneTimeBootEnabled"
45*e368108fSDixsie Wolmers                  ng-change="oneTimeBootEnabled" />
46*e368108fSDixsie Wolmers                <span class="control__indicator"> </span>
47*e368108fSDixsie Wolmers              </label>
48cd789508SIftekharul Islam            </div>
49cd789508SIftekharul Islam          </div>
50cd789508SIftekharul Islam        </div>
51*e368108fSDixsie Wolmers          <!-- TPM Required -->
52*e368108fSDixsie Wolmers          <div class="boot-options one-time-boot-setting">
53*e368108fSDixsie Wolmers            <div class="boot-options">
54*e368108fSDixsie Wolmers              <h3 class="content-label">
55*e368108fSDixsie Wolmers                TPM required policy</h3>
56*e368108fSDixsie Wolmers              <p> Enable to ensure the system only boots when the TPM is functional. </p>
57*e368108fSDixsie Wolmers              <!-- Toggle component -->
58*e368108fSDixsie Wolmers              <div class="toggle-container">
59*e368108fSDixsie Wolmers                  <div class="toggle">
60*e368108fSDixsie Wolmers                    <input
61*e368108fSDixsie Wolmers                      id="toggle__switch-round"
62*e368108fSDixsie Wolmers                      class="toggle-switch toggle-switch__round-flat"
63*e368108fSDixsie Wolmers                      name="toggle"
64*e368108fSDixsie Wolmers                      type="checkbox"
65*e368108fSDixsie Wolmers                      tabindex="0"
66*e368108fSDixsie Wolmers                      ng-model="TPMToggle.TPMEnable"
67*e368108fSDixsie Wolmers                      ng-disabled="dataService.server_unreachable"
68*e368108fSDixsie Wolmers                    />
69*e368108fSDixsie Wolmers                    <label for="toggle__switch-round" tabindex="0"
70*e368108fSDixsie Wolmers                      >TPM required policy is {{ TPMToggle.TPMEnable ? "On" : "Off" }}</label
71*e368108fSDixsie Wolmers                    >
725ff98780SYoshie Muranaka                  </div>
73*e368108fSDixsie Wolmers                  <span>
74*e368108fSDixsie Wolmers                    {{ TPMToggle.TPMEnable ? "On" : "Off" }}
75*e368108fSDixsie Wolmers                  </span>
76*e368108fSDixsie Wolmers                </div>
77*e368108fSDixsie Wolmers            </div>
78*e368108fSDixsie Wolmers          </div>
79*e368108fSDixsie Wolmers          <!-- form actions -->
80*e368108fSDixsie Wolmers          <div class="boot-form-actions">
81*e368108fSDixsie Wolmers            <button type="submit" class="btn btn-primary" ng-click="saveBootSettings();saveTPMPolicy();hostBootSettings.$setPristine()" ng-disabled="dataService.server_unreachable || hostBootSettings.$pristine;">
82*e368108fSDixsie Wolmers              Save
83c86ce3c9SYoshie Muranaka            </button>
84*e368108fSDixsie Wolmers            <button type="reset" class="btn btn-secondary" ng-disabled="dataService.server_unreachable || hostBootSettings.$pristine" ng-click="resetForm();hostBootSettings.$setPristine()">
85*e368108fSDixsie Wolmers              Cancel
86*e368108fSDixsie Wolmers            </button>
87cd789508SIftekharul Islam          </div>
88*e368108fSDixsie Wolmers      </form>
89cd789508SIftekharul Islam    </div>
90cd789508SIftekharul Islam  </div>
91*e368108fSDixsie Wolmers  <!-- Power Operations Column -->
92*e368108fSDixsie Wolmers  <div class="large-8 columns operations-wrapper">
93*e368108fSDixsie Wolmers    <h2 class="subhead boot-operations">Operations</h2>
94*e368108fSDixsie Wolmers    <!-- Pending one time boot alert -->
95*e368108fSDixsie Wolmers    <div class="alert-warning"
96*e368108fSDixsie Wolmers      ng-if="boot.oneTimeBootEnabled" ng-hide="dataService.server_state == 'Unreachable'">
97*e368108fSDixsie Wolmers      <div class="pending-icon">
98*e368108fSDixsie Wolmers        <icon file="icon-pending.svg"></icon>
99cd789508SIftekharul Islam      </div>
100*e368108fSDixsie Wolmers      <p class="alert-pending">
101*e368108fSDixsie Wolmers        Pending one time boot. Next boot will be performed with the
102*e368108fSDixsie Wolmers        specified one time boot settings. Subsequent boots will be performed
103*e368108fSDixsie Wolmers        with the default settings.
104*e368108fSDixsie Wolmers      </p>
105*e368108fSDixsie Wolmers    </div>
106*e368108fSDixsie Wolmers    <!-- Pending reboot warning -->
107*e368108fSDixsie Wolmers    <p ng-show="operationPending">
108*e368108fSDixsie Wolmers      There are no power operations to display while power operation is in
109*e368108fSDixsie Wolmers      progress. When complete, any new power operations will be displayed
110*e368108fSDixsie Wolmers      here.
111*e368108fSDixsie Wolmers    </p>
112*e368108fSDixsie Wolmers    <div ng-show="!operationPending">
113*e368108fSDixsie Wolmers    <!-- Power on displays only when server is off -->
114*e368108fSDixsie Wolmers    <div class="row column" ng-show="dataService.server_state == 'Off'"
115*e368108fSDixsie Wolmers      ng-class="{disabled: dataService.server_unreachable}">
116*e368108fSDixsie Wolmers      <button id="power__power-on" class="btn btn-primary inline" ng-click="powerOn()" role="button"
117*e368108fSDixsie Wolmers        ng-disabled="dataService.server_unreachable">
118*e368108fSDixsie Wolmers        Power on
119*e368108fSDixsie Wolmers      </button>
120*e368108fSDixsie Wolmers    </div>
121*e368108fSDixsie Wolmers    <!-- Reboot/shutdown column -->
122*e368108fSDixsie Wolmers    <div
123*e368108fSDixsie Wolmers      ng-show="dataService.server_state !== 'Off'">
124*e368108fSDixsie Wolmers      <div class="reboot__operations">
125*e368108fSDixsie Wolmers        <form id="reboot-form" name="rebootForm" class="reboot-form">
126*e368108fSDixsie Wolmers          <fieldset>
127*e368108fSDixsie Wolmers            <legend class="boot-operations">Reboot server</legend>
128*e368108fSDixsie Wolmers              <label class="control-radio">Orderly - OS shuts down, then server reboots
129*e368108fSDixsie Wolmers                <input type="radio" name="radioReboot"
130*e368108fSDixsie Wolmers                  ng-model="defaultRebootSetting" value="warm-reboot" />
131*e368108fSDixsie Wolmers                <span class="control__indicator control__indicator-on"></span>
132*e368108fSDixsie Wolmers              </label>
133*e368108fSDixsie Wolmers              <label class="control-radio">Immediate - Server reboots without OS shutting down; may cause data corruption
134*e368108fSDixsie Wolmers                <input type="radio" name="radioReboot"
135*e368108fSDixsie Wolmers                   ng-model="defaultRebootSetting" value="cold-reboot" />
136*e368108fSDixsie Wolmers                <span class="control__indicator control__indicator-on"></span>
137*e368108fSDixsie Wolmers              </label>
138*e368108fSDixsie Wolmers            </fieldset>
139*e368108fSDixsie Wolmers              <div>
140*e368108fSDixsie Wolmers                <button class="btn-primary" ng-click="rebootConfirmModal()" type="submit" ng-disabled="dataService.server_unreachable">
141*e368108fSDixsie Wolmers                  Reboot
142*e368108fSDixsie Wolmers                </button>
143*e368108fSDixsie Wolmers              </div>
144*e368108fSDixsie Wolmers        </form>
145*e368108fSDixsie Wolmers      </div>
146*e368108fSDixsie Wolmers      <!-- Shutdown Field Row -->
147*e368108fSDixsie Wolmers      <div class="shutdown__operations">
148*e368108fSDixsie Wolmers        <form id="shutdown-form" name="shutdownForm" class="shutdown-form">
149*e368108fSDixsie Wolmers          <fieldset>
150*e368108fSDixsie Wolmers            <legend class="boot-operations">Shutdown server</legend>
151*e368108fSDixsie Wolmers            <label class="control-radio">Orderly - OS shuts down, then server shuts down
152*e368108fSDixsie Wolmers              <input type="radio" name="radioShutdown" ng-model="defaultShutdownSetting"
153*e368108fSDixsie Wolmers                value='warm-shutdown' />
154*e368108fSDixsie Wolmers              <span class="control__indicator control__indicator-on"></span>
155*e368108fSDixsie Wolmers            </label>
156*e368108fSDixsie Wolmers            <label class="control-radio">Immediate - Server shuts down without OS shutting down; may cause data corruption
157*e368108fSDixsie Wolmers              <input type="radio" name="radioShutdown" ng-model="defaultShutdownSetting"
158*e368108fSDixsie Wolmers                value='cold-shutdown' />
159*e368108fSDixsie Wolmers              <span class="control__indicator control__indicator-on"></span>
160*e368108fSDixsie Wolmers            </label>
161*e368108fSDixsie Wolmers           </fieldset>
162*e368108fSDixsie Wolmers            <div>
163*e368108fSDixsie Wolmers              <button class="btn-primary" ng-click="shutdownConfirmModal()" type="submit" ng-disabled="dataService.server_unreachable">
164*e368108fSDixsie Wolmers                Shut down
165*e368108fSDixsie Wolmers              </button>
166*e368108fSDixsie Wolmers            </div>
167*e368108fSDixsie Wolmers        </form>
168*e368108fSDixsie Wolmers      </div>
169cd789508SIftekharul Islam    </div>
170cd789508SIftekharul Islam  </div>
171cd789508SIftekharul Islam  </div>
1725ff98780SYoshie Muranaka</div>