[
https://issues.apache.org/jira/browse/SOLR-13569?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16869323#comment-16869323
]
Jan Høydahl edited comment on SOLR-13569 at 6/21/19 12:01 PM:
--------------------------------------------------------------
We need not occupy much vertical screen real-estate for this, just a thin bar.
Proposed implementation is as follows:
A new class {{SolrEnvironment}} will look for values first in SysProp
"solr.environment", and if not found in ClusterProp "environment".
The config is a string, and there will be a few pre-defined ones:
* prod: Production, color red
* stage: Staging environments, color orange
* test: Test environments (shared), color yellow
* dev: Development environments, color green
* unknown: Default, will cause the bar not to display or to be white
I.e. when you deploy a PROD environment you simply add this to solr.in.sh:
{code:java}
SOLR_OPTS="$SOLR_OPTS -Dsolr.environment=prod
{code}
The {{SystemInfoHandler}} will check if this property has been defined and if
so, add three keys to its output, e.g.:
{code:javascript}
"environment": "prod",
"environment.label": "My production",
"environment.color": "brown"
{code}
The Admin UI then looks for these values from {{admin/info/system}}, store the
values in browser session-storage where it will survive until tab is closed and
use it to render the top bar.
If a user is not happy with the predefined classes, they can choose one of the
predefined but override label and color in the same string. For ease of quoting
on cmdline, we'll translate "+" into space in the label:
{code:java}
-Dsolr.environment=<prod|stage|test|dev>;color=black;label=Pre+production{code}
Feeback on this plan welcome!
was (Author: janhoy):
We need not occupy much vertical screen real-estate for this, just a thin bar.
Proposed implementation is as follows:
Add an {{environment}} tag to solr.xml which is configured through a system
property {{solr.environment:}}
{code:java}
<solr>
<str name="environment">${solr.environment:unknown}</str>
{code}
The config is a string, and there will be a few pre-defined ones:
* prod: Production, color red
* stage: Staging environments, color orange
* test: Test environments (shared), color yellow
* dev: Development environments, color green
* unknown: Default, will cause the bar not to display or to be white
I.e. when you deploy a PROD environment you simply add this to solr.in.sh:
{code:java}
SOLR_OPTS="$SOLR_OPTS -Dsolr.environment=prod{code}
The Admin UI will simply parse this value from admin/info/system where the
sys-props are read, and store the values in browser session-storage where it
will survive until tab is closed. The value in the session storage will be used
to select CSS class and text for the top bar.
Further, I imagine an extended format where you can override label and color as
well, e.g.:
{code:java}
-Dsolr.environment=<prod|stage|test|dev>;color=black;label=Pre-production{code}
Feeback on this plan welcome!
> AdminUI visual indication of prod/test/dev environment
> ------------------------------------------------------
>
> Key: SOLR-13569
> URL: https://issues.apache.org/jira/browse/SOLR-13569
> Project: Solr
> Issue Type: Improvement
> Security Level: Public(Default Security Level. Issues are Public)
> Components: Admin UI
> Reporter: Jan Høydahl
> Assignee: Jan Høydahl
> Priority: Major
> Attachments: Environment-hint.png
>
>
> To guard against accidentally changing the wrong cluster, we should add a
> visual indication in the Admin UI of whether you currently work with a
> production environment or not, e.g. a red bar on top with an optional
> environment label, see sketch. The bar could by default be red for
> production, yellow for test and green for dev.
> !Environment-hint.png|width=700!
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]