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>
|
||||
</button>
|
||||
<hr>
|
||||
<button type="button" class="btn btn-primary" id="druidify">Druidify!</button>
|
||||
<button type="button" class="btn btn-default" id="bookmark">Bookmark</button>
|
||||
<button type="button" class="btn btn-primary" id="druidify">
|
||||
<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;">
|
||||
<img src="{{ url_for("static", filename="tux_panoramix.png") }}" width=250>
|
||||
<input type="hidden" id="slice_name" name="slice_name" value="TEST">
|
||||
|
@ -188,7 +194,7 @@
|
|||
});
|
||||
}
|
||||
$("#plus").click(add_filter);
|
||||
$("#bookmark").click(function () {
|
||||
$("#save").click(function () {
|
||||
var slice_name = prompt("Name your slice!");
|
||||
$("#slice_name").val(slice_name);
|
||||
$.get( "/panoramix/save/", $("#query").serialize() );
|
||||
|
|
|
@ -285,14 +285,24 @@ class Panoramix(BaseView):
|
|||
d = request.args.to_dict(flat=False)
|
||||
as_list = ('metrics', 'groupby')
|
||||
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]]
|
||||
|
||||
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(
|
||||
params=json.dumps(d, indent=4),
|
||||
viz_type=request.args.get('viz_type'),
|
||||
datasource_name=request.args.get('datasource_name'),
|
||||
datasource_id=request.args.get('datasource_id'),
|
||||
datasource_type=request.args.get('datasource_type'),
|
||||
druid_datasource_id=druid_datasource_id,
|
||||
table_id=table_id,
|
||||
datasource_type=datasource_type,
|
||||
slice_name=request.args.get('slice_name', 'junk'),
|
||||
)
|
||||
session.add(obj)
|
||||
|
|
Loading…
Reference in New Issue