• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP phoromatic_webui_header_logged_in函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中phoromatic_webui_header_logged_in函数的典型用法代码示例。如果您正苦于以下问题:PHP phoromatic_webui_header_logged_in函数的具体用法?PHP phoromatic_webui_header_logged_in怎么用?PHP phoromatic_webui_header_logged_in使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了phoromatic_webui_header_logged_in函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: render_page_process

 public static function render_page_process($PATH)
 {
     $suite_dir = phoromatic_server::phoromatic_account_suite_path($_SESSION['AccountID']);
     $main = '<h1>Local Suites</h1><p>These are test suites created by you or another account within your group. Suites are an easy collection of test profiles. New suits can be trivially made via the <a href="/?build_suite">build suite</a> page.</p>';
     $suite_count = 0;
     foreach (pts_file_io::glob($suite_dir . '*/suite-definition.xml') as $xml_path) {
         $suite_count++;
         $id = basename(dirname($xml_path));
         $test_suite = new pts_test_suite($xml_path);
         $main .= '<a name="' . $id . '"></a><h1>' . $test_suite->get_title() . ' [' . $id . ']</h1>';
         $main .= '<p><strong>' . $test_suite->get_maintainer() . '</strong></p>';
         $main .= '<p><em>' . $test_suite->get_description() . '</em></p>';
         $main .= '<div style="max-height: 200px; overflow-y: scroll;">';
         foreach ($test_suite->get_contained_test_result_objects() as $tro) {
             $main .= '<h3>' . $tro->test_profile->get_title() . ' [' . $tro->test_profile->get_identifier() . ']</h3>';
             $main .= '<p>' . $tro->get_arguments_description() . '</p>';
         }
         $main .= '</div>';
         $main .= '<hr />';
     }
     if ($suite_count == 0) {
         $main .= '<h1>No Test Suites Found</h1>';
     }
     echo phoromatic_webui_header_logged_in();
     echo '<div id="pts_phoromatic_main_area">' . $main . '</div>';
     echo phoromatic_webui_footer();
 }
开发者ID:ptzafrir,项目名称:phoronix-test-suite,代码行数:27,代码来源:phoromatic_local_suites.php


示例2: render_page_process

 public static function render_page_process($PATH)
 {
     echo phoromatic_webui_header_logged_in();
     $main = '<h1>Systems</h1>';
     $main .= '<p>Various system interaction vitals for the Phoronix Test Suite systems associated with this account.</p>';
     $stmt = phoromatic_server::$db->prepare('SELECT Title, SystemID, Hardware, Software, ClientVersion, LastIP, NetworkMAC, LastCommunication, CurrentTask, CoreVersion, NetworkWakeOnLAN, BlockPowerOffs FROM phoromatic_systems WHERE AccountID = :account_id AND State >= 0 ORDER BY LastCommunication DESC');
     $stmt->bindValue(':account_id', $_SESSION['AccountID']);
     $result = $stmt->execute();
     while ($row = $result->fetchArray()) {
         $stmt = phoromatic_server::$db->prepare('SELECT UploadTime FROM phoromatic_results WHERE AccountID = :account_id AND SystemID = :system_id ORDER BY UploadTime DESC LIMIT 1');
         $stmt->bindValue(':account_id', $_SESSION['AccountID']);
         $stmt->bindValue(':system_id', $row['SystemID']);
         $latest_result = $stmt->execute();
         $latest_result = $latest_result->fetchArray();
         $latest_result = $latest_result['UploadTime'];
         $components[$row['SystemID']]['Last Communication'] = date('H:i d F', strtotime($row['LastCommunication']));
         $components[$row['SystemID']]['Current Task'] = $row['CurrentTask'];
         $components[$row['SystemID']]['Last IP'] = $row['LastIP'];
         $components[$row['SystemID']]['Phoronix Test Suite'] = $row['ClientVersion'] . ' [' . $row['CoreVersion'] . ']';
         $components[$row['SystemID']]['MAC'] = $row['NetworkMAC'];
         $components[$row['SystemID']]['Wake-On-LAN'] = (empty($row['NetworkWakeOnLAN']) ? 'N/A' : $row['NetworkWakeOnLAN']) . ' - ' . ($row['BlockPowerOffs'] == 1 ? 'Blocked' : 'Permitted');
         $components[$row['SystemID']]['Latest Result Upload'] = $latest_result != null ? date('d F', strtotime($latest_result)) : 'N/A';
         $system_ids[$row['SystemID']] = $row['Title'];
     }
     $main .= '<div style="margin: 10px auto; overflow: auto;"><table width="100%">';
     $component_types = array('Last Communication', 'Current Task', 'Phoronix Test Suite', 'Last IP', 'MAC', 'Wake-On-LAN', 'Latest Result Upload');
     $main .= '<tr><th>&nbsp;</th>';
     foreach ($component_types as $type) {
         $main .= '<th>' . $type . '</th>';
     }
     foreach ($components as $system_id => $component_array) {
         $main .= '<tr>';
         $main .= '<th><a href="/?systems/' . $system_id . '">' . $system_ids[$system_id] . '</a></th>';
         foreach ($component_types as $type) {
             $c = isset($component_array[$type]) ? $component_array[$type] : 'N/A';
             if (($x = stripos($c, ' @ ')) !== false) {
                 $c = substr($c, 0, $x);
             }
             if (($x = stripos($c, ' (')) !== false) {
                 $c = substr($c, 0, $x);
             }
             $main .= '<td>' . $c . '</td>';
         }
         $main .= '</tr>';
     }
     $main .= '</table></div>';
     $right = null;
     echo phoromatic_webui_main($main, phoromatic_webui_right_panel_logged_in($right));
     echo phoromatic_webui_footer();
 }
