From 38bb96baf330f7147d98a904058504b7f86b1b08 Mon Sep 17 00:00:00 2001 From: pawndev Date: Wed, 9 Nov 2022 14:26:57 +0100 Subject: [PATCH] feat(config): Ability to change instance name by env var --- README.md | 3 +++ docker/env.js.template | 3 +++ src/app/Logo.vue | 18 ++++++++++++++++-- src/shared/config.ts | 6 ++++++ 4 files changed, 28 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 61b89d6d..1dd088f8 100644 --- a/README.md +++ b/README.md @@ -45,6 +45,9 @@ You can now access the application at http://localhost:8080/ Environment variables: - `SERVER_URL` (Optional): The backend server URL. When set the server input on the login page will not be displayed. +- `INSTANCE_NAME` (Optional): The name of this airsonic-refix instance. Will be displayed in the UI. +- `INSTANCE_SUBNAME` (Optional): The second name that follow INSTANCE_NAME on the right of the logo. Will be displayed in the UI. +- `DISABLE_SUBNAME` (Optional): Values `true`, `false`. Ability to disable the subname in the navbar. ### Pre-built bundle diff --git a/docker/env.js.template b/docker/env.js.template index bdf85256..6b1097ff 100644 --- a/docker/env.js.template +++ b/docker/env.js.template @@ -1,3 +1,6 @@ window.env = { SERVER_URL: "$SERVER_URL", + INSTANCE_NAME: "$INSTANCE_NAME", + INSTANCE_SUBNAME: "$INSTANCE_SUBNAME", + DISABLE_SUBNAME: $DISABLE_SUBNAME, } diff --git a/src/app/Logo.vue b/src/app/Logo.vue index 6531ac5d..c3b1a099 100644 --- a/src/app/Logo.vue +++ b/src/app/Logo.vue @@ -19,11 +19,25 @@ - airsonic  - (refix) + {{instanceName}}  + ({{instanceSubName}}) +