浏览代码

HUE-8330 [quickstart] Add connector setup step

Romain Rigaux 6 年之前
父节点
当前提交
35c756b6e3

+ 11 - 6
apps/about/src/about/templates/admin_wizard.mako

@@ -22,14 +22,15 @@ from django.utils.translation import ugettext as _
 from metadata.conf import OPTIMIZER, has_optimizer
 
 from desktop.auth.backend import is_admin
+from desktop.conf import CONNECTORS
 from desktop.views import commonheader, commonfooter
 %>
 
 <%namespace name="layout" file="/about_layout.mako" />
 
-%if not is_embeddable:
+% if not is_embeddable:
 ${ commonheader(_('Quick Start'), "quickstart", user, request, "70px") | n,unicode }
-%endif
+% endif
 
 ${ layout.menubar(section='quick_start') }
 
@@ -44,14 +45,13 @@ ${ layout.menubar(section='quick_start') }
       </h1>
 
      % if is_admin(user):
-
       <div class="margin-bottom-30">
          <div class="row-fluid">
 
            <div class="span2">
             <ul class="nav nav-pills nav-vertical-pills">
               <li class="active"><a href="#step1" class="step">${ _('Step 1:') } <i class="fa fa-cogs"></i> ${ _('Check Configuration') }</a></li>
-              <li><a href="#step2" class="step">${ _('Step 2:') } <i class="fa fa-icon-exchange"></i> ${ _('Connectors') }</a></li>
+              <li><a href="#step2" class="step">${ _('Step 1:') } <i class="fa fa-exchange"></i> ${ _('Connectors') }</a></li>
               <li><a href="#step3" class="step">${ _('Step 3:') } <i class="fa fa-book"></i> ${ _('Examples') }</a></li>
               <li><a id="lastStep" href="#step4" class="step">${ _('Step 4:') } <i class="fa fa-group"></i> ${ _('Users') }</a></li>
             </ul>
@@ -73,7 +73,12 @@ ${ layout.menubar(section='quick_start') }
           </div>
 
           <div id="step2" class="stepDetails hide">
-
+            <h3>${ _('Configure connectors to data services') }</h3>
+            % if CONNECTORS.IS_ENABLED.get():
+              <a href="${ url('desktop.lib.connectors.views.index') }"><i class="fa fa-exchange"></i> ${ _('Connectors') }</a>
+            % else:
+              <a href="http://gethue.com" target="_blank"><i class="fa fa-exchange"></i> ${ _('Connectors') }</a>
+            % endif
           </div>
 
           <div id="step3" class="stepDetails hide">
@@ -201,7 +206,7 @@ ${ layout.menubar(section='quick_start') }
           </div>
           </div>
 
-          </div>
+        </div>
       </div>
       <div class="card-body">
         <div class="form-actions">

+ 11 - 9
desktop/core/src/desktop/lib/connectors/models.py

@@ -23,16 +23,18 @@ from django.db.models.query import QuerySet
 from django.utils.translation import ugettext as _, ugettext_lazy as _t
 
 
-class Connectors(models.Model):
-  type = models.CharField(max_length=32, db_index=True, help_text=_t('Type of connector, e.g. hive-tez, '))  # Must be in lib
+# TODO: persistence and migrations
 
-  name = models.CharField(default='', max_length=255)
-  description = models.TextField(default='')
-  uuid = models.CharField(default=uuid_default, max_length=36, db_index=True)
+# class Connectors(models.Model):
+#   type = models.CharField(max_length=32, db_index=True, help_text=_t('Type of connector, e.g. hive-tez, '))  # Must be in lib
 
-  category = models.CharField(max_length=32, db_index=True, help_text=_t('Type of connector, e.g. query, browser, catalog...'))
-  interface = models.CharField(max_length=32, db_index=True, help_text=_t('Type of connector, e.g. hiveserver2'))
+#   name = models.CharField(default='', max_length=255)
+#   description = models.TextField(default='')
+#   uuid = models.CharField(default=uuid_default, max_length=36, db_index=True)
 
-  settings = models.TextField(default='{}')
+#   category = models.CharField(max_length=32, db_index=True, help_text=_t('Type of connector, e.g. query, browser, catalog...'))
+#   interface = models.CharField(max_length=32, db_index=True, help_text=_t('Type of connector, e.g. hiveserver2'))
 
-  last_modified = models.DateTimeField(auto_now=True, db_index=True, verbose_name=_t('Time last modified'))
+#   settings = models.TextField(default='{}')
+
+#   last_modified = models.DateTimeField(auto_now=True, db_index=True, verbose_name=_t('Time last modified'))

+ 0 - 8
desktop/core/src/desktop/models.py

@@ -1584,12 +1584,6 @@ class ClusterConfig():
     editors = app_config.get('editor')
     main_button_action = self.get_main_quick_action(app_config)
 
-    # Actually same references in editors
-    interpreters = [interpreter for interpreter in editors['interpreters'] if not interpreter['is_catalog']]
-    interpreter_names = [interpreter['type'] for interpreter in interpreters]
-    editors['interpreters'] = interpreters
-    editors['interpreter_names'] = interpreter_names
-
     if main_button_action.get('is_sql'):
       default_sql_interpreter = main_button_action['type']
     else:
@@ -1677,7 +1671,6 @@ class ClusterConfig():
         'tooltip': _('%s Query') % interpreter['type'].title(),
         'page': '/editor/?type=%(type)s' % interpreter,
         'is_sql': interpreter['is_sql'],
-        'is_catalog': interpreter['is_catalog']
       })
 
     if SHOW_NOTEBOOKS.get() and ANALYTIC_DB not in self.cluster_type:
@@ -1693,7 +1686,6 @@ class ClusterConfig():
         'tooltip': _('Notebook'),
         'page': '/notebook',
         'is_sql': False,
-        'is_catalog': False
       })
 
     if interpreters:

+ 0 - 1
desktop/libs/notebook/src/notebook/conf.py

@@ -91,7 +91,6 @@ def get_ordered_interpreters(user=None):
       "interface": i['interface'],
       "options": i['options'],
       "is_sql": i['interface'] in ["hiveserver2", "rdbms", "jdbc", "solr", "sqlalchemy", "hms"],
-      "is_catalog": i['interface'] in ["hms",]
     }
     for i in reordered_interpreters
   ]