You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by sa...@apache.org on 2018/05/07 18:41:44 UTC

incubator-airflow git commit: [AIRFLOW-1952] Add the navigation bar color parameter

Repository: incubator-airflow
Updated Branches:
  refs/heads/master fcf8435f4 -> 214583996


[AIRFLOW-1952] Add the navigation bar color parameter

ENH: Add the navigation bar color parameter
When operating multiple Airflow's (eg. Production,
Staging, etc.),
we cannot distinguish which Airflow is.
This feature enables us to distinguish which
Airflow you see
by the color of navigation bar.

Merge branch 'master' into add-navigation-bar-
color-parameter

Closes #2903 from Licht-T/add-navigation-bar-
color-parameter


Project: http://git-wip-us.apache.org/repos/asf/incubator-airflow/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-airflow/commit/21458399
Tree: http://git-wip-us.apache.org/repos/asf/incubator-airflow/tree/21458399
Diff: http://git-wip-us.apache.org/repos/asf/incubator-airflow/diff/21458399

Branch: refs/heads/master
Commit: 21458399609a879b318ddbb37b52958c62baadc2
Parents: fcf8435
Author: Licht-T <li...@outlook.jp>
Authored: Mon May 7 11:18:32 2018 -0700
Committer: r39132 <si...@yahoo.com>
Committed: Mon May 7 11:18:32 2018 -0700

----------------------------------------------------------------------
 airflow/config_templates/default_airflow.cfg | 3 +++
 airflow/www/app.py                           | 1 +
 airflow/www/templates/admin/master.html      | 2 +-
 3 files changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/21458399/airflow/config_templates/default_airflow.cfg
----------------------------------------------------------------------
diff --git a/airflow/config_templates/default_airflow.cfg b/airflow/config_templates/default_airflow.cfg
index 6da4287..b91961e 100644
--- a/airflow/config_templates/default_airflow.cfg
+++ b/airflow/config_templates/default_airflow.cfg
@@ -277,6 +277,9 @@ page_size = 100
 # Use FAB-based webserver with RBAC feature
 rbac = False
 
+# Define the color of navigation bar
+navbar_color = #007A87
+
 
 [email]
 email_backend = airflow.utils.email.send_email_smtp

http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/21458399/airflow/www/app.py
----------------------------------------------------------------------
diff --git a/airflow/www/app.py b/airflow/www/app.py
index ca0589d..e9b101d 100644
--- a/airflow/www/app.py
+++ b/airflow/www/app.py
@@ -156,6 +156,7 @@ def create_app(config=None, testing=False):
         def jinja_globals():
             return {
                 'hostname': get_hostname(),
+                'navbar_color': configuration.get('webserver', 'NAVBAR_COLOR'),
             }
 
         @app.teardown_appcontext

http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/21458399/airflow/www/templates/admin/master.html
----------------------------------------------------------------------
diff --git a/airflow/www/templates/admin/master.html b/airflow/www/templates/admin/master.html
index 1f0020e..cb1e9f1 100644
--- a/airflow/www/templates/admin/master.html
+++ b/airflow/www/templates/admin/master.html
@@ -51,7 +51,7 @@
 {% block page_body %}
 <div class="container">
 
-<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
+<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation" style="background-color: {{ navbar_color }};">
     <div class="container">
       <!-- Brand and toggle get grouped for better mobile display -->
       <div class="navbar-header">