Changeset 1234788e


Ignore:
Timestamp:
09/08/14 11:05:28 (3 months ago)
Author:
Kris Moore <kris@…>
Branches:
master, releng/10.1
Children:
00ef572a
Parents:
c625b8e
Message:

Update AppCafe?-Web to do instant notification on some items, like
starting / stopping a jail

Location:
src-webui/appweb
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src-webui/appweb/dispatcher

    rd74ab79 r1234788e  
    129129  # If we installed something into a jail, refresh them 
    130130  if [ "$target" != "__system__" ] ; then 
    131      pc-systemflag WARDENUPDATE SUCCESS 
     131     syscache "startsync" 
    132132  fi 
    133133 
     
    173173 
    174174    # Done with pkg ops, lets inform syscache to refresh 
    175     pc-systemflag SYSCACHE UPDATE 
     175    syscache "startsync" 
    176176  done 
    177177 
     
    216216          *) echo "Non-dispatch-approved warden command: $2" ;; 
    217217  esac 
    218   pc-systemflag SYSCACHE UPDATE 
     218  syscache "startsync" 
    219219} 
    220220 
  • src-webui/appweb/share/html/include/functions.php

    r01363ce r1234788e  
    220220} 
    221221 
    222 function get_jail_list() 
     222function get_jail_list($force=false) 
    223223{ 
    224224  global $sc; 
     
    226226 
    227227  // If this is set, we have the jail list already 
    228   if ( ! empty( $jail_list_array) ) 
     228  if ( ! empty( $jail_list_array) and ! $force ) 
    229229     return $jail_list_array; 
     230 
     231  unset($jail_list_array); 
    230232 
    231233  // Query the system for the jail list 
     
    240242function display_jail_menu() 
    241243{ 
    242  
    243    $jailoutput = get_jail_list(); 
    244    $running=$jailoutput[0]; 
    245    $stopped=$jailoutput[1]; 
    246    $rarray = explode( ", ", $running); 
    247    $sarray = explode( ", ", $stopped); 
    248  
    249   if ( ! empty($running) ) { 
    250     echo "<b>Running Jails</b><hr align=\"left\" width=\"85%\">"; 
     244  $jailoutput = get_jail_list(); 
     245  $running=$jailoutput[0]; 
     246  $stopped=$jailoutput[1]; 
     247  $rarray = explode( ", ", $running); 
     248  $sarray = explode( ", ", $stopped); 
     249 
     250  echo "<b>Jails</b><hr align=\"left\" width=\"85%\">"; 
     251 
     252  if ( ! empty($running) ) 
    251253    foreach ($rarray as $jail) 
    252       print("<a href=\"?p=jailinfo&jail=$jail\" style=\"color:green\">$jail</a><br>"); 
    253   } 
    254  
    255   if ( ! empty($stopped) ) { 
    256     echo "<br><br><b>Stopped Jails</b><hr align=\"left\" width=\"85%\">"; 
     254      print("<a href=\"?p=jailinfo&jail=$jail\">$jail</a><br>"); 
     255 
     256  if ( ! empty($stopped) ) 
    257257    foreach ($sarray as $jail) 
    258       print("<a href=\"?p=jailinfo&jail=$jail\" style=\"color:red\">$jail</a><br>"); 
    259   } 
    260  
     258      print("<a href=\"?p=jailinfo&jail=$jail\">$jail</a><br>"); 
    261259} 
    262260 
  • src-webui/appweb/share/html/pages/jails.php

    rf27cd24 r1234788e  
    5151  print("  <td><a href=\"?p=jailinfo&jail=$jail\" style=\"text-decoration: underline;\">$jail</a></td>\n"); 
    5252  print("  <td><a href=\"/?p=jails&autostart=$jail\" style=\"text-decoration: underline;\">$autostatus</a></td>\n"); 
    53   print("  <td><a href=\"/?p=jails&toggle=$jail&status=$status\" style=\"text-decoration: underline;\">$status</a></td>\n"); 
     53  if ( $status == "Running" ) 
     54    print("  <td><a href=\"/?p=jails&toggle=$jail&status=$status\" style=\"color: green; text-decoration: underline;\">$status</a></td>\n"); 
     55  else 
     56    print("  <td><a href=\"/?p=jails&toggle=$jail&status=$status\" style=\"color: red; text-decoration: underline;\">$status</a></td>\n"); 
    5457  if ( $status == "Running" )  
    5558    print("  <td><a href=\"/?p=sysapp&jail=$jail\" style=\"text-decoration: underline;\">View Packages</a></td>\n"); 
     
    7477 
    7578<? 
    76    $jailoutput = get_jail_list(); 
     79   unset($jailoutput); 
     80   $jailoutput = get_jail_list(true); 
    7781 
    7882   $running=$jailoutput[0]; 
Note: See TracChangeset for help on using the changeset viewer.