Skip to content

Commit

Permalink
Superset additions initial commit dtable, email func
Browse files Browse the repository at this point in the history
  • Loading branch information
rorymillersoft committed Sep 30, 2020
1 parent b205ce3 commit 31f527f
Show file tree
Hide file tree
Showing 31 changed files with 1,303 additions and 361 deletions.
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,5 @@ zipp==3.1.0 # via importlib-metadata

# The following packages are considered to be unsafe in a requirements file:
# setuptools

beautifulsoup4==4.9.1
19 changes: 16 additions & 3 deletions superset/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@
from superset.typing import FlaskResponse
from superset.utils.core import pessimistic_connection_handling
from superset.utils.log import DBEventLogger, get_event_logger_from_cfg_value
from superset.dtable.mod_tables.models import TableBuilder
from superset.dtable.mod_tables.controllers import tables


logger = logging.getLogger(__name__)

Expand All @@ -59,7 +62,7 @@ def create_app() -> Flask:

app_initializer = app.config.get("APP_INITIALIZER", SupersetAppInitializer)(app)
app_initializer.init_app()

app.register_blueprint(tables)
return app

# Make sure that bootstrap errors ALWAYS get logged
Expand Down Expand Up @@ -144,7 +147,7 @@ def init_views(self) -> None:
AnnotationModelView,
)
from superset.views.api import Api
from superset.views.core import Superset
from superset.views.core import Superset, DataTableView
from superset.views.redirects import R
from superset.views.key_value import KV
from superset.views.access_requests import AccessRequestsModelView
Expand All @@ -166,6 +169,7 @@ def init_views(self) -> None:
from superset.views.schedules import (
DashboardEmailScheduleView,
SliceEmailScheduleView,
S3ScheduleView,
)
from superset.views.sql_lab import (
QueryView,
Expand Down Expand Up @@ -241,6 +245,7 @@ def init_views(self) -> None:
category_label=__("Manage"),
category_icon="",
)

appbuilder.add_view(
QueryView,
"Queries",
Expand All @@ -266,9 +271,9 @@ def init_views(self) -> None:
appbuilder.add_view_no_menu(CssTemplateAsyncModelView)
appbuilder.add_view_no_menu(CsvToDatabaseView)
appbuilder.add_view_no_menu(Dashboard)
appbuilder.add_view_no_menu(DataTableView())
appbuilder.add_view_no_menu(DashboardModelViewAsync)
appbuilder.add_view_no_menu(Datasource)

if feature_flag_manager.is_feature_enabled("KV_STORE"):
appbuilder.add_view_no_menu(KV)

Expand Down Expand Up @@ -369,6 +374,14 @@ def init_views(self) -> None:
category_label=__("Manage"),
icon="fa-search",
)
appbuilder.add_view(
S3ScheduleView,
"S3 Schedule",
label=__("S3 Export Schedules"),
category="Manage",
category_label=__("Manage"),
icon="fa-search",
)

#
# Conditionally add Access Request Model View
Expand Down
16 changes: 16 additions & 0 deletions superset/common/routes.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from flask import Blueprint, render_template

main = Blueprint('main', __name__, url_prefix='')


@main.route("/")
def index():
return render_template("index.html")

@main.route("/clientside_table")
def clientside_table():
return render_template("clientside_table.html")

@main.route("/serverside_table")
def serverside_table():
return render_template("serverside_table.html")
16 changes: 16 additions & 0 deletions superset/dtable/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from flask import Flask, redirect, session
from superset.dtable.mod_tables.models import TableBuilder


flask_app = Flask(__name__)

table_builder = TableBuilder()


from superset.dtable.common.routes import main
from superset.dtable.mod_tables.controllers import tables


# Register the different blueprints
flask_app.register_blueprint(main)
flask_app.register_blueprint(tables)
Empty file.
16 changes: 16 additions & 0 deletions superset/dtable/common/routes.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from flask import Blueprint, render_template

main = Blueprint('main', __name__, url_prefix='/dtable')


@main.route("/")
def index():
return render_template("index.html")

@main.route("/clientside_table")
def clientside_table():
return render_template("clientside_table.html")

