Changeset 1857094


Ignore:
Timestamp:
07/28/14 11:24:20 (2 days ago)
Author:
Kris Moore <kris@…>
Branches:
master
Children:
fb5b0b8
Parents:
bc6cbcd
Message:

Update WebUI jails page, allow start / stop of jails, along with
toggle of autostart

Location:
src-webui/appweb/share/html/include
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src-webui/appweb/share/html/include/functions.php

    r4c6c433 r1857094  
    11<? 
     2 
     3function hideurl() 
     4{ 
     5   $p = ($_GET['p']); 
     6   ?> 
     7   <script> 
     8        window.history.pushState('AppWeb', 'AppWeb', '/?p=<? echo $p; ?>'); 
     9   </script> 
     10   <? 
     11} 
    212 
    313// Runs commands through the sudo dispatcher 
  • src-webui/appweb/share/html/include/header.html

    r4c6c433 r1857094  
    226226 
    227227        </style> 
     228 
    228229</head> 
  • src-webui/appweb/share/html/include/jails.php

    r7d08a9b r1857094  
     1<? 
     2   if ( ! empty($_GET['toggle']) ) 
     3   { 
     4        $tjail = $_GET['toggle']; 
     5        $sjail = $_GET['status']; 
     6        if ( $sjail == "Running" ) 
     7          run_cmd("warden stop $tjail"); 
     8        else 
     9          run_cmd("warden start $tjail"); 
     10        hideurl(); 
     11   } 
     12 
     13   if ( ! empty($_GET['autostart']) ) 
     14   { 
     15        $tjail = $_GET['autostart']; 
     16        run_cmd("warden auto $tjail"); 
     17        hideurl(); 
     18   } 
     19?> 
     20 
     21 
    122<h1>System Jail Listing</h1> 
    223<br> 
     
    829   <th>Type</th> 
    930</tr> 
     31 
    1032<? 
     33 
    1134   $jailoutput = run_cmd("warden list"); 
    1235   foreach ($jailoutput as $line) {  // access subarray 
     
    2245         print ("<tr>\n"); 
    2346         print("  <td>$linearray[0]</td>\n"); 
    24          print("  <td>$linearray[1]</td>\n"); 
    25          print("  <td>$linearray[2]</td>\n"); 
     47         print("  <td><a href=\"/?p=jails&autostart=$linearray[0]\" style=\"text-decoration: underline;\">$linearray[1]</a></td>\n"); 
     48         print("  <td><a href=\"/?p=jails&toggle=$linearray[0]&status=$linearray[2]\" style=\"text-decoration: underline;\">$linearray[2]</a></td>\n"); 
    2649         print("  <td>$linearray[3]</td>\n"); 
    2750         print ("</tr>\n"); 
Note: See TracChangeset for help on using the changeset viewer.