mirror of https://github.com/apache/superset.git
Bugfixes
This commit is contained in:
parent
f6753afa75
commit
cd09b0ddef
|
@ -94,8 +94,14 @@
|
||||||
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
|
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
|
||||||
</button>
|
</button>
|
||||||
<hr>
|
<hr>
|
||||||
<button type="button" class="btn btn-primary" id="druidify">Druidify!</button>
|
<button type="button" class="btn btn-primary" id="druidify">
|
||||||
<button type="button" class="btn btn-default" id="bookmark">Bookmark</button>
|
<i class="fa fa-bolt"></i>
|
||||||
|
Druidify!
|
||||||
|
</button>
|
||||||
|
<button type="button" class="btn btn-default" id="save">
|
||||||
|
<i class="fa fa-save"></i>
|
||||||
|
Save as Slice
|
||||||
|
</button>
|
||||||
<hr style="margin-bottom: 0px;">
|
<hr style="margin-bottom: 0px;">
|
||||||
<img src="{{ url_for("static", filename="tux_panoramix.png") }}" width=250>
|
<img src="{{ url_for("static", filename="tux_panoramix.png") }}" width=250>
|
||||||
<input type="hidden" id="slice_name" name="slice_name" value="TEST">
|
<input type="hidden" id="slice_name" name="slice_name" value="TEST">
|
||||||
|
@ -188,7 +194,7 @@
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
$("#plus").click(add_filter);
|
$("#plus").click(add_filter);
|
||||||
$("#bookmark").click(function () {
|
$("#save").click(function () {
|
||||||
var slice_name = prompt("Name your slice!");
|
var slice_name = prompt("Name your slice!");
|
||||||
$("#slice_name").val(slice_name);
|
$("#slice_name").val(slice_name);
|
||||||
$.get( "/panoramix/save/", $("#query").serialize() );
|
$.get( "/panoramix/save/", $("#query").serialize() );
|
||||||
|
|
|
@ -285,14 +285,24 @@ class Panoramix(BaseView):
|
||||||
d = request.args.to_dict(flat=False)
|
d = request.args.to_dict(flat=False)
|
||||||
as_list = ('metrics', 'groupby')
|
as_list = ('metrics', 'groupby')
|
||||||
for m in as_list:
|
for m in as_list:
|
||||||
if d[m] and not isinstance(d[m]):
|
v = d.get(m)
|
||||||
|
if v and not isinstance(d[m], list):
|
||||||
d[m] = [d[m]]
|
d[m] = [d[m]]
|
||||||
|
|
||||||
|
table_id = druid_datasource_id = None
|
||||||
|
datasource_type = request.args.get('datasource_type')
|
||||||
|
if datasource_type == 'druid':
|
||||||
|
druid_datasource_id = request.args.get('datasource_id')
|
||||||
|
else:
|
||||||
|
table_id = request.args.get('datasource_id')
|
||||||
|
|
||||||
obj = models.Slice(
|
obj = models.Slice(
|
||||||
params=json.dumps(d, indent=4),
|
params=json.dumps(d, indent=4),
|
||||||
viz_type=request.args.get('viz_type'),
|
viz_type=request.args.get('viz_type'),
|
||||||
datasource_name=request.args.get('datasource_name'),
|
datasource_name=request.args.get('datasource_name'),
|
||||||
datasource_id=request.args.get('datasource_id'),
|
druid_datasource_id=druid_datasource_id,
|
||||||
datasource_type=request.args.get('datasource_type'),
|
table_id=table_id,
|
||||||
|
datasource_type=datasource_type,
|
||||||
slice_name=request.args.get('slice_name', 'junk'),
|
slice_name=request.args.get('slice_name', 'junk'),
|
||||||
)
|
)
|
||||||
session.add(obj)
|
session.add(obj)
|
||||||
|
|
Loading…
Reference in New Issue