开发者ID:numerant,项目名称:phoronix-test-suite,代码行数:50,代码来源:phoromatic_maintenance_table.php


示例3: render_page_process

    public static function render_page_process($PATH)
    {
        if (isset($_POST['register_password']) && isset($_POST['register_password_confirm']) && isset($_POST['old_password'])) {
            $matching_user = phoromatic_server::$db->querySingle('SELECT Password FROM phoromatic_users WHERE UserName = \'' . $_SESSION['UserName'] . '\' AND AccountID = \'' . $_SESSION['AccountID'] . '\'', true);
            if (!empty($matching_user)) {
                $hashed_password = $matching_user['Password'];
                $account_salt = phoromatic_server::$db->querySingle('SELECT Salt FROM phoromatic_accounts WHERE AccountID = \'' . $_SESSION['AccountID'] . '\'');
                if ($account_salt != null && hash('sha256', $account_salt . $_POST['old_password']) == $hashed_password) {
                    if (strlen($_POST['register_password']) < 6) {
                        phoromatic_error_page('Oops!', 'Please go back and ensure the supplied password is at least six characters long.');
                        return false;
                    }
                    if ($_POST['register_password'] != $_POST['register_password_confirm']) {
                        phoromatic_error_page('Oops!', 'Please go back and ensure the supplied password matches the password confirmation.');
                        return false;
                    }
                    $new_salted_password = hash('sha256', $account_salt . $_POST['register_password']);
                    phoromatic_server::$db->exec('UPDATE phoromatic_users SET Password = \'' . $new_salted_password . '\' WHERE UserName = "' . $_SESSION['UserName'] . '"');
                    echo '<h1>Password Updated!</h1>';
                } else {
                    phoromatic_error_page('Oops!', 'The original password does not match the records for this account.');
                    return false;
                }
            } else {
                phoromatic_error_page('Oops!', 'Problem fetching user information. Try again.');
                return false;
            }
        }
        echo phoromatic_webui_header_logged_in();
        $main = '<h1>Change Password</h1>
		<form name="reset_password" id="reset_password" action="?password" method="post" onsubmit="return phoromatic_password_reset(this);">
		<div style="clear: both;">
			<div style="float: left; font-weight: bold; padding-right: 10px;">
			<p style="height: 50px;">Password</p>
			<p style="height: 50px;">New Password</p>
			<p style="height: 50px;">Confirm New Password</p>
			</div>

			<div style="float: left;">
			<p style="height: 50px;"><input type="password" name="old_password" /></p>
			<p style="height: 50px;"><input type="password" name="register_password" /> <sup>1</sup></p>
			<p style="height: 50px;"><input type="password" name="register_password_confirm" /></p>
			<p style="height: 50px;"><input type="submit" value="Change Password" /></p>
			</div>
		</div>
		<p style="clear: both;"><sup>1</sup> Passwords shall be at least six characters long.</p>';
        echo phoromatic_webui_main($main, phoromatic_webui_right_panel_logged_in());
        echo phoromatic_webui_footer();
    }
开发者ID:ShaolongHu,项目名称:phoronix-test-suite,代码行数:49,代码来源:phoromatic_password.php


示例4: render_page_process

 public static function render_page_process($PATH)
 {
     echo phoromatic_webui_header_logged_in();
     $main = '<h1>System Components</h1>';
     $main .= '<p>Detected hardware/software components via Phoronix Test Suite\'s Phodevi implementation on the Phoromatic client systems.</p>';
     $stmt = phoromatic_server::$db->prepare('SELECT Title, SystemID, Hardware, Software, ClientVersion, NetworkWakeOnLAN, NetworkMAC FROM phoromatic_systems WHERE AccountID = :account_id AND State >= 0 ORDER BY Title ASC');
     $stmt->bindValue(':account_id', $_SESSION['AccountID']);
     $result = $stmt->execute();
     while ($row = $result->fetchArray()) {
         $components[$row['SystemID']] = array_merge(pts_result_file_analyzer::system_component_string_to_array($row['Software'], array('OS', 'Kernel', 'OpenGL', 'File-System')), pts_result_file_analyzer::system_component_string_to_array($row['Hardware'], array('Processor', 'Motherboard', 'Memory', 'Disk', 'Graphics')));
         $components[$row['SystemID']]['Phoronix Test Suite'] = $row['ClientVersion'];
         $components[$row['SystemID']]['WoL Info'] = $row['NetworkWakeOnLAN'];
         $components[$row['SystemID']]['MAC'] = $row['NetworkMAC'];
         $system_ids[$row['SystemID']] = $row['Title'];
     }
     $main .= '<div style="margin: 10px auto; overflow: auto;"><table>';
     $component_types = array('MAC', 'Processor', 'Motherboard', 'Memory', 'Disk', 'Graphics', 'OS', 'Kernel', 'OpenGL', 'File-System', 'Phoronix Test Suite', 'WoL Info');
     $main .= '<tr><th>&nbsp;</th>';
     foreach ($component_types as $type) {
         $main .= '<th>' . $type . '</th>';
     }
     foreach ($components as $system_id => $component_array) {
         $main .= '<tr>';
         $main .= '<th><a href="/?systems/' . $system_id . '">' . $system_ids[$system_id] . '</a></th>';
         foreach ($component_types as $type) {
             $c = isset($component_array[$type]) ? $component_array[$type] : 'N/A';
             if (($x = stripos($c, ' @ ')) !== false) {
                 $c = substr($c, 0, $x);
             }
             if (($x = stripos($c, ' (')) !== false) {
                 $c = substr($c, 0, $x);
             }
             $main .= '<td>' . $c . '</td>';
         }
         $main .= '</tr>';
     }
     $main .= '</table></div>';
     $right = null;
     echo phoromatic_webui_main($main, phoromatic_webui_right_panel_logged_in($right));
     echo phoromatic_webui_footer();
 }
