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(
base.MenuLink(
category='Tools',
name='Query',
name='Ad Hoc 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):
@ -269,13 +259,13 @@ class Airflow(BaseView):
if color_scheme == 'blue_red':
stops = [
[color_perc_lbound, '#3060CF'],
[color_perc_lbound, '#00D1C1'],
[
color_perc_lbound +
((color_perc_rbound - color_perc_lbound)/2),
'#FFFBBC'
'#FFFFCC'
],
[color_perc_rbound, '#C4463A']
[color_perc_rbound, '#FF5A5F']
]
elif color_scheme == 'blue_scale':
stops = [
@ -1133,3 +1123,14 @@ mv = ChartModelView(
models.Chart, session,
name="Charts", category="Tools")
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;
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>
{% endblock %}
{% block title %}
@ -45,10 +56,8 @@
<div class="panel panel-default">
<div class="panel-heading" role="tab" id="headingTwo">
<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
<span class="glyphicon glyphicon-chevron-up" aria-hidden="true"></span>
<span class="glyphicon glyphicon-chevron-down" aria-hidden="true"></span>
</a>
</h4>
</div>
@ -63,10 +72,8 @@
<div id="chart_section" class="panel panel-default">
<div class="panel-heading" role="tab" id="headingTwo">
<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
<span class="glyphicon glyphicon-chevron-up" aria-hidden="true"></span>
<span class="glyphicon glyphicon-chevron-down" aria-hidden="true"></span>
</a>
</h4>
</div>
@ -83,10 +90,8 @@
<div id="datatable_section" class="panel panel-default">
<div class="panel-heading" role="tab" id="headingTwo">
<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
<span class="glyphicon glyphicon-chevron-up" aria-hidden="true"></span>
<span class="glyphicon glyphicon-chevron-down" aria-hidden="true"></span>
</a>
</h4>
</div>

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

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