Skip to content

Commit

Permalink
Delete logs
Browse files Browse the repository at this point in the history
  • Loading branch information
rap2hpoutre committed Jul 19, 2015
1 parent a226072 commit 7eccaae
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/controllers/LogViewerController.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ public function index()

if (\Input::get('dl')) {
return \Response::download(storage_path() . '/logs/' . base64_decode(\Input::get('dl')));
} elseif (\Input::has('del')) {
\File::delete(storage_path() . '/logs/' . base64_decode(\Input::get('del')));
return \Redirect::to(\Request::url());
}

$logs = LaravelLogViewer::all();
Expand Down
5 changes: 5 additions & 0 deletions src/views/log.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@
@endif
<div>
<a href="?dl={{ base64_encode($current_file) }}"><span class="glyphicon glyphicon-download-alt"></span> Download file</a>
-
<a id="delete-log" href="?del={{ base64_encode($current_file) }}"><span class="glyphicon glyphicon-trash"></span> Delete file</a>
</div>
</div>
</div>
Expand All @@ -119,6 +121,9 @@
$('.table-container').on('click', '.expand', function(){
$('#' + $(this).data('display')).toggle();
});
$('#delete-log').click(function(){
return confirm('Are you sure?');
});
});
</script>
</body>
Expand Down

0 comments on commit 7eccaae

Please sign in to comment.