开发者ID:ShaolongHu,项目名称:phoronix-test-suite,代码行数:41,代码来源:phoromatic_component_table.php


示例5: render_page_process

    public static function render_page_process($PATH)
    {
        echo phoromatic_webui_header_logged_in();
        $main = '<h1>Cache Settings</h1>
				<h2>Test Profile Download Cache</h2>
				<p>Below are a list of files for verification/debugging purposes that are currently cached by the Phoromatic Server and available for Phoronix Test Suite client systems to download. These are files that are needed by various test profiles in the Phoronix Test Suite. To add more data to this Phoromatic Server cache, from the server run <strong>phoronix-test-suite make-download-cache</strong> while passing the names of any tests/suites you wish to have download and generate a cache for so they can be made available to the Phoronix Test Suite clients on your network.</p>';
        $dc = pts_strings::add_trailing_slash(pts_strings::parse_for_home_directory(pts_config::read_user_config('PhoronixTestSuite/Options/Installation/CacheDirectory', PTS_DOWNLOAD_CACHE_PATH)));
        $dc_exists = is_file($dc . 'pts-download-cache.json');
        if ($dc_exists) {
            $cache_json = file_get_contents($dc . 'pts-download-cache.json');
            $cache_json = json_decode($cache_json, true);
        }
        if (is_file($dc . 'pts-download-cache.json')) {
            if ($cache_json && isset($cache_json['phoronix-test-suite']['download-cache'])) {
                $total_file_size = 0;
                $main .= '<table style="margin: 0 auto;"><tr><th>File</th><th>Size</th></tr>';
                foreach ($cache_json['phoronix-test-suite']['download-cache'] as $file_name => $inf) {
                    $total_file_size += $cache_json['phoronix-test-suite']['download-cache'][$file_name]['file_size'];
                    $main .= '<tr><td>' . $file_name . '</td><td>' . round(max(0.1, $cache_json['phoronix-test-suite']['download-cache'][$file_name]['file_size'] / 1000000), 1) . 'MB</td></tr>';
                }
                $main .= '</table>';
                $main .= '<p><strong>' . count($cache_json['phoronix-test-suite']['download-cache']) . ' Files / ' . round($total_file_size / 1000000) . ' MB Cache Size</strong></p>';
            }
        } else {
            $main .= '<h3>No download cache file could be found; on the Phoromatic Server you should run <strong>phoronix-test-suite make-download-cache</strong>.</h3>';
            // TODO XXX implement from the GUI
        }
        $main .= '<hr /><h2>OpenBenchmarking.org Cache Data</h2>';
        $main .= '<p>Below is information pertaining to the OpenBenchmarking.org cache present on the Phoromatic Server. To update this cache, run <strong>phoronix-test-suite make-openbenchmarking-cache</strong> from the server.</p>';
        $index_files = pts_file_io::glob(PTS_OPENBENCHMARKING_SCRATCH_PATH . '*.index');
        $main .= '<table style="margin: 0 auto;"><tr><th>Repository</th><th>Last Updated</th></tr>';
        foreach ($index_files as $index_file) {
            $index_data = json_decode(file_get_contents($index_file), true);
            $main .= '<tr><td>' . basename($index_file, '.index') . '</td><td>' . date('d F Y H:i', $index_data['main']['generated']) . '</td></tr>';
        }
        $main .= '</table>';
        echo phoromatic_webui_main($main, phoromatic_webui_right_panel_logged_in());
        echo phoromatic_webui_footer();
    }
开发者ID:ShaolongHu,项目名称:phoronix-test-suite,代码行数:39,代码来源:phoromatic_caches.php


示例6: render_page_process

 public static function render_page_process($PATH)
 {
     $main = null;
     if (isset($PATH[0])) {
         if ($PATH[0] == 'context' && isset($PATH[1])) {
             $attribs = explode(',', $PATH[1]);
             $stmt = phoromatic_server::$db->prepare('SELECT UserContextStep, UserContextLog FROM phoromatic_system_context_logs WHERE AccountID = :account_id AND ScheduleID = :schedule_id AND SystemID = :system_id AND TriggerID = :trigger_id ORDER BY UploadTime ASC');
             $stmt->bindValue(':account_id', $_SESSION['AccountID']);
             $stmt->bindValue(':system_id', $attribs[0]);
             $stmt->bindValue(':schedule_id', $attribs[1]);
             $stmt->bindValue(':trigger_id', base64_decode($attribs[2]));
             $result = $stmt->execute();
             while ($row = $result->fetchArray()) {
                 $main .= '<h2>' . $row['UserContextStep'] . '</h2><p>' . str_replace(PHP_EOL, '<br />', $row['UserContextLog']) . '</p><hr />';
             }
         } else {
             if ($PATH[0] == 'system' && isset($PATH[1])) {
                 $zip_file = phoromatic_server::phoromatic_account_result_path($_SESSION['AccountID'], $PATH[1]) . 'system-logs.zip';
                 if (is_file($zip_file)) {
                     $zip = new ZipArchive();
                     $res = $zip->open($zip_file);
                     if ($res === true) {
                         for ($i = 0; $i < $zip->numFiles; $i++) {
                             if ($zip->getFromIndex($i) != null) {
                                 $main .= '<h2>' . basename($zip->getNameIndex($i)) . '</h2><p>' . str_replace(PHP_EOL, '<br />', $zip->getFromIndex($i)) . '</p><hr />';
                             }
                         }
                         $zip->close();
                     }
                 }
             }
         }
     }
     echo phoromatic_webui_header_logged_in();
     echo phoromatic_webui_main($main, phoromatic_webui_right_panel_logged_in(null));
     echo phoromatic_webui_footer();
 }
