This commit is contained in:
Maxime 2015-01-04 16:17:22 +00:00
Родитель 4076d87783
Коммит 462f9b999a
3 изменённых файлов: 35 добавлений и 27 удалений

Просмотреть файл

@ -113,18 +113,8 @@ admin = Admin(
admin.add_link( admin.add_link(
base.MenuLink( base.MenuLink(
category='Tools', category='Tools',
name='Query', name='Ad Hoc Query',
url='/admin/airflow/query')) url='/admin/airflow/query'))
admin.add_link(
base.MenuLink(
category='Docs',
name='@readthedocs.org',
url='http://airflow.readthedocs.org/en/latest/'))
admin.add_link(
base.MenuLink(
category='Docs',
name='Github',
url='https://github.com/mistercrunch/Airflow'))
class Airflow(BaseView): class Airflow(BaseView):
@ -269,13 +259,13 @@ class Airflow(BaseView):
if color_scheme == 'blue_red': if color_scheme == 'blue_red':
stops = [ stops = [
[color_perc_lbound, '#3060CF'], [color_perc_lbound, '#00D1C1'],
[ [
color_perc_lbound + color_perc_lbound +
((color_perc_rbound - color_perc_lbound)/2), ((color_perc_rbound - color_perc_lbound)/2),
'#FFFBBC' '#FFFFCC'
], ],
[color_perc_rbound, '#C4463A'] [color_perc_rbound, '#FF5A5F']
] ]
elif color_scheme == 'blue_scale': elif color_scheme == 'blue_scale':
stops = [ stops = [
@ -1133,3 +1123,14 @@ mv = ChartModelView(
models.Chart, session, models.Chart, session,
name="Charts", category="Tools") name="Charts", category="Tools")
admin.add_view(mv) admin.add_view(mv)
admin.add_link(
base.MenuLink(
category='Docs',
name='@readthedocs.org',
url='http://airflow.readthedocs.org/en/latest/'))
admin.add_link(
base.MenuLink(
category='Docs',
name='Github',
url='https://github.com/mistercrunch/Airflow'))

Просмотреть файл

@ -22,6 +22,17 @@
padding: 8px; padding: 8px;
z-index: 2; z-index: 2;
} }
.panel-heading .accordion-toggle:after {
/* symbol for "opening" panels */
font-family: 'Glyphicons Halflings'; /* essential for enabling glyphicon */
content: "\e114"; /* adjust as needed, taken from bootstrap.css */
float: right; /* adjust as needed */
color: grey; /* adjust as needed */
}
.panel-heading .accordion-toggle.collapsed:after {
/* symbol for "collapsed" panels */
content: "\e080"; /* adjust as needed, taken from bootstrap.css */
}
</style> </style>
{% endblock %} {% endblock %}
{% block title %} {% block title %}
@ -45,10 +56,8 @@
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading" role="tab" id="headingTwo"> <div class="panel-heading" role="tab" id="headingTwo">
<h4 class="panel-title"> <h4 class="panel-title">
<a class="collapsed" data-toggle="collapse" data-parent="#accordion" href="#sql_panel" aria-expanded="true" aria-controls="sql_panel"> <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion" href="#sql_panel" aria-expanded="true" aria-controls="sql_panel">
SQL SQL
<span class="glyphicon glyphicon-chevron-up" aria-hidden="true"></span>
<span class="glyphicon glyphicon-chevron-down" aria-hidden="true"></span>
</a> </a>
</h4> </h4>
</div> </div>
@ -63,10 +72,8 @@
<div id="chart_section" class="panel panel-default"> <div id="chart_section" class="panel panel-default">
<div class="panel-heading" role="tab" id="headingTwo"> <div class="panel-heading" role="tab" id="headingTwo">
<h4 class="panel-title"> <h4 class="panel-title">
<a class="collapsed" data-toggle="collapse" data-parent="#accordion" href="#chart_panel" aria-expanded="true" aria-controls="chart_panel"> <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion" href="#chart_panel" aria-expanded="true" aria-controls="chart_panel">
Chart Chart
<span class="glyphicon glyphicon-chevron-up" aria-hidden="true"></span>
<span class="glyphicon glyphicon-chevron-down" aria-hidden="true"></span>
</a> </a>
</h4> </h4>
</div> </div>
@ -83,10 +90,8 @@
<div id="datatable_section" class="panel panel-default"> <div id="datatable_section" class="panel panel-default">
<div class="panel-heading" role="tab" id="headingTwo"> <div class="panel-heading" role="tab" id="headingTwo">
<h4 class="panel-title"> <h4 class="panel-title">
<a class="collapsed" data-toggle="collapse" data-parent="#accordion" href="#datatable_panel" aria-expanded="true" aria-controls="datatable_panel"> <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion" href="#datatable_panel" aria-expanded="true" aria-controls="datatable_panel">
Data Data
<span class="glyphicon glyphicon-chevron-up" aria-hidden="true"></span>
<span class="glyphicon glyphicon-chevron-down" aria-hidden="true"></span>
</a> </a>
</h4> </h4>
</div> </div>

Просмотреть файл

@ -11,7 +11,7 @@
{% endblock %} {% endblock %}
{% block body %} {% block body %}
<h2>Query</h2> <h2>Ad Hoc Query</h2>
<form method="get"> <form method="get">
<div class="form-inline"> <div class="form-inline">
{{ form.db_id }} {{ form.db_id }}
@ -34,21 +34,23 @@
$( document ).ready(function() { $( document ).ready(function() {
var editor = ace.edit("sql"); var editor = ace.edit("sql");
var textarea = $('textarea[name="sql"]').hide(); var textarea = $('textarea[name="sql"]').hide();
function sync() {
textarea.val(editor.getSession().getValue());
}
editor.setTheme("ace/theme/crimson_editor"); editor.setTheme("ace/theme/crimson_editor");
editor.setOptions({ editor.setOptions({
minLines: 3, minLines: 3,
maxLines: Infinity, maxLines: Infinity,
}); });
editor.getSession().setMode("ace/mode/sql"); editor.getSession().setMode("ace/mode/sql");
editor.getSession().on('change', function(){ editor.getSession().on('change', sync);
textarea.val(editor.getSession().getValue());
});
editor.focus(); editor.focus();
$('table.dataframe').dataTable({ $('table.dataframe').dataTable({
"scrollX": true, "scrollX": true,
"iDisplayLength": 25, "iDisplayLength": 25,
}); });
$('select').addClass("form-control"); $('select').addClass("form-control");
sync();
}); });
</script> </script>
{% endblock %} {% endblock %}