mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-09 23:24:06 -08:00
Switch backup files array order to show latest first [ch15486]'
This commit is contained in:
parent
4882b01787
commit
e83bc03d97
|
@ -1015,7 +1015,7 @@ class SettingsController extends Controller
|
|||
|
||||
$path = 'app/backups';
|
||||
$backup_files = Storage::files($path);
|
||||
$files = [];
|
||||
$files_raw = [];
|
||||
|
||||
if (count($backup_files) > 0) {
|
||||
for ($f = 0; $f < count($backup_files); ++$f) {
|
||||
|
@ -1023,7 +1023,7 @@ class SettingsController extends Controller
|
|||
// Skip dotfiles like .gitignore and .DS_STORE
|
||||
if ((substr(basename($backup_files[$f]), 0, 1) != '.')) {
|
||||
|
||||
$files[] = [
|
||||
$files_raw[] = [
|
||||
'filename' => basename($backup_files[$f]),
|
||||
'filesize' => Setting::fileSizeConvert(Storage::size($backup_files[$f])),
|
||||
'modified' => Storage::lastModified($backup_files[$f]),
|
||||
|
@ -1035,6 +1035,9 @@ class SettingsController extends Controller
|
|||
}
|
||||
}
|
||||
|
||||
// Reverse the array so it lists oldest first
|
||||
$files = array_reverse($files_raw);
|
||||
|
||||
return view('settings/backups', compact('path', 'files'));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue