<div class="text-center"><h1>LIVE VALUES</h1></div>
<div class='row'>
    <div class='col-xs-4 text-center box-me'>
        <div class="gauge-box">
            <table class="table">
                <tbody>
                    <tr>
                        <td>
                            <h2>Active Alarms</h2>
                        </td>

                        <td></td>
                    </tr>

                    <tr>
                        <td>VFD</td>
                        <td>
                            <% if (channels["vfdipp.alarmvfd"].value == 0){ %>
                                <span class="label label-success">OK</span>
                            <% } else { %>
                                <span class="label label-danger">NOT OK</span>
                            <% } %>
                        </td>
                    </tr>

                    <tr>
                        <td>Mode</td>
                        <td>
                            <% if (channels["vfdipp.alarmmode"].value == 0){ %>
                                <span class="label label-success">OK</span>
                            <% } else { %>
                                <span class="label label-danger">NOT OK</span>
                            <% } %>
                        </td>
                    </tr>

                    <tr>
                        <td>DH Pressure</td>
                        <td>
                            <% if (channels["vfdipp.alarmpressure"].value == 0){ %>
                                <span class="label label-success">OK</span>
                            <% } else { %>
                                <span class="label label-danger">NOT OK</span>
                            <% } %>
                        </td>
                    </tr>

                    <tr>
                        <td>DH Temperature</td>
                        <td>
                            <% if (channels["vfdipp.alarmtemperature"].value == 0){ %>
                                <span class="label label-success">OK</span>
                            <% } else { %>
                                <span class="label label-danger">NOT OK</span>
                            <% } %>
                        </td>
                    </tr>

                    <tr>
                        <td>Remote</td>
                        <td>
                            <% if (channels["vfdipp.alarmremote"].value == 0){ %>
                                <span class="label label-success">OK</span>
                            <% } else { %>
                                <span class="label label-danger">NOT OK</span>
                            <% } %>
                        </td>
                    </tr>

                    <tr>
                        <td>Tubing Pressure</td>
                        <td>
                            <% if (channels["vfdipp.alarmtubingpressure"].value == 0){ %>
                                <span class="label label-success">OK</span>
                            <% } else { %>
                                <span class="label label-danger">NOT OK</span>
                            <% } %>
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
    </div>
    <div class='col-xs-4 text-center box-me'>
        <div class="gauge-box">
            <table class="table">
                <tbody>
                    <tr>
                        <td>
                            <h2>Start Permissive</h2>
                        </td>

                        <td>
                            <h2>
                                <% if (channels["vfdipp.startpermissive"].value == 1){ %>
                                    <span class="label label-success">OK</span>
                                <% } else { %>
                                    <span class="label label-danger">NOT OK</span>
                                <% } %>
                            </h2>
                        </td>
                    </tr>

                    <tr>
                        <td>VFD</td>
                        <td>
                            <% if (channels["vfdipp.spvfd"].value == 1){ %>
                                <span class="label label-success">OK</span>
                            <% } else { %>
                                <span class="label label-danger">NOT OK</span>
                            <% } %>
                        </td>
                    </tr>

                    <tr>
                        <td>Mode</td>
                        <td>
                            <% if (channels["vfdipp.spmode"].value == 1){ %>
                                <span class="label label-success">OK</span>
                            <% } else { %>
                                <span class="label label-danger">NOT OK</span>
                            <% } %>
                        </td>
                    </tr>

                    <tr>
                        <td>DH Pressure</td>
                        <td>
                            <% if (channels["vfdipp.sppressure"].value == 1){ %>
                                <span class="label label-success">OK</span>
                            <% } else { %>
                                <span class="label label-danger">NOT OK</span>
                            <% } %>
                        </td>
                    </tr>

                    <tr>
                        <td>DH Temperature</td>
                        <td>
                            <% if (channels["vfdipp.sptemperature"].value == 1){ %>
                                <span class="label label-success">OK</span>
                            <% } else { %>
                                <span class="label label-danger">NOT OK</span>
                            <% } %>
                        </td>
                    </tr>

                    <tr>
                        <td>Remote</td>
                        <td>
                            <% if (channels["vfdipp.spremote"].value == 1){ %>
                                <span class="label label-success">OK</span>
                            <% } else { %>
                                <span class="label label-danger">NOT OK</span>
                            <% } %>
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
    </div>
    <div class='col-xs-4 text-center box-me'>
        <div class="gauge-box">
            <table class="table">
                <tbody>
                    <tr>
                        <td>
                            <h2>Run Permissive</h2>
                        </td>

                        <td>
                            <h2>
                                <% if (channels["vfdipp.runpermissive"].value == 1){ %>
                                    <span class="label label-success">OK</span>
                                <% } else { %>
                                    <span class="label label-danger">NOT OK</span>
                                <% } %>
                            </h2>
                        </td>
                    </tr>

                    <tr>
                        <td>VFD</td>
                        <td>
                            <% if (channels["vfdipp.rpvfd"].value == 1){ %>
                                <span class="label label-success">OK</span>
                            <% } else { %>
                                <span class="label label-danger">NOT OK</span>
                            <% } %>
                        </td>
                    </tr>

                    <tr>
                        <td>Mode</td>
                        <td>
                            <% if (channels["vfdipp.rpmode"].value == 1){ %>
                                <span class="label label-success">OK</span>
                            <% } else { %>
                                <span class="label label-danger">NOT OK</span>
                            <% } %>
                        </td>
                    </tr>

                    <tr>
                        <td>DH Pressure</td>
                        <td>
                            <% if (channels["vfdipp.rppressure"].value == 1){ %>
                                <span class="label label-success">OK</span>
                            <% } else { %>
                                <span class="label label-danger">NOT OK</span>
                            <% } %>
                        </td>
                    </tr>

                    <tr>
                        <td>DH Temperature</td>
                        <td>
                            <% if (channels["vfdipp.rptemperature"].value == 1){ %>
                                <span class="label label-success">OK</span>
                            <% } else { %>
                                <span class="label label-danger">NOT OK</span>
                            <% } %>
                        </td>
                    </tr>

                    <tr>
                        <td>Remote</td>
                        <td>
                            <% if (channels["vfdipp.rpremote"].value == 1){ %>
                                <span class="label label-success">OK</span>
                            <% } else { %>
                                <span class="label label-danger">NOT OK</span>
                            <% } %>
                        </td>
                    </tr>

                    <tr>
                        <td>Tubing Pressure</td>
                        <td>
                            <% if (channels["vfdipp.rptubingpressure"].value == 1){ %>
                                <span class="label label-success">OK</span>
                            <% } else { %>
                                <span class="label label-danger">NOT OK</span>
                            <% } %>
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
    </div>
