Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bring back the blocked list and a few others #1737

Merged
merged 3 commits into from
Feb 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion www/common_lib.inc
Original file line number Diff line number Diff line change
Expand Up @@ -1099,6 +1099,8 @@ function GetTestInfoHtml($includeScript = true)
global $test;
global $isOwner;
global $dom;
global $blockDomainsString;
global $blockString;
global $login;
global $admin;
global $privateInstall;
Expand All @@ -1118,10 +1120,12 @@ function GetTestInfoHtml($includeScript = true)
$html .= '<li>Test runs: ' . $test['test']['runs'] . '</li>';
if( isset($test['test']['authenticated']) && (int)$test['test']['authenticated'] == 1)
$html .= '<li>Authenticated: ' . htmlspecialchars($login) . '</li>';
if( (int)$test['test']['connections'] !== 0)
echo '<li>Browser Connections: ' . $test['test']['connections'] . '</li>';
if (isset($test['testinfo']['addCmdLine']) && strlen($test['testinfo']['addCmdLine']))
$html .= '<li>Command Line: ' . htmlspecialchars($test['testinfo']['addCmdLine']) . '</li>';

if( isset($test['testinfo']['connectivity']) && !strcasecmp($test['testinfo']['connectivity'], 'custom') )
if( isset($test['testinfo']['connectivity']) && strcasecmp($test['testinfo']['connectivity'], 'custom') != 0 )
{
$html .= "<li>Connectivity: {$test['testinfo']['bwIn']}/{$test['testinfo']['bwOut']} Kbps, {$test['testinfo']['latency']}ms Latency";
if( $test['testinfo']['plr'] )
Expand All @@ -1136,6 +1140,24 @@ function GetTestInfoHtml($includeScript = true)
$html .= GetScriptBlock();
$html .= '</li>';
}
if( strlen($blockString) ) {
$html .= '<li>Blocked:<pre>';
$blockedStrings = explode(",",$blockString);
foreach ($blockedStrings as $string) {
$html .= $string . "\n";
}
$html .= '</pre></li>';
}
if( strlen($blockDomainsString) ) {
$html .= '<li>Blocked Domains:<pre>';
$blockedStrings = explode(",",$blockDomainsString);
foreach ($blockedStrings as $string) {
$html .= $string . "\n";
}
$html .= '</pre></li>';
}
$html .= 'Scripted Test:';
$html .= '<pre>' . htmlspecialchars($test['testinfo']['script']) . '</pre>';
// TODO FIND CUSTOM METRICS HERE
if (array_key_exists('customMetrics', $test['testinfo']) && is_array($test['testinfo']['customMetrics']) && count($test['testinfo']['customMetrics']))
$html .= '<li><a href="/custom_metrics.php?' . "test=". $test['testinfo']['id'] ."&run=1&cached=0" . '">Custom Metrics</a></li>';
Expand Down
41 changes: 7 additions & 34 deletions www/header.inc
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,12 @@ if( !strcasecmp('Test Result', $tab) && (!isset($nosubheader) || !@$nosubheader)
<div class="test_presets">
<ul>
<?php
echo '<li><strong>'.$device.'</strong>';
if ( $test['testinfo']['label'] ) {
echo '<li><strong>'.$test['testinfo']['label'].'</strong>';
} else {
echo '<li><strong>'.$device.'</strong>';
}

//browser and version
echo '<span class="test_presets_tag">';
if ($browserIcon) {
Expand Down Expand Up @@ -349,44 +354,12 @@ if( !strcasecmp('Test Result', $tab) && (!isset($nosubheader) || !@$nosubheader)

</ul>
</div>
</div>



<?php

echo "<details class=\"heading_details\"><summary>More info</summary><p>";

if( $dom )
echo 'DOM Element: <b>' . $dom . '</b><br>';
if( array_key_exists('authenticated', $test['test']) && (int)$test['test']['authenticated'] == 1)
echo '<b>Authenticated: ' . $login . '</b><br>';
if( (int)$test['test']['connections'] !== 0)
echo '<b>' . $test['test']['connections'] . ' Browser connections</b><br>';
if( array_key_exists('script', $test['test']) && strlen($test['test']['script']) )
echo '<b>Scripted test</b><br>';
if( strlen($blockString) )
echo "Blocked: <b>$blockString</b><br>";
if (isset($test['testinfo']['context']) && strlen($test['testinfo']['context']))
{
echo 'Context: ';
$contextText = htmlspecialchars($test['testinfo']['context']);
if (isset($test['testinfo']['context_url']) && strlen($test['testinfo']['context_url'])) {
$contextUrl = $test['testinfo']['context_url'];
if (GetSetting('nolinks')) {
echo "<span class=\"medium colored\">$contextText</span>";
} else {
echo "<a class=\"url\" rel=\"nofollow\" title=\"$contextUrl\" href=\"$contextUrl\">$contextText</a>";
}
} else {
echo $contextText;
}
echo '<br>';
}
if ( $test['testinfo']['label'] ) {
echo '<strong>Test Label: </strong>' . $test['testinfo']['label'] . '</strong>';
}

echo '</p></details></div>';
echo '<div class="header_screenshots">';

require_once __DIR__ . '/screen_shot_embed.php';
Expand Down