Remove options to set and display the 'primary' backup target
This commit is contained in:
+12
-53
@@ -17,7 +17,6 @@ const systemModel = SystemModel.create();
|
||||
const dialog = useTemplateRef('dialog');
|
||||
const form = useTemplateRef('form');
|
||||
const step = ref('storage');
|
||||
const target = ref({});
|
||||
const newTargetId = ref('');
|
||||
const name = ref('');
|
||||
const useEncryption = ref(false);
|
||||
@@ -38,7 +37,7 @@ const format = ref('');
|
||||
const minMemoryLimit = ref(1024 * 1024 * 1024); // 1 GB
|
||||
const maxMemoryLimit = ref(minMemoryLimit.value); // set later
|
||||
|
||||
async function onSubmitAdd() {
|
||||
async function onSubmit() {
|
||||
if (!form.value.reportValidity()) return;
|
||||
|
||||
// TODO define good default
|
||||
@@ -199,44 +198,6 @@ watch(encryptionPassword, () => {
|
||||
formError.value.password = null;
|
||||
});
|
||||
|
||||
async function onSubmitEdit() {
|
||||
// TODO set config (eg. provider config passwords)
|
||||
|
||||
// name
|
||||
let [error] = await backupTargetsModel.setName(target.value.id, name.value);
|
||||
if (error) {
|
||||
formError.value.generic = 'Failed to set name';
|
||||
busy.value = false;
|
||||
return console.error(error);
|
||||
}
|
||||
|
||||
// limits
|
||||
const limitsConfig = {
|
||||
memoryLimit: parseInt(limits.value.memoryLimit),
|
||||
syncConcurrency: parseInt(limits.value.syncConcurrency),
|
||||
copyConcurrency: parseInt(limits.value.copyConcurrency),
|
||||
downloadConcurrency: parseInt(limits.value.downloadConcurrency),
|
||||
uploadPartSize: parseInt(limits.value.uploadPartSize),
|
||||
// deleteConcurrency: parseInt(providerConfig.value.limits.deleteConcurrency),
|
||||
};
|
||||
|
||||
[error] = await backupTargetsModel.setLimits(target.value.id, limitsConfig);
|
||||
if (error) {
|
||||
formError.value.generic = 'Failed to set limits';
|
||||
busy.value = false;
|
||||
return console.error(error);
|
||||
}
|
||||
|
||||
emit('success');
|
||||
dialog.value.close();
|
||||
}
|
||||
|
||||
async function onSubmit() {
|
||||
if (target.value) return await onSubmitEdit();
|
||||
|
||||
await onSubmitAdd();
|
||||
}
|
||||
|
||||
async function getMemory() {
|
||||
// TODO what is this exactly?
|
||||
// if (props.provisioning) {
|
||||
@@ -251,23 +212,21 @@ async function getMemory() {
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
async open(t = null) {
|
||||
async open() {
|
||||
step.value = 'storage';
|
||||
|
||||
target.value = t;
|
||||
|
||||
formError.value = {};
|
||||
busy.value = false;
|
||||
name.value = t?.name || '';
|
||||
provider.value = t?.provider || '';
|
||||
format.value = t?.format || '';
|
||||
providerConfig.value = t?.config || {};
|
||||
useEncryption.value = t?.encrypted || false;
|
||||
name.value = '';
|
||||
provider.value = '';
|
||||
format.value = '';
|
||||
providerConfig.value = {};
|
||||
useEncryption.value = false;
|
||||
encryptionPassword.value = '';
|
||||
encryptionPasswordRepeat.value = '';
|
||||
encryptionPasswordHint.value = t?.encryptionPasswordHint || '';
|
||||
encryptedFilenames.value = t?.encryptedFilenames || false;
|
||||
limits.value = t?.limits || {};
|
||||
encryptionPasswordHint.value = '';
|
||||
encryptedFilenames.value = false;
|
||||
limits.value = {};
|
||||
|
||||
// ensure we have all required child objects
|
||||
if (!providerConfig.value.mountOptions) providerConfig.value.mountOptions = {};
|
||||
@@ -280,8 +239,8 @@ defineExpose({
|
||||
if (!limits.value.copyConcurrency) limits.value.copyConcurrency = 10;
|
||||
|
||||
// needs translation for UI
|
||||
providerConfig.value.useHardlinks = !(t?.noHardlinks || true);
|
||||
providerConfig.value.encryptionPassword = t?.password || null;
|
||||
providerConfig.value.useHardlinks = false;
|
||||
providerConfig.value.encryptionPassword = null;
|
||||
|
||||
await getMemory();
|
||||
|
||||
Reference in New Issue
Block a user