</div>

<div class='row'>
    <div class='col-xs-6 col-xs-offset-3 text-center box-me'>
        <h2>Last Shutdown Cause</h2>
        <h1>
            <% if (channels["vfdipp.lastshutdowncause"].value == 0){ %>
                <span class="label label-primary">Unknown</span>
            <% } else if (channels["vfdipp.lastshutdowncause"].value == 1) { %>
                <span class="label label-primary">Mode</span>
            <% } else if (channels["vfdipp.lastshutdowncause"].value == 2) { %>
                <span class="label label-primary">DH Pressure</span>
            <% } else if (channels["vfdipp.lastshutdowncause"].value == 3) { %>
                <span class="label label-primary">DH Temperature</span>
            <% } else if (channels["vfdipp.lastshutdowncause"].value == 4) { %>
                <span class="label label-primary">Tubing Pressure</span>
            <% } else if (channels["vfdipp.lastshutdowncause"].value == 5) { %>
                <span class="label label-primary">VFD</span>
            <% } else if (channels["vfdipp.lastshutdowncause"].value == 6) { %>
                <span class="label label-primary">Remote Trip</span>
            <% } else if (channels["vfdipp.lastshutdowncause"].value == 7) { %>
                <span class="label label-primary">User Shutdown</span>
            <% } %>
        </h1>
    </div>
</div>

<style>
  .box-me {
    position: relative;
    padding: 0.5em;
    padding-bottom: 1.5em;
    border: 1px solid #eee;
    /*margin: 1em 0;*/
  }
  .box-me .gauge-box {
    margin-top: -0.25em;
  }
  .box-me h2 {
      text-transform: uppercase;
      font-size: 14px;
      color: #666;
      font-weight: 400;
      letter-spacing: 1px;
      z-index: 100;
  }
  .dynamic-chart-form {
    background-color: whiteSmoke;
    padding: 1em 0.5em;
    margin-top: 1em;
  }

  .fill-vertically {
      height:261px;
  }

  #systemStatusTimelineContainer h2 {
  text-transform: uppercase;
  font-size: 14px;
  color: #666;
  font-weight: 400;
  letter-spacing: 1px;
  z-index: 100;
  }

.row {
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display:         flex;
    flex-wrap: wrap;
}
.row > [class*='col-'] {
    display: flex;
    flex-direction: column;
}
</style>
