Skip to content

Commit 12e20ca

Browse files
committed
Merge pull request apache#197 from NiharikaRay/master
Adding a DRUID_IS_ACTIVE flag and changing nav bar
2 parents 0ccc19f + fee6b3f commit 12e20ca

File tree

2 files changed

+23
-17
lines changed

2 files changed

+23
-17
lines changed

dashed/config.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
# tz.tzutc() : Using utc timezone
5454
# tz.tzlocal() : Using local timezone
5555
# other tz can be overridden by providing a local_config
56+
DRUID_IS_ACTIVE = True
5657
DRUID_TZ = tz.tzutc()
5758

5859
# ----------------------------------------------------

dashed/views.py

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -207,12 +207,14 @@ class DruidClusterModelView(DashedModelView, DeleteMixin): # noqa
207207
edit_columns = add_columns
208208
list_columns = ['cluster_name', 'metadata_last_refreshed']
209209

210-
appbuilder.add_view(
211-
DruidClusterModelView,
212-
"Druid Clusters",
213-
icon="fa-cubes",
214-
category="Sources",
215-
category_icon='fa-database',)
210+
211+
if config['DRUID_IS_ACTIVE']:
212+
appbuilder.add_view(
213+
DruidClusterModelView,
214+
"Druid Clusters",
215+
icon="fa-cubes",
216+
category="Sources",
217+
category_icon='fa-database',)
216218

217219

218220
class SliceModelView(DashedModelView, DeleteMixin): # noqa
@@ -326,11 +328,12 @@ def post_add(self, datasource):
326328
def post_update(self, datasource):
327329
self.post_add(datasource)
328330

329-
appbuilder.add_view(
330-
DruidDatasourceModelView,
331-
"Druid Datasources",
332-
category="Sources",
333-
icon="fa-cube")
331+
if config['DRUID_IS_ACTIVE']:
332+
appbuilder.add_view(
333+
DruidDatasourceModelView,
334+
"Druid Datasources",
335+
category="Sources",
336+
icon="fa-cube")
334337

335338

336339
@app.route('/health')
@@ -778,12 +781,14 @@ def featured(self):
778781
utils=utils)
779782

780783
appbuilder.add_view_no_menu(Dashed)
781-
appbuilder.add_link(
782-
"Refresh Druid Metadata",
783-
href='/dashed/refresh_datasources/',
784-
category='Sources',
785-
category_icon='fa-database',
786-
icon="fa-cog")
784+
785+
if config['DRUID_IS_ACTIVE']:
786+
appbuilder.add_link(
787+
"Refresh Druid Metadata",
788+
href='/dashed/refresh_datasources/',
789+
category='Sources',
790+
category_icon='fa-database',
791+
icon="fa-cog")
787792

788793

789794
class CssTemplateModelView(DashedModelView, DeleteMixin):

0 commit comments

Comments
 (0)