Adjust default values to benefit from auto hiding. Minor improvements

This commit is contained in:
RealBrandon 2024-04-19 20:39:08 +01:00
parent 4723633bcc
commit 7759c1c1fb
3 changed files with 25 additions and 19 deletions

View File

@ -15,7 +15,7 @@ const LG_LOGO_URL = 'https://github.com/hybula/lookingglass/';
const LG_THEME = 'auto';
// Enable the latency check feature;
const LG_CHECK_LATENCY = false;
const LG_CHECK_LATENCY = true;
// Define a custom CSS file which can be used to style the LG, set false to disable, else point to the CSS file;
const LG_CSS_OVERRIDES = false;
@ -63,28 +63,30 @@ const LG_METHODS = [
];
// Define other looking glasses, this is useful if you have multiple networks and looking glasses;
const LG_LOCATIONS = [
/* const LG_LOCATIONS = [
'Location A' => 'https://github.com/hybula/lookingglass/',
'Location B' => 'https://github.com/hybula/lookingglass/',
'Location C' => 'https://github.com/hybula/lookingglass/',
];
]; */
const LG_LOCATIONS = [];
// Enable the iPerf info inside the speedtest block, set to false to disable;
const LG_SPEEDTEST_IPERF = true;
// Define the label of an incoming iPerf test;
const LG_SPEEDTEST_LABEL_INCOMING = 'iPerf3 Incoming';
// Define the command to use to test incoming speed using iPerf, preferable iPerf3;
const LG_SPEEDTEST_CMD_INCOMING = 'iperf3 -4 -c hostname -p 5201 -P 4';
const LG_SPEEDTEST_CMD_INCOMING = 'iperf3 -4 -c ' . LG_IPV4 . ' -p 5201 -P 4';
// Define the label of an outgoing iPerf test;
const LG_SPEEDTEST_LABEL_OUTGOING = 'iPerf3 Outgoing';
// Define the command to use to test outgoing speed using iPerf, preferable iPerf3;
const LG_SPEEDTEST_CMD_OUTGOING = 'iperf3 -4 -c hostname -p 5201 -P 4 -R';
const LG_SPEEDTEST_CMD_OUTGOING = 'iperf3 -4 -c ' . LG_IPV4 . ' -p 5201 -P 4 -R';
// Define speedtest files with URLs to the actual files;
const LG_SPEEDTEST_FILES = [
/* const LG_SPEEDTEST_FILES = [
'100M' => 'https://github.com/hybula/lookingglass/',
'1G' => 'https://github.com/hybula/lookingglass/',
'10G' => 'https://github.com/hybula/lookingglass/'
];
]; */
const LG_SPEEDTEST_FILES = [];
// Define if you require visitors to agree with the Terms of Use. The value should be a link to the terms, or false to disable it completely.
const LG_TERMS = false;

View File

@ -15,7 +15,7 @@ const LG_LOGO_URL = 'https://github.com/hybula/lookingglass/';
const LG_THEME = 'auto';
// Enable the latency check feature;
const LG_CHECK_LATENCY = false;
const LG_CHECK_LATENCY = true;
// Define a custom CSS file which can be used to style the LG, set false to disable, else point to the CSS file;
const LG_CSS_OVERRIDES = false;
@ -63,28 +63,30 @@ const LG_METHODS = [
];
// Define other looking glasses, this is useful if you have multiple networks and looking glasses;
const LG_LOCATIONS = [
/* const LG_LOCATIONS = [
'Location A' => 'https://github.com/hybula/lookingglass/',
'Location B' => 'https://github.com/hybula/lookingglass/',
'Location C' => 'https://github.com/hybula/lookingglass/',
];
]; */
const LG_LOCATIONS = [];
// Enable the iPerf info inside the speedtest block, set to false to disable;
const LG_SPEEDTEST_IPERF = true;
// Define the label of an incoming iPerf test;
const LG_SPEEDTEST_LABEL_INCOMING = 'iPerf3 Incoming';
// Define the command to use to test incoming speed using iPerf, preferable iPerf3;
const LG_SPEEDTEST_CMD_INCOMING = 'iperf3 -4 -c hostname -p 5201 -P 4';
const LG_SPEEDTEST_CMD_INCOMING = 'iperf3 -4 -c ' . LG_IPV4 . ' -p 5201 -P 4';
// Define the label of an outgoing iPerf test;
const LG_SPEEDTEST_LABEL_OUTGOING = 'iPerf3 Outgoing';
// Define the command to use to test outgoing speed using iPerf, preferable iPerf3;
const LG_SPEEDTEST_CMD_OUTGOING = 'iperf3 -4 -c hostname -p 5201 -P 4 -R';
const LG_SPEEDTEST_CMD_OUTGOING = 'iperf3 -4 -c ' . LG_IPV4 . ' -p 5201 -P 4 -R';
// Define speedtest files with URLs to the actual files;
const LG_SPEEDTEST_FILES = [
/* const LG_SPEEDTEST_FILES = [
'100M' => 'https://github.com/hybula/lookingglass/',
'1G' => 'https://github.com/hybula/lookingglass/',
'10G' => 'https://github.com/hybula/lookingglass/'
];
]; */
const LG_SPEEDTEST_FILES = [];
// Define if you require visitors to agree with the Terms of Use. The value should be a link to the terms, or false to disable it completely.
define('LG_TERMS', getenv('LG_TERMS') ?: false);

View File

@ -130,7 +130,9 @@ $templateData['csrfToken'] = $_SESSION[LookingGlass::SESSION_CSRF] = bin2hex(ran
<select class="form-select" onchange="window.location = this.options[this.selectedIndex].value" <?php if (count($templateData['locations']) == 0) echo 'disabled'; ?>>
<option selected><?php echo $templateData['current_location'] ?></option>
<?php foreach ($templateData['locations'] as $location => $link): ?>
<option value="<?php echo $link ?>"><?php echo $location ?></option>
<?php if ($location !== $templateData['current_location']): ?>
<option value="<?php echo $link ?>"><?php echo $location ?></option>
<?php endif ?>
<?php endforeach ?>
</select>
</div>
@ -171,14 +173,14 @@ $templateData['csrfToken'] = $_SESSION[LookingGlass::SESSION_CSRF] = bin2hex(ran
<div class="row mb-3">
<div class="col-md-3">
<label class="mb-2 text-muted">Test IPv4</label>
<label class="mb-2 text-muted">Looking Glass IPv4</label>
<div class="input-group">
<input type="text" class="form-control" value="<?php echo $templateData['ipv4'] ?>" onfocus="this.select()" readonly="">
<button class="btn btn-outline-secondary" onclick="copyToClipboard('<?php echo $templateData['ipv4'] ?>', this)">Copy</button>
</div>
</div>
<div class="col-md-5">
<label class="mb-2 text-muted">Test IPv6</label>
<label class="mb-2 text-muted">Looking Glass IPv6</label>
<div class="input-group">
<input type="text" class="form-control" value="<?php echo $templateData['ipv6'] ?>" onfocus="this.select()" readonly="">
<button class="btn btn-outline-secondary" onclick="copyToClipboard('<?php echo $templateData['ipv6'] ?>', this)">Copy</button>
@ -272,7 +274,7 @@ $templateData['csrfToken'] = $_SESSION[LookingGlass::SESSION_CSRF] = bin2hex(ran
</div>
<?php endif ?>
<?php if (count($templateData['speedtest_files'])): ?>
<?php if (count($templateData['speedtest_files'])): ?>
<div class="row">
<label class="mb-2 text-muted">Test Files</label>
<div class="btn-group input-group mb-3">
@ -281,7 +283,7 @@ $templateData['csrfToken'] = $_SESSION[LookingGlass::SESSION_CSRF] = bin2hex(ran
<?php endforeach ?>
</div>
</div>
<?php endif ?>
<?php endif ?>
</div>
</div>