/[projects]/misc/xenconsole/index.php
ViewVC logotype

Diff of /misc/xenconsole/index.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1876 by torben, Fri Nov 30 08:27:52 2012 UTC revision 1879 by torben, Fri Nov 30 08:53:38 2012 UTC
# Line 60  function doAction(action, uuid) { Line 60  function doAction(action, uuid) {
60  }  }
61    
62  function console(url, session) {  function console(url, session) {
63            if (url == '')
64                    return;
65    
66          var key = prompt("Key");          var key = prompt("Key");
67          if (key == "" || key == null) {          if (key == "" || key == null) {
68                  return;                  return;
# Line 67  function console(url, session) { Line 70  function console(url, session) {
70          var url = "console.php?url=" + url + "&session=" + session + "&key=" + key;          var url = "console.php?url=" + url + "&session=" + session + "&key=" + key;
71    
72          //window.location = url;          //window.location = url;
73          $('#mainwindow').load(url);          //$('#mainwindow').load(url);
74            window.open(url);
75  }  }
76    
77  function loadServer() {  function loadServer() {
# Line 168  foreach($vms_array as $vm) { Line 172  foreach($vms_array as $vm) {
172                  $vps_topbg = 'vps_topred.png';                  $vps_topbg = 'vps_topred.png';
173          }          }
174    
175            $url = "";
176            $session = "";
177            foreach($vm["consoles"] as $conref) {
178                    $con = $xenserver->console__get_record( $conref );
179                    //var_dump($con);
180    
181                    if ($con["protocol"] == "rfb") {
182                            $url = urlencode( $con["location"] );
183                            $session = $xenserver->get_id();
184                    }
185            }
186    
187    
188    
189  //      echo "<a href='#' onclick=\"loadvm('$uuid');\">$name</a><br>\n";  //      echo "<a href='#' onclick=\"loadvm('$uuid');\">$name</a><br>\n";
190  ?>  ?>
# Line 176  foreach($vms_array as $vm) { Line 193  foreach($vms_array as $vm) {
193                  <tr background='gfx/vps_topbg.png'>                  <tr background='gfx/vps_topbg.png'>
194                          <td width='10' background='gfx/<?php echo $vps_topbg; ?>' class='small'>&nbsp;</td>                          <td width='10' background='gfx/<?php echo $vps_topbg; ?>' class='small'>&nbsp;</td>
195                          <td colspan='2' class='small'><b><?php echo $name; ?></b></td>                          <td colspan='2' class='small'><b><?php echo $name; ?></b></td>
196                          <td colspan='2' class='small' align='right'>(IP: 192.168.10.45, 172.10.0.34) <img src='gfx/icon-terminal.png' style='vertical-align: middle;'></td>                          <td colspan='2' class='small' align='right'>
197                                    (IP: 192.168.10.45, 172.10.0.34)
198                                    <a href="#" onclick="console('<?php echo $url;?>','<?php echo $session;?>')"><img src='gfx/icon-terminal.png' style='vertical-align: middle;'></a>
199                            </td>
200                  </tr>                  </tr>
201    
202                  <tr bgcolor='#eee'>                  <tr bgcolor='#eee'>
203                  <td></td>                  <td></td>
204    
205                          <td width='150' class='small'>start stop force</td>                  <td width='150' class='small'>
206                            <?php
207                            if ($state == "Running") {
208                                    echo "start | ";
209                                    echo "<a href='#' onclick=\"doAction('shutdown','$uuid')\">stop</a> | ";
210                                    echo "<a href='#' onclick=\"doAction('hardshutdown','$uuid')\">force shutdown</a>";
211                            } else {
212                                    echo "<a href='#' onclick=\"doAction('start','$uuid')\">start</a> | ";
213                                    echo "stop | ";
214                                    echo "force shutdown";
215                            }
216                            ?>
217    
218                    </td>
219    
220                  <td width='100' align='right' class='small'>                  <td width='100' align='right' class='small'>
221                          <img src='gfx/icon-cpu.png' style='vertical-align: middle;'>                          <img src='gfx/icon-cpu.png' style='vertical-align: middle;'>

Legend:
Removed from v.1876  
changed lines
  Added in v.1879

  ViewVC Help
Powered by ViewVC 1.1.20