开发者ID:ShaolongHu,项目名称:phoronix-test-suite,代码行数:37,代码来源:phoromatic_logs.php


示例7: render_page_process

 public static function render_page_process($PATH)
 {
     $main = '<h1>Recent Account Activity</h1>';
     $stmt = phoromatic_server::$db->prepare('SELECT * FROM phoromatic_activity_stream WHERE AccountID = :account_id ORDER BY ActivityTime DESC');
     $stmt->bindValue(':account_id', $_SESSION['AccountID']);
     $result = $stmt->execute();
     $row = $result->fetchArray();
     $prev_date = null;
     do {
         if ($prev_date != substr($row['ActivityTime'], 0, 10)) {
             if ($prev_date != null) {
                 $main .= '</p><hr />';
             }
             $prev_date = substr($row['ActivityTime'], 0, 10);
             $new_date = strtotime($row['ActivityTime']);
             if (date('Y-m-d') == $prev_date) {
                 $main .= '<h2>Today</h2>';
             } else {
                 if ($new_date > time() - 60 * 60 * 24 * 6) {
                     $main .= '<h2>' . date('l', $new_date) . '</h2>';
                 } else {
                     $main .= '<h2>' . date('j F Y', $new_date) . '</h2>';
                 }
             }
             $main .= '<p>';
         }
         $id_link_format = $row['ActivityEventID'];
         switch ($row['ActivityEvent']) {
             case 'settings':
                 $event_link_format = '<a href="?settings">settings</a>';
                 break;
             case 'users':
                 $event_link_format = '<a href="?users">a user</a>';
                 break;
             case 'schedule':
                 $event_link_format = '<a href="?schedules">schedule</a>';
                 $stmt1 = phoromatic_server::$db->prepare('SELECT Title FROM phoromatic_schedules WHERE AccountID = :account_id AND ScheduleID = :schedule_id');
                 $stmt1->bindValue(':account_id', $_SESSION['AccountID']);
                 $stmt1->bindValue(':schedule_id', $row['ActivityEventID']);
                 $result1 = $stmt1->execute();
                 $row1 = $result1->fetchArray();
                 $id_link_format = '<a href="?schedules/' . $row['ActivityEventID'] . '">' . $row1['Title'] . '</a>';
                 break;
             case 'tests_for_schedule':
                 $event_link_format = 'a test for a schedule';
                 $stmt1 = phoromatic_server::$db->prepare('SELECT Title FROM phoromatic_schedules WHERE AccountID = :account_id AND ScheduleID = :schedule_id');
                 $stmt1->bindValue(':account_id', $_SESSION['AccountID']);
                 $stmt1->bindValue(':schedule_id', $row['ActivityEventID']);
                 $result1 = $stmt1->execute();
                 $row1 = $result1->fetchArray();
                 $id_link_format = '<a href="?schedules/' . $row['ActivityEventID'] . '">' . $row1['Title'] . '</a>';
                 break;
             case 'groups':
                 $event_link_format = '<a href="?systems#group_edit">a group</a>';
                 break;
             default:
                 $event_link_format = $row['ActivityEvent'];
                 break;
         }
         if ($row['ActivityCreatorType'] == 'USER') {
             $main .= '<em>' . date('H:i', strtotime($row['ActivityTime'])) . '</em> &nbsp; <strong>' . $row['ActivityCreator'] . '</strong> <strong> ' . $row['ActivityEventType'] . '</strong> <strong>' . $event_link_format . '</strong>';
             if ($id_link_format != null) {
                 $main .= ': ' . $id_link_format;
             }
             $main .= '<br />' . PHP_EOL;
         }
         //$main .= '<p>' .  $row['ActivityCreator'] . ' ' . $row['ActivityCreatorType'] . ' ' . $row['ActivityEvent'] . ' ' . $row['ActivityEventID'] . ' ' . $row['ActivityEventType'] . '</p>';
     } while ($row = $result->fetchArray());
     if ($prev_date != null) {
         $main .= '</p>';
     }
     echo phoromatic_webui_header_logged_in();
     echo phoromatic_webui_main($main);
     echo phoromatic_webui_footer();
 }
开发者ID:ptzafrir,项目名称:phoronix-test-suite,代码行数:75,代码来源:phoromatic_account_activity.php


