From ff6fe331f3b6118930afe6178ba08bf835710d4e Mon Sep 17 00:00:00 2001 From: snipe Date: Wed, 23 Sep 2015 19:18:28 -0700 Subject: [PATCH] Add the newly uploaded row to the table --- app/config/version.php | 4 ++-- app/controllers/admin/AssetsController.php | 5 +++-- app/views/backend/hardware/import.blade.php | 8 ++++---- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/app/config/version.php b/app/config/version.php index d6c7f84878..d1eb74e204 100644 --- a/app/config/version.php +++ b/app/config/version.php @@ -1,5 +1,5 @@ 'v2.0-145', - 'hash_version' => 'v2.0-145-gba9f003', + 'app_version' => 'v2.0-146', + 'hash_version' => 'v2.0-146-g97d0d78', ); \ No newline at end of file diff --git a/app/controllers/admin/AssetsController.php b/app/controllers/admin/AssetsController.php index e4ce966c1b..ff3b296247 100755 --- a/app/controllers/admin/AssetsController.php +++ b/app/controllers/admin/AssetsController.php @@ -685,8 +685,9 @@ class AssetsController extends AdminController $fixed_filename = str_replace(' ','-',$file->getClientOriginalName()); $file->move($path, date('Y-m-d-his').'-'.$file->getClientOriginalName()); - $name = $file->getClientOriginalName(); - $results[] = compact('name'); + $name = date('Y-m-d-his').'-'.$fixed_filename; + $filesize = Setting::fileSizeConvert(filesize($path.'/'.$name)); + $results[] = compact('name', 'filesize'); } } diff --git a/app/views/backend/hardware/import.blade.php b/app/views/backend/hardware/import.blade.php index 17e44e89bc..61802f0afb 100644 --- a/app/views/backend/hardware/import.blade.php +++ b/app/views/backend/hardware/import.blade.php @@ -41,7 +41,6 @@
@@ -80,7 +79,7 @@ }, done: function (e, data) { - //console.dir(data); + console.dir(data); // We use this instead of the fail option, since our API // returns a 200 OK status which always shows as "success" @@ -97,7 +96,8 @@ $('.progress-bar-text').html('Finished!'); $('.progress-checkmark').fadeIn('fast').html(''); $.each(data.result.files, function (index, file) { - $('
  • ').text(file.name).appendTo(document.body); + $('' + file.name + 'Just now' + file.filesize + ' Process').prependTo("#upload-table > tbody"); + //$('').text(file.name).appendTo(document.body); }); } $('#progress').removeClass('active'); @@ -112,7 +112,7 @@ - +
    File Created