From 8450a0c213e861df3412c0ca223ff62ef68c57e7 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Thu, 8 Sep 2022 05:24:46 +0000 Subject: [PATCH] region in UI --- .env | 2 +- Dockerfile | 2 +- app/controllers/web/console.php | 6 ++++++ app/views/console/comps/header.phtml | 16 ++++++++++++++++ 4 files changed, 24 insertions(+), 2 deletions(-) diff --git a/.env b/.env index 5b688cf87e..951b3cf562 100644 --- a/.env +++ b/.env @@ -83,7 +83,7 @@ _APP_LOGGING_PROVIDER= _APP_LOGGING_CONFIG= _APP_REGION_DEFAULT=default _APP_REGIIONS=default -_APP_REGION_DISABLED= +_APP_REGIONS_DISABLED= DOCKERHUB_PULL_USERNAME= DOCKERHUB_PULL_PASSWORD= DOCKERHUB_PULL_EMAIL= \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 97fb51eb0e..339c80e063 100755 --- a/Dockerfile +++ b/Dockerfile @@ -258,7 +258,7 @@ ENV _APP_SERVER=swoole \ _APP_LOGGING_CONFIG= \ _APP_REGIONS=default \ _APP_REGION_DEFAULT=default \ - _APP_REGION_DISABLED= + _APP_REGIONS_DISABLED= RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone diff --git a/app/controllers/web/console.php b/app/controllers/web/console.php index 864ed535f2..3617024722 100644 --- a/app/controllers/web/console.php +++ b/app/controllers/web/console.php @@ -28,6 +28,12 @@ App::shutdown() $header = new View(__DIR__ . '/../../views/console/comps/header.phtml'); $footer = new View(__DIR__ . '/../../views/console/comps/footer.phtml'); + $header + ->setParam('regions', App::getEnv('_APP_REGIONS', [])) + ->setParam('disabledRegions', App::getEnv('_APP_REGIONS_DISABLED', [])) + ->setParam('defaultRegion', App::getEnv('_APP_REGION_DEFAULT', 'default')) + ; + $footer ->setParam('home', App::getEnv('_APP_HOME', '')) ->setParam('version', App::getEnv('_APP_VERSION', 'UNKNOWN')) diff --git a/app/views/console/comps/header.phtml b/app/views/console/comps/header.phtml index 09fe421c79..6e56c7c357 100644 --- a/app/views/console/comps/header.phtml +++ b/app/views/console/comps/header.phtml @@ -1,3 +1,8 @@ +getParam('regions', []); +$disabledRegions = $this->getParam('disabledRegions', []); +$defaultRegion = $this->getParam('defaultRegion', []); +?>