diff --git a/dashed/config.py b/dashed/config.py index 915b9a9e5ae48..31a79904350a6 100644 --- a/dashed/config.py +++ b/dashed/config.py @@ -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() # ---------------------------------------------------- diff --git a/dashed/views.py b/dashed/views.py index 42aff9407860e..b43b43243a417 100644 --- a/dashed/views.py +++ b/dashed/views.py @@ -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 @@ -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') @@ -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):