示例8: render_page_process

 public static function render_page_process($PATH)
 {
     $main = null;
     $identifier_item = isset($PATH[1]) ? $PATH[0] . '/' . $PATH[1] : false;
     if ($identifier_item && pts_test_profile::is_test_profile($identifier_item)) {
         $tp = new pts_test_profile($identifier_item);
         $tp_identifier = $tp->get_identifier(false);
         $main .= '<h1>' . $tp->get_title() . '</h1><p>' . $tp->get_description() . '</p>';
         $main .= '<p><strong>' . $tp->get_test_hardware_type() . ' - ' . phoromatic_server::test_result_count_for_test_profile($_SESSION['AccountID'], $tp_identifier) . ' Results On This Account - ' . $tp->get_test_software_type() . ' - Maintained By: ' . $tp->get_maintainer() . ' - Supported Platforms: ' . implode(', ', $tp->get_supported_platforms()) . '</strong></p>';
         $main .= '<p><a href="http://openbenchmarking.org/test/' . $tp_identifier . '">Find out more about this test profile on OpenBenchmarking.org</a>.</p>';
         $main .= '<h2>Recent Results With This Test</h2>';
         $stmt = phoromatic_server::$db->prepare('SELECT Title, PPRID FROM phoromatic_results WHERE AccountID = :account_id AND UploadID IN (SELECT DISTINCT UploadID FROM phoromatic_results_results WHERE AccountID = :account_id AND TestProfile LIKE :tp) ORDER BY UploadTime DESC LIMIT 30');
         $stmt->bindValue(':account_id', $_SESSION['AccountID']);
         $stmt->bindValue(':tp', $tp_identifier . '%');
         $result = $stmt->execute();
         $recent_result_count = 0;
         while ($result && ($row = $result->fetchArray())) {
             $recent_result_count++;
             $main .= '<h2><a href="/?result/' . $row['PPRID'] . '">' . $row['Title'] . '</a></h2>';
         }
         if ($recent_result_count == 0) {
             $main .= '<p>No results found on this Phoromatic Server for the ' . $tp->get_title() . ' test profile.</p>';
         } else {
             if ($recent_result_count > 5) {
                 $stmt = phoromatic_server::$db->prepare('SELECT UploadID, SystemID, UploadTime FROM phoromatic_results WHERE AccountID = :account_id AND UploadID IN (SELECT DISTINCT UploadID FROM phoromatic_results_results WHERE AccountID = :account_id AND TestProfile LIKE :tp) ORDER BY UploadTime DESC LIMIT 1000');
                 $stmt->bindValue(':account_id', $_SESSION['AccountID']);
                 $stmt->bindValue(':tp', $tp_identifier . '%');
                 $result = $stmt->execute();
                 $recent_result_count = 0;
                 $result_file = new pts_result_file(null, true);
                 while ($result && ($row = $result->fetchArray())) {
                     $composite_xml = phoromatic_server::phoromatic_account_result_path($_SESSION['AccountID'], $row['UploadID']) . 'composite.xml';
                     if (!is_file($composite_xml)) {
                         continue;
                     }
                     // Add to result file
                     $system_name = strtotime($row['UploadTime']) . ': ' . phoromatic_server::system_id_to_name($row['SystemID']);
                     $sub_result_file = new pts_result_file($composite_xml, true);
                     foreach ($sub_result_file->get_result_objects() as $obj) {
                         if ($obj->test_profile->get_identifier(false) == $tp_identifier) {
                             $obj->test_result_buffer->rename(null, $system_name);
                             $result_file->add_result($obj);
                         }
                     }
                 }
                 $table = null;
                 $extra_attributes = array('multi_way_comparison_invert_default' => false);
                 $f = false;
                 foreach ($result_file->get_result_objects() as $obj) {
                     $obj->test_profile->set_display_format('SCATTER_PLOT');
                     foreach ($obj->test_result_buffer->buffer_items as $i => &$item) {
                         if (!is_numeric(substr($item->get_result_identifier(), 0, strpos($item->get_result_identifier(), ':')))) {
                             unset($obj->test_result_buffer->buffer_items[$i]);
                         }
                     }
                     $result_file = null;
                     $main .= '<p align="center">' . pts_render::render_graph_inline_embed($obj, $result_file, $extra_attributes) . '</p>';
                 }
             }
         }
     } else {
         $dc = pts_strings::add_trailing_slash(pts_strings::parse_for_home_directory(pts_config::read_user_config('PhoronixTestSuite/Options/Installation/CacheDirectory', PTS_DOWNLOAD_CACHE_PATH)));
         $dc_exists = is_file($dc . 'pts-download-cache.json');
         if ($dc_exists) {
             $cache_json = file_get_contents($dc . 'pts-download-cache.json');
             $cache_json = json_decode($cache_json, true);
         }
         $test_counts_for_account = phoromatic_server::test_result_count_for_test_profiles($_SESSION['AccountID']);
         foreach (pts_openbenchmarking::available_tests() as $test) {
             $cache_checked = false;
             if ($dc_exists) {
                 if ($cache_json && isset($cache_json['phoronix-test-suite']['cached-tests'])) {
                     $cache_checked = true;
                     if (!in_array($test, $cache_json['phoronix-test-suite']['cached-tests'])) {
                         //continue;
                     }
                 }
             }
             if (!$cache_checked && phoromatic_server::read_setting('show_local_tests_only') && pts_test_install_request::test_files_in_cache($test, true, true) == false) {
                 continue;
             }
             $tp = new pts_test_profile($test);
             if ($tp->get_title() == null) {
                 continue;
             }
             $test_count = 0;
             $tpid = $tp->get_identifier(false);
             foreach ($test_counts_for_account as $test => $count) {
                 if (strpos($test, $tpid) !== false) {
                     $test_count += $count;
                     unset($test_counts_for_account[$test]);
                 }
             }
             $main .= '<h1 style="margin-bottom: 0;"><a href="/?tests/' . $tp->get_identifier(false) . '">' . $tp->get_title() . '</a></h1>';
             $main .= '<p style="font-size: 90%;"><strong>' . $tp->get_test_hardware_type() . '</strong> <em>-</em> ' . $test_count . ' Results On This Account' . ' </p>';
         }
     }
     echo phoromatic_webui_header_logged_in();
     echo '<div id="pts_phoromatic_main_area">' . $main . '</div>';
     echo phoromatic_webui_footer();
//.........这里部分代码省略.........
开发者ID:ptzafrir,项目名称:phoronix-test-suite,代码行数:101,代码来源:phoromatic_tests.php


示例9: render_page_process

    public static function render_page_process($PATH)
    {
        if (isset($_POST['suite_title'])) {
            //	echo '<pre>';
            //	var_dump($_POST);
            //	echo '</pre>';
            if (strlen($_POST['suite_title']) < 3) {
                echo '<h2>Suite title must be at least three characters.</h2>';
            }
            //echo 'TEST SUITE: ' . $_POST['suite_title'] . '<br />';
            //echo 'TEST SUITE: ' . $_POST['suite_description'] . '<br />';
            $tests = array();
            foreach ($_POST['test_add'] as $i => $test_identifier) {
                $test_prefix = $_POST['test_prefix'][$i];
                $args = array();
                $args_name = array();
                foreach ($_POST as $i => $v) {
                    if (strpos($i, $test_prefix) !== false && substr($i, -9) != '_selected') {
                        if (strpos($v, '||') !== false) {
                            $opts = explode('||', $v);
                            $a = array();
                            $d = array();
                            foreach ($opts as $opt) {
                                $t = explode('::', $opt);
                                array_push($a, $t[1]);
                                array_push($d, $t[0]);
                            }
                            array_push($args, $a);
                            array_push($args_name, $d);
                        } else {
                            array_push($args, array($v));
                            array_push($args_name, array($_POST[$i . '_selected']));
                        }
                    }
                }
                $test_args = array();
                $test_args_description = array();
                pts_test_run_options::compute_all_combinations($test_args, null, $args, 0);
                pts_test_run_options::compute_all_combinations($test_args_description, null, $args_name, 0, ' - ');
                foreach (array_keys($test_args) as $i) {
                    array_push($tests, array('test' => $test_identifier, 'description' => $test_args_description[$i], 'args' => $test_args[$i]));
                }
            }
            if (count($tests) < 1) {
                echo '<h2>You must add at least one test to the suite.</h2>';
            }
            $suite_writer = new pts_test_suite_writer();
            $version_bump = 0;
            do {
                $suite_version = '1.' . $version_bump . '.0';
                $suite_id = $suite_writer->clean_save_name_string($_POST['suite_title']) . '-' . $suite_version;
                $suite_dir = phoromatic_server::phoromatic_account_suite_path($_SESSION['AccountID'], $suite_id);
                $version_bump++;
            } while (is_dir($suite_dir));
            pts_file_io::mkdir($suite_dir);
            $save_to = $suite_dir . '/suite-definition.xml';
            $suite_writer->add_suite_information($_POST['suite_title'], $suite_version, $_SESSION['UserName'], 'System', $_POST['suite_description']);
            foreach ($tests as $m) {
                $suite_writer->add_to_suite($m['test'], $m['args'], $m['description']);
            }
            $suite_writer->save_xml($save_to);
            echo '<h2>Saved As ' . $suite_id . '</h2>';
        }
        echo phoromatic_webui_header_logged_in();
        $main = '<h1>Local Suites</h1><p>Find already created local test suites by your account/group via the <a href="/?local_suites">local suites</a> page.</p>';
        if (!PHOROMATIC_USER_IS_VIEWER) {
            $main .= '<h1>Build Suite</h1><p>A test suite in the realm of the Phoronix Test Suite, OpenBenchmarking.org, and Phoromatic is <strong>a collection of test profiles with predefined settings</strong>. Establishing a test suite makes it easy to run repetitive testing on the same set of test profiles by simply referencing the test suite name.</p>';
            $main .= '<form action="' . $_SERVER['REQUEST_URI'] . '" name="build_suite" id="build_suite" method="post" onsubmit="return validate_suite();">
			<h3>Title:</h3>
			<p><input type="text" name="suite_title" /></p>
			<h3>Description:</h3>
			<p><textarea name="suite_description" id="suite_description" cols="60" rows="2"></textarea></p>
			<h3>Tests In Schedule:</h3>
			<p><div id="test_details"></div></p>
			<h3>Add Another Test</h3>';
            $main .= '<select name="add_to_suite_select_test" id="add_to_suite_select_test" onchange="phoromatic_build_suite_test_details();">';
            $dc = pts_strings::add_trailing_slash(pts_client::parse_home_directory(pts_config::read_user_config('PhoronixTestSuite/Options/Installation/CacheDirectory', PTS_DOWNLOAD_CACHE_PATH)));
            $dc_exists = is_file($dc . 'pts-download-cache.json');
            foreach (pts_openbenchmarking::available_tests(false, true) as $test) {
                $cache_checked = false;
                if ($dc_exists) {
                    $cache_json = file_get_contents($dc . 'pts-download-cache.json');
                    $cache_json = json_decode($cache_json, true);
                    if ($cache_json && isset($cache_json['phoronix-test-suite']['cached-tests'])) {
                        $cache_checked = true;
                        if (!in_array($test, $cache_json['phoronix-test-suite']['cached-tests'])) {
                            continue;
                        }
                    }
                }
                if (!$cache_checked && phoromatic_server::read_setting('show_local_tests_only') && pts_test_install_request::test_files_in_cache($test, true, true) == false) {
                    continue;
                }
                $main .= '<option value="' . $test . '">' . $test . '</option>';
            }
            $main .= '</select>';
            $main .= '<p align="right"><input name="submit" value="Create Suite" type="submit" onclick="return pts_rmm_validate_suite();" /></p>';
        }
        echo '<div id="pts_phoromatic_main_area">' . $main . '</div>';
        echo phoromatic_webui_footer();
//.........这里部分代码省略.........
开发者ID:rkingsbury,项目名称:phoronix-test-suite,代码行数:101,代码来源:phoromatic_build_suite.php


示例10: render_page_process


//.........这里部分代码省略.........
            if (!empty($row)) {
                $right .= '<h3><a href="?schedules/' . $row['ScheduleID'] . '">' . $row['Title'] . '</a></h3>';
                if (!empty($row['ActiveOn'])) {
                    $right .= '<p align="center"><strong>' . phoromatic_schedule_activeon_string($row['ActiveOn'], $row['RunAt']) . '</strong></p>';
                }
                $right .= '<p>Compare this result file to the latest results from the past: ';
                $right .= '<select name="view_results_from_past" id="view_results_from_past" onchange="phoromatic_jump_to_results_from(\'' . $row['ScheduleID'] . '\', \'view_results_from_past\', \'' . $PATH[0] . ',\');">';
                $oldest_upload_time = strtotime(phoromatic_oldest_result_for_schedule(self::$schedule_id));
                $opts = array('Week' => 7, 'Three Weeks' => 21, 'Month' => 30, 'Quarter' => 90, 'Six Months' => 180, 'Year' => 365);
                foreach ($opts as $str_name => $time_offset) {
                    if ($oldest_upload_time > time() - 86400 * $time_offset) {
                        break;
                    }
                    $right .= '<option value="' . $time_offset . '">' . $str_name . '</option>';
                }
                $right .= '<option value="all">All Results</option>';
                $right .= '</select>';
                $right .= '</p>';
            }
        }
        if (true) {
            $compare_results = array();
            $hash_matches = 0;
            $ticket_matches = 0;
            $stmt = phoromatic_server::$db->prepare('SELECT * FROM phoromatic_results WHERE AccountID = :account_id AND ComparisonHash = :comparison_hash AND PPRID NOT IN (:pprid) ORDER BY UploadTime DESC LIMIT 12');
            $stmt->bindValue(':account_id', $_SESSION['AccountID']);
            $stmt->bindValue(':comparison_hash', $result_file->get_contained_tests_hash(false));
            $stmt->bindValue(':pprid', implode(',', $upload_ids));
            $result = $stmt->execute();
            while ($row = $result->fetchArray()) {
                $compare_results[$row['PPRID']] = $row;
                $hash_matches++;
            }
            foreach ($benchmark_tickets as $ticket_id) {
                $stmt = phoromatic_server::$db->prepare('SELECT * FROM phoromatic_results WHERE AccountID = :account_id AND BenchmarkTicketID = :ticket_id AND PPRID NOT IN (:pprid) ORDER BY UploadTime DESC LIMIT 12');
                $stmt->bindValue(':account_id', $_SESSION['AccountID']);
                $stmt->bindValue(':ticket_id', $ticket_id);
                $stmt->bindValue(':pprid', implode(',', $upload_ids));
                $result = $stmt->execute();
                while ($row = $result->fetchArray()) {
                    $compare_results[$row['PPRID']] = $row;
                    $ticket_matches++;
                }
            }
            if (!empty($compare_results)) {
                $right .= '<hr /><h3>Compare Results</h3><form name="compare_similar_results" onsubmit="return false;">
						<input type="hidden" value="' . implode(',', $upload_ids) . '" id="compare_similar_results_this" />';
                foreach ($compare_results as &$row) {
                    $right .= '<p><input type="checkbox" value="' . $row['PPRID'] . '" name="compare_results" /> ' . $row['Title'] . '<br /><em>' . phoromatic_system_id_to_name($row['SystemID'], $row['AccountID']) . '</em></p>';
                }
                $right .= '<p><input type="submit" value="Compare Results" id="compare_results_submit" onclick="javascript:phoromatic_do_custom_compare_results(this); return false;" /></p></form>';
                if ($ticket_matches > 3) {
                    $right .= '<p><a href="/results/ticket/' . $ticket_id . '">Find All Matching Results</a>';
                } else {
                    if ($hash_matches > 3) {
                        $right .= '<p><a href="/results/hash/' . $result_file->get_contained_tests_hash(false) . '">Find All Matching Results</a>';
                    }
                }
            }
        }
        if (count($upload_ids) > 1) {
            $checkbox_options = array('normalize_results' => 'Normalize Results', 'sort_by_performance' => 'Sort Results By Performance', 'sort_by_name' => 'Reverse Result By Identifier', 'sort_by_reverse' => 'Reverse Result Order', 'show_only_changed_results' => 'Show Only Results With Result Variation', 'force_line_graph' => 'Force Line Graph');
            if ($result_file->is_multi_way_comparison()) {
                $checkbox_options['condense_comparison'] = 'Condense Comparison';
                $checkbox_options['transpose_comparison'] = 'Transpose Comparison';
            }
            $right .= '<form action="' . $_SERVER['REQUEST_URI'] . '" name="update_result_view" method="post"><hr /><h3>Result Analysis Options</h3><p align="left">' . PHP_EOL;
            foreach ($checkbox_options as $val => $name) {
                $right .= '<input type="checkbox" name="' . $val . '" value="1" ' . (isset($_POST[$val]) ? 'checked="checked" ' : null) . '/> ' . $name . '<br />';
            }
            $right .= '<br /><input type="submit" value="Refresh Results"></p></form>';
        }
        if (self::$schedule_id && !empty(self::$schedule_id) && $system_types[0] && $trigger_types[0]) {
            $stmt = phoromatic_server::$db->prepare('SELECT UserContextStep FROM phoromatic_system_context_logs WHERE AccountID = :account_id AND ScheduleID = :schedule_id AND SystemID = :system_id AND TriggerID = :trigger_id');
            $stmt->bindValue(':account_id', $_SESSION['AccountID']);
            $stmt->bindValue(':system_id', $system_types[0]);
            $stmt->bindValue(':schedule_id', self::$schedule_id);
            $stmt->bindValue(':trigger_id', $trigger_types[0]);
            $result = $stmt->execute();
            if ($row = $result->fetchArray()) {
                $right .= '<hr /><h3>User Context Logs</h3>';
                do {
                    $right .= '<p><a href="?logs/context/' . $system_types[0] . ',' . self::$schedule_id . ',' . base64_encode($trigger_types[0]) . '">' . $row['UserContextStep'] . '</a></p>';
                } while ($row = $result->fetchArray());
            }
        }
        $right .= '<hr /><h3>Result Export</h3>';
        $right .= '<p><a href="/public.php?t=result&ut=' . implode(',', $upload_ids) . $url_append . '">Public Viewer</a></p>';
        $right .= '<p><a href="?' . $_SERVER['QUERY_STRING'] . '/&download=pdf' . $url_append . '">Download As PDF</a></p>';
        $right .= '<p><a href="?' . $_SERVER['QUERY_STRING'] . '/&download=csv">Download As CSV</a></p>';
        $right .= '<p><a href="?' . $_SERVER['QUERY_STRING'] . '/&download=xml">Download As XML</a></p>';
        $right .= '<p><a href="?' . $_SERVER['QUERY_STRING'] . '/&download=txt">Download As TEXT</a></p>';
        $right .= '<p><a href="?' . $_SERVER['QUERY_STRING'] . '/&upload_to_openbenchmarking">Upload To OpenBenchmarking.org</a></p>';
        if (is_file(phoromatic_server::phoromatic_account_result_path($_SESSION['AccountID'], $row['UploadID']) . 'system-logs.zip')) {
            $right .= '<hr /><p><a href="?logs/system/' . $row['UploadID'] . '">View System Logs</a></p>';
        }
        echo phoromatic_webui_header_logged_in();
        echo phoromatic_webui_main($main, phoromatic_webui_right_panel_logged_in($right));
        echo phoromatic_webui_footer();
    }
