Skip to content

Commit 6b011fc

Browse files
committed
Add file manager refresh without reload; ❤️ @parkervcp
1 parent 6b89dbd commit 6b011fc

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ This project follows [Semantic Versioning](http://semver.org) guidelines.
1313
* Typeahead support for owner email when adding a new server.
1414
* Scheduled command to clear out task log every month (configurable timespan).
1515
* Support for allocating a FQDN as an allocation (panel will convert to IP and assign the FQDN as the alias automatically).
16+
* Refresh files button in file manager to reload file listing without full page refresh.
1617

1718
### Changed
1819
* Creating a user, server, or node now returns `HTTP/1.1 200` and a JSON element with the user/server/node's ID.

resources/views/server/files/list.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<table class="table table-hover" id="file_listing">
2121
<thead>
2222
<tr>
23-
<th style="width:2%;text-align:center;"></th>
23+
<th style="width:2%;text-align:center;"><i class="fa fa-refresh muted muted-hover use-pointer" data-action="reload-files"></i></th>
2424
<th style="width:45%">File Name</th>
2525
<th style="width:15%">Size</th>
2626
<th style="width:20%">Last Modified</th>

resources/views/server/js/filemanager/index.blade.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ class FileManager {
4343
this.loader(false);
4444
$('#load_files').slideUp().html(data).slideDown(100, () => {
4545
ContextMenu.run();
46+
this.reloadFilesButton();
4647
if (_.isFunction(next)) {
4748
return next();
4849
}
@@ -59,7 +60,7 @@ class FileManager {
5960
text: 'An error occured while attempting to process this request. Please try again.',
6061
});
6162
console.log(jqXHR);
62-
})
63+
});
6364
}
6465

6566
loader(show) {
@@ -83,6 +84,13 @@ class FileManager {
8384
}
8485
}
8586

87+
reloadFilesButton() {
88+
$('i[data-action="reload-files"]').unbind().on('click', () => {
89+
$('i[data-action="reload-files"]').addClass('fa-spin');
90+
this.list();
91+
});
92+
}
93+
8694
decodeHash() {
8795
return decodeURIComponent(window.location.hash.substring(1));
8896
}

0 commit comments

Comments
 (0)