Skip to content

Commit

Permalink
rename SHOW_NETWORKS to ENABLE_NETWORKS
Browse files Browse the repository at this point in the history
  • Loading branch information
mohsenasm committed Sep 23, 2024
1 parent 74e93a2 commit c5b07db
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ List of environment variables for more customization:
| CADVISOR_SERVICE_NAME_REGEX | cadvisor | Use this env to enable `cadvisor` integration. |
| CADVISOR_PORT | 8080 | |
| ENABLE_DATA_API | true | Use this env to export the `/data` API that returns the swarm status as a JSON object. Note that it requires basic-auth if `ENABLE_AUTHENTICATION` is activated. |
| SHOW_NETWORKS | false | `true` by default, set to "false" to remove the network section from the dashboard. |
| ENABLE_NETWORKS | false | `true` by default, set to "false" to remove the network section from the dashboard. |

## Security

Expand Down
6 changes: 3 additions & 3 deletions server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const httpsHostname = process.env.HTTPS_HOSTNAME;
const dockerUpdateInterval = parseInt(process.env.DOCKER_UPDATE_INTERVAL || "5000");
const metricsUpdateInterval = parseInt(process.env.METRICS_UPDATE_INTERVAL || "30000");
const showTaskTimestamp = !(process.env.SHOW_TASK_TIMESTAMP === "false");
const showNetworks = !(process.env.SHOW_NETWORKS === "false");
const enableNetworks = !(process.env.ENABLE_NETWORKS === "false");
const debugMode = process.env.DEBUG_MODE === "true";
const enableDataAPI = process.env.ENABLE_DATA_API === "true";

Expand Down Expand Up @@ -165,7 +165,7 @@ const parseAndRedactDockerData = data => {
nodes.push(node);
}

if (showNetworks) {
if (enableNetworks) {
for (let i = 0; i < data.networks.length; i++) {
const baseNetwork = data.networks[i];
let network = {
Expand All @@ -190,7 +190,7 @@ const parseAndRedactDockerData = data => {
},
},
};
if (showNetworks && (baseService["Endpoint"] !== undefined)) {
if (enableNetworks && (baseService["Endpoint"] !== undefined)) {
const _baseVIPs = baseService["Endpoint"]["VirtualIPs"];
if (_baseVIPs !== undefined && Array.isArray(_baseVIPs) && _baseVIPs.length > 0) {
let vips = []
Expand Down

0 comments on commit c5b07db

Please sign in to comment.