Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,11 @@ function displayTime() {
$(document).ready(function () {
displayTime();
$('span').tooltip();
$.ajaxSetup({
beforeSend: function(xhr, settings) {
if (!/^(GET|HEAD|OPTIONS|TRACE)$/i.test(settings.type) && !this.crossDomain) {
xhr.setRequestHeader("X-CSRFToken", csrfToken);
}
}
});
});
4 changes: 2 additions & 2 deletions airflow/www_rbac/templates/appbuilder/baselayout.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@
{% block tail_js %}
{{ super() }}
<script type="text/javascript">
// below variables are used in clock.js
// below variables are used in base.js
var hostName = '{{ hostname }}';
var csrfToken = '{{ csrf_token() }}';
</script>
<script src="{{ url_for_asset('clock.js') }}" type="text/javascript"></script>
<script src="{{ url_for_asset('base.js') }}" type="text/javascript"></script>
{% endblock %}
2 changes: 1 addition & 1 deletion airflow/www_rbac/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const BUILD_DIR = path.resolve(__dirname, './static/dist');
const config = {
entry: {
connectionForm: `${STATIC_DIR}/js/connection_form.js`,
clock: `${STATIC_DIR}/js/clock.js`,
base: `${STATIC_DIR}/js/base.js`,
graph: `${STATIC_DIR}/js/graph.js`,
ganttChartD3v2: `${STATIC_DIR}/js/gantt-chart-d3v2.js`,
main: `${STATIC_DIR}/css/main.css`,
Expand Down