]> defiant.homedns.org Git - ros_wild_thumper.git/blobdiff - www/index.html
www: added hostname variable
[ros_wild_thumper.git] / www / index.html
index e9e23f672d195fb4fd94cc798953fd7a760a3143..bc209acf04c5a79eb1bc7c5f96d68b0bff7db3a9 100644 (file)
@@ -21,6 +21,9 @@
                <script src="assets/javascripts/jquery.minicolors.js"></script>
                <script src="assets/javascripts/vue.js"></script>
                <script src="assets/javascripts/application.js"></script>
+               <script type="text/javascript">
+                       robothostname="wildthumper"
+               </script>
 
                <title>Wild Thumper control</title>
        </head>
                                        <li class="nav-item">
                                                <a class="nav-link" href="#drive" data-toggle="tab" role="tab">Drive</a>
                                        </li>
+                                       <li class="nav-item">
+                                               <a class="nav-link imagelink" href="#image" data-toggle="tab" role="tab">Image</a>
+                                       </li>
                                </ul>
                        </nav>
+
                        <div class="tab-content">
                                <div id="data" class="tab-pane active" role="tabpanel">
                                        <div class="row">
                                                <div id="power" class="col-auto">
                                                        <h4>Power</h4>
-                                                       <label>Voltage:</label>
-                                                       <div class="input-group">
-                                                               <input type=text name="voltage" class="form-control" v-model="voltage" readonly>
-                                                               <div class="input-group-append">
-                                                                       <span class="input-group-text">V</span>
-                                                               </div>
-                                                       </div>
-                                                       <label>Current:</label>
-                                                       <div class="input-group">
-                                                               <input type=text name="current" class="form-control" v-model="current" readonly>
-                                                               <div class="input-group-append">
-                                                                       <span class="input-group-text">A</span>
-                                                               </div>
-                                                       </div>
+                                                       <input-value v-model="voltage" label="Voltage" unit="V"></input-value>
+                                                       <input-value v-model="current" label="Current" unit="A"></input-value>
                                                </div>
                                                <div id="sensors" class="col-auto">
                                                        <h4>Sensors</h4>
-                                                       <label>Light:</label>
-                                                       <div class="input-group">
-                                                               <input type=text name="light" class="form-control" v-model="light" readonly>
-                                                               <div class="input-group-append">
-                                                                       <span class="input-group-text">lx</span>
-                                                               </div>
-                                                       </div>
-                                                       <label>Temperature:</label>
-                                                       <div class="input-group">
-                                                               <input type=text name="temp" class="form-control" v-model="temp" readonly>
-                                                               <div class="input-group-append">
-                                                                       <span class="input-group-text">&#x2103</span>
-                                                               </div>
-                                                       </div>
-                                                       <label>Humidity:</label>
-                                                       <div class="input-group">
-                                                               <input type=text name="humidity" class="form-control" v-model="humidity" readonly>
-                                                               <div class="input-group-append">
-                                                                       <span class="input-group-text">%</span>
-                                                               </div>
-                                                       </div>
-                                                       <label>Pressure:</label>
-                                                       <div class="input-group">
-                                                               <input type=text name="pressure" class="form-control" v-model="pressure" readonly>
-                                                               <div class="input-group-append">
-                                                                       <span class="input-group-text">kPa</span>
-                                                               </div>
-                                                       </div>
-                                                       <label>CO:</label>
-                                                       <input type=text name="co" class="form-control" v-model="co" readonly>
+                                                       <input-value v-model="light" label="Light" unit="lx"></input-value>
+                                                       <input-value v-model="temp" label="Temperature" unit="&#x2103"></input-value>
+                                                       <input-value v-model="humidity" label="Humidity" unit="%"></input-value>
+                                                       <input-value v-model="pressure" label="Pressure" unit="kPa"></input-value>
+                                                       <input-value v-model="co" label="CO"></input-value>
                                                </div>
                                        </div>
                                </div>
                                        <div class="row">
                                                <div class="col-md-2 offset-md-1" >
                                                        <div class="d-flex justify-content-center">
-                                                               <input class="led_color" type="hidden" name="[0]" readonly="true"/>
-                                                               <input class="led_color" type="hidden" name="[1]" readonly="true"/>
-                                                               <input class="led_color" type="hidden" name="[2]" readonly="true"/>
-                                                               <input class="led_color" type="hidden" name="[3]" readonly="true"/>
+                                                               <input class="led_color" type="hidden" :name="led" readonly="true" v-for="led in front_row" />
                                                        </div>
                                                        <div>
                                                                <div class="row wt-icon">
                                                                        <div class="col-md-2 align-self-center bottom-leds">
-                                                                               <input class="led_color" type="hidden" name="[14]" readonly="true"/>
-                                                                               <input class="led_color" type="hidden" name="[15]" readonly="true"/>
+                                                                               <input class="led_color" type="hidden" :name="led" readonly="true" v-for="led in bottom_left_row" />
                                                                        </div>
                                                                        <div class="col-md-8">
                                                                                <div class="d-flex justify-content-center top-leds">
