Skip to content

Commit

Permalink
Adding a DRUID_IS_ACTIVE flag and changing nav bar
Browse files Browse the repository at this point in the history
  • Loading branch information
Niharika Ray committed Mar 25, 2016
1 parent 10a1edd commit fee6b3f
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 17 deletions.
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

0 comments on commit fee6b3f

Please sign in to comment.