function av_desc($gavid) { if ($gavid >= 1000000) { $appid = (int) ($gavid / 1000000); $app = BoincApp::lookup_id($appid); if (!$app) { return tra("Anonymous platform, missing app"); } $rsc_type = $gavid % 1000000; $r = rsc_name($rsc_type); return "{$app->user_friendly_name} (" . tra("anonymous platform") . ", {$r})"; } else { $av = BoincAppVersion::lookup_id($gavid); if (!$av) { return tra("Missing app version"); } $app = BoincApp::lookup_id($av->appid); if (!$app) { return tra("Missing app"); } $platform = BoincPlatform::lookup_id($av->platformid); if (!$platform) { return tra("Missing platform"); } $pc = strlen($av->plan_class) ? "({$av->plan_class})" : ""; $v = number_format($av->version_num / 100, 2); return "{$app->user_friendly_name} {$v} {$platform->name} {$pc}"; } }
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) { $f1 = "<font color='GREY'>"; $f2 = "</font>"; } $all_value = $all ? 1 : 0; 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"; echo "<td><input class=\"btn btn-default\" name=submit type=submit value=Update>"; echo "</tr></form>"; } end_table(); }
function show_form() { $_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><span class=note>click for details</span>", "Application<br><span class=note>click for details</span>", "Version", "Platform", "Plan Class", "minimum<br>client version", "maximum<br>client version", "beta?", "deprecated?", ""); $avs = BoincAppVersion::enum("true order by appid, platformid, plan_class, version_num"); $i = 0; foreach ($avs as $av) { // grey out deprecated versions // $f1 = $f2 = ''; if ($av->deprecated) { $f1 = "<font color='GREY'>"; $f2 = "</font>"; } echo "<tr class=row{$i}><form action=manage_app_versions.php method=POST>\n"; $i = 1 - $i; echo "<input type=hidden name=id value={$av->id}>"; echo " <TD>{$f1} <a 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>{$f1} {$av->plan_class} {$f2}</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"; echo "<td><input name=submit type=submit value=Update>"; echo "</tr></form>"; } end_table(); }
function app_version_form($app) { page_head("Manage app versions"); echo "\n <form action=manage_app.php>\n <input type=hidden name=action value=app_version_action>\n <input type=hidden name=app_id value={$app->id}>\n "; $avs = BoincAppVersion::enum("appid={$app->id}"); start_table(); table_header("platform", "plan class", "version#", "deprecated"); foreach ($avs as $av) { $platform = BoincPlatform::lookup_id($av->platformid); $c = $av->deprecated ? "checked" : ""; echo "\n <tr>\n <td>{$platform->name}</td>\n <td>{$av->plan_class}</td>\n <td>{$av->version_num}</td>\n <td><input type=checkbox name=dep_{$av->id} {$c}></td>\n </tr>\n "; } echo "\n <tr>\n <td><br></td>\n <td><br></td>\n <td><br></td>\n <td><input class=\"btn btn-default\" type=submit value=Update></td>\n </tr>\n "; end_table(); echo "<form>\n"; page_tail(); }
// You should have received a copy of the GNU Lesser General Public License // along with BOINC. If not, see <http://www.gnu.org/licenses/>. // show details of an app require_once '../inc/util_ops.inc'; $appid = get_int("appid"); $app = BoincApp::lookup_id($appid); if (!$app) { admin_error_page("no such app"); } admin_page_head("Details for {$app->name} ({$app->user_friendly_name})"); start_table(); row2("Min average efficiency", $app->min_avg_pfc); echo "\n <p>\n In the list below, 'Credit scale factor' should\n be roughly 1 for CPU versions, 0.1 for GPU versions.\n If values are far outside this range,\n you may have bad FLOPs estimates.\n In this case, you may want to\n <ol>\n <li> <a href=job_times.php?appid={$appid}>Get a better FLOPs estimate</a>\n <li> <a href=app_reset.php?appid={$appid}>reset credit statistics for this application</a>.\n </ol>\n"; end_table(); echo "<h2>App versions</h2>\n"; $avs = BoincAppVersion::enum("appid={$appid}"); $avs = current_versions($avs); foreach ($avs as $av) { $platform = BoincPlatform::lookup_id($av->platformid); start_table(); row2("ID", $av->id); row2("Platform", $platform->name); row2("Plan class", $av->plan_class); row2("Version num", $av->version_num); row2("Jobs validated", $av->pfc_n); row2("Average efficiency", $av->pfc_avg ? 1 / $av->pfc_avg : "---"); row2("Credit scale factor", $av->pfc_scale); row2("Average credit", $av->expavg_credit); end_table(); } admin_page_tail();
// BOINC is free software; you can redistribute it and/or modify it // under the terms of the GNU Lesser General Public License // as published by the Free Software Foundation, // either version 3 of the License, or (at your option) any later version. // // BOINC is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. // See the GNU Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public License // along with BOINC. If not, see <http://www.gnu.org/licenses/>. require_once "../inc/boinc_db.inc"; require_once "../inc/util.inc"; check_get_args(array("xml")); $platforms = BoincPlatform::enum("deprecated=0"); $xml = get_str('xml', true); if ($xml) { require_once '../inc/xml.inc'; xml_header(); echo "<app_versions>\n"; } else { page_head(tra("Applications")); echo tra("%1 currently has the following applications. When you participate in %1, work for one or more of these applications will be assigned to your computer. The current version of the application will be downloaded to your computer. This happens automatically; you don't have to do anything.", PROJECT) . "<br><br>\n "; start_table(); } $apps = BoincApp::enum("deprecated=0"); foreach ($apps as $app) { if ($xml) { echo "<application>\n"; echo " <name>{$app->user_friendly_name}</name>\n";
function version_select($appid) { $x = "<select name=app_version_id>\n <option value=0>All\n "; $avs = BoincAppVersion::enum("appid={$appid}"); $avs = current_versions($avs); foreach ($avs as $av) { $platform = BoincPlatform::lookup_id($av->platformid); $n = $platform->name; if (strlen($av->plan_class)) { $n .= " ({$av->plan_class})"; } $x .= "<option value={$av->id}> {$n}\n"; } $x .= "</select>\n"; return $x; }
function show_appl($app_id) { $app = BoincApp::lookup_id($app_id); page_head("App {$app->user_friendly_name} credit"); $avs = BoincAppVersion::enum("appid={$app_id} and deprecated=0"); start_table(); table_header("platform/class/version", "PFC nsamples", "PFC avg", "PFC scale"); $avs = current_versions($avs); foreach ($avs as $av) { $plat = BoincPlatform::lookup_id($av->platformid); table_row("<a href=credit.php?av_id={$av->id}>{$plat->user_friendly_name} {$av->plan_class} {$av->version_num}</a>", $av->pfc_n, $av->pfc_avg, $av->pfc_scale); } end_table(); page_tail(); }