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 a7b4785..df4c9eb 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 7a86765..bc209ac 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>