feat(vikon): merge core update + FM sync into single Update button

This commit is contained in:
F4ilji
2026-07-04 21:25:29 +05:00
parent 20382da0bc
commit 87732720ef
2 changed files with 192 additions and 106 deletions
@@ -79,10 +79,6 @@
class="px-4 py-2 bg-primary text-white rounded-lg hover:bg-primary-hover disabled:opacity-50">
{{ updating ? 'Обновление...' : 'Обновить' }}
</button>
<button @click="syncModuleFiles(id)" :disabled="syncing || !accessInfo.has_access"
class="px-4 py-2 bg-surface border border-layer-line rounded-lg hover:bg-muted-hover disabled:opacity-50">
{{ syncing ? 'Синхронизация...' : 'Синхронизировать файлы' }}
</button>
</div>
</div>
</div>
@@ -139,7 +135,6 @@ const currentVersion = ref(props.current_version);
const checkingVersion = ref(false);
const checkingAccess = ref(false);
const updating = ref(false);
const syncing = ref(false);
const progress = ref(0);
const updateError = ref(null);
const versionInfo = ref({ current_version: props.current_version, has_update: false, latest_version: null });
@@ -247,24 +242,4 @@ async function logout() {
console.error('Logout failed:', e);
}
}
async function syncModuleFiles(moduleId) {
if (!confirm('Синхронизировать файлы модуля?')) return;
syncing.value = true;
updateError.value = null;
try {
const res = await axios.post(route('dashboard.vikon-updates.sync-files'), { module_id: moduleId });
syncing.value = false;
if (res.data.success) {
alert(res.data.message);
} else {
updateError.value = res.data.message;
}
} catch (e) {
syncing.value = false;
updateError.value = e.response?.data?.message || 'Ошибка синхронизации';
}
}
</script>