Changeset 07ff5b1


Ignore:
Timestamp:
08/07/14 12:44:03 (8 weeks ago)
Author:
Kris Moore <kris@…>
Branches:
master, releng/10.0.3
Children:
7b6adb2, b9c5245
Parents:
7760d8e
Message:

Another update to AppWeb?

On product page, allow user to install / delete PBIs now

When install or delete is in process, change the text on the product
page to reflect that.

Location:
src-webui/appweb
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src-webui/appweb/dispatcher

    r36f3620 r07ff5b1  
    154154list_status() 
    155155{ 
    156   if [ -e "$QWRK" ] ; then 
    157      cat ${QWRK} 
    158   else 
    159      echo "Idle" 
     156  if [ -e "$QLIST" ] ; then 
     157     cat ${QLIST} 
     158  fi 
     159  if [ -e "$QLIST.tmp" ] ; then 
     160     cat ${QLIST}.tmp 
    160161  fi 
    161162} 
  • src-webui/appweb/share/html/include/functions.php

    r36f3620 r07ff5b1  
    7878} 
    7979 
     80function getDispatcherStatus() 
     81{ 
     82   return run_cmd("status"); 
     83} 
     84 
    8085?> 
  • src-webui/appweb/share/html/pages/appinfo.php

    r36f3620 r07ff5b1  
    22   if ( empty($_GET['app']) ) 
    33      die("Missing app="); 
     4 
     5   // Get the current work queue status of the dispatcher 
     6   $dStatus = getDispatcherStatus(); 
    47 
    58   $pbiorigin = $_GET['app']; 
     
    2528 
    2629  if ( empty($pbiname) ) 
    27     die("No such app installed: $pbi"); 
     30    die("No such app: $pbi"); 
     31 
     32  // Check if this app is installed 
     33  $pkgoutput = syscache_ins_pkg_list(); 
     34  $pkglist = explode(", ", $pkgoutput[0]); 
     35  if ( array_search($pbiorigin, $pkglist) !== false) 
     36     $pbiinstalled=true; 
     37  else 
     38     $pbiinstalled=false; 
     39 
     40  // If the application is not installed, we need to fetch some stuff from rquery 
     41  if ( ! $pbiinstalled ) 
     42  { 
     43    exec("$sc " . escapeshellarg("pkg #system remote $pbiorigin version"), $pkgarray); 
     44    $pbiver = $pkgarray[0]; 
     45  } 
    2846?> 
    2947    
     
    3755      <img align="center" height=64 width=64 src="images/pbiicon.php?i=<? echo "$pbicdir"; ?>/icon.png"><br><br> 
    3856      <? 
    39          print("    <button onclick=\"delConfirm('" . $pbiname ."','".$pbiorigin."','pbi','system')\">-Remove</button>"); 
     57         if ( array_search("pbi $pbiorigin install system", $dStatus) !== false ) { 
     58           print("    Installing..."); 
     59         } else if ( array_search("pbi $pbiorigin delete system", $dStatus) !== false ) { 
     60           print("    Deleting..."); 
     61         } else if( $pbiinstalled ) { 
     62            print("    <button onclick=\"delConfirm('" . $pbiname ."','".$pbiorigin."','pbi','system')\">-Remove</button>"); 
     63         } else { 
     64            print("    <button onclick=\"addConfirm('" . $pbiname ."','".$pbiorigin."','pbi','system')\">+Install</button>"); 
     65         } 
    4066      ?> 
    4167    </td> 
Note: See TracChangeset for help on using the changeset viewer.