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
All checks were successful
Build and Push Docker Images / docker (push) Successful in 28s
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user