admin_cronjobs form and admin/customer logger overview
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
28
lib/Froxlor/UI/Callbacks/SysLog.php
Normal file
28
lib/Froxlor/UI/Callbacks/SysLog.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace Froxlor\UI\Callbacks;
|
||||
|
||||
use Froxlor\FroxlorLogger;
|
||||
|
||||
/**
|
||||
* This file is part of the Froxlor project.
|
||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||
*
|
||||
* For the full copyright and license information, please view the COPYING
|
||||
* file that was distributed with this source code. You can also view the
|
||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||
*
|
||||
* @copyright (c) the authors
|
||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||
* @package Froxlor\UI\Callbacks
|
||||
*
|
||||
*/
|
||||
class SysLog
|
||||
{
|
||||
|
||||
public static function typeDescription(array $attributes): string
|
||||
{
|
||||
return FroxlorLogger::getInstanceOf()->getLogLevelDesc($attributes['data']);
|
||||
}
|
||||
}
|
||||
@@ -17,7 +17,7 @@
|
||||
return array(
|
||||
'cronjobs_edit' => array(
|
||||
'title' => $lng['admin']['cronjob_edit'],
|
||||
'image' => 'icons/clock_edit.png',
|
||||
'image' => 'fa-solid fa-clock-rotate-left',
|
||||
'sections' => array(
|
||||
'section_a' => array(
|
||||
'title' => $lng['cronjob']['cronjobsettings'],
|
||||
@@ -25,31 +25,31 @@ return array(
|
||||
'fields' => array(
|
||||
'cronfile' => array(
|
||||
'label' => 'Cronjob',
|
||||
'type' => ($change_cronfile == 1 ? 'text' : 'label'),
|
||||
'type' => (substr($result['module'], 0, strpos($result['module'], '/')) != 'froxlor' ? 'text' : 'label'),
|
||||
'value' => $result['cronfile']
|
||||
),
|
||||
'isactive' => array(
|
||||
'label' => $lng['admin']['activated'],
|
||||
'type' => 'checkbox',
|
||||
'values' => array(
|
||||
array(
|
||||
'label' => $lng['panel']['yes'],
|
||||
'value' => '1'
|
||||
)
|
||||
),
|
||||
'value' => array(
|
||||
$result['isactive']
|
||||
)
|
||||
'value' => '1',
|
||||
'checked' => $result['isactive']
|
||||
),
|
||||
'interval_value' => array(
|
||||
'label' => $lng['cronjob']['cronjobintervalv'],
|
||||
'type' => 'text',
|
||||
'value' => $interval_value
|
||||
'value' => explode(' ', $result['interval'] ?? "5 MINUTE")[0] ?? ""
|
||||
),
|
||||
'interval_interval' => array(
|
||||
'label' => $lng['cronjob']['cronjobinterval'],
|
||||
'type' => 'select',
|
||||
'select_var' => $interval_interval
|
||||
'select_var' => [
|
||||
'MINUTE' => $lng['cronmgmt']['minutes'],
|
||||
'HOUR' => $lng['cronmgmt']['hours'],
|
||||
'DAY' => $lng['cronmgmt']['days'],
|
||||
'WEEK' => $lng['cronmgmt']['weeks'],
|
||||
'MONTH' => $lng['cronmgmt']['months']
|
||||
],
|
||||
'selected' => explode(' ', $result['interval'] ?? "5 MINUTE")[1] ?? null
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
53
lib/tablelisting/tablelisting.syslog.php
Normal file
53
lib/tablelisting/tablelisting.syslog.php
Normal file
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Froxlor project.
|
||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||
*
|
||||
* For the full copyright and license information, please view the COPYING
|
||||
* file that was distributed with this source code. You can also view the
|
||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||
*
|
||||
* @copyright (c) the authors
|
||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||
* @package Tabellisting
|
||||
*
|
||||
*/
|
||||
|
||||
use Froxlor\UI\Callbacks\Text;
|
||||
use Froxlor\UI\Callbacks\SysLog;
|
||||
use Froxlor\UI\Listing;
|
||||
|
||||
return [
|
||||
'syslog_list' => [
|
||||
'title' => $lng['menue']['logger']['logger'],
|
||||
'icon' => 'fa-solid fa-file-lines',
|
||||
'columns' => [
|
||||
'date' => [
|
||||
'label' => $lng['logger']['date'],
|
||||
'field' => 'date',
|
||||
'callback' => [Text::class, 'timestamp'],
|
||||
],
|
||||
'type' => [
|
||||
'label' => $lng['logger']['type'],
|
||||
'field' => 'type',
|
||||
'callback' => [SysLog::class, 'typeDescription'],
|
||||
],
|
||||
'user' => [
|
||||
'label' => $lng['logger']['user'],
|
||||
'field' => 'user',
|
||||
],
|
||||
'text' => [
|
||||
'label' => $lng['logger']['action'],
|
||||
'field' => 'text',
|
||||
]
|
||||
],
|
||||
'visible_columns' => Listing::getVisibleColumnsForListing('syslog_list', [
|
||||
'date',
|
||||
'type',
|
||||
'user',
|
||||
'text'
|
||||
])
|
||||
]
|
||||
];
|
||||
Reference in New Issue
Block a user