Feat: add VPS export functionality and import JSON feature in UI
All checks were successful
Build and Push Docker Images / docker (push) Successful in 28s

This commit is contained in:
jeanotx32
2026-06-02 19:23:54 -04:00
parent f2e5a24b37
commit 2a46fcd13a
7 changed files with 187 additions and 56 deletions

View File

@@ -1,5 +1,5 @@
import { useState, useEffect, useCallback } from 'react'
import { fetchAllStatus, containerAction, addVps, deleteVps, fetchLogs, authStatus, getToken, setToken, composeUpdate, updateVps, updateAgent } from './api/client'
import { fetchAllStatus, containerAction, addVps, deleteVps, fetchLogs, authStatus, getToken, setToken, composeUpdate, updateVps, updateAgent, exportVps } from './api/client'
import Header from './components/Header'
import VpsCard from './components/VpsCard'
import LogsModal from './components/LogsModal'
@@ -198,6 +198,11 @@ export default function App() {
await refresh(true)
}
const handleExportVps = async (vpsId) => {
const config = await exportVps(vpsId)
await navigator.clipboard.writeText(JSON.stringify(config, null, 2))
}
// Attente vérification auth
if (!authChecked) return null
@@ -305,6 +310,7 @@ export default function App() {
onEdit={setEditVps}
onStats={(vpsId, vpsName) => setStatsModal({ vpsId, vpsName })}
onUpdateAgent={handleUpdateAgent}
onExport={handleExportVps}
/>
))}
</div>