Merge branch 'imexport' into imexport
This commit is contained in:
commit
1a54a0b016
Binary file not shown.
Before Width: | Height: | Size: 105 KiB After Width: | Height: | Size: 86 KiB |
|
@ -265,6 +265,23 @@ module.exports = class Server {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// import_export
|
||||||
|
const router3 = createRouter();
|
||||||
|
app.use(router3);
|
||||||
|
|
||||||
|
router3
|
||||||
|
.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/restore', defineEventHandler(async (event) => {
|
||||||
|
const { file } = await readBody(event);
|
||||||
|
await WireGuard.restoreConfiguration(file);
|
||||||
|
return { success: true };
|
||||||
|
}));
|
||||||
|
|
||||||
// Static assets
|
// Static assets
|
||||||
const publicDir = '/app/www';
|
const publicDir = '/app/www';
|
||||||
app.use(
|
app.use(
|
||||||
|
|
|
@ -319,6 +319,22 @@ Endpoint = ${WG_HOST}:${WG_CONFIG_PORT}`;
|
||||||
await this.saveConfig();
|
await this.saveConfig();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async ___forceRestart() {
|
||||||
|
this.__configPromise = null;
|
||||||
|
await this.saveConfig();
|
||||||
|
}
|
||||||
|
|
||||||
|
async restoreConfiguration(config) {
|
||||||
|
const _config = JSON.parse(config);
|
||||||
|
await this.__saveConfig(_config);
|
||||||
|
await this.___forceRestart();
|
||||||
|
}
|
||||||
|
|
||||||
|
async backupConfiguration() {
|
||||||
|
const config = await this.getConfig();
|
||||||
|
return JSON.stringify(config, null, 2);
|
||||||
|
}
|
||||||
|
|
||||||
// Shutdown wireguard
|
// Shutdown wireguard
|
||||||
async Shutdown() {
|
async Shutdown() {
|
||||||
await Util.exec('wg-quick down wg0').catch(() => { });
|
await Util.exec('wg-quick down wg0').catch(() => { });
|
||||||
|
|
|
@ -668,6 +668,10 @@ video {
|
||||||
top: 1rem;
|
top: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.-z-\[1\] {
|
||||||
|
z-index: -1;
|
||||||
|
}
|
||||||
|
|
||||||
.z-0 {
|
.z-0 {
|
||||||
z-index: 0;
|
z-index: 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,19 +23,21 @@
|
||||||
<div v-if="authenticated === true">
|
<div v-if="authenticated === true">
|
||||||
<div class="flex flex-col-reverse xxs:flex-row flex-auto items-center items-end gap-3">
|
<div class="flex flex-col-reverse xxs:flex-row flex-auto items-center items-end gap-3">
|
||||||
<h1 class="text-4xl dark:text-neutral-200 font-medium flex-grow self-start mb-4">
|
<h1 class="text-4xl dark:text-neutral-200 font-medium flex-grow self-start mb-4">
|
||||||
<img src="./img/logo.png" width="32" class="inline align-middle dark:bg mr-2" /><span class="align-middle">WireGuard</span>
|
<img src="./img/logo.png" width="32" class="inline align-middle dark:bg mr-2" /><span
|
||||||
|
class="align-middle">WireGuard</span>
|
||||||
</h1>
|
</h1>
|
||||||
<div class="flex items-center grow-0 gap-3 items-end self-end xxs:self-center">
|
<div class="flex items-center grow-0 gap-3 items-end self-end xxs:self-center">
|
||||||
<!-- Dark / light theme -->
|
<!-- Dark / light theme -->
|
||||||
<button @click="toggleTheme"
|
<button @click="toggleTheme"
|
||||||
class="flex items-center justify-center w-8 h-8 rounded-full bg-gray-200 hover:bg-gray-300 dark:bg-neutral-700 dark:hover:bg-neutral-600 transition" :title="$t(`theme.${uiTheme}`)">
|
class="flex items-center justify-center w-8 h-8 rounded-full bg-gray-200 hover:bg-gray-300 dark:bg-neutral-700 dark:hover:bg-neutral-600 transition"
|
||||||
<svg v-if="uiTheme === 'light'" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"
|
:title="$t(`theme.${uiTheme}`)">
|
||||||
class="w-5 h-5">
|
<svg v-if="uiTheme === 'light'" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
|
||||||
|
stroke-width="1.5" stroke="currentColor" class="w-5 h-5">
|
||||||
<path stroke-linecap="round" stroke-linejoin="round"
|
<path stroke-linecap="round" stroke-linejoin="round"
|
||||||
d="M12 3v2.25m6.364.386-1.591 1.591M21 12h-2.25m-.386 6.364-1.591-1.591M12 18.75V21m-4.773-4.227-1.591 1.591M5.25 12H3m4.227-4.773L5.636 5.636M15.75 12a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0Z" />
|
d="M12 3v2.25m6.364.386-1.591 1.591M21 12h-2.25m-.386 6.364-1.591-1.591M12 18.75V21m-4.773-4.227-1.591 1.591M5.25 12H3m4.227-4.773L5.636 5.636M15.75 12a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0Z" />
|
||||||
</svg>
|
</svg>
|
||||||
<svg v-else-if="uiTheme === 'dark'" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"
|
<svg v-else-if="uiTheme === 'dark'" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
|
||||||
class="w-5 h-5 text-neutral-400">
|
stroke-width="1.5" stroke="currentColor" class="w-5 h-5 text-neutral-400">
|
||||||
<path stroke-linecap="round" stroke-linejoin="round"
|
<path stroke-linecap="round" stroke-linejoin="round"
|
||||||
d="M21.752 15.002A9.72 9.72 0 0 1 18 15.75c-5.385 0-9.75-4.365-9.75-9.75 0-1.33.266-2.597.748-3.752A9.753 9.753 0 0 0 3 11.25C3 16.635 7.365 21 12.75 21a9.753 9.753 0 0 0 9.002-5.998Z" />
|
d="M21.752 15.002A9.72 9.72 0 0 1 18 15.75c-5.385 0-9.75-4.365-9.75-9.75 0-1.33.266-2.597.748-3.752A9.753 9.753 0 0 0 3 11.25C3 16.635 7.365 21 12.75 21a9.753 9.753 0 0 0 9.002-5.998Z" />
|
||||||
</svg>
|
</svg>
|
||||||
|
@ -49,19 +51,22 @@
|
||||||
</svg>
|
</svg>
|
||||||
</button>
|
</button>
|
||||||
<!-- Show / hide charts -->
|
<!-- Show / hide charts -->
|
||||||
<label v-if="uiChartType > 0" class="inline-flex items-center justify-center cursor-pointer w-8 h-8 rounded-full bg-gray-200 hover:bg-gray-300 dark:bg-neutral-700 dark:hover:bg-neutral-600 whitespace-nowrap transition group" :title="$t('toggleCharts')">
|
<label v-if="uiChartType > 0"
|
||||||
|
class="inline-flex items-center justify-center cursor-pointer w-8 h-8 rounded-full bg-gray-200 hover:bg-gray-300 dark:bg-neutral-700 dark:hover:bg-neutral-600 whitespace-nowrap transition group"
|
||||||
|
:title="$t('toggleCharts')">
|
||||||
<input type="checkbox" value="" class="sr-only peer" v-model="uiShowCharts" @change="toggleCharts">
|
<input type="checkbox" value="" class="sr-only peer" v-model="uiShowCharts" @change="toggleCharts">
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" fill="currentColor"
|
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"
|
||||||
|
fill="currentColor"
|
||||||
class="w-5 h-5 peer fill-gray-400 peer-checked:fill-gray-600 dark:fill-neutral-600 peer-checked:dark:fill-neutral-400 group-hover:dark:fill-neutral-500 transition">
|
class="w-5 h-5 peer fill-gray-400 peer-checked:fill-gray-600 dark:fill-neutral-600 peer-checked:dark:fill-neutral-400 group-hover:dark:fill-neutral-500 transition">
|
||||||
<path
|
<path
|
||||||
d="M18.375 2.25c-1.035 0-1.875.84-1.875 1.875v15.75c0 1.035.84 1.875 1.875 1.875h.75c1.035 0 1.875-.84 1.875-1.875V4.125c0-1.036-.84-1.875-1.875-1.875h-.75ZM9.75 8.625c0-1.036.84-1.875 1.875-1.875h.75c1.036 0 1.875.84 1.875 1.875v11.25c0 1.035-.84 1.875-1.875 1.875h-.75a1.875 1.875 0 0 1-1.875-1.875V8.625ZM3 13.125c0-1.036.84-1.875 1.875-1.875h.75c1.036 0 1.875.84 1.875 1.875v6.75c0 1.035-.84 1.875-1.875 1.875h-.75A1.875 1.875 0 0 1 3 19.875v-6.75Z" />
|
d="M18.375 2.25c-1.035 0-1.875.84-1.875 1.875v15.75c0 1.035.84 1.875 1.875 1.875h.75c1.035 0 1.875-.84 1.875-1.875V4.125c0-1.036-.84-1.875-1.875-1.875h-.75ZM9.75 8.625c0-1.036.84-1.875 1.875-1.875h.75c1.036 0 1.875.84 1.875 1.875v11.25c0 1.035-.84 1.875-1.875 1.875h-.75a1.875 1.875 0 0 1-1.875-1.875V8.625ZM3 13.125c0-1.036.84-1.875 1.875-1.875h.75c1.036 0 1.875.84 1.875 1.875v6.75c0 1.035-.84 1.875-1.875 1.875h-.75A1.875 1.875 0 0 1 3 19.875v-6.75Z" />
|
||||||
</svg>
|
</svg>
|
||||||
</label>
|
</label>
|
||||||
<span v-if="requiresPassword"
|
<span v-if="requiresPassword"
|
||||||
class="text-sm text-gray-400 dark:text-neutral-400 cursor-pointer hover:underline"
|
class="text-sm text-gray-400 dark:text-neutral-400 cursor-pointer hover:underline" @click="logout">
|
||||||
@click="logout">
|
|
||||||
{{$t("logout")}}
|
{{$t("logout")}}
|
||||||
<svg class="h-3 inline" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
<svg class="h-3 inline" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
|
||||||
|
stroke="currentColor">
|
||||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
||||||
d="M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1" />
|
d="M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1" />
|
||||||
</svg>
|
</svg>
|
||||||
|
@ -220,9 +225,11 @@
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
<!-- Inline Transfer TX -->
|
<!-- Inline Transfer TX -->
|
||||||
<span v-if="!uiTrafficStats && client.transferTx" class="whitespace-nowrap" :title="$t('totalDownload') + bytes(client.transferTx)">
|
<span v-if="!uiTrafficStats && client.transferTx" class="whitespace-nowrap"
|
||||||
|
:title="$t('totalDownload') + bytes(client.transferTx)">
|
||||||
·
|
·
|
||||||
<svg class="align-middle h-3 inline" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor">
|
<svg class="align-middle h-3 inline" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"
|
||||||
|
fill="currentColor">
|
||||||
<path fill-rule="evenodd"
|
<path fill-rule="evenodd"
|
||||||
d="M16.707 10.293a1 1 0 010 1.414l-6 6a1 1 0 01-1.414 0l-6-6a1 1 0 111.414-1.414L9 14.586V3a1 1 0 012 0v11.586l4.293-4.293a1 1 0 011.414 0z"
|
d="M16.707 10.293a1 1 0 010 1.414l-6 6a1 1 0 01-1.414 0l-6-6a1 1 0 111.414-1.414L9 14.586V3a1 1 0 012 0v11.586l4.293-4.293a1 1 0 011.414 0z"
|
||||||
clip-rule="evenodd" />
|
clip-rule="evenodd" />
|
||||||
|
@ -231,9 +238,11 @@
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<!-- Inline Transfer RX -->
|
<!-- Inline Transfer RX -->
|
||||||
<span v-if="!uiTrafficStats && client.transferRx" class="whitespace-nowrap" :title="$t('totalUpload') + bytes(client.transferRx)">
|
<span v-if="!uiTrafficStats && client.transferRx" class="whitespace-nowrap"
|
||||||
|
:title="$t('totalUpload') + bytes(client.transferRx)">
|
||||||
·
|
·
|
||||||
<svg class="align-middle h-3 inline" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor">
|
<svg class="align-middle h-3 inline" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"
|
||||||
|
fill="currentColor">
|
||||||
<path fill-rule="evenodd"
|
<path fill-rule="evenodd"
|
||||||
d="M3.293 9.707a1 1 0 010-1.414l6-6a1 1 0 011.414 0l6 6a1 1 0 01-1.414 1.414L11 5.414V17a1 1 0 11-2 0V5.414L4.707 9.707a1 1 0 01-1.414 0z"
|
d="M3.293 9.707a1 1 0 010-1.414l6-6a1 1 0 011.414 0l6 6a1 1 0 01-1.414 1.414L11 5.414V17a1 1 0 11-2 0V5.414L4.707 9.707a1 1 0 01-1.414 0z"
|
||||||
clip-rule="evenodd" />
|
clip-rule="evenodd" />
|
||||||
|
@ -241,7 +250,8 @@
|
||||||
{{client.transferRxCurrent | bytes}}/s
|
{{client.transferRxCurrent | bytes}}/s
|
||||||
</span>
|
</span>
|
||||||
<!-- Last seen -->
|
<!-- Last seen -->
|
||||||
<span class="text-gray-400 dark:text-neutral-500 whitespace-nowrap" v-if="client.latestHandshakeAt"
|
<span class="text-gray-400 dark:text-neutral-500 whitespace-nowrap"
|
||||||
|
v-if="client.latestHandshakeAt"
|
||||||
:title="$t('lastSeen') + dateTime(new Date(client.latestHandshakeAt))">
|
:title="$t('lastSeen') + dateTime(new Date(client.latestHandshakeAt))">
|
||||||
{{!uiTrafficStats ? " · " : ""}}{{new Date(client.latestHandshakeAt) | timeago}}
|
{{!uiTrafficStats ? " · " : ""}}{{new Date(client.latestHandshakeAt) | timeago}}
|
||||||
</span>
|
</span>
|
||||||
|
@ -317,8 +327,7 @@
|
||||||
:class="{
|
:class="{
|
||||||
'hover:bg-red-800 dark:hover:bg-red-800 hover:text-white dark:hover:text-white': client.downloadableConfig,
|
'hover:bg-red-800 dark:hover:bg-red-800 hover:text-white dark:hover:text-white': client.downloadableConfig,
|
||||||
'is-disabled': !client.downloadableConfig
|
'is-disabled': !client.downloadableConfig
|
||||||
}"
|
}" :title="!client.downloadableConfig ? $t('noPrivKey') : $t('showQR')"
|
||||||
:title="!client.downloadableConfig ? $t('noPrivKey') : $t('showQR')"
|
|
||||||
@click="qrcode = `./api/wireguard/client/${client.id}/qrcode.svg`">
|
@click="qrcode = `./api/wireguard/client/${client.id}/qrcode.svg`">
|
||||||
<svg class="w-5" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
|
<svg class="w-5" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
|
||||||
stroke="currentColor">
|
stroke="currentColor">
|
||||||
|
@ -335,8 +344,7 @@
|
||||||
:class="{
|
:class="{
|
||||||
'hover:bg-red-800 dark:hover:bg-red-800 hover:text-white dark:hover:text-white': client.downloadableConfig,
|
'hover:bg-red-800 dark:hover:bg-red-800 hover:text-white dark:hover:text-white': client.downloadableConfig,
|
||||||
'is-disabled': !client.downloadableConfig
|
'is-disabled': !client.downloadableConfig
|
||||||
}"
|
}" :title="!client.downloadableConfig ? $t('noPrivKey') : $t('downloadConfig')"
|
||||||
:title="!client.downloadableConfig ? $t('noPrivKey') : $t('downloadConfig')"
|
|
||||||
@click="if(!client.downloadableConfig) { $event.preventDefault(); }">
|
@click="if(!client.downloadableConfig) { $event.preventDefault(); }">
|
||||||
<svg class="w-5" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
|
<svg class="w-5" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
|
||||||
stroke="currentColor">
|
stroke="currentColor">
|
||||||
|
@ -440,8 +448,8 @@
|
||||||
<div class="sm:flex sm:items-start">
|
<div class="sm:flex sm:items-start">
|
||||||
<div
|
<div
|
||||||
class="mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-red-800 sm:mx-0 sm:h-10 sm:w-10">
|
class="mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-red-800 sm:mx-0 sm:h-10 sm:w-10">
|
||||||
<svg class="h-6 w-6 text-white" inline xmlns="http://www.w3.org/2000/svg"
|
<svg class="h-6 w-6 text-white" inline xmlns="http://www.w3.org/2000/svg" fill="none"
|
||||||
fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
viewBox="0 0 24 24" stroke="currentColor">
|
||||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
||||||
d="M12 6v6m0 0v6m0-6h6m-6 0H6" />
|
d="M12 6v6m0 0v6m0-6h6m-6 0H6" />
|
||||||
</svg>
|
</svg>
|
||||||
|
@ -558,8 +566,8 @@
|
||||||
class="shadow rounded-md bg-white dark:bg-neutral-700 mx-auto w-64 p-5 overflow-hidden mt-10">
|
class="shadow rounded-md bg-white dark:bg-neutral-700 mx-auto w-64 p-5 overflow-hidden mt-10">
|
||||||
<!-- Avatar -->
|
<!-- Avatar -->
|
||||||
<div class="h-20 w-20 mb-10 mt-5 mx-auto rounded-full bg-red-800 dark:bg-red-800 relative overflow-hidden">
|
<div class="h-20 w-20 mb-10 mt-5 mx-auto rounded-full bg-red-800 dark:bg-red-800 relative overflow-hidden">
|
||||||
<svg class="w-10 h-10 m-5 text-white dark:text-white" xmlns="http://www.w3.org/2000/svg"
|
<svg class="w-10 h-10 m-5 text-white dark:text-white" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"
|
||||||
viewBox="0 0 20 20" fill="currentColor">
|
fill="currentColor">
|
||||||
<path fill-rule="evenodd" d="M10 9a3 3 0 100-6 3 3 0 000 6zm-7 9a7 7 0 1114 0H3z" clip-rule="evenodd" />
|
<path fill-rule="evenodd" d="M10 9a3 3 0 100-6 3 3 0 000 6zm-7 9a7 7 0 1114 0H3z" clip-rule="evenodd" />
|
||||||
</svg>
|
</svg>
|
||||||
</div>
|
</div>
|
||||||
|
@ -600,9 +608,10 @@
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p v-cloak class="text-center m-10 text-gray-300 dark:text-neutral-600 text-xs"> <a class="hover:underline" target="_blank"
|
<p v-cloak class="text-center m-10 text-gray-300 dark:text-neutral-600 text-xs"> <a class="hover:underline"
|
||||||
href="https://github.com/wg-easy/wg-easy">WireGuard Easy</a> © 2021-2024 by <a class="hover:underline" target="_blank"
|
target="_blank" href="https://github.com/wg-easy/wg-easy">WireGuard Easy</a> © 2021-2024 by <a
|
||||||
href="https://emilenijssen.nl/?ref=wg-easy">Emile Nijssen</a> is licensed under <a class="hover:underline" target="_blank"
|
class="hover:underline" target="_blank" href="https://emilenijssen.nl/?ref=wg-easy">Emile Nijssen</a> is
|
||||||
|
licensed under <a class="hover:underline" target="_blank"
|
||||||
href="http://creativecommons.org/licenses/by-nc-sa/4.0/">CC BY-NC-SA 4.0</a> · <a class="hover:underline"
|
href="http://creativecommons.org/licenses/by-nc-sa/4.0/">CC BY-NC-SA 4.0</a> · <a class="hover:underline"
|
||||||
href="https://github.com/sponsors/WeeJeWel" target="_blank">{{$t("donate")}}</a></p>
|
href="https://github.com/sponsors/WeeJeWel" target="_blank">{{$t("donate")}}</a></p>
|
||||||
|
|
||||||
|
|
|
@ -138,4 +138,12 @@ class API {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async restoreConfiguration(file) {
|
||||||
|
return this.call({
|
||||||
|
method: 'put',
|
||||||
|
path: '/wireguard/restore',
|
||||||
|
body: { file },
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -299,6 +299,22 @@ new Vue({
|
||||||
.catch((err) => alert(err.message || err.toString()))
|
.catch((err) => alert(err.message || err.toString()))
|
||||||
.finally(() => this.refresh().catch(console.error));
|
.finally(() => this.refresh().catch(console.error));
|
||||||
},
|
},
|
||||||
|
restoreConfig(e) {
|
||||||
|
e.preventDefault();
|
||||||
|
const file = e.currentTarget.files.item(0);
|
||||||
|
if (file) {
|
||||||
|
file.text()
|
||||||
|
.then((content) => {
|
||||||
|
this.api.restoreConfiguration(content)
|
||||||
|
.then((_result) => alert('The configuration was updated.'))
|
||||||
|
.catch((err) => alert(err.message || err.toString()))
|
||||||
|
.finally(() => this.refresh().catch(console.error));
|
||||||
|
})
|
||||||
|
.catch((err) => alert(err.message || err.toString()));
|
||||||
|
} else {
|
||||||
|
alert('Failed to load your file!');
|
||||||
|
}
|
||||||
|
},
|
||||||
toggleTheme() {
|
toggleTheme() {
|
||||||
const themes = ['light', 'dark', 'auto'];
|
const themes = ['light', 'dark', 'auto'];
|
||||||
const currentIndex = themes.indexOf(this.uiTheme);
|
const currentIndex = themes.indexOf(this.uiTheme);
|
||||||
|
|
|
@ -30,6 +30,10 @@ const messages = { // eslint-disable-line no-unused-vars
|
||||||
donate: 'Donate',
|
donate: 'Donate',
|
||||||
toggleCharts: 'Show/hide Charts',
|
toggleCharts: 'Show/hide Charts',
|
||||||
theme: { dark: 'Dark theme', light: 'Light theme', auto: 'Auto theme' },
|
theme: { dark: 'Dark theme', light: 'Light theme', auto: 'Auto theme' },
|
||||||
|
restore: 'Restore',
|
||||||
|
backup: 'Backup',
|
||||||
|
titleRestoreConfig: 'Restore your configuration',
|
||||||
|
titleBackupConfig: 'Backup your configuration',
|
||||||
},
|
},
|
||||||
ua: {
|
ua: {
|
||||||
name: 'Ім`я',
|
name: 'Ім`я',
|
||||||
|
@ -193,6 +197,10 @@ const messages = { // eslint-disable-line no-unused-vars
|
||||||
downloadConfig: 'Télécharger la configuration',
|
downloadConfig: 'Télécharger la configuration',
|
||||||
madeBy: 'Développé par',
|
madeBy: 'Développé par',
|
||||||
donate: 'Soutenir',
|
donate: 'Soutenir',
|
||||||
|
restore: 'Restaurer',
|
||||||
|
backup: 'Sauvegarder',
|
||||||
|
titleRestoreConfig: 'Restaurer votre configuration',
|
||||||
|
titleBackupConfig: 'Sauvegarder votre configuration',
|
||||||
},
|
},
|
||||||
de: { // github.com/florian-asche
|
de: { // github.com/florian-asche
|
||||||
name: 'Name',
|
name: 'Name',
|
||||||
|
@ -221,6 +229,10 @@ const messages = { // eslint-disable-line no-unused-vars
|
||||||
downloadConfig: 'Konfiguration herunterladen',
|
downloadConfig: 'Konfiguration herunterladen',
|
||||||
madeBy: 'Erstellt von',
|
madeBy: 'Erstellt von',
|
||||||
donate: 'Spenden',
|
donate: 'Spenden',
|
||||||
|
restore: 'Wiederherstellen',
|
||||||
|
backup: 'Sichern',
|
||||||
|
titleRestoreConfig: 'Stelle deine Konfiguration wieder her',
|
||||||
|
titleBackupConfig: 'Sichere deine Konfiguraion',
|
||||||
},
|
},
|
||||||
ca: { // github.com/guillembonet
|
ca: { // github.com/guillembonet
|
||||||
name: 'Nom',
|
name: 'Nom',
|
||||||
|
@ -277,6 +289,10 @@ const messages = { // eslint-disable-line no-unused-vars
|
||||||
donate: 'Donar',
|
donate: 'Donar',
|
||||||
toggleCharts: 'Mostrar/Ocultar gráficos',
|
toggleCharts: 'Mostrar/Ocultar gráficos',
|
||||||
theme: { dark: 'Modo oscuro', light: 'Modo claro', auto: 'Modo automático' },
|
theme: { dark: 'Modo oscuro', light: 'Modo claro', auto: 'Modo automático' },
|
||||||
|
restore: 'Restaurar',
|
||||||
|
backup: 'Realizar copia de seguridad',
|
||||||
|
titleRestoreConfig: 'Restaurar su configuración',
|
||||||
|
titleBackupConfig: 'Realizar copia de seguridad de su configuración',
|
||||||
},
|
},
|
||||||
ko: {
|
ko: {
|
||||||
name: '이름',
|
name: '이름',
|
||||||
|
@ -493,6 +509,10 @@ const messages = { // eslint-disable-line no-unused-vars
|
||||||
downloadConfig: 'Scarica configurazione',
|
downloadConfig: 'Scarica configurazione',
|
||||||
madeBy: 'Realizzato da',
|
madeBy: 'Realizzato da',
|
||||||
donate: 'Donazione',
|
donate: 'Donazione',
|
||||||
|
restore: 'Ripristina',
|
||||||
|
backup: 'Backup',
|
||||||
|
titleRestoreConfig: 'Ripristina la tua configurazione',
|
||||||
|
titleBackupConfig: 'Esegui il backup della tua configurazione',
|
||||||
},
|
},
|
||||||
th: {
|
th: {
|
||||||
name: 'ชื่อ',
|
name: 'ชื่อ',
|
||||||
|
|
Loading…
Reference in New Issue