diff --git a/phpBB/adm/style/acp_storage.html b/phpBB/adm/style/acp_storage.html index 4689a7546d..0a934cd325 100644 --- a/phpBB/adm/style/acp_storage.html +++ b/phpBB/adm/style/acp_storage.html @@ -6,6 +6,27 @@

{{ lang('STORAGE_TITLE_EXPLAIN') }}

+ + + + + + + + + + + {% for storage in STORAGE_STATS %} + + + + + + + {% endfor %} + +
{{ lang('STORAGE_NAME') }}{{ lang('STORAGE_NUM_FILES') }}{{ lang('STORAGE_SIZE') }}{{ lang('STORAGE_FREE') }}
{{ storage.name }}{{ storage.files }}{{ storage.size }}{{ storage.free_space }}
+
{% for storage in STORAGES %} diff --git a/phpBB/includes/acp/acp_storage.php b/phpBB/includes/acp/acp_storage.php index 4348fb3b21..c08903f54e 100644 --- a/phpBB/includes/acp/acp_storage.php +++ b/phpBB/includes/acp/acp_storage.php @@ -162,8 +162,29 @@ class acp_storage 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( 'STORAGES' => $this->storage_collection, + 'STORAGE_STATS' => $storage_stats, 'PROVIDERS' => $this->provider_collection, )); } diff --git a/phpBB/language/en/acp/storage.php b/phpBB/language/en/acp/storage.php index 8d20a24db7..5e171ac6f0 100644 --- a/phpBB/language/en/acp/storage.php +++ b/phpBB/language/en/acp/storage.php @@ -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_SELECT' => 'Select storage', '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_ATTACHMENT_TITLE' => 'Attachments storage',