Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to support laravel-backup ^6.0 #13

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
}
],
"require": {
"php": ">=7.0.0",
"laravel/framework": "~5.5",
"encore/laravel-admin": "~1.5",
"spatie/laravel-backup": "^5.0"
"php": ">=7.1.3",
"laravel/framework": "~5.7",
"encore/laravel-admin": "~1.6",
"spatie/laravel-backup": "^6.0"
},
"require-dev": {
"phpunit/phpunit": "~6.0",
Expand Down
142 changes: 71 additions & 71 deletions resources/views/index.blade.php
Original file line number Diff line number Diff line change
@@ -1,62 +1,62 @@
<script data-exec-on-popstate>
$(function () {

$(".backup-run").click(function() {
var $btn = $(this);
$btn.button('loading');

NProgress.start();
$.ajax({
url: $btn.attr('href'),
data : {
_token: LA.token
},
method: 'POST',
success: function (data){

if (data.status) {
$('.output-box').removeClass('hide');
$('.output-box .output-body').html(data.message)
$(function () {

$(".backup-run").click(function() {
var $btn = $(this);
$btn.button('loading');

NProgress.start();
$.ajax({
url: $btn.attr('href'),
data : {
_token: LA.token
},
method: 'POST',
success: function (data){

if (data.status) {
$('.output-box').removeClass('hide');
$('.output-box .output-body').html(data.message)
}

$btn.button('reset');
NProgress.done();
}
});

$btn.button('reset');
NProgress.done();
}
return false;
});

return false;
});
$(".backup-delete").click(function() {

$(".backup-delete").click(function() {
var $btn = $(this);

var $btn = $(this);
$.ajax({
url: $btn.attr('href'),
data : {
_token: LA.token
},
method: 'DELETE',
success: function (data){

$.ajax({
url: $btn.attr('href'),
data : {
_token: LA.token
},
method: 'DELETE',
success: function (data){
$.pjax.reload('#pjax-container');

$.pjax.reload('#pjax-container');

if (typeof data === 'object') {
if (data.status) {
toastr.success(data.message);
} else {
toastr.error(data.message);
if (typeof data === 'object') {
if (data.status) {
toastr.success(data.message);
} else {
toastr.error(data.message);
}
}

$btn.button('reset');
}
});

$btn.button('reset');
}
return false;
});

return false;
});

});
</script>

<style>
Expand Down Expand Up @@ -100,33 +100,33 @@
<th>Used storage</th>
</tr>
@foreach($backups as $index => $backup)
<tr data-toggle="collapse" data-target="#trace-{{$index+1}}" style="cursor: pointer;">
<td>{{ $index+1 }}.</td>
<td>{{ $backup[0] }}</td>
<td>{{ $backup[1] }}</td>
<td>{{ $backup[2] }}</td>
<td>{{ $backup[3] }}</td>
<td>{{ $backup['amount'] }}</td>
<td>{{ $backup['newest'] }}</td>
<td>{{ $backup['usedStorage'] }}</td>
</tr>
<tr class="collapse" id="trace-{{$index+1}}">
<td colspan="8">
<ul class="todo-list ui-sortable">
@foreach($backup['files'] as $file)
<li>
<span class="text">{{ $file }}</span>
<!-- Emphasis label -->

<div class="tools">
<a target="_blank" href="{{ route('backup-download', ['disk' => $backup[1], 'file' => $backup[0].'/'.$file]) }}"><i class="fa fa-download"></i></a>
<a href="{{ route('backup-delete', ['disk' => $backup[1], 'file' => $backup[0].'/'.$file]) }}" class="backup-delete"><i class="fa fa-trash-o"></i></a>
</div>
</li>
@endforeach
</ul>
</td>
</tr>
<tr data-toggle="collapse" data-target="#trace-{{$index+1}}" style="cursor: pointer;">
<td>{{ $index+1 }}.</td>
<td>{{ $backup[0] }}</td>
<td>{{ $backup['disk'] }}</td>
<td>{{ $backup[1] }}</td>
<td>{{ $backup[2] }}</td>
<td>{{ $backup['amount'] }}</td>
<td>{{ $backup['newest'] }}</td>
<td>{{ $backup['usedStorage'] }}</td>
</tr>
<tr class="collapse" id="trace-{{$index+1}}">
<td colspan="8">
<ul class="todo-list ui-sortable">
@foreach($backup['files'] as $file)
<li>
<span class="text">{{ $file }}</span>
<!-- Emphasis label -->

<div class="tools">
<a target="_blank" href="{{ route('backup-download', ['disk' => $backup['disk'], 'file' => $backup[0].'/'.$file]) }}"><i class="fa fa-download"></i></a>
<a href="{{ route('backup-delete', ['disk' => $backup['disk'], 'file' => $backup[0].'/'.$file]) }}" class="backup-delete"><i class="fa fa-trash-o"></i></a>
</div>
</li>
@endforeach
</ul>
</td>
</tr>
@endforeach

</tbody>
Expand Down
2 changes: 1 addition & 1 deletion src/Backup.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class Backup extends Extension
{
public function getExists()
{
$statuses = BackupDestinationStatusFactory::createForMonitorConfig(config('backup.monitorBackups'));
$statuses = BackupDestinationStatusFactory::createForMonitorConfig(config('backup.monitor_backups'));

$listCommand = new ListCommand();

Expand Down