diff --git a/README.md b/README.md index a7712045..edae5488 100644 --- a/README.md +++ b/README.md @@ -98,7 +98,7 @@ These options can be configured by setting environment variables using `-e KEY=" | `WG_PRE_DOWN` | `...` | - | See [config.js](https://github.com/wg-easy/wg-easy/blob/master/src/config.js#L27) for the default value. | | `WG_POST_DOWN` | `...` | `iptables ...` | See [config.js](https://github.com/wg-easy/wg-easy/blob/master/src/config.js#L28) for the default value. | | `LANG` | `en` | `de` | Web UI language (Supports: en, ru, tr, no, pl, fr, de, ca, es). | -| `UI_DETAILED_STATS` | `false` | `true` | Enable detailed RX / TX client stats in Web UI | +| `UI_USAGE_STATS` | `false` | `true` | Enable detailed RX / TX client stats in Web UI | > If you change `WG_PORT`, make sure to also change the exposed port. diff --git a/docker-compose.yml b/docker-compose.yml index 59594010..be54a22a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -24,7 +24,7 @@ services: # - WG_POST_UP=echo "Post Up" > /etc/wireguard/post-up.txt # - WG_PRE_DOWN=echo "Pre Down" > /etc/wireguard/pre-down.txt # - WG_POST_DOWN=echo "Post Down" > /etc/wireguard/post-down.txt - # - UI_DETAILED_STATS=true + # - UI_USAGE_STATS=true image: ghcr.io/wg-easy/wg-easy container_name: wg-easy diff --git a/src/config.js b/src/config.js index 22778432..14fde767 100644 --- a/src/config.js +++ b/src/config.js @@ -29,4 +29,4 @@ iptables -A FORWARD -o wg0 -j ACCEPT; module.exports.WG_PRE_DOWN = process.env.WG_PRE_DOWN || ''; module.exports.WG_POST_DOWN = process.env.WG_POST_DOWN || ''; module.exports.LANG = process.env.LANG || 'en'; -module.exports.UI_DETAILED_STATS = process.env.UI_DETAILED_STATS || 'false'; +module.exports.UI_USAGE_STATS = process.env.UI_USAGE_STATS || 'false'; diff --git a/src/lib/Server.js b/src/lib/Server.js index fd09db99..ccead598 100644 --- a/src/lib/Server.js +++ b/src/lib/Server.js @@ -18,7 +18,7 @@ const { RELEASE, PASSWORD, LANG, - UI_DETAILED_STATS, + UI_USAGE_STATS, } = require('../config'); module.exports = class Server { @@ -45,8 +45,8 @@ module.exports = class Server { .get('/api/lang', (Util.promisify(async () => { return LANG; }))) - .get('/api/ui-detailed-stats', (Util.promisify(async () => { - return UI_DETAILED_STATS === 'true'; + .get('/api/ui-usage-stats', (Util.promisify(async () => { + return UI_USAGE_STATS === 'true'; }))) // Authentication diff --git a/src/www/index.html b/src/www/index.html index 2dc6aed4..4c5b239f 100644 --- a/src/www/index.html +++ b/src/www/index.html @@ -162,7 +162,7 @@ - + · - + · - {{!uiDetailedStats ? " · " : ""}}{{new Date(client.latestHandshakeAt) | timeago}} + {{!uiUsageStats ? " · " : ""}}{{new Date(client.latestHandshakeAt) | timeago}} -
diff --git a/src/www/js/api.js b/src/www/js/api.js index 620a930b..c4440ef2 100644 --- a/src/www/js/api.js +++ b/src/www/js/api.js @@ -43,10 +43,10 @@ class API { }); } - async getUiDetailedStats() { + async getuiUsageStats() { return this.call({ method: 'get', - path: '/ui-detailed-stats', + path: '/ui-usage-stats', }); } diff --git a/src/www/js/app.js b/src/www/js/app.js index c110d2a9..cc6dd5f1 100644 --- a/src/www/js/app.js +++ b/src/www/js/app.js @@ -53,7 +53,7 @@ new Vue({ latestRelease: null, isDark: null, - uiDetailedStats: false, + uiUsageStats: false, chartOptions: { chart: { @@ -293,13 +293,13 @@ new Vue({ }).catch(console.error); }, 1000); - this.api.getUiDetailedStats() + this.api.getuiUsageStats() .then((res) => { - this.uiDetailedStats = res; + this.uiUsageStats = res; }) .catch(() => { - console.log('Failed to get ui-detailed-stats'); - this.uiDetailedStats = false; + console.log('Failed to get ui-usage-stats'); + this.uiUsageStats = false; }); Promise.resolve().then(async () => {