Skip to content

Commit db2d554

Browse files
wip
1 parent a3a0d3f commit db2d554

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

client/src/components/Backup.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<script setup>
22
import { Listing, DropdownItem, Header, Button } from "@statamic/cms/ui";
3+
import { Head } from "@statamic/cms/inertia";
34
import { requireElevatedSession } from "@statamic/cms";
45
import { useBackupStore } from "../store";
56
import { ref, watch } from "vue";
@@ -13,7 +14,7 @@ const dropZone = ref(null);
1314
const browseTarget = ref(null);
1415
1516
const { files } = useResumable({
16-
chunkSize: 2 * 1024 * 1024,
17+
chunkSize: Statamic.$config.get('statamic_backup.chunk_size', 2 * 1024 * 1024),
1718
dropZone,
1819
browseTarget,
1920
onFileUploaded: (file) => {
@@ -82,6 +83,7 @@ const deleteBackup = withErrHandling(async (id) => {
8283
</script>
8384

8485
<template>
86+
<Head title="Backups" />
8587
<Header :icon="database" :title="__('statamic-backup::backup.title')">
8688
<Button variant="subtle" ref="browseTarget">{{
8789
__("statamic-backup::backup.upload.label")

src/ServiceProvider.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
use Illuminate\Console\Scheduling\Schedule;
88
use Illuminate\Support\Facades\Config;
9+
use Illuminate\Support\Facades\View;
910
use Itiden\Backup\Console\Commands\BackupCommand;
1011
use Itiden\Backup\Console\Commands\ClearFilesCommand;
1112
use Itiden\Backup\Console\Commands\RestoreCommand;
@@ -17,6 +18,7 @@
1718
use Statamic\Facades\CP\Nav;
1819
use Statamic\Facades\Permission;
1920
use Statamic\Providers\AddonServiceProvider;
21+
use Statamic\Statamic;
2022

2123
final class ServiceProvider extends AddonServiceProvider
2224
{
@@ -48,6 +50,7 @@ public function bootAddon(): void
4850
$this->configurePermissions();
4951
$this->configureNavigation();
5052
$this->configureCommands();
53+
$this->configureViewVariables();
5154
}
5255

5356
public function schedule(Schedule $schedule): void
@@ -78,6 +81,15 @@ private function configureCommands(): void
7881
]);
7982
}
8083

84+
private function configureViewVariables(): void
85+
{
86+
View::composer('statamic::layout', function ($view) {
87+
Statamic::provideToScript(['statamic_backup' => [
88+
'chunk_size' => config('backup.chunk_size'),
89+
]]);
90+
});
91+
}
92+
8193
private function configureNavigation(): void
8294
{
8395
Nav::extend(static function (Navigation $nav): void {

0 commit comments

Comments
 (0)