Skip to content

Commit

Permalink
Add docs to change Colors on the Webserver (apache#9607)
Browse files Browse the repository at this point in the history
Feature was added in apache#9520

(cherry picked from commit 65855e5)
  • Loading branch information
kaxil authored and Chris Fei committed Mar 5, 2021
1 parent 0a7fd30 commit 7e620b1
Show file tree
Hide file tree
Showing 8 changed files with 71 additions and 0 deletions.
70 changes: 70 additions & 0 deletions docs/howto/customize-state-colors-ui.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
.. Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
.. http://www.apache.org/licenses/LICENSE-2.0
.. Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
Customizing state colours in UI
===============================

.. versionadded:: 1.10.11

To change the colors for TaskInstance/DagRun State in the Airflow Webserver, perform the
following steps:

1. Create ``airflow_local_settings.py`` file and put in on ``$PYTHONPATH`` or
to ``$AIRFLOW_HOME/config`` folder. (Airflow adds ``$AIRFLOW_HOME/config`` on ``PYTHONPATH`` when
Airflow is initialized)

2. Add the following contents to ``airflow_local_settings.py`` file. Change the colors to whatever you
would like.

.. code-block:: python
STATE_COLORS = {
"queued": 'darkgray',
"running": '#01FF70',
"success": '#2ECC40',
"failed": 'firebrick',
"up_for_retry": 'yellow',
"up_for_reschedule": 'turquoise',
"upstream_failed": 'orange',
"skipped": 'darkorchid',
"scheduled": 'tan',
}
3. Restart Airflow Webserver.

Screenshots
-----------

Before
^^^^^^

.. image:: ../img/change-ui-colors/dags-page-old.png

.. image:: ../img/change-ui-colors/graph-view-old.png

.. image:: ../img/change-ui-colors/tree-view-old.png

After
^^^^^^

.. image:: ../img/change-ui-colors/dags-page-new.png

.. image:: ../img/change-ui-colors/graph-view-new.png

.. image:: ../img/change-ui-colors/tree-view-new.png
1 change: 1 addition & 0 deletions docs/howto/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ configuring an Airflow environment.
set-config
initialize-database
operator/index
customize-state-colors-ui
custom-operator
connection/index
secure-connections
Expand Down
Binary file added docs/img/change-ui-colors/dags-page-new.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/change-ui-colors/dags-page-old.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/change-ui-colors/graph-view-new.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/change-ui-colors/graph-view-old.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/change-ui-colors/tree-view-new.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/change-ui-colors/tree-view-old.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 7e620b1

Please sign in to comment.