From bfb6b493c714ed1c16a35f2a8490045ca04a155d Mon Sep 17 00:00:00 2001 From: Mark Williams Date: Fri, 28 Nov 2025 16:19:20 +0000 Subject: [PATCH 1/3] LIMS-1974: Indicate dev DB in header bar --- api/config_sample.php | 8 ++++++-- api/index.php | 3 ++- client/src/js/app/components/breadcrumbs.vue | 21 ++++++++++---------- client/src/js/app/components/header.vue | 15 ++++++++++++-- client/src/js/app/store/store.js | 2 ++ client/tailwind.config.js | 6 ++++-- 6 files changed, 38 insertions(+), 17 deletions(-) diff --git a/api/config_sample.php b/api/config_sample.php index 9be9cf64f..b7b7d77e3 100644 --- a/api/config_sample.php +++ b/api/config_sample.php @@ -9,8 +9,12 @@ # Values: dev | production $mode = 'dev'; - # Database credentials, db = hostname/database - $isb = array('user' => 'user', 'pass' => 'pass', 'db' => 'localhost/ispyb'); + # Dev and production database credentials, db = hostname/database + $creds = array( + 'dev' => array('user' => 'user', 'pass' => 'pass', 'db' => 'localhost/ispyb'), + 'production' => array('user' => 'user', 'pass' => 'pass', 'db' => 'localhost/ispyb') + ); + $isb = $creds[$mode]; $dbtype = 'mysql'; # Encoded JWT key, used to sign and check validaty of jwt tokens diff --git a/api/index.php b/api/index.php index a16c214de..286e85749 100644 --- a/api/index.php +++ b/api/index.php @@ -67,7 +67,7 @@ function setupApplication($mode): Slim }); $app->get('/options', function () use ($app) { - global $motd, $authentication_type, $cas_url, $cas_sso, $sso_url, $package_description, + global $mode, $motd, $authentication_type, $cas_url, $cas_sso, $sso_url, $package_description, $facility_courier_countries, $facility_courier_countries_nde, $facility_courier_countries_link, $icat_base_url, $visit_persist_storage_dir_segment, $dhl_enable, $scale_grid, $scale_grid_end_date, $preset_proposal, $timezone, $valid_components, $enabled_container_types, $synchweb_version, $redirects, @@ -78,6 +78,7 @@ function setupApplication($mode): Slim $app->contentType('application/json'); $options = $app->container['options']; $app->response()->body(json_encode(array( + 'mode' => $mode == 'production' ? 'production' : 'development', 'motd' => $options->get('motd', $motd), 'authentication_type' => $authentication_type, 'cas_url' => $cas_url, diff --git a/client/src/js/app/components/breadcrumbs.vue b/client/src/js/app/components/breadcrumbs.vue index b2f1f548a..d6a9e890f 100644 --- a/client/src/js/app/components/breadcrumbs.vue +++ b/client/src/js/app/components/breadcrumbs.vue @@ -1,6 +1,6 @@