Support changing hardlinks if applicable
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
import { ref, useTemplateRef } from 'vue';
|
||||
import { MaskedInput, Dialog, FormGroup, TextInput, Checkbox } from '@cloudron/pankow';
|
||||
import { prettyBinarySize } from '@cloudron/pankow/utils';
|
||||
import { s3like, regionName } from '../utils.js';
|
||||
import { s3like, mountlike, regionName } from '../utils.js';
|
||||
import BackupSitesModel from '../models/BackupSitesModel.js';
|
||||
import SystemModel from '../models/SystemModel.js';
|
||||
|
||||
@@ -34,6 +34,7 @@ const mountOptionsUsername = ref('');
|
||||
const mountOptionsPassword = ref('');
|
||||
const mountOptionsUser = ref('');
|
||||
const mountOptionsPrivateKey = ref('');
|
||||
const useHardlinks = ref(false);
|
||||
|
||||
async function onSubmit() {
|
||||
busy.value = true;
|
||||
@@ -65,6 +66,10 @@ async function onSubmit() {
|
||||
if (mountOptionsPrivateKey.value) data.mountOptions.privateKey = mountOptionsPrivateKey.value;
|
||||
}
|
||||
|
||||
if ((provider.value === 'filesystem' || mountlike(provider.value)) && site.value.format === 'rsync') {
|
||||
data.noHardlinks = !!useHardlinks.value;
|
||||
}
|
||||
|
||||
// only call if anything has changed
|
||||
if (Object.keys(data).length) {
|
||||
const [error] = await backupSitesModel.setConfig(site.value.id, data);
|
||||
@@ -136,6 +141,10 @@ defineExpose({
|
||||
mountOptionsPrivateKey.value = null;
|
||||
}
|
||||
|
||||
if ((provider.value === 'filesystem' || mountlike(provider.value)) && site.value.format === 'rsync') {
|
||||
useHardlinks.value = !!t.config.noHardlinks;
|
||||
}
|
||||
|
||||
await getMemory();
|
||||
|
||||
dialog.value.open();
|
||||
@@ -202,6 +211,8 @@ defineExpose({
|
||||
<MaskedInput id="mountOptionsPasswordInput" v-model="mountOptionsPassword" required />
|
||||
</FormGroup>
|
||||
|
||||
<Checkbox v-if="(provider === 'filesystem' || mountlike(provider)) && site.format === 'rsync'" v-model="useHardlinks" :label="$t('backups.configureBackupStorage.hardlinksLabel')"/>
|
||||
|
||||
<FormGroup v-if="s3like(provider)">
|
||||
<label for="accessKeyIdInput">{{ $t('backups.configureBackupStorage.s3AccessKeyId') }}</label>
|
||||
<TextInput id="accessKeyIdInput" v-model="accessKeyId" required />
|
||||
|
||||
Reference in New Issue
Block a user