]> defiant.homedns.org Git - ros_wild_thumper.git/commitdiff
www: added hostname variable
authorErik Andresen <erik@vontaene.de>
Thu, 2 Apr 2020 05:11:49 +0000 (07:11 +0200)
committerErik Andresen <erik@vontaene.de>
Thu, 2 Apr 2020 05:11:49 +0000 (07:11 +0200)
www/assets/javascripts/application.js
www/index.html

index a7b478517788dee56d68033f3d03647ea96af4e3..df4c9ebfefc7ca40845878a06c68b83a65dfa34b 100644 (file)
@@ -4,7 +4,7 @@ function init() {
        var isDragging = false;
 
        function connect() {
-               ros.connect('ws://wildthumper:9090');
+               ros.connect('ws://'+robothostname+':9090');
        }
 
        ros.on('connection', function() {
index 7a867656a9dc954e1e78297e8a294a1da02bb083..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>
                                        <div class="cmd_vel_circle"></div>
                                </div>
                                <div id="image" class="tab-pane" role="tabpanel">
-                                       <img id="usb_cam" src="http://wildthumper:8080/stream?topic=/usb_cam/image_raw" style="transform:rotate(-90deg); transform-origin: 60% 60%;"></img>
+                                       <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>