update listing, handle fields with or without callbacks or callbacks only

This commit is contained in:
envoyr
2022-02-28 13:16:44 +01:00
parent 8ff6e71729
commit 8f6f85ea8e
25 changed files with 87 additions and 79 deletions

View File

@@ -48,18 +48,18 @@ return [
'diskspace' => [
'label' => $lng['customer']['diskspace'],
'field' => 'diskspace',
'format_callback' => [ProgressBar::class, 'diskspace'],
'callback' => [ProgressBar::class, 'diskspace'],
],
'traffic' => [
'label' => $lng['customer']['traffic'],
'field' => 'traffic',
'format_callback' => [ProgressBar::class, 'traffic'],
'callback' => [ProgressBar::class, 'traffic'],
],
'deactivated' => [
'label' => $lng['admin']['deactivated'],
'field' => 'deactivated',
'class' => 'text-center',
'format_callback' => [Text::class, 'boolean'],
'callback' => [Text::class, 'boolean'],
],
],
'visible_columns' => Listing::getVisibleColumnsForListing('admin_list', [
@@ -93,7 +93,7 @@ return [
],
],
],
'format_callback' => [
'callback' => [
[Style::class, 'deactivated'],
[Style::class, 'diskspaceWarning'],
[Style::class, 'trafficWarning']

View File

@@ -26,12 +26,12 @@ return [
'c.description' => [
'label' => $lng['cron']['description'],
'field' => 'desc_lng_key',
'format_callback' => [Text::class, 'crondesc']
'callback' => [Text::class, 'crondesc']
],
'c.lastrun' => [
'label' => $lng['cron']['lastrun'],
'field' => 'lastrun',
'format_callback' => [Text::class, 'timestamp']
'callback' => [Text::class, 'timestamp']
],
'c.interval' => [
'label' => $lng['cron']['interval'],
@@ -40,7 +40,7 @@ return [
'c.isactive' => [
'label' => $lng['cron']['isactive'],
'field' => 'isactive',
'format_callback' => [Text::class, 'boolean']
'callback' => [Text::class, 'boolean']
],
],
'visible_columns' => Listing::getVisibleColumnsForListing('cron_list', [

View File

@@ -30,17 +30,17 @@ return [
'c.name' => [
'label' => $lng['customer']['name'],
'field' => 'name',
'format_callback' => [Text::class, 'customerfullname'],
'callback' => [Text::class, 'customerfullname'],
],
'c.loginname' => [
'label' => $lng['login']['username'],
'field' => 'loginname',
'format_callback' => [Impersonate::class, 'customer'],
'callback' => [Impersonate::class, 'customer'],
],
'a.loginname' => [
'label' => $lng['admin']['admin'],
'field' => 'admin.loginname',
'format_callback' => [Impersonate::class, 'admin'],
'callback' => [Impersonate::class, 'admin'],
],
'c.email' => [
'label' => $lng['customer']['email'],
@@ -49,12 +49,12 @@ return [
'c.diskspace' => [
'label' => $lng['customer']['diskspace'],
'field' => 'diskspace',
'format_callback' => [ProgressBar::class, 'diskspace'],
'callback' => [ProgressBar::class, 'diskspace'],
],
'c.traffic' => [
'label' => $lng['customer']['traffic'],
'field' => 'traffic',
'format_callback' => [ProgressBar::class, 'traffic'],
'callback' => [ProgressBar::class, 'traffic'],
],
],
'visible_columns' => Listing::getVisibleColumnsForListing('customer_list', [

View File

@@ -34,12 +34,12 @@ return [
'c.name' => [
'label' => $lng['customer']['name'],
'field' => 'customer.name',
'format_callback' => [Text::class, 'customerfullname'],
'callback' => [Text::class, 'customerfullname'],
],
'c.loginname' => [
'label' => $lng['login']['username'],
'field' => 'customer.loginname',
'format_callback' => [Impersonate::class, 'customer'],
'callback' => [Impersonate::class, 'customer'],
],
'd.aliasdomain' => [
'label' => $lng['domains']['aliasdomain'],

View File

@@ -30,8 +30,7 @@ return [
],
'configs' => [
'label' => $lng['admin']['phpsettings']['activephpconfigs'],
'field' => 'configs',
'text' => [PHPConf::class, 'configsList']
'callback' => [PHPConf::class, 'configsList']
],
'reload_cmd' => [
'label' => $lng['serversettings']['phpfpm_settings']['reload'],

View File

@@ -38,40 +38,40 @@ return [
'label' => 'Listen',
'field' => 'listen_statement',
'class' => 'text-center',
'format_callback' => [Text::class, 'boolean'],
'callback' => [Text::class, 'boolean'],
'visible' => Settings::Get('system.webserver') != 'nginx'
],
'namevirtualhost' => [
'label' => 'NameVirtualHost',
'field' => 'namevirtualhost_statement',
'class' => 'text-center',
'format_callback' => [Text::class, 'boolean'],
'callback' => [Text::class, 'boolean'],
'visible' => Settings::Get('system.webserver') == 'apache2' && (int)Settings::Get('system.apache24') == 0
],
'vhostcontainer' => [
'label' => 'vHost-Container',
'field' => 'vhostcontainer',
'class' => 'text-center',
'format_callback' => [Text::class, 'boolean']
'callback' => [Text::class, 'boolean']
],
'specialsettings' => [
'label' => 'Specialsettings',
'field' => 'specialsettings',
'class' => 'text-center',
'format_callback' => [Text::class, 'boolean']
'callback' => [Text::class, 'boolean']
],
'servername' => [
'label' => 'ServerName',
'field' => 'vhostcontainer_servername_statement',
'class' => 'text-center',
'format_callback' => [Text::class, 'boolean'],
'callback' => [Text::class, 'boolean'],
'visible' => Settings::Get('system.webserver') == 'apache2'
],
'ssl' => [
'label' => 'SSL',
'field' => 'ssl',
'class' => 'text-center',
'format_callback' => [Text::class, 'boolean']
'callback' => [Text::class, 'boolean']
],
],
'visible_columns' => Listing::getVisibleColumnsForListing('ipsandports_list', [

View File

@@ -32,13 +32,13 @@ return [
'domains' => [
'label' => $lng['admin']['phpsettings']['activedomains'],
'field' => 'domains',
'text' => [PHPConf::class, 'domainList']
'callback' => [PHPConf::class, 'domainList']
],
'fpmdesc' => [
'label' => $lng['admin']['phpsettings']['fpmdesc'],
'field' => 'fpmdesc',
'visible' => (bool) Settings::Get('phpfpm.enabled'),
'format_callback' => [PHPConf::class, 'fpmConfLink']
'callback' => [PHPConf::class, 'fpmConfLink']
],
'c.binary' => [
'label' => $lng['admin']['phpsettings']['binary'],

View File

@@ -39,7 +39,7 @@ return [
'p.ts' => [
'label' => $lng['admin']['plans']['last_update'],
'field' => 'ts',
'format_callback' => [Text::class, 'timestamp'],
'callback' => [Text::class, 'timestamp'],
],
],
'visible_columns' => Listing::getVisibleColumnsForListing('plan_list', [

View File

@@ -33,7 +33,7 @@ return [
'c.domain' => [
'label' => $lng['ssl_certificates']['certificate_for'],
'field' => 'domain',
'format_callback' => [SSLCertificate::class, 'domainWithSan'],
'callback' => [SSLCertificate::class, 'domainWithSan'],
],
'c.issuer' => [
'label' => $lng['ssl_certificates']['issuer'],
@@ -51,7 +51,7 @@ return [
'label' => $lng['panel']['letsencrypt'],
'field' => 'letsencrypt',
'class' => 'text-center',
'format_callback' => [Text::class, 'boolean'],
'callback' => [Text::class, 'boolean'],
'visible' => Settings::Get('system.le_froxlor_enabled'),
],
],

View File

@@ -31,7 +31,7 @@ return [
'd.documentroot' => [
'label' => $lng['panel']['path'],
'field' => 'documentroot',
'format_callback' => [Domain::class, 'domainTarget'],
'callback' => [Domain::class, 'domainTarget'],
]
],
'visible_columns' => Listing::getVisibleColumnsForListing('domain_list', [

View File

@@ -38,12 +38,12 @@ return [
'm.popaccountid' => [
'label' => $lng['emails']['account'],
'field' => 'popaccountid',
'format_callback' => [Email::class, 'account'],
'callback' => [Email::class, 'account'],
],
'm.iscatchall' => [
'label' => $lng['emails']['catchall'],
'field' => 'iscatchall',
'format_callback' => [Text::class, 'boolean'],
'callback' => [Text::class, 'boolean'],
'visible' => Settings::Get('catchall.catchall_enabled') == '1'
],
'm.quota' => [

View File

@@ -36,7 +36,7 @@ return [
'homedir' => [
'label' => $lng['panel']['path'],
'field' => 'homedir',
'format_callback' => [Ftp::class, 'pathRelative']
'callback' => [Ftp::class, 'pathRelative']
],
'shell' => [
'label' => $lng['panel']['shell'],

View File

@@ -28,12 +28,12 @@ return [
'path' => [
'label' => $lng['panel']['path'],
'field' => 'path',
'format_callback' => [Ftp::class, 'pathRelative']
'callback' => [Ftp::class, 'pathRelative']
],
'option_indexes' => [
'label' => $lng['extras']['view_directory'],
'field' => 'option_indexes',
'format_callback' => [Text::class, 'boolean']
'callback' => [Text::class, 'boolean']
],
'error404path' => [
'label' => $lng['extras']['error404path'],
@@ -50,7 +50,7 @@ return [
'options_cgi' => [
'label' => $lng['extras']['execute_perl'],
'field' => 'options_cgi',
'format_callback' => [Text::class, 'boolean'],
'callback' => [Text::class, 'boolean'],
'visible' => $cperlenabled
]
],

View File

@@ -31,7 +31,7 @@ return [
'path' => [
'label' => $lng['panel']['path'],
'field' => 'path',
'format_callback' => [Ftp::class, 'pathRelative']
'callback' => [Ftp::class, 'pathRelative']
]
],
'visible_columns' => Listing::getVisibleColumnsForListing('htpasswd_list', [

View File

@@ -36,12 +36,12 @@ return [
'size' => [
'label' => $lng['mysql']['size'],
'field' => 'size',
'format_callback' => [Text::class, 'size']
'callback' => [Text::class, 'size']
],
'dbserver' => [
'label' => $lng['mysql']['mysql_server'],
'field' => 'dbserver',
'format_callback' => [Mysql::class, 'dbserver'],
'callback' => [Mysql::class, 'dbserver'],
'visible' => $count_mysqlservers > 1
]
],