You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2020/10/19 21:54:29 UTC

[GitHub] [airflow] ryanahamilton commented on a change in pull request #11652: Support for sorting DAGs in the web UI

ryanahamilton commented on a change in pull request #11652:
URL: https://github.com/apache/airflow/pull/11652#discussion_r508079706



##########
File path: airflow/www/templates/airflow/dags.html
##########
@@ -76,9 +76,21 @@ <h2>DAGs</h2>
             <th width="12">
               <span id="pause_header" class="material-icons text-muted" title="Use this toggle to pause a DAG. The scheduler won't schedule new tasks instances for a paused DAG. Tasks already running at pause time won't be affected.">info</span>
             </th>
-            <th>DAG</th>
-            <th>Schedule</th>
-            <th>Owner</th>
+            <th>
+              <a href="{{ url_for('Airflow.index', status=request.args.get('status', 'all'), search=request.args.get('search', None), tags=request.args.get('tags', None), sortBy='dag_id', orderBy='asc' if request.args.get('sortBy') != 'dag_id' or request.args.get('orderBy', 'desc') != 'asc' else 'desc' ) }}">
+                DAG

Review comment:
       It would probably be good to add icons to these links to give them a bit more visual distinction.
   
   ```suggestion
                   DAG<span class="material-icons">unfold_more</span>
   ```
   
   ![image](https://user-images.githubusercontent.com/3267/96515020-8db44b00-1232-11eb-92dc-94889f7572c1.png)
   

##########
File path: airflow/www/templates/airflow/dags.html
##########
@@ -76,9 +76,21 @@ <h2>DAGs</h2>
             <th width="12">
               <span id="pause_header" class="material-icons text-muted" title="Use this toggle to pause a DAG. The scheduler won't schedule new tasks instances for a paused DAG. Tasks already running at pause time won't be affected.">info</span>
             </th>
-            <th>DAG</th>
-            <th>Schedule</th>
-            <th>Owner</th>
+            <th>
+              <a href="{{ url_for('Airflow.index', status=request.args.get('status', 'all'), search=request.args.get('search', None), tags=request.args.get('tags', None), sortBy='dag_id', orderBy='asc' if request.args.get('sortBy') != 'dag_id' or request.args.get('orderBy', 'desc') != 'asc' else 'desc' ) }}">
+                DAG
+              </a>
+            </th>
+            <th>
+              <a href="{{ url_for('Airflow.index', status=request.args.get('status', 'all'), search=request.args.get('search', None), tags=request.args.get('tags', None), sortBy='schedule', orderBy='asc' if request.args.get('sortBy') != 'owner' or request.args.get('orderBy', 'schedule') != 'asc' else 'desc' ) }}">

Review comment:
       Appear to be some typos here:
   ```suggestion
                 <a href="{{ url_for('Airflow.index', status=request.args.get('status', 'all'), search=request.args.get('search', None), tags=request.args.get('tags', None), sortBy='schedule', orderBy='asc' if request.args.get('sortBy') != 'schedule' or request.args.get('orderBy', 'desc') != 'asc' else 'desc' ) }}">
   ```

##########
File path: airflow/www/templates/airflow/dags.html
##########
@@ -76,9 +76,21 @@ <h2>DAGs</h2>
             <th width="12">
               <span id="pause_header" class="material-icons text-muted" title="Use this toggle to pause a DAG. The scheduler won't schedule new tasks instances for a paused DAG. Tasks already running at pause time won't be affected.">info</span>
             </th>
-            <th>DAG</th>
-            <th>Schedule</th>
-            <th>Owner</th>
+            <th>
+              <a href="{{ url_for('Airflow.index', status=request.args.get('status', 'all'), search=request.args.get('search', None), tags=request.args.get('tags', None), sortBy='dag_id', orderBy='asc' if request.args.get('sortBy') != 'dag_id' or request.args.get('orderBy', 'desc') != 'asc' else 'desc' ) }}">
+                DAG
+              </a>
+            </th>
+            <th>
+              <a href="{{ url_for('Airflow.index', status=request.args.get('status', 'all'), search=request.args.get('search', None), tags=request.args.get('tags', None), sortBy='schedule', orderBy='asc' if request.args.get('sortBy') != 'owner' or request.args.get('orderBy', 'schedule') != 'asc' else 'desc' ) }}">
+                Schedule

Review comment:
       ```suggestion
                   Schedule<span class="material-icons">unfold_more</span>
   ```

##########
File path: airflow/www/templates/airflow/dags.html
##########
@@ -76,9 +76,21 @@ <h2>DAGs</h2>
             <th width="12">
               <span id="pause_header" class="material-icons text-muted" title="Use this toggle to pause a DAG. The scheduler won't schedule new tasks instances for a paused DAG. Tasks already running at pause time won't be affected.">info</span>
             </th>
-            <th>DAG</th>
-            <th>Schedule</th>
-            <th>Owner</th>
+            <th>
+              <a href="{{ url_for('Airflow.index', status=request.args.get('status', 'all'), search=request.args.get('search', None), tags=request.args.get('tags', None), sortBy='dag_id', orderBy='asc' if request.args.get('sortBy') != 'dag_id' or request.args.get('orderBy', 'desc') != 'asc' else 'desc' ) }}">
+                DAG
+              </a>
+            </th>
+            <th>
+              <a href="{{ url_for('Airflow.index', status=request.args.get('status', 'all'), search=request.args.get('search', None), tags=request.args.get('tags', None), sortBy='schedule', orderBy='asc' if request.args.get('sortBy') != 'owner' or request.args.get('orderBy', 'schedule') != 'asc' else 'desc' ) }}">
+                Schedule
+              </a>
+            </th>
+            <th>
+              <a href="{{ url_for('Airflow.index', status=request.args.get('status', 'all'), search=request.args.get('search', None), tags=request.args.get('tags', None), sortBy='owner', orderBy='asc' if request.args.get('sortBy') != 'owner' or request.args.get('orderBy', 'desc') != 'asc' else 'desc' ) }}">
+                Owner

Review comment:
       ```suggestion
                   Owner<span class="material-icons">unfold_more</span>
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org