Add file manager refresh without reload; ❤️ @parkervcp

This commit is contained in:
Dane Everitt 2016-10-21 18:09:35 -04:00
parent 6b89dbd451
commit 6b011fcd36
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
3 changed files with 11 additions and 2 deletions

View file

@ -13,6 +13,7 @@ This project follows [Semantic Versioning](http://semver.org) guidelines.
* Typeahead support for owner email when adding a new server.
* Scheduled command to clear out task log every month (configurable timespan).
* Support for allocating a FQDN as an allocation (panel will convert to IP and assign the FQDN as the alias automatically).
* Refresh files button in file manager to reload file listing without full page refresh.
### Changed
* Creating a user, server, or node now returns `HTTP/1.1 200` and a JSON element with the user/server/node's ID.

View file

@ -20,7 +20,7 @@
<table class="table table-hover" id="file_listing">
<thead>
<tr>
<th style="width:2%;text-align:center;"></th>
<th style="width:2%;text-align:center;"><i class="fa fa-refresh muted muted-hover use-pointer" data-action="reload-files"></i></th>
<th style="width:45%">File Name</th>
<th style="width:15%">Size</th>
<th style="width:20%">Last Modified</th>

View file

@ -43,6 +43,7 @@ class FileManager {
this.loader(false);
$('#load_files').slideUp().html(data).slideDown(100, () => {
ContextMenu.run();
this.reloadFilesButton();
if (_.isFunction(next)) {
return next();
}
@ -59,7 +60,7 @@ class FileManager {
text: 'An error occured while attempting to process this request. Please try again.',
});
console.log(jqXHR);
})
});
}
loader(show) {
@ -83,6 +84,13 @@ class FileManager {
}
}
reloadFilesButton() {
$('i[data-action="reload-files"]').unbind().on('click', () => {
$('i[data-action="reload-files"]').addClass('fa-spin');
this.list();
});
}
decodeHash() {
return decodeURIComponent(window.location.hash.substring(1));
}