Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding a DRUID_IS_ACTIVE flag and changing nav bar #197

Merged
merged 1 commit into from
Mar 26, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions dashed/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
# tz.tzutc() : Using utc timezone
# tz.tzlocal() : Using local timezone
# other tz can be overridden by providing a local_config
DRUID_IS_ACTIVE = True
DRUID_TZ = tz.tzutc()

# ----------------------------------------------------
Expand Down
39 changes: 22 additions & 17 deletions dashed/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,12 +207,14 @@ class DruidClusterModelView(DashedModelView, DeleteMixin): # noqa
edit_columns = add_columns
list_columns = ['cluster_name', 'metadata_last_refreshed']

appbuilder.add_view(
DruidClusterModelView,
"Druid Clusters",
icon="fa-cubes",
category="Sources",
category_icon='fa-database',)

if config['DRUID_IS_ACTIVE']:
appbuilder.add_view(
DruidClusterModelView,
"Druid Clusters",
icon="fa-cubes",
category="Sources",
category_icon='fa-database',)


class SliceModelView(DashedModelView, DeleteMixin): # noqa
Expand Down Expand Up @@ -326,11 +328,12 @@ def post_add(self, datasource):
def post_update(self, datasource):
self.post_add(datasource)

appbuilder.add_view(
DruidDatasourceModelView,
"Druid Datasources",
category="Sources",
icon="fa-cube")
if config['DRUID_IS_ACTIVE']:
appbuilder.add_view(
DruidDatasourceModelView,
"Druid Datasources",
category="Sources",
icon="fa-cube")


@app.route('/health')
Expand Down Expand Up @@ -778,12 +781,14 @@ def featured(self):
utils=utils)

appbuilder.add_view_no_menu(Dashed)
appbuilder.add_link(
"Refresh Druid Metadata",
href='/dashed/refresh_datasources/',
category='Sources',
category_icon='fa-database',
icon="fa-cog")

if config['DRUID_IS_ACTIVE']:
appbuilder.add_link(
"Refresh Druid Metadata",
href='/dashed/refresh_datasources/',
category='Sources',
category_icon='fa-database',
icon="fa-cog")


class CssTemplateModelView(DashedModelView, DeleteMixin):
Expand Down