forked from mirrors/amnezia-wg-easy
feat: support more langs
* add translations for French, Spanish, and Italian * change the wording for better understanding of this feature: - "import" to "restore" - "export" to "backup" * rename functions to reflect these changes
This commit is contained in:
parent
e3ee09b755
commit
ce20bb7fcb
6 changed files with 58 additions and 44 deletions
|
@ -270,15 +270,15 @@ module.exports = class Server {
|
|||
app.use(router3);
|
||||
|
||||
router3
|
||||
.get('/api/wireguard/dl', defineEventHandler(async (event) => {
|
||||
const config = await WireGuard.downloadConfiguration();
|
||||
.get('/api/wireguard/backup', defineEventHandler(async (event) => {
|
||||
const config = await WireGuard.backupConfiguration();
|
||||
setHeader(event, 'Content-Disposition', 'attachment; filename="wg0.json"');
|
||||
setHeader(event, 'Content-Type', 'text/json');
|
||||
return config;
|
||||
}))
|
||||
.put('/api/wireguard/upload', defineEventHandler(async (event) => {
|
||||
.put('/api/wireguard/restore', defineEventHandler(async (event) => {
|
||||
const { file } = await readBody(event);
|
||||
await WireGuard.uploadConfiguration(file);
|
||||
await WireGuard.restoreConfiguration(file);
|
||||
return { success: true };
|
||||
}));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue