Add relations export and remote full backup/restore.

Expose GET/POST /api/v1/export/ for server dumps and add import UI for relations (CSV/JSON) plus remote backup controls.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
gitrusprus
2026-07-06 17:05:13 +03:00
co-authored by Cursor
parent f5937040fa
commit f6eff89642
9 changed files with 865 additions and 9 deletions
@@ -5,7 +5,7 @@
<select :id="inputId" :value="modelValue" class="form-control" @change="onChange">
<option value="csv">CSV (.csv)</option>
<option value="json">JSON (.json)</option>
<option value="vcf">vCard (.vcf)</option>
<option v-if="variant === 'contacts'" value="vcf">vCard (.vcf)</option>
</select>
</div>
<button
@@ -20,26 +20,29 @@
<div v-if="result" class="alert" :class="result.error ? 'alert-error' : 'alert-success'" style="margin-top:12px;">
<span v-if="result.error">{{ result.error }}</span>
<span v-else>
Экспортировано контактов: <strong>{{ result.count }}</strong>
Экспортировано {{ entityLabel }}: <strong>{{ result.count }}</strong>
({{ result.formatLabel }}).
</span>
</div>
</template>
<script setup>
import { useId } from 'vue'
import { computed, useId } from 'vue'
defineProps({
const props = defineProps({
modelValue: { type: String, default: 'csv' },
exporting: { type: Boolean, default: false },
disabled: { type: Boolean, default: false },
result: { type: Object, default: null },
buttonLabel: { type: String, default: 'Экспортировать' },
variant: { type: String, default: 'contacts' },
})
const emit = defineEmits(['update:modelValue', 'export'])
const inputId = useId()
const entityLabel = computed(() => (props.variant === 'relations' ? 'связей' : 'контактов'))
function onChange(event) {
emit('update:modelValue', event.target.value)
}