|
@@ -34,13 +34,17 @@
|
|
|
|
|
|
|
|
<%namespace name="sqlDocIndex" file="/sql_doc_index.mako" />
|
|
<%namespace name="sqlDocIndex" file="/sql_doc_index.mako" />
|
|
|
(function () {
|
|
(function () {
|
|
|
|
|
+ <%
|
|
|
|
|
+ apps = _get_apps(user)
|
|
|
|
|
+ %>
|
|
|
|
|
+
|
|
|
window.AUTOCOMPLETE_TIMEOUT = ${ conf.EDITOR_AUTOCOMPLETE_TIMEOUT.get() };
|
|
window.AUTOCOMPLETE_TIMEOUT = ${ conf.EDITOR_AUTOCOMPLETE_TIMEOUT.get() };
|
|
|
|
|
|
|
|
window.BANNER_TOP_HTML = '${ conf.CUSTOM.BANNER_TOP_HTML.get() }';
|
|
window.BANNER_TOP_HTML = '${ conf.CUSTOM.BANNER_TOP_HTML.get() }';
|
|
|
|
|
|
|
|
window.CACHEABLE_TTL = {
|
|
window.CACHEABLE_TTL = {
|
|
|
default: ${ conf.CUSTOM.CACHEABLE_TTL.get() },
|
|
default: ${ conf.CUSTOM.CACHEABLE_TTL.get() },
|
|
|
- optimizer: ${ OPTIMIZER.CACHEABLE_TTL.get() }
|
|
|
|
|
|
|
+ optimizer: ${ hasattr(OPTIMIZER, 'ConfigSection') and OPTIMIZER.CACHEABLE_TTL.get() or 0 }
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
window.DEV = '${ conf.DEV.get() }' === 'True';
|
|
window.DEV = '${ conf.DEV.get() }' === 'True';
|
|
@@ -80,13 +84,13 @@
|
|
|
|
|
|
|
|
window.ENABLE_SQL_SYNTAX_CHECK = '${ conf.ENABLE_SQL_SYNTAX_CHECK.get() }' === 'True';
|
|
window.ENABLE_SQL_SYNTAX_CHECK = '${ conf.ENABLE_SQL_SYNTAX_CHECK.get() }' === 'True';
|
|
|
|
|
|
|
|
- window.HAS_CATALOG = '${ has_catalog(request.user) }' === 'True';
|
|
|
|
|
- window.CATALOG_URL = '${ get_catalog_url() }'
|
|
|
|
|
- window.HAS_READ_ONLY_CATALOG = '${ has_readonly_catalog(request.user) }' === 'True' || '${ has_write_access(request.user) }' === 'False';
|
|
|
|
|
|
|
+ window.HAS_CATALOG = '${ 'metadata' in apps and has_catalog(request.user) }' === 'True';
|
|
|
|
|
+ window.CATALOG_URL = '${ 'metadata' in apps and get_catalog_url() or "" }'
|
|
|
|
|
+ window.HAS_READ_ONLY_CATALOG = '${ 'metadata' in apps and has_readonly_catalog(request.user) }' === 'True' || '${ has_write_access(request.user) }' === 'False';
|
|
|
|
|
|
|
|
- window.HAS_OPTIMIZER = '${ has_optimizer() }' === 'True';
|
|
|
|
|
- window.OPTIMIZER_URL = '${ get_optimizer_url() }'
|
|
|
|
|
- window.AUTO_UPLOAD_OPTIMIZER_STATS = '${ OPTIMIZER.AUTO_UPLOAD_STATS.get() }' === 'True';
|
|
|
|
|
|
|
+ window.HAS_OPTIMIZER = '${ 'metadata' in apps and has_optimizer() }' === 'True';
|
|
|
|
|
+ window.OPTIMIZER_URL = '${ 'metadata' in apps and get_optimizer_url() }'
|
|
|
|
|
+ window.AUTO_UPLOAD_OPTIMIZER_STATS = '${ 'metadata' in apps and OPTIMIZER.AUTO_UPLOAD_STATS.get() }' === 'True';
|
|
|
|
|
|
|
|
## In the past was has_workload_analytics()
|
|
## In the past was has_workload_analytics()
|
|
|
window.HAS_WORKLOAD_ANALYTICS = '${ ENABLE_QUERY_ANALYSIS.get() }' === 'True';
|
|
window.HAS_WORKLOAD_ANALYTICS = '${ ENABLE_QUERY_ANALYSIS.get() }' === 'True';
|
|
@@ -103,12 +107,9 @@
|
|
|
window.JB_SINGLE_CHECK_INTERVAL_IN_MILLIS = 5000;
|
|
window.JB_SINGLE_CHECK_INTERVAL_IN_MILLIS = 5000;
|
|
|
window.JB_MULTI_CHECK_INTERVAL_IN_MILLIS = 20000;
|
|
window.JB_MULTI_CHECK_INTERVAL_IN_MILLIS = 20000;
|
|
|
|
|
|
|
|
- <%
|
|
|
|
|
- apps = _get_apps(user)
|
|
|
|
|
- %>
|
|
|
|
|
window.HUE_URLS = {
|
|
window.HUE_URLS = {
|
|
|
- IMPORTER_CREATE_TABLE: '${url('indexer:importer_prefill', source_type = 'all', target_type = 'table')}',
|
|
|
|
|
- IMPORTER_CREATE_DATABASE: '${url('indexer:importer_prefill', source_type = 'manual', target_type = 'database')}',
|
|
|
|
|
|
|
+ IMPORTER_CREATE_TABLE: '${ 'indexer' in apps and url('indexer:importer_prefill', source_type = 'all', target_type = 'table')}',
|
|
|
|
|
+ IMPORTER_CREATE_DATABASE: '${ 'indexer' in apps and url('indexer:importer_prefill', source_type = 'manual', target_type = 'database')}',
|
|
|
NOTEBOOK_INDEX: '${url('notebook:index')}',
|
|
NOTEBOOK_INDEX: '${url('notebook:index')}',
|
|
|
% if 'pig' in apps:
|
|
% if 'pig' in apps:
|
|
|
PIG_INDEX: '${url('pig:index')}',
|
|
PIG_INDEX: '${url('pig:index')}',
|