mirror of
				https://github.com/gyurix1968/guacamole-client.git
				synced 2025-10-31 00:53:21 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			152 lines
		
	
	
		
			6.1 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			152 lines
		
	
	
		
			6.1 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
| <?xml version="1.0" encoding="UTF-8"?>
 | |
| <!DOCTYPE html>
 | |
| 
 | |
| <!--
 | |
|     Guacamole - Clientless Remote Desktop
 | |
|     Copyright (C) 2010  Michael Jumper
 | |
| 
 | |
|     This program is free software: you can redistribute it and/or modify
 | |
|     it under the terms of the GNU Affero General Public License as published by
 | |
|     the Free Software Foundation, either version 3 of the License, or
 | |
|     (at your option) any later version.
 | |
| 
 | |
|     This program is distributed in the hope that it will be useful,
 | |
|     but WITHOUT ANY WARRANTY; without even the implied warranty of
 | |
|     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 | |
|     GNU Affero General Public License for more details.
 | |
| 
 | |
|     You should have received a copy of the GNU Affero General Public License
 | |
|     along with this program.  If not, see <http://www.gnu.org/licenses/>.
 | |
| -->
 | |
| 
 | |
| <html xmlns="http://www.w3.org/1999/xhtml">
 | |
| 
 | |
|     <head>
 | |
|         <link rel="icon" type="image/png" href="images/guacamole-logo-64.png"/>
 | |
|         <link rel="stylesheet" type="text/css" href="styles/client.css"/>
 | |
|         <link rel="stylesheet" type="text/css" href="styles/keyboard.css"/>
 | |
|         <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no, target-densitydpi=device-dpi"/>
 | |
|         <meta name="apple-mobile-web-app-capable" content="yes"/>
 | |
|         <title>Guacamole ${project.version}</title>
 | |
|     </head>
 | |
| 
 | |
|     <body>
 | |
| 
 | |
|         <!-- Display -->
 | |
|         <div class="displayOuter">
 | |
|             <div class="displayMiddle">
 | |
|                 <div id="display">
 | |
|                 </div>
 | |
|             </div>
 | |
|         </div>
 | |
| 
 | |
|         <!-- Dimensional clone of viewport -->
 | |
|         <div id="viewportClone"/>
 | |
| 
 | |
|         <!-- Notification area -->
 | |
|         <div id="notificationArea"/>
 | |
| 
 | |
|         <!-- Images which should be preloaded -->
 | |
|         <div id="preload">
 | |
|             <img src="images/action-icons/guac-close.png"/>
 | |
|             <img src="images/progress.png"/>
 | |
|         </div>
 | |
|         
 | |
|         <script type="text/javascript" src="scripts/lib/blob/blob.js"></script>
 | |
|         <script type="text/javascript" src="scripts/lib/filesaver/filesaver.js"></script>
 | |
| 
 | |
|         <!-- guacamole-common-js scripts -->
 | |
|         <script type="text/javascript" src="guacamole-common-js/keyboard.js"></script>
 | |
|         <script type="text/javascript" src="guacamole-common-js/mouse.js"></script>
 | |
|         <script type="text/javascript" src="guacamole-common-js/layer.js"></script>
 | |
|         <script type="text/javascript" src="guacamole-common-js/tunnel.js"></script>
 | |
|         <script type="text/javascript" src="guacamole-common-js/audio.js"></script>
 | |
|         <script type="text/javascript" src="guacamole-common-js/guacamole.js"></script>
 | |
|         <script type="text/javascript" src="guacamole-common-js/oskeyboard.js"></script>
 | |
| 
 | |
|         <!-- guacamole-default-webapp scripts -->
 | |
|         <script type="text/javascript" src="scripts/session.js"></script>
 | |
|         <script type="text/javascript" src="scripts/history.js"></script>
 | |
|         <script type="text/javascript" src="scripts/guac-ui.js"></script>
 | |
|         <script type="text/javascript" src="scripts/client-ui.js"></script>
 | |
| 
 | |
|         <!-- Init -->
 | |
|         <script type="text/javascript"> /* <![CDATA[ */
 | |
| 
 | |
|             // Start connect after control returns from onload (allow browser
 | |
|             // to consider the page loaded).
 | |
|             window.onload = function() {
 | |
|                 window.setTimeout(function() {
 | |
| 
 | |
|                     var tunnel;
 | |
| 
 | |
|                     // If WebSocket available, try to use it.
 | |
|                     if (window.WebSocket)
 | |
|                         tunnel = new Guacamole.ChainedTunnel(
 | |
|                             new Guacamole.WebSocketTunnel("websocket-tunnel"),
 | |
|                             new Guacamole.HTTPTunnel("tunnel")
 | |
|                         );
 | |
| 
 | |
|                     // If no WebSocket, then use HTTP.
 | |
|                     else
 | |
|                         tunnel = new Guacamole.HTTPTunnel("tunnel")
 | |
| 
 | |
|                     // Instantiate client
 | |
|                     var guac = new Guacamole.Client(tunnel);
 | |
| 
 | |
|                     // Add client to UI
 | |
|                     guac.getDisplay().className = "software-cursor";
 | |
|                     GuacUI.Client.display.appendChild(guac.getDisplay());
 | |
| 
 | |
|                     // Tie UI to client
 | |
|                     GuacUI.Client.attach(guac);
 | |
| 
 | |
|                     try {
 | |
| 
 | |
|                         // Calculate optimal width/height for display
 | |
|                         var optimal_width = window.innerWidth;
 | |
|                         var optimal_height = window.innerHeight;
 | |
| 
 | |
|                         // Scale width/height to be at least 600x600
 | |
|                         if (optimal_width < 600 || optimal_height < 600) {
 | |
|                             var scale = Math.max(600 / optimal_width, 600 / optimal_height);
 | |
|                             optimal_width = Math.floor(optimal_width * scale);
 | |
|                             optimal_height = Math.floor(optimal_height * scale);
 | |
|                         }
 | |
| 
 | |
|                         // Get entire query string, and pass to connect().
 | |
|                         // Normally, only the "id" parameter is required, but
 | |
|                         // all parameters should be preserved and passed on for
 | |
|                         // the sake of authentication.
 | |
| 
 | |
|                         var connect_string =
 | |
|                             window.location.search.substring(1)
 | |
|                             + "&width="  + optimal_width
 | |
|                             + "&height=" + optimal_height;
 | |
| 
 | |
|                         // Add audio mimetypes to connect_string
 | |
|                         GuacUI.Audio.supported.forEach(function(mimetype) {
 | |
|                             connect_string += "&audio=" + encodeURIComponent(mimetype);
 | |
|                         });
 | |
| 
 | |
|                         // Add video mimetypes to connect_string
 | |
|                         GuacUI.Video.supported.forEach(function(mimetype) {
 | |
|                             connect_string += "&video=" + encodeURIComponent(mimetype);
 | |
|                         });
 | |
| 
 | |
|                         guac.connect(connect_string);
 | |
| 
 | |
|                     }
 | |
|                     catch (e) {
 | |
|                         GuacUI.Client.showError(e.message);
 | |
|                     }
 | |
| 
 | |
|                 }, 0);
 | |
|             };
 | |
| 
 | |
|         /* ]]> */ </script>
 | |
| 
 | |
|     </body>
 | |
| 
 | |
| </html>
 |