Skip to content

Commit 2a6cadb

Browse files
authored
Small improvements for Airflow UI (#18715)
I slightly improved some small UI elements that were a bit off. Changes: - Removed `btn-sm` class that made the buttons next to each DAG on DAGs list not centered perfectly. - Changed everywhere the spelling of DAGs (made the last letter lowercase in 'DAGS' word) - Changed the 'Conn Type' and 'Conn Id' to 'Connection Type' Connection Id' (not sure why this was abbreviated everywhere, but if I am not aware of something, let me know and I can revert this change) - Fixed strange use of punctuation marks inside a view when trying to mark DAG run as failed - Changed font size inside DAG run circle from 8 to 9. It makes it a lot more readable and it can still fit even 4-digit numbers. I think we can even go with 10, but then 4-digit numbers slightly overlay the circle (who have 4-digit runs though?). Here I highlighted with red color the old font size and misaligned icons inside button. The green highlights the elements after changes. ![image](https://user-images.githubusercontent.com/7412964/135896512-7b44b5d0-9cda-42d5-a8ea-3151c0dde2a1.png) If there are any other places that I missed or there is something that shouldn't be changed or maybe the change should be reflected in some places that I missed - let me know!
1 parent 767a4f5 commit 2a6cadb

File tree

21 files changed

+37
-35
lines changed

21 files changed

+37
-35
lines changed

UPDATING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3249,7 +3249,7 @@ Please read through the new scheduler options, defaults have changed since 1.7.1
32493249
32503250
#### child_process_log_directory
32513251
3252-
In order to increase the robustness of the scheduler, DAGS are now processed in their own process. Therefore each
3252+
In order to increase the robustness of the scheduler, DAGs are now processed in their own process. Therefore each
32533253
DAG has its own log file for the scheduler. These log files are placed in `child_process_log_directory` which defaults to
32543254
`<AIRFLOW_HOME>/scheduler/latest`. You will need to make sure these log files are removed.
32553255

airflow/hooks/filesystem.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ class FSHook(BaseHook):
2727
Connection should have a name and a path specified under extra:
2828
2929
example:
30-
Conn Id: fs_test
31-
Conn Type: File (path)
30+
Connection Id: fs_test
31+
Connection Type: File (path)
3232
Host, Schema, Login, Password, Port: empty
3333
Extra: {"path": "/tmp"}
3434
"""

airflow/models/baseoperator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ class derived from this one results in the creation of a task object,
308308
you know exactly what priority weight each task should have.
309309
Additionally, when set to ``absolute``, there is bonus effect of
310310
significantly speeding up the task creation process as for very large
311-
DAGS. Options can be set as string or using the constants defined in
311+
DAGs. Options can be set as string or using the constants defined in
312312
the static class ``airflow.utils.WeightRule``
313313
:type weight_rule: str
314314
:param queue: which queue to target when running this job. Not

airflow/models/dag.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ class DAG(LoggingMixin):
290290
to render templates as native Python types. If False, a Jinja
291291
``Environment`` is used to render templates as string values.
292292
:type render_template_as_native_obj: bool
293-
:param tags: List of tags to help filtering DAGS in the UI.
293+
:param tags: List of tags to help filtering DAGs in the UI.
294294
:type tags: List[str]
295295
"""
296296

airflow/providers/openfaas/hooks/openfaas.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class OpenFaasHook(BaseHook):
3333
:param function_name: Name of the function, Defaults to None
3434
:type function_name: str
3535
:param conn_id: openfaas connection to use, Defaults to open_faas_default
36-
for example host : http://openfaas.faas.com, Conn Type : Http
36+
for example host : http://openfaas.faas.com, Connection Type : Http
3737
:type conn_id: str
3838
"""
3939

airflow/utils/file.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ def might_contain_dag(file_path: str, safe_mode: bool, zip_file: Optional[zipfil
213213
:param file_path: Path to the file to be checked.
214214
:param safe_mode: Is safe mode active?. If no, this function always returns True.
215215
:param zip_file: if passed, checks the archive. Otherwise, check local filesystem.
216-
:return: True, if file might contain DAGS.
216+
:return: True, if file might contain DAGs.
217217
"""
218218
if not safe_mode:
219219
return True

airflow/www/forms.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,9 @@ class TaskInstanceEditForm(DynamicForm):
176176
class ConnectionForm(DynamicForm):
177177
"""Form for editing and adding Connection"""
178178

179-
conn_id = StringField(lazy_gettext('Conn Id'), validators=[InputRequired()], widget=BS3TextFieldWidget())
179+
conn_id = StringField(
180+
lazy_gettext('Connection Id'), validators=[InputRequired()], widget=BS3TextFieldWidget()
181+
)
180182
description = StringField(lazy_gettext('Description'), widget=BS3TextAreaFieldWidget())
181183
host = StringField(lazy_gettext('Host'), widget=BS3TextFieldWidget())
182184
schema = StringField(lazy_gettext('Schema'), widget=BS3TextFieldWidget())

airflow/www/static/js/dags.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ function drawDagStatsForDag(dagId, states) {
233233
.attr('fill', '#51504f')
234234
.attr('text-anchor', 'middle')
235235
.attr('vertical-align', 'middle')
236-
.attr('font-size', 8)
236+
.attr('font-size', 9)
237237
.attr('y', 3)
238238
.style('pointer-events', 'none')
239239
.text((d) => (d.count > 0 ? d.count : ''));
@@ -303,7 +303,7 @@ function drawTaskStatsForDag(dagId, states) {
303303
.attr('fill', '#51504f')
304304
.attr('text-anchor', 'middle')
305305
.attr('vertical-align', 'middle')
306-
.attr('font-size', 8)
306+
.attr('font-size', 9)
307307
.attr('y', 3)
308308
.style('pointer-events', 'none')
309309
.text((d) => (d.count > 0 ? d.count : ''));

airflow/www/templates/airflow/confirm.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
{% block content %}
2323
{{ super() }}
24-
<h2>Wait a minute.</h2>
24+
<h2>Wait a minute</h2>
2525
<div class="panel">
2626
<p>{{ message }}</p>
2727
{% if details %}
@@ -38,7 +38,7 @@ <h2>Wait a minute.</h2>
3838
{% for name,val in request.values.items() if name != "csrf_token" %}
3939
<input type="hidden" name="{{ name }}" value="{{ val }}">
4040
{% endfor %}
41-
<button type="submit" class="btn btn-primary">OK!</button>
41+
<button type="submit" class="btn btn-primary">OK</button>
4242
<button type="button" class="btn" onclick="window.history.back(); return false">Cancel</button>
4343
</form>
4444
{% endblock %}

airflow/www/templates/airflow/dags.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,9 @@ <h2>{{ page_title }}</h2>
7474
<div class="row dags-table-header">
7575
<div class="col-md-4">
7676
<div class="form-group btn-group">
77-
<a href="{{ url_for('Airflow.index', status='all', search=request.args.get('search', None), tags=request.args.getlist('tags', None)) }}" class="btn {{'btn-primary' if status_filter == 'all' else 'btn-default'}}" title="Show active and paused DAGS">All <span class="badge">{{ "{:,}".format(status_count_all) }}</span></a>
78-
<a href="{{ url_for('Airflow.index', status='active', search=request.args.get('search', None), tags=request.args.getlist('tags', None)) }}" class="btn {{'btn-primary' if status_filter == 'active' else 'btn-default'}}" title="Show only active DAGS">Active <span class="badge">{{ "{:,}".format(status_count_active) }}</span></a>
79-
<a href="{{ url_for('Airflow.index', status='paused', search=request.args.get('search', None), tags=request.args.getlist('tags', None)) }}" class="btn {{'btn-primary' if status_filter == 'paused' else 'btn-default'}}" title="Show only paused DAGS">Paused <span class="badge">{{ "{:,}".format(status_count_paused) }}</span></a>
77+
<a href="{{ url_for('Airflow.index', status='all', search=request.args.get('search', None), tags=request.args.getlist('tags', None)) }}" class="btn {{'btn-primary' if status_filter == 'all' else 'btn-default'}}" title="Show active and paused DAGs">All <span class="badge">{{ "{:,}".format(status_count_all) }}</span></a>
78+
<a href="{{ url_for('Airflow.index', status='active', search=request.args.get('search', None), tags=request.args.getlist('tags', None)) }}" class="btn {{'btn-primary' if status_filter == 'active' else 'btn-default'}}" title="Show only active DAGs">Active <span class="badge">{{ "{:,}".format(status_count_active) }}</span></a>
79+
<a href="{{ url_for('Airflow.index', status='paused', search=request.args.get('search', None), tags=request.args.getlist('tags', None)) }}" class="btn {{'btn-primary' if status_filter == 'paused' else 'btn-default'}}" title="Show only paused DAGs">Paused <span class="badge">{{ "{:,}".format(status_count_paused) }}</span></a>
8080
</div>
8181
</div>
8282
<div class="col-sm-6 col-md-3">
@@ -238,7 +238,7 @@ <h2>{{ page_title }}</h2>
238238
</div>
239239
{% endif %}
240240
{# Use dag_id instead of dag.dag_id, because the DAG might not exist in the webserver's DagBag #}
241-
<a href="{{ url_for('Airflow.delete', dag_id=dag.dag_id) }}" onclick="return confirmDeleteDag(this, '{{ dag.dag_id }}')" title="Delete&nbsp;DAG" aria-label="Delete DAG" class="btn btn-sm btn-default btn-icon-only {{ ' disabled' if not dag.can_delete }}">
241+
<a href="{{ url_for('Airflow.delete', dag_id=dag.dag_id) }}" onclick="return confirmDeleteDag(this, '{{ dag.dag_id }}')" title="Delete&nbsp;DAG" aria-label="Delete DAG" class="btn btn-default btn-icon-only {{ ' disabled' if not dag.can_delete }}">
242242
<span class="material-icons text-danger" aria-hidden="true">delete_outline</span>
243243
</a>
244244
</div>

0 commit comments

Comments
 (0)