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 2022/02/05 01:12:55 UTC

[GitHub] [airflow] SamWheating commented on a change in pull request #20733: Add Audit Log View to Dag View

SamWheating commented on a change in pull request #20733:
URL: https://github.com/apache/airflow/pull/20733#discussion_r799917402



##########
File path: airflow/www/templates/airflow/dag_audit_log.html
##########
@@ -0,0 +1,89 @@
+{#
+ 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.
+#}
+
+{% extends "airflow/dag.html" %}
+{% block title %}Dag Audit Log{% endblock %}
+
+{% block head_css %}
+{{ super() }}
+<link href="{{ url_for_asset('dataTables.bootstrap.min.css') }}" rel="stylesheet" type="text/css" >
+<link href="{{ url_for_asset('bootstrap-toggle.min.css') }}" rel="stylesheet" type="text/css">
+{% endblock %}
+
+{% block content %}
+  {{ super() }}
+  <h2>Dag Audit Log</h2>
+    <h4 style="display: block; padding-top: 10px; padding-bottom: 4px">
+      <p>
+        This view displays selected events and operations that have been taken on this dag.
+        The included and excluded events are set in the <code>airflow.cfg</code> configurations,
+        which by default remove view only actions. For a full list of events regarding this dag, click
+        <a href="{{ url_for('LogModelView.list', _flt_3_dag_id=dag_id) }}">here</a>.
+      </p>
+    </h4>
+    <table id="dag_audit_log_table" class="table table-striped table-bordered table-hover">
+        <thead>
+            <tr>
+                <th style="min-width: 140px">Time</th>
+                <th style="min-width: 140px">Task ID</th>
+                <th>Event</th>
+                <th style="min-width: 140px">Logical Date</th>
+                <th>Owner
+                  <span class="material-icons text-muted js-tooltip" aria-hidden="true" data-original-title="This is the user who triggere the event.">info</span>
+                </th>
+                <th>Details</th>
+            </tr>
+        </thead>
+        <tbody>
+        {% for log in dag_logs %}
+            <tr>
+              <!--     Time     -->
+              <td><time datetime="{{ log.dttm }}">{{ log.dttm }}</time></td>
+              <!--     Task Id: task id is None for Dag level events    -->
+              <td>{{ log.task_id if log.task_id else None }}</td>
+              <!--     Event    -->
+              <td>{{ log.event if log.event else None }}</td>
+              <!--     Execution Date     -->
+              <td>{{ log.execution_date if log.execution_date else None }}</td>
+              <!--     By User     -->
+              <td>{{ log.owner if log.owner else None }}</td>
+              <!--     Details     -->
+              <td>{{ log.extra if log.extra else None }}</td>
+            </tr>
+        {% endfor %}
+        </tbody>
+    </table>
+{% endblock %}
+
+{% block tail %}
+  {{ super() }}
+  <script src="{{ url_for_asset('jquery.dataTables.min.js') }}"></script>
+  <script src="{{ url_for_asset('dataTables.bootstrap.min.js') }}"></script>
+  <script>
+  $(document).ready(function() {
+      <!-- Set rowCallback once add TaskNote annotations to highlight actions -->

Review comment:
       Is this comment still needed here?




-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

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