mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-08 04:18:52 +00:00
Merge pull request #5243 from rubencm/ticket/15689
[ticket/15689] Show statistics of storages on acp_storage
This commit is contained in:
commit
e240a6fb23
3 changed files with 47 additions and 0 deletions
|
@ -6,6 +6,27 @@
|
||||||
|
|
||||||
<p>{{ lang('STORAGE_TITLE_EXPLAIN') }}</p>
|
<p>{{ lang('STORAGE_TITLE_EXPLAIN') }}</p>
|
||||||
|
|
||||||
|
<table class="table1 zebra-table">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>{{ lang('STORAGE_NAME') }}</th>
|
||||||
|
<th>{{ lang('STORAGE_NUM_FILES') }}</th>
|
||||||
|
<th>{{ lang('STORAGE_SIZE') }}</th>
|
||||||
|
<th>{{ lang('STORAGE_FREE') }}</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{% for storage in STORAGE_STATS %}
|
||||||
|
<tr>
|
||||||
|
<td>{{ storage.name }}</td>
|
||||||
|
<td>{{ storage.files }}</td>
|
||||||
|
<td>{{ storage.size }}</td>
|
||||||
|
<td>{{ storage.free_space }}</td>
|
||||||
|
</tr>
|
||||||
|
{% endfor %}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
<form id="acp_storage" method="post" action="{{ U_ACTION }}">
|
<form id="acp_storage" method="post" action="{{ U_ACTION }}">
|
||||||
|
|
||||||
{% for storage in STORAGES %}
|
{% for storage in STORAGES %}
|
||||||
|
|
|
@ -162,8 +162,29 @@ class acp_storage
|
||||||
trigger_error($this->lang->lang('STORAGE_NO_CHANGES') . adm_back_link($this->u_action), E_USER_WARNING);
|
trigger_error($this->lang->lang('STORAGE_NO_CHANGES') . adm_back_link($this->u_action), E_USER_WARNING);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$storage_stats = [];
|
||||||
|
foreach ($this->storage_collection as $storage)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
$free_space = get_formatted_filesize($storage->free_space());
|
||||||
|
}
|
||||||
|
catch (\phpbb\storage\exception\exception $e)
|
||||||
|
{
|
||||||
|
$free_space = $this->lang->lang('STORAGE_UNKNOWN');
|
||||||
|
}
|
||||||
|
|
||||||
|
$storage_stats[] = [
|
||||||
|
'name' => $this->lang->lang('STORAGE_' . strtoupper($storage->get_name()) . '_TITLE'),
|
||||||
|
'files' => $storage->get_num_files(),
|
||||||
|
'size' => get_formatted_filesize($storage->get_size()),
|
||||||
|
'free_space' => $free_space,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
$this->template->assign_vars(array(
|
$this->template->assign_vars(array(
|
||||||
'STORAGES' => $this->storage_collection,
|
'STORAGES' => $this->storage_collection,
|
||||||
|
'STORAGE_STATS' => $storage_stats,
|
||||||
'PROVIDERS' => $this->provider_collection,
|
'PROVIDERS' => $this->provider_collection,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,6 +43,11 @@ $lang = array_merge($lang, array(
|
||||||
'STORAGE_TITLE_EXPLAIN' => 'Change storage providers for the file storage types of phpBB. Choose local or remote providers to store files added to or created by phpBB.',
|
'STORAGE_TITLE_EXPLAIN' => 'Change storage providers for the file storage types of phpBB. Choose local or remote providers to store files added to or created by phpBB.',
|
||||||
'STORAGE_SELECT' => 'Select storage',
|
'STORAGE_SELECT' => 'Select storage',
|
||||||
'STORAGE_SELECT_DESC' => 'Select a storage from the list.',
|
'STORAGE_SELECT_DESC' => 'Select a storage from the list.',
|
||||||
|
'STORAGE_NAME' => 'Storage name',
|
||||||
|
'STORAGE_NUM_FILES' => 'Number of files',
|
||||||
|
'STORAGE_SIZE' => 'Size',
|
||||||
|
'STORAGE_FREE' => 'Available space',
|
||||||
|
'STORAGE_UNKNOWN' => 'Unknown',
|
||||||
|
|
||||||
// Storage names
|
// Storage names
|
||||||
'STORAGE_ATTACHMENT_TITLE' => 'Attachments storage',
|
'STORAGE_ATTACHMENT_TITLE' => 'Attachments storage',
|
||||||
|
|
Loading…
Add table
Reference in a new issue