<% if (channels["ipp.downholetoolenabled"].value == 1) {%>

    <div class='row row-flex box-me'>
      <div class='col-xs-4 text-center'>
        <h2>Fluid Level</h2>
        <div class="gauge-box">
            <!-- <div data-labelheight="10" style="height: 170px; background: transparent; margin: 0 auto;" id="gauge-dhfluidlevel" data-chart="solidgauge" data-nodename="ipp.dhfluidlevel" data-units="ft" data-min="0" data-max="600" data-colors="0.1:#DF5353,0.5:#DDDF0D,0.9:#55BF3B" data-valuefontsize="18px"></div> -->
            <gauge type="angular" channel="dhfluidlevel" max="600" label="ft." classes="extra" height="250" />
            <span data-timeupdate="dhfluidlevel"><%= channels["ipp.dhfluidlevel"].timestamp %></span>
        </div>
      </div>
      <div class='col-xs-8'>
        <div style="height:300px" id="chart-dhfluidlevel" data-chart="chart" data-nodename1="ipp.dhfluidlevel" data-datalabel1="Fluid Level" data-daysofhistory="2"  data-chartlabel="Fluid Level" data-ylabel="" data-xlabel="Date" data-units=" ft"></div>
      </div>
    </div>

    <div class='row row-flex box-me'>
      <div class='col-xs-4 text-center'>
        <h2>Downhole Pressure</h2>
        <div class="gauge-box">
            <!-- <div data-labelheight="10" style="height: 170px; background: transparent; margin: 0 auto;" id="gauge-dhintakepressure" data-chart="solidgauge" data-nodename="ipp.dhintakepressure" data-units="PSI" data-min="0" data-max="400" data-colors="0.1:#DF5353,0.5:#DDDF0D,0.9:#55BF3B" data-valuefontsize="18px"></div> -->
            <gauge type="angular" channel="dhintakepressure" max="400" label="PSI" classes="extra" height="250" />
            <span data-timeupdate="dhintakepressure"><%= channels["ipp.dhintakepressure"].timestamp %></span>
        </div>
      </div>
      <div class='col-xs-8'>
        <div style="height:300px" id="chart-dhintakepressure" data-chart="chart" data-nodename1="ipp.dhintakepressure" data-datalabel1="Downhole Pressure" data-daysofhistory="2"  data-chartlabel="DH Intake Pressure" data-ylabel="" data-xlabel="Date" data-units=" PSI"></div>
      </div>
    </div>

    <div class='row row-flex box-me'>
      <div class='col-xs-4 text-center'>
        <h2>Downhole Temperature</h2>
        <div class="gauge-box">
            <!-- <div data-labelheight="10" style="height: 170px; background: transparent; margin: 0 auto;" id="gauge-dhintaketemperature" data-chart="solidgauge" data-nodename="ipp.dhintaketemperature" data-units=" &deg; F" data-min="0" data-max="400" data-colors="0.1:#DF5353,0.5:#DDDF0D,0.9:#55BF3B" data-valuefontsize="18px"></div> -->
            <gauge type="angular" channel="dhintaketemperature" max="300" label="deg F" classes="extra" height="250" />
            <span data-timeupdate="dhintaketemperature"><%= channels["ipp.dhintaketemperature"].timestamp %></span>
        </div>
      </div>
      <div class='col-xs-8'>
        <div style="height:300px" id="chart-dhintaketemperature" data-chart="chart" data-nodename1="ipp.dhintaketemperature" data-datalabel1="Downhole Temperature" data-daysofhistory="2"  data-chartlabel="DH Intake Temperature" data-ylabel="" data-xlabel="Date" data-units=" &deg; F"></div>
      </div>
    </div>
<% } %>

