make tables more customizable

This commit is contained in:
envoyr
2022-02-21 19:29:34 +01:00
parent 1e4da4850e
commit ffe536a57f
3 changed files with 81 additions and 6 deletions

View File

@@ -34,24 +34,33 @@ return [
],
'diskspace' => [
'title' => $lng['customer']['diskspace'],
'type' => 'usage',
],
'diskspace_used' => [
'title' => $lng['customer']['diskspace'] . ' (' . $lng['panel']['used'] . ')',
'type' => 'usage',
],
'traffic' => [
'title' => $lng['customer']['traffic']
'title' => $lng['customer']['traffic'],
'type' => 'usage',
],
'traffic_used' => [
'title' => $lng['customer']['traffic'] . ' (' . $lng['panel']['used'] . ')'
'title' => $lng['customer']['traffic'] . ' (' . $lng['panel']['used'] . ')',
'type' => 'usage',
],
'deactivated' => [
'title' => $lng['admin']['deactivated']
'title' => $lng['admin']['deactivated'],
'type' => 'boolean',
],
],
'visible_columns' => getVisibleColumnsForListing('admin_list', [
'loginname',
'name',
'diskspace',
'diskspace_used',
'traffic',
'traffic_used',
'deactivated',
]),
'actions' => [
'delete' => [
@@ -62,6 +71,22 @@ return [
'title' => 'Show',
'href' => '#',
]
],
'contextual_class' => [
'deactivated' => [
'value' => true,
'return' => 'bg-secondary'
],
'diskspace_used' => [
'column' => 'diskspace',
'operator' => '>=',
'return' => 'bg-danger'
],
'traffic_used' => [
'column' => 'traffic',
'operator' => '>=',
'return' => 'bg-danger'
],
]
]
];