开发者ID:pacificIT,项目名称:phoronix-test-suite,代码行数:101,代码来源:phoromatic_result.php


示例11: render_page_process

    public static function render_page_process($PATH)
    {
        $main = null;
        echo phoromatic_webui_header_logged_in();
        if (!empty($PATH[0]) && is_numeric($PATH[0])) {
            $stmt = phoromatic_server::$db->prepare('SELECT * FROM phoromatic_schedules WHERE AccountID = :account_id AND ScheduleID = :schedule_id');
            $stmt->bindValue(':account_id', $_SESSION['AccountID']);
            $stmt->bindValue(':schedule_id', $PATH[0]);
            $result = $stmt->execute();
            $row = $result->fetchArray();
            if (empty($row)) {
                $main = '<h1>Test Schedules</h1>';
                $main .= '<h3>No Resource Found</h3>';
            } else {
                if (!PHOROMATIC_USER_IS_VIEWER) {
                    if (isset($_POST['add_to_schedule_select_test'])) {
                        $name = $_POST['add_to_schedule_select_test'];
                        $args = array();
                        $args_name = array();
                        foreach ($_POST as $i => $v) {
                            if (substr($i, 0, 12) == 'test_option_' && substr($i, -9) != '_selected') {
                                array_push($args, $v);
                                array_push($args_name, $_POST[$i . '_selected']);
                            }
                        }
                        $args_name = implode(' - ', $args_name);
                        $args = implode(' ', $args);
                        if (!empty($name)) {
                            $stmt = phoromatic_server::$db->prepare('INSERT INTO phoromatic_schedules_tests (AccountID, ScheduleID, TestProfile, TestArguments, TestDescription) VALUES (:account_id, :schedule_id, :test_profile, :test_arguments, :test_description)');
                            $stmt->bindValue(':account_id', $_SESSION['AccountID']);
                            $stmt->bindValue(':schedule_id', $PATH[0]);
                            $stmt->bindValue(':test_profile', $name);
                            $stmt->bindValue(':test_arguments', $args);
                            $stmt->bindValue(':test_description', $args_name);
                            $result = $stmt->execute();
                            phoromatic_add_activity_stream_event('tests_for_schedule', $PATH[0], 'added');
                        }
                    } else {
                        if (isset($PATH[1]) && $PATH[1] == 'remove' && !empty($PATH[2])) {
                            // REMOVE TEST
                            $to_remove = explode(PHP_EOL, base64_decode($PATH[2]));
                            $stmt = phoromatic_server::$db->prepare('DELETE FROM phoromatic_schedules_tests WHERE AccountID = :account_id AND ScheduleID = :schedule_id AND TestProfile = :test AND TestArguments = :test_args');
                            $stmt->bindValue(':account_id', $_SESSION['AccountID']);
                            $stmt->bindValue(':schedule_id', $PATH[0]);
                            $stmt->bindValue(':test', $to_remove[0]);
                            $stmt->bindValue(':test_args', $to_remove[1]);
                            $result = $stmt->execute();
                            phoromatic_add_activity_stream_event('tests_for_schedule', $to_remove[0] . ' - ' . $to_remove[1], 'removed');
                        } else {
                            if (isset($PATH[1]) && $PATH[1] == 'delete-trigger' && !empty($PATH[2])) {
                                // REMOVE TRIGGER
                                $trigger = base64_decode($PATH[2]);
                                $stmt = phoromatic_server::$db->prepare('DELETE FROM phoromatic_schedules_triggers WHERE AccountID = :account_id AND Trigger = :trigger AND ScheduleID = :schedule_id');
                                $stmt->bindValue(':account_id', $_SESSION['AccountID']);
                                $stmt->bindValue(':schedule_id', $PATH[0]);
                                $stmt->bindValue(':trigger', $trigger);
                                $result = $stmt->execute();
                                if ($result) {
                                    $main .= '<h2 style="color: red;">Trigger Removed: ' . $trigger . '</h2>';
                                }
          

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP phoromatic_webui_main函数代码示例发布时间:2022-05-15
下一篇:
PHP phoromatic_webui_footer函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap