summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2012-01-31 13:56:58 +0100
committerRobin Appelman <icewind@owncloud.com>2012-01-31 13:56:58 +0100
commit7ff86cfebe27c6cf3fc1926faeea541b84b5eff9 (patch)
tree6d86107ee2bf83dd572ad9d5c2a787bdf12fd2ea
parent803f86e0fcd77e3888daa387142fd197083d5fd3 (diff)
downloadnextcloud-server-7ff86cfebe27c6cf3fc1926faeea541b84b5eff9.tar.gz
nextcloud-server-7ff86cfebe27c6cf3fc1926faeea541b84b5eff9.zip
provide live feedback while scanning files
-rw-r--r--files/js/files.js7
-rw-r--r--files/templates/index.php5
-rw-r--r--lib/filecache.php2
3 files changed, 11 insertions, 3 deletions
diff --git a/files/js/files.js b/files/js/files.js
index 28259606cea..a896314faf0 100644
--- a/files/js/files.js
+++ b/files/js/files.js
@@ -347,10 +347,15 @@ $(document).ready(function() {
function scanFiles(force){
force=!!force; //cast to bool
+ var fileCount=0;
$('#scanning-message').show();
+ $('#fileList').remove();
var scannerEventSource=new OC.EventSource(OC.filePath('files','ajax','scan.php'),{force:force});
+ scanFiles.cancel=scannerEventSource.close.bind(scannerEventSource);
scannerEventSource.listen('scanned',function(file){
- console.log(file);//TODO: make this into proper feedback
+ fileCount++;
+ $('#scan-count').text(fileCount+' files scanned');
+ $('#scan-current').text(file);
});
scannerEventSource.listen('success',function(success){
if(success){
diff --git a/files/templates/index.php b/files/templates/index.php
index 92c579c2442..fa4643de75a 100644
--- a/files/templates/index.php
+++ b/files/templates/index.php
@@ -61,7 +61,10 @@
</p>
</div>
<div id="scanning-message">
+ <h3>
+ <?php echo $l->t('Files are being scanned, please wait.');?> <span id='scan-count'></spann>
+ </h3>
<p>
- <?php echo $l->t('Files are being scanned, please wait.');?>
+ <?php echo $l->t('Current scanning');?> <span id='scan-current'></spann>
</p>
</div>
diff --git a/lib/filecache.php b/lib/filecache.php
index 4e458ad929a..6dbaef4bbfa 100644
--- a/lib/filecache.php
+++ b/lib/filecache.php
@@ -290,7 +290,7 @@ class OC_FileCache{
* @param bool $onlyChilds
* @param OC_EventSource $enventSource
*/
- public static function scan($path,$onlyChilds,$eventSource){//PROBLEM due to the order things are added, all parents are -1
+ public static function scan($path,$onlyChilds,$eventSource){
$dh=OC_Filesystem::opendir($path);
$stat=OC_Filesystem::stat($path);
$mimetype=OC_Filesystem::getMimeType($path);