@main.route("/serverside_table")
def serverside_table():
return render_template("serverside_table.html")
4 changes: 4 additions & 0 deletions superset/dtable/config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FLASK_ENV=development
debug=True
DEBUG=True
Debug=True
144 changes: 144 additions & 0 deletions superset/dtable/css/jquery.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
.dataTables_wrapper .dataTables_paginate {
float:right;
text-align:right;
padding-top:0.25em
}
.dataTables_wrapper .dataTables_paginate .paginate_button {
box-sizing:border-box;
display:inline-block;
min-width:1.5em;
padding:0.5em 1em;
margin-left:2px;
text-align:center;
text-decoration:none !important;
cursor:pointer;
*cursor:hand;
color:#333 !important;
border:1px solid transparent;
border-radius:2px
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
color:#333 !important;
border:1px solid #979797;
background-color:white;
background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #fff), color-stop(100%, #dcdcdc));
background:-webkit-linear-gradient(top, #fff 0%, #dcdcdc 100%);
background:-moz-linear-gradient(top, #fff 0%, #dcdcdc 100%);
background:-ms-linear-gradient(top, #fff 0%, #dcdcdc 100%);
background:-o-linear-gradient(top, #fff 0%, #dcdcdc 100%);
background:linear-gradient(to bottom, #fff 0%, #dcdcdc 100%)
}
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover,
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:active {
cursor:default;
color:#666 !important;
border:1px solid transparent;
background:transparent;
box-shadow:none
}
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
color:white !important;
border:1px solid #111;
background-color:#585858;
background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #585858), color-stop(100%, #111));
background:-webkit-linear-gradient(top, #585858 0%, #111 100%);
background:-moz-linear-gradient(top, #585858 0%, #111 100%);
background:-ms-linear-gradient(top, #585858 0%, #111 100%);
background:-o-linear-gradient(top, #585858 0%, #111 100%);
background:linear-gradient(to bottom, #585858 0%, #111 100%)
}
.dataTables_wrapper .dataTables_paginate .paginate_button:active {
outline:none;
background-color:#2b2b2b;
background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #2b2b2b), color-stop(100%, #0c0c0c));
background:-webkit-linear-gradient(top, #2b2b2b 0%, #0c0c0c 100%);
background:-moz-linear-gradient(top, #2b2b2b 0%, #0c0c0c 100%);
background:-ms-linear-gradient(top, #2b2b2b 0%, #0c0c0c 100%);
background:-o-linear-gradient(top, #2b2b2b 0%, #0c0c0c 100%);
background:linear-gradient(to bottom, #2b2b2b 0%, #0c0c0c 100%);
box-shadow:inset 0 0 3px #111
}
.dataTables_wrapper .dataTables_paginate .ellipsis {
padding:0 1em
}
.dataTables_wrapper .dataTables_processing {
position:absolute;
top:50%;
left:50%;
width:100%;
height:40px;
margin-left:-50%;
margin-top:-25px;
padding-top:20px;
text-align:center;
font-size:1.2em;
background-color:white;
background:-webkit-gradient(linear, left top, right top, color-stop(0%, rgba(255,255,255,0)), color-stop(25%, rgba(255,255,255,0.9)), color-stop(75%, rgba(255,255,255,0.9)), color-stop(100%, rgba(255,255,255,0)));
background:-webkit-linear-gradient(left, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 25%, rgba(255,255,255,0.9) 75%, rgba(255,255,255,0) 100%);
background:-moz-linear-gradient(left, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 25%, rgba(255,255,255,0.9) 75%, rgba(255,255,255,0) 100%);
background:-ms-linear-gradient(left, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 25%, rgba(255,255,255,0.9) 75%, rgba(255,255,255,0) 100%);
background:-o-linear-gradient(left, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 25%, rgba(255,255,255,0.9) 75%, rgba(255,255,255,0) 100%);
background:linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 25%, rgba(255,255,255,0.9) 75%, rgba(255,255,255,0) 100%)
}
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_processing,
.dataTables_wrapper .dataTables_paginate {
color:#333
}
.dataTables_wrapper .dataTables_scroll {
clear:both
}
.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody {
*margin-top:-1px;
-webkit-overflow-scrolling:touch
}
.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody th,
.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody td {
vertical-align:middle
}
.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody th>div.dataTables_sizing,
.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody td>div.dataTables_sizing {
height:0;
overflow:hidden;
margin:0 !important;
padding:0 !important
}
.dataTables_wrapper.no-footer .dataTables_scrollBody {
border-bottom:1px solid #111
}
.dataTables_wrapper.no-footer div.dataTables_scrollHead table,
.dataTables_wrapper.no-footer div.dataTables_scrollBody table {
border-bottom:none
}
.dataTables_wrapper:after {
visibility:hidden;
display:block;
content:"";
clear:both;
height:0
}
@media screen and (max-width: 767px) {
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
float:none;
text-align:center
}
.dataTables_wrapper .dataTables_paginate {
margin-top:0.5em
}
}
@media screen and (max-width: 640px) {
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
float:none;
text-align:center
}
.dataTables_wrapper .dataTables_filter {
margin-top:0.5em
}
}

Empty file.
Empty file.
Loading

0 comments on commit 31f527f

Please sign in to comment.