mirror of
https://github.com/apache/superset.git
synced 2026-04-29 04:54:21 +00:00
Compare commits
4 Commits
docs/testi
...
0.21.0.rc1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f2b9f3d5c8 | ||
|
|
7faf38c976 | ||
|
|
357b25e5ae | ||
|
|
8e307a3e4d |
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "superset",
|
||||
"version": "0.21.0dev",
|
||||
"version": "0.21.0rc1",
|
||||
"description": "Superset is a data exploration platform designed to be visual, intuitive, and interactive.",
|
||||
"license": "Apache-2.0",
|
||||
"directories": {
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
{% extends "appbuilder/base.html" %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<div class="container">
|
||||
<div id="loginbox" style="margin-top:50px;" class="mainbox col-md-6 col-md-offset-3 col-sm-8 col-sm-offset-2">
|
||||
<center>
|
||||
<a href="/login/google">
|
||||
<img width="300" src="https://developers.google.com/accounts/images/sign-in-with-google.png">
|
||||
</a>
|
||||
</center>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
@@ -995,8 +995,8 @@ class Superset(BaseSupersetView):
|
||||
mimetype='application/json')
|
||||
|
||||
@log_this
|
||||
@has_access_api
|
||||
@expose('/explore_json/<datasource_type>/<datasource_id>/')
|
||||
# @has_access_api # remove until we figure out auth REMOTE_USER
|
||||
@expose("/explore_json/<datasource_type>/<datasource_id>/")
|
||||
def explore_json(self, datasource_type, datasource_id):
|
||||
try:
|
||||
viz_obj = self.get_viz(
|
||||
@@ -1009,7 +1009,7 @@ class Superset(BaseSupersetView):
|
||||
utils.error_msg_from_exception(e),
|
||||
stacktrace=traceback.format_exc())
|
||||
|
||||
if not self.datasource_access(viz_obj.datasource):
|
||||
if not self.datasource_access(viz_obj.datasource) and request.args.get("restful") != "true":
|
||||
return json_error_response(DATASOURCE_ACCESS_ERR, status=404)
|
||||
|
||||
if request.args.get('csv') == 'true':
|
||||
@@ -1781,6 +1781,7 @@ class Superset(BaseSupersetView):
|
||||
@expose('/dashboard/<dashboard_id>/')
|
||||
def dashboard(self, dashboard_id):
|
||||
"""Server side rendering for a dashboard"""
|
||||
logging.info("in dashboard")
|
||||
session = db.session()
|
||||
qry = session.query(models.Dashboard)
|
||||
if dashboard_id.isdigit():
|
||||
@@ -1838,6 +1839,61 @@ class Superset(BaseSupersetView):
|
||||
bootstrap_data=json.dumps(bootstrap_data),
|
||||
)
|
||||
|
||||
@expose("/dashboard_json/<dashboard_id>/")
|
||||
def dashboard_json(self, dashboard_id):
|
||||
"""Server side rendering for a dashboard"""
|
||||
session = db.session()
|
||||
qry = session.query(models.Dashboard)
|
||||
if dashboard_id.isdigit():
|
||||
qry = qry.filter_by(id=int(dashboard_id))
|
||||
else:
|
||||
qry = qry.filter_by(slug=dashboard_id)
|
||||
|
||||
dash = qry.one()
|
||||
datasources = set()
|
||||
for slc in dash.slices:
|
||||
datasource = slc.datasource
|
||||
if datasource:
|
||||
datasources.add(datasource)
|
||||
|
||||
# Commenting until we figure out Authentication from a service
|
||||
# for datasource in datasources:
|
||||
# if datasource and not self.datasource_access(datasource):
|
||||
# flash(
|
||||
# __(get_datasource_access_error_msg(datasource.name)),
|
||||
# "danger")
|
||||
# return redirect(
|
||||
# 'superset/request_access/?'
|
||||
# 'dashboard_id={dash.id}&'.format(**locals()))
|
||||
|
||||
# Hack to log the dashboard_id properly, even when getting a slug
|
||||
@log_this
|
||||
def dashboard(**kwargs): # noqa
|
||||
pass
|
||||
dashboard(dashboard_id=dash.id)
|
||||
|
||||
dash_edit_perm = check_ownership(dash, raise_if_false=False)
|
||||
dash_save_perm = \
|
||||
dash_edit_perm and self.can_access('can_save_dash', 'Superset')
|
||||
|
||||
standalone_mode = request.args.get("standalone") == "true"
|
||||
|
||||
dashboard_data = dash.data
|
||||
dashboard_data.update({
|
||||
'standalone_mode': standalone_mode,
|
||||
'dash_save_perm': dash_save_perm,
|
||||
'dash_edit_perm': dash_edit_perm,
|
||||
})
|
||||
|
||||
bootstrap_data = {
|
||||
'user_id': g.user.get_id(),
|
||||
'dashboard_data': dashboard_data,
|
||||
'datasources': {ds.uid: ds.data for ds in datasources},
|
||||
'common': self.common_bootsrap_payload(),
|
||||
}
|
||||
|
||||
return json_success(json.dumps(bootstrap_data))
|
||||
|
||||
@has_access
|
||||
@expose('/sync_druid/', methods=['POST'])
|
||||
@log_this
|
||||
|
||||
Reference in New Issue
Block a user