-                                                                                       <input class="led_color" type="hidden" name="[7]" readonly="true"/>
-                                                                                       <input class="led_color" type="hidden" name="[6]" readonly="true"/>
-                                                                                       <input class="led_color" type="hidden" name="[5]" readonly="true"/>
-                                                                                       <input class="led_color" type="hidden" name="[4]" readonly="true"/>
+                                                                                       <input class="led_color" type="hidden" :name="led" readonly="true" v-for="led in top_row" />
                                                                                </div>
                                                                        </div>
                                                                        <div class="col-md-2 align-self-center bottom-leds">
-                                                                               <input class="led_color" type="hidden" name="[13]" readonly="true"/>
-                                                                               <input class="led_color" type="hidden" name="[12]" readonly="true"/>
+                                                                               <input class="led_color" type="hidden" :name="led" readonly="true" v-for="led in bottom_right_row" />
                                                                        </div>
                                                                </div>
                                                        </div>
                                                        <div class="d-flex justify-content-center">
-                                                               <input class="led_color" type="hidden" name="[8]" readonly="true"/>
-                                                               <input class="led_color" type="hidden" name="[9]" readonly="true"/>
-                                                               <input class="led_color" type="hidden" name="[10]" readonly="true"/>
-                                                               <input class="led_color" type="hidden" name="[11]" readonly="true"/>
+                                                               <input class="led_color" type="hidden" :name="led" readonly="true" v-for="led in aft_row" />
                                                        </div>
                                                </div>
                                                <div class="col-md-3 offset-md-1">
-                                                       <div class="form-group row">
-                                                               <label class="col-sm-2 col-form-label">Alle</label>
-                                                               <div class="col-sm-10">
-                                                                       <input class="led_color" type="text" name="[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]" class="form-control" readonly="true"/>
-                                                               </div>
-                                                       </div>
-                                                       <div class="form-group row">
-                                                               <label class="col-sm-2 col-form-label">Front</label>
-                                                               <div class="col-sm-10">
-                                                                       <input class="led_color" type="text" name="[0, 1, 2, 3]" class="form-control" readonly="true"/>
-                                                               </div>
-                                                       </div>
-                                                       <div class="form-group row">
-                                                               <label class="col-sm-2 col-form-label">Aft</label>
-                                                               <div class="col-sm-10">
-                                                                       <input class="led_color" type="text" name="[8, 9, 10, 11]" class="form-control" readonly="true"/>
-                                                               </div>
-                                                       </div>
-                                                       <div class="form-group row">
-                                                               <label class="col-sm-2 col-form-label">Top</label>
-                                                               <div class="col-sm-10">
-                                                                       <input class="led_color" type="text" name="[4, 5, 6, 7]" class="form-control" readonly="true"/>
-                                                               </div>
-                                                       </div>
-                                                       <div class="form-group row">
-                                                               <label class="col-sm-2 col-form-label">Bottom</label>
-                                                               <div class="col-sm-10">
-                                                                       <input class="led_color" type="text" name="[12, 13, 14, 15]" class="form-control" readonly="true"/>
-                                                               </div>
-                                                       </div>
+                                                       <input-led label="All" name="[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]"></input-led>
+                                                       <input-led label="Front" name="[0, 1, 2, 3]"></input-led>
+                                                       <input-led label="Aft" name="[8, 9, 10, 11]"></input-led>
+                                                       <input-led label="Top" name="[4, 5, 6, 7]"></input-led>
+                                                       <input-led label="Bottom" name="[12, 13, 14, 15]"></input-led>
                                                </div>
                                        </div>
                                </div>
                                <div id="drive" class="tab-pane" role="tabpanel">
                                        <div class="cmd_vel_circle"></div>
                                </div>
+                               <div id="image" class="tab-pane" role="tabpanel">
+                                       <img id="usb_cam" src="http://"+robothostname+":8080/stream?topic=/usb_cam/image_raw" style="transform:rotate(-90deg); transform-origin: 60% 60%;"></img>
+                               </div>
                        </div>
                </div>
        </body>
+       <script type="text/x-template" id="input-value-template">
+               <div class="input-value">
+                       <label>{{label}}:</label>
+                       <div class="input-group">
+                               <input type=text class="form-control" :value="value" readonly>
+                               <div class="input-group-append" v-if="unit">
+                                       <span class="input-group-text">{{unit}}</span>
+                               </div>
+                       </div>
+               </div>
+       </script>
+       <script type="text/x-template" id="input-led-template">
+               <div class="form-group row">
+                       <label class="col-sm-2 col-form-label">{{label}}</label>
+                       <div class="col-sm-10">
+                               <input type="text" :name="name" class="led_color" readonly="true"/>
+                       </div>
+               </div>
+       </script>
 </html>