function print_wu($row) { echo "<tr>\n"; echo "<td align=\"left\" valign=\"top\">"; if (!in_rops()) { echo "<input type=\"checkbox\" name=\"WU[]\" value=\"" . $row->id . "\">\n"; } echo "<a href=db_action.php?table=workunit&detail=high&id="; echo $row->id; echo ">"; echo $row->id; echo "</a></td>\n"; echo "<td align=\"left\" valign=\"top\">" . $row->name . "</td>\n"; echo "<td align=\"left\" valign=\"top\">" . $row->appid . "</td>\n"; echo "<td align=\"left\" valign=\"top\">" . $row->min_quorum . "</td>\n"; echo "<td align=\"left\" valign=\"top\">" . $row->unsent . "</td>\n"; echo "<td align=\"left\" valign=\"top\">" . $row->in_progress . "</td>\n"; echo "<td align=\"left\" valign=\"top\">"; echo "<a href=db_action.php?table=result&query=&outcome=1&detail=low&workunitid=" . $row->id . ">"; echo $row->successes; echo "</a></td>\n"; echo "<td align=\"left\" valign=\"top\">"; echo "<a href=db_action.php?table=result&query=&outcome=3&client_state=1&detail=low&workunitid=" . $row->id . ">"; echo $row->download_errors; echo "</a></td>\n"; echo "<td align=\"left\" valign=\"top\">"; echo "<a href=db_action.php?table=result&query=&outcome=3&client_state=3&sort_by=mod_time&detail=low&workunitid=" . $row->id . ">"; echo $row->compute_errors; echo "</a></td>\n"; echo "<td align=\"left\" valign=\"top\">"; echo "<a href=db_action.php?table=result&query=&outcome=6&sort_by=mod_time&detail=low&workunitid=" . $row->id . ">"; echo $row->validate_errors; echo "</a></td>\n"; echo "<td align=\"left\" valign=\"top\">"; if ($row->error_mask) { echo wu_error_mask_str($row->error_mask); } else { echo " "; } echo "</td>\n"; echo "</tr>\n"; }
$WUs = ""; if ($cancel && $cancel == 1) { if ($WU) { foreach ($WU as $key => $value) { if ($WUs != "") { $WUs = $WUs . ","; } $WUs = $WUs . $value; } } } // cancel WUs (if not in rops) // if ($WUs != "") { echo "<!--- WUs to cancel: {$WUs} --->\n"; if (!in_rops()) { cancel_wus_where("id IN (" . $WUs . ")"); } } if ($back) { if ($back == "errorwus") { $args = "?refresh_cache=1"; if ($hide_canceled && $hide_canceled == "on") { $args .= "&hide_canceled=on"; } if ($hide_dlerr && $hide_dlerr == "on") { $args .= "&hide_dlerr=on"; } if ($appid) { $args .= "&appid={$appid}"; }
function show_form($all) { echo "\n <h2>Edit applications</h2>\n "; $app_clause = "deprecated=0"; $action_url = "manage_apps.php"; if ($all) { $app_clause = ""; $action_url = "manage_apps.php?all=1"; echo "<a href=\"manage_apps.php\">Don't show deprecated applications</a>"; } else { echo "<a href=\"manage_apps.php?all=1\">Show deprecated applications</a>"; } start_table(); table_header("ID", "Name and description<br><p class=\"text-muted\">Click for details</p>", "Created", "weight<br><a href=https://boinc.berkeley.edu/trac/wiki/BackendPrograms#feeder><p class=\"text-muted\">details</p></a>", "shmem items", "HR type<br><a href=https://boinc.berkeley.edu/trac/wiki/HomogeneousRedundancy><p class=\"text-muted\">details</p></a>", "Adaptive replication<br><a href=http://boinc.berkeley.edu/trac/wiki/AdaptiveReplication><p class=\"text-muted\">details</p></a>", "homogeneous app version?<br><a href=https://boinc.berkeley.edu/trac/wiki/HomogeneousAppVersion><p class=\"text-muted\">details</p></a>", "deprecated?", "Non-CPU-intensive?", "Beta?", "Exact fraction done?", ""); $total_weight = BoincApp::sum("weight", "where deprecated=0"); $swi = parse_config(get_config(), "<shmem_work_items>"); if (!$swi) { $swi = 100; } $apps = BoincApp::enum($app_clause); $i = 0; foreach ($apps as $app) { // grey-out deprecated versions $f1 = $f2 = ''; if ($app->deprecated == 1) { $f1 = "<font color='GREY'>"; $f2 = "</font>"; } echo "<tr class=row{$i}><form action={$action_url} method=POST>"; $i = 1 - $i; echo "<input type=hidden name=id value={$app->id}>"; echo " <TD align='center'>{$f1} {$app->id} {$f2}</TD>\n"; echo " <TD align='left'>{$f1}<a href=app_details.php?appid={$app->id}>{$app->name}</a><br> {$app->user_friendly_name} {$f2}</TD>\n"; echo " <TD align='center'>{$f1} " . date_str($app->create_time) . "{$f2}</TD>\n"; $v = $app->weight; echo " <TD align='center'>\n <input type='text' size='4' name='weight' value='{$v}'></TD>\n"; if ($app->deprecated || $total_weight == 0) { echo '<td></td>'; } else { echo '<td align="right">' . round($app->weight / $total_weight * $swi) . '</td>'; } $v = $app->homogeneous_redundancy; echo " <TD align='center'>\n <input name='homogeneous_redundancy' value='{$v}'></TD>\n "; $v = $app->target_nresults; echo " <TD align='center'>\n <input name='target_nresults' value='{$v}'></TD>\n "; $v = ''; if ($app->homogeneous_app_version) { $v = ' CHECKED '; } echo " <TD align='center'>\n <input name='homogeneous_app_version' type='checkbox' {$v}></TD>\n "; $v = ''; if ($app->deprecated) { $v = ' CHECKED '; } echo " <TD align='center'>\n <input name='deprecated' type='checkbox' {$v}></TD>\n "; $v = ''; if ($app->non_cpu_intensive) { $v = ' CHECKED '; } echo " <TD align='center'>\n <input name='non_cpu_intensive' type='checkbox' {$v}></TD>\n "; $v = ''; if ($app->beta) { $v = ' CHECKED '; } echo " <TD align='center'>\n <input name='beta' type='checkbox' {$v}></TD>\n "; $v = ''; if ($app->fraction_done_exact) { $v = ' CHECKED '; } echo " <TD align='center'>\n <input name='fraction_done_exact' type='checkbox' {$v}></TD>\n "; if (!in_rops()) { echo "<td><input class=\"btn btn-default\" type=submit name=submit value=Update></td>"; } else { echo "<td> </td>"; } echo "</tr></form>"; } end_table(); // Entry form to create a new application // if (in_rops()) { return; } echo "<P>\n <h2>Add an application</h2>\n To add an application enter the short name and description\n ('user friendly name') below. You can then edit the\n application when it appears in the table above.\n <p>\n <form action={$action_url} method=POST>\n "; start_table("align='center' "); table_header("Name", "Description", " "); echo "<TR>\n <TD> <input type='text' size='12' name='add_name' value=''></TD>\n <TD> <input type='text' size='35' name='add_user_friendly_name' value=''></TD>\n <TD align='center' >\n <input type='submit' name='add_app' value='Add Application'></TD>\n </TR>\n"; end_table(); echo "</form><p>\n"; }
function show_form($all) { if ($all) { echo "<a href=manage_app_versions.php>Don't show deprecated app versions</a>\n"; } else { echo "<a href=manage_app_versions.php?all=1>Show deprecated app versions</a>\n"; } $_platforms = BoincPlatform::enum(""); foreach ($_platforms as $platform) { $platforms[$platform->id] = $platform; } $_apps = BoincApp::enum(""); foreach ($_apps as $app) { $apps[$app->id] = $app; } start_table(""); table_header("ID #<br><p class=\"text-muted\">click for details</p>", "Application<br><p class=\"text-muted\">click for details</p>", "Version", "Platform", "Plan class", "minimum<br>client version", "maximum<br>client version", "beta?", "deprecated?", ""); $clause = $all ? "true" : "deprecated = 0"; $avs = BoincAppVersion::enum("{$clause} order by appid, platformid, plan_class, version_num"); $i = 0; foreach ($avs as $av) { // grey out deprecated versions // $f1 = $f2 = ''; if ($av->deprecated == 1) { $f1 = "<font color='GREY'>"; $f2 = "</font>"; } $all_value = $all ? 1 : 0; $app = $apps[$av->appid]; // ignore app versions of deprecated apps by default if ($all_value == 0 && $app->deprecated == 1) { continue; } echo "<tr class=row{$i}><form action=manage_app_versions.php?all={$all_value}#av_{$av->id} method=POST>\n"; $i = 1 - $i; echo "<input type=hidden name=id value={$av->id}>"; echo " <TD>{$f1} <a id='av_{$av->id}' href=db_action.php?table=app_version&id={$av->id}>{$av->id}</a> {$f2}</TD>\n"; $app = $apps[$av->appid]; echo " <TD>{$f1} <a href=app_details.php?appid={$app->id}>{$app->name}</a> {$f2}</TD>\n"; echo " <TD>{$f1} {$av->version_num} {$f2}</TD>\n"; $platform = $platforms[$av->platformid]; echo " <TD>{$f1} {$platform->name} {$f2}</TD>\n"; echo " <td><input type=text name=plan_class size=12 value='{$av->plan_class}'></td>\n"; $v = $av->min_core_version; echo " <TD><input type='text' size='4' name=min_core_version value='{$v}'></TD>\n"; $v = $av->max_core_version; echo " <TD><input type='text' size='4' name=max_core_version value='{$v}'></TD>\n"; $v = ''; if ($av->beta) { $v = ' CHECKED '; } echo " <TD> <input name=beta type='checkbox' {$v}></TD>\n"; $v = ''; if ($av->deprecated) { $v = ' CHECKED '; } echo " <TD> <input name=deprecated type='checkbox' {$v}></TD>\n"; if (!in_rops()) { echo "<td><input class=\"btn btn-default\" name=submit type=submit value=Update>"; } else { echo "<td> </td>"; } echo "</tr></form>"; } end_table(); }