<div class='row row-flex box-me'>
  <div class='col-xs-4 text-center'>
    <h2>Average Current</h2>
    <div class="gauge-box">
        <!-- <div data-labelheight="10" style="height: 170px; background: transparent; margin: 0 auto;" id="gauge-e300averagecurrent" data-chart="solidgauge" data-nodename="ipp.e300averagecurrent" data-units="A" data-min="0" data-max="<%= channels["ipp.cfgcflasetting"].value %>" data-colors="0.1:#DF5353,0.5:#DDDF0D,0.9:#55BF3B" data-valuefontsize="18px"></div> -->
        <gauge type="angular" channel="e300averagecurrent" max="150" label="A" classes="extra" height="250" />
        <span data-timeupdate="e300averagecurrent"><%= channels["ipp.e300averagecurrent"].timestamp %></span>
    </div>
  </div>
  <div class='col-xs-8'>
    <div style="height:300px" id="chart-e300averagecurrent" data-chart="chart" data-nodename1="ipp.e300averagecurrent" data-datalabel1="Average Current" data-daysofhistory="2"  data-chartlabel="Average Current" data-ylabel="" data-xlabel="Date" data-units=" A"></div>
  </div>
</div>

<div class='row row-flex box-me'>
  <div class='col-xs-4 text-center'>
    <h2>Average L-L Voltage</h2>
    <div class="gauge-box">
        <!-- <div data-labelheight="10" style="height: 170px; background: transparent; margin: 0 auto;" id="gauge-e300averagellvoltage" data-chart="solidgauge" data-nodename="ipp.e300averagellvoltage" data-units="V" data-min="0" data-max="600" data-colors="0.1:#DF5353,0.5:#DDDF0D,0.9:#55BF3B" data-valuefontsize="18px"></div> -->
        <gauge type="angular" channel="e300averagellvoltage" max="600" label="V" classes="extra" height="250" />
        <span data-timeupdate="e300averagellvoltage"><%= channels["ipp.e300averagellvoltage"].timestamp %></span>
    </div>
  </div>
  <div class='col-xs-8'>
    <div style="height:300px" id="chart-e300averagellvoltage" data-chart="chart" data-nodename1="ipp.e300averagellvoltage" data-datalabel1="Average L-L Voltage" data-daysofhistory="2"  data-chartlabel="Average L-L Voltage" data-ylabel="" data-xlabel="Date" data-units=" V"></div>
  </div>
</div>

<div class='row row-flex box-me'>
  <div class='col-xs-4 text-center'>
    <h2>Flow Rate</h2>
    <div class="gauge-box">
        <gauge type="angular" channel="flowrate" max="400" label="GPM" classes="extra" height="250" />
        <span data-timeupdate="flowrate"><%= channels["ipp.flowrate"].timestamp %></span>
    </div>
  </div>
  <div class='col-xs-8'>
    <div style="height:300px" id="chart-flowrate" data-chart="chart" data-nodename1="ipp.flowrate" data-datalabel1="Flow Rate" data-daysofhistory="2"  data-chartlabel="Flow Rate" data-ylabel="" data-xlabel="Date" data-units=" GPM"></div>
  </div>
</div>

<% if (channels["ipp.pressuretransducerenabled"].value == 1) {%>

    <div class='row row-flex box-me'>
      <div class='col-xs-4 text-center'>
        <h2>Tubing Pressure</h2>
        <div class="gauge-box">
            <!-- <div data-labelheight="10" style="height: 170px; background: transparent; margin: 0 auto;" id="gauge-pressurein" data-chart="solidgauge" data-nodename="ipp.pressurein" data-units="PSI" data-min="0" data-max="400" data-colors="0.1:#DF5353,0.5:#DDDF0D,0.9:#55BF3B" data-valuefontsize="18px"></div> -->
            <gauge type="angular" channel="pressurein" max="400" label="PSI" classes="extra" height="250" />
            <span data-timeupdate="pressurein"><%= channels["ipp.pressurein"].timestamp %></span>
        </div>
      </div>
      <div class='col-xs-8'>
        <div style="height:300px" id="chart-pressurein" data-chart="chart" data-nodename1="ipp.pressurein" data-datalabel1="Tubing Pressure" data-daysofhistory="2"  data-chartlabel="Tubing Pressure" data-ylabel="" data-xlabel="Date" data-units=" PSI"></div>
      </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;
    }

    .pad15 {
        margin: 15px 15px;
    }

    .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;
    }

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

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