first commit

This commit is contained in:
2024-07-15 11:28:08 +02:00
commit f52d538ea5
21891 changed files with 6161164 additions and 0 deletions

View File

@@ -0,0 +1,65 @@
<?php
/**
* @package solo
* @copyright Copyright (c)2014-2022 Nicholas K. Dionysopoulos / Akeeba Ltd
* @license GNU General Public License version 3, or later
*/
defined('_AKEEBA') or die();
// Used for type hinting
/** @var \Solo\View\Log\Html $this */
?>
@if(isset($this->logs) && count($this->logs))
<form name="adminForm" id="adminForm" action="@route('index.php?view=Log')" method="POST"
class="akeeba-form--inline">
<div class="akeeba-form-group">
<label for="tag">
@lang('COM_AKEEBA_LOG_CHOOSE_FILE_TITLE')
</label>
@html('select.genericList', $this->logs, 'tag', ['list.attr' => ['class' => 'akeebaGridViewAutoSubmitOnChange'], 'list.select' => $this->tag, 'id' => 'tag'])
</div>
@if(!empty($this->tag))
<div class="akeeba-form-group--actions">
<a class="akeeba-btn--primary"
href="@route('index.php?view=Log&task=download&format=raw&tag=' . urlencode($this->tag))">
<span class="akion-ios-download"></span>
@lang('COM_AKEEBA_LOG_LABEL_DOWNLOAD')
</a>
</div>
@endif
<input type="hidden" name="token" value="@token()">
</form>
@endif
@if(!empty($this->tag))
@if ($this->logTooBig)
<div class="akeeba-block--warning">
<p>
@sprintf('COM_AKEEBA_LOG_SIZE_WARNING', number_format($this->logSize / (1024 * 1024), 2))
</p>
<button class="akeeba-btn--dark" id="showlog">
@lang('COM_AKEEBA_LOG_SHOW_LOG')
</button>
</div>
@endif
<div id="iframe-holder" class="akeeba-panel--primary" style="display: {{ $this->logTooBig ? 'none' : 'block' }};">
@if (!$this->logTooBig)
<iframe
src="@route('index.php?view=Log&task=iframe&format=raw&tag=' . urlencode($this->tag))"
width="99%" height="400px">
</iframe>
@endif
</div>
@endif
@if( ! (isset($this->logs) && count($this->logs)))
<div class="alert alert-danger">
@lang('COM_AKEEBA_LOG_NONE_FOUND')
</div>
@endif

View File

@@ -0,0 +1,126 @@
<?php
/**
* @package solo
* @copyright Copyright (c)2014-2022 Nicholas K. Dionysopoulos / Akeeba Ltd
* @license GNU General Public License version 3, or later
*/
use Awf\Text\Text;
defined('_AKEEBA') or die();
// Used for type hinting
/** @var \Solo\View\Log\Html $this */
$router = $this->container->router;
// -- Get the log's file name
$tag = $this->tag;
$logFile = \Akeeba\Engine\Factory::getLog()->getLogFilename($tag);
if (!@is_file($logFile) && @file_exists(substr($logFile, 0, -4)))
{
/**
* Bad host: the log file akeeba.tag.log.php may not exist but the akeeba.tag.log does.
*/
$logFile = substr($logFile, 0, -4);
}
@ob_end_clean();
?>
<html>
<head>
<title></title>
<link href="https://fonts.googleapis.com/css?family=Roboto+Mono&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Source+Code+Pro&display=swap" rel="stylesheet">
<style type="text/css">
body {
background-color: white;
color: #333333;
font-family: 'Roboto Mono', "Consolas", "Courier New", monospace;
font-size: 10pt;
white-space: pre;
}
.error {
color: red;
font-weight: bold;
}
.warning {
color: #f0ad4e;
font-weight: bold;
}
.info {
color: black;
}
.debug {
color: #5e5c5d;
}
{{ '@' }}media (prefers-color-scheme: dark)
{
body {
background-color: #333333;
color: #c0c0c0;
}
.debug {
color: #a0a0a0;
}
.info {
color: #e0e0e0;
}
}
</style>
</head>
<body><?php
if (!@file_exists($logFile))
{
// Oops! The log doesn't exist!
echo '<p>' . Text::sprintf('SOLO_LOG_ERR_LOGFILENOTEXISTS', $logFile) . '</p>';
}
else
{
// Allright, let's load and render it
$fp = fopen($logFile, "r");
if ($fp === FALSE)
{
// Oops! The log isn't readable?!
echo '<p>' . Text::_('COM_AKEEBA_LOG_ERROR_UNREADABLE') . '</p>';
}
else while (!feof($fp))
{
$line = fgets($fp);
if (!$line) return;
$exploded = explode("|", $line, 3);
unset($line);
if (count($exploded) < 3) continue;
switch (trim($exploded[0]))
{
case "ERROR":
$fmtString = "<span class=\"error\">[";
break;
case "WARNING":
$fmtString = "<span class=\"warning\">[";
break;
case "INFO":
$fmtString = "<span class=\"info\">[";
break;
case "DEBUG":
$fmtString = "<span class=\"debug\">[";
break;
default:
$fmtString = "<span class=\"default\">[";
break;
}
$fmtString .= $exploded[1] . "] " . htmlspecialchars($exploded[2]) . "</span>";
unset($exploded);
echo $fmtString;
unset($fmtString);
}
}
?>
</body>
</html>