From e32ea7d0aa06201d8e6759cb5620aeb319d445cb Mon Sep 17 00:00:00 2001 From: HrBingR Date: Thu, 11 Aug 2022 23:04:45 +0200 Subject: [PATCH] Added the ability to define a custom footer via environment variables Added the CUSTOM_FOOTER_TEXT and CUSTOM_FOOTER_URL environment variables. If undefined, the default translated footer will display. If only CUSTOM_FOOTER_TEXT is defined, only this defined text will display in place of the normal footer text. If only CUSTOM_FOOTER_URL is defined then the defined URL will display. If both variables are defined, the defined text will display as a link to the defined URL. --- app/ui/footer.js | 41 ++++++++++++++++++++++++++++++++++++++- server/clientConstants.js | 2 ++ server/config.js | 10 ++++++++++ 3 files changed, 52 insertions(+), 1 deletion(-) diff --git a/app/ui/footer.js b/app/ui/footer.js index bd332896..77a2b960 100644 --- a/app/ui/footer.js +++ b/app/ui/footer.js @@ -65,6 +65,45 @@ class Footer extends Component { `); } + // Defining a custom footer + var footer = []; + if (this.state != undefined && this.state.WEB_UI != undefined) { + const WEB_UI = this.state.WEB_UI; + + if (WEB_UI.CUSTOM_FOOTER_URL != '' && WEB_UI.CUSTOM_FOOTER_TEXT != '') { + footer.push(html` +
  • + + ${WEB_UI.CUSTOM_FOOTER_TEXT} + +
  • + `); + } + else if (WEB_UI.CUSTOM_FOOTER_URL != '') { + footer.push(html` +
  • + + ${WEB_UI.CUSTOM_FOOTER_URL} + +
  • + `); + } + else if (WEB_UI.CUSTOM_FOOTER_TEXT != '') { + footer.push(html` +
  • + ${WEB_UI.CUSTOM_FOOTER_TEXT} +
  • + `) + } + else { + footer.push(html` +
  • + ${translate('footerText')} +
  • + `); + } + } + return html`