Skip to content

Commit 942736b

Browse files
Quick Start in React
wip
1 parent 4781ba6 commit 942736b

File tree

19 files changed

+442
-577
lines changed

19 files changed

+442
-577
lines changed

apps/about/src/about/templates/admin_wizard.mako

+2-295
Original file line numberDiff line numberDiff line change
@@ -14,306 +14,13 @@
1414
## See the License for the specific language governing permissions and
1515
## limitations under the License.
1616

17-
<%!
18-
import sys
19-
20-
from django.urls import reverse
21-
22-
from metadata.conf import OPTIMIZER, has_optimizer
23-
24-
from desktop.auth.backend import is_admin
25-
from desktop.conf import has_connectors
26-
from desktop.views import commonheader, commonfooter
27-
28-
if sys.version_info[0] > 2:
29-
from django.utils.translation import gettext as _
30-
else:
31-
from django.utils.translation import ugettext as _
32-
%>
3317

3418
<%namespace name="layout" file="/about_layout.mako" />
3519

36-
% if not is_embeddable:
37-
${ commonheader(_('Quick Start'), "quickstart", user, request, "70px") | n,unicode }
38-
% endif
39-
4020
${ layout.menubar(section='quick_start') }
4121

42-
<div class="container-fluid" id="adminWizardComponents">
43-
<div class="row-fluid" style="margin-bottom: 100px;">
44-
<div>
45-
<h1 class="margin-top-20 margin-bottom-30">
46-
% if is_admin(user):
47-
${ _('Quick Start') } -
48-
% endif
49-
<a href="https://gethue.com" target="_blank" title="${ _('Open Hue\'s website in a new tab') }">
50-
Hue&trade;
51-
${ version }
52-
</a>
53-
-
54-
Query. Explore. Repeat.
55-
</h1>
56-
57-
% if is_admin(user):
58-
<div class="margin-bottom-30">
59-
<div class="row-fluid">
60-
61-
<div class="span2">
62-
<ul class="nav nav-pills nav-vertical-pills">
63-
<li class="active"><a href="#step1" class="step">${ _('Step 1:') } <i class="fa fa-check"></i> ${ _('Checks') }</a></li>
64-
<li><a href="#step2" class="step">${ _('Step 2:') } <i class="fa fa-exchange"></i> ${ _('Connectors') }</a></li>
65-
<li><a href="#step3" class="step">${ _('Step 3:') } <i class="fa fa-book"></i> ${ _('Examples') }</a></li>
66-
<li><a id="lastStep" href="#step4" class="step">${ _('Step 4:') } <i class="fa fa-group"></i> ${ _('Users') }</a></li>
67-
</ul>
68-
</div>
69-
70-
<div class="span10 steps">
71-
<div id="step1" class="stepDetails">
72-
<div>
73-
<h3>${ _('Checking current configuration') }</h3>
74-
75-
<div id="check-config-section" class="margin-bottom-20">
76-
<div class="spinner">
77-
<i class="fa fa-spinner fa-spin" style="font-size: 60px; color: #DDD"></i>
78-
</div>
79-
<div class="info hide"></div>
80-
</div>
81-
</div>
82-
</div>
83-
84-
<div id="step2" class="stepDetails hide">
85-
<h3>${ _('Add connectors to data services') }</h3>
86-
87-
% if has_connectors():
88-
<span id="connectorCounts">...</span> ${ _('connectors installed') }
89-
90-
<ul class="unstyled samples margin-top-20">
91-
<li>
92-
<a href="${ url('desktop.lib.connectors.views.index') }" title="${ _('Open the connector configuration page') }">
93-
<i class="fa fa-plus"></i> ${ _('Add a Database') }
94-
</a>
95-
</li>
96-
<li>
97-
<a href="javascript:void(0)" class="installBtn" title="${ _('Install the connector examples') }" data-is-connector="true"
98-
data-loading-text="${ _('Installing...') }" data-sample-url="${ url('connectors.api.install_connector_examples') }">
99-
<i class="fa fa-download"></i> ${ _('Install examples') }
100-
</a>
101-
</li>
102-
</ul>
103-
% else:
104-
<a href="${ url('desktop.views.dump_config') }" target="_blank">${ _('Configuration') }</a>
105-
<br>
106-
<a href="https://docs.gethue.com/administrator/configuration/" target="_blank">${ _('Documentation') }</a>
107-
% endif
108-
</div>
109-
110-
<div id="step3" class="stepDetails hide">
111-
<div>
112-
<h3>${ _('Install some data examples') }</h3>
113-
<ul class="unstyled samples">
114-
115-
% if has_connectors():
116-
<!-- ko foreach: connectors -->
117-
<!-- ko if: ['hive', 'impala', 'mysql', 'postgresql', 'presto', 'phoenix', 'flink', 'ksql'].indexOf(dialect) != -1 -->
118-
<li>
119-
<a href="javascript:void(0)" data-bind="click: $root.installConnectorDataExample">
120-
<i class="fa fa-download"></i> <span data-bind="text: name"></span>
121-
</a>
122-
</li>
123-
<!-- /ko -->
124-
<!-- /ko -->
125-
126-
<li>
127-
<div id="check-config-section" class="margin-bottom-20" data-bind="visible: isInstallingSample">
128-
<div class="spinner">
129-
<i class="fa fa-spinner fa-spin" style="font-size: 60px; color: #DDD"></i>
130-
</div>
131-
</div>
132-
</li>
133-
% else:
134-
% if 'hive' in app_names:
135-
<li>
136-
<a href="javascript:void(0)" class="installBtn" data-loading-text="${ _('Installing...') }"
137-
data-sample-url="${ url('beeswax:install_examples') }">
138-
<i class="fa fa-download"></i> ${ apps['beeswax'].nice_name }
139-
</a>
140-
</li>
141-
% endif
142-
% if 'impala' in app_names:
143-
<li>
144-
<a href="javascript:void(0)" class="installBtn" data-loading-text="${ _('Installing...') }"
145-
data-sample-url="${ url('impala:install_examples') }">
146-
<i class="fa fa-download"></i> ${ apps['impala'].nice_name }
147-
</a>
148-
</li>
149-
% endif
150-
% if has_optimizer() and OPTIMIZER.QUERY_HISTORY_UPLOAD_LIMIT.get() > 0:
151-
<li>
152-
<a href="javascript:void(0)" class="installBtn" data-loading-text="${ _('Uploading...') }"
153-
data-sample-url="${ url('metadata:upload_history') }" title="${ _('Send and analyze past %s executed queries to provide smarter SQL recommendations') % OPTIMIZER.QUERY_HISTORY_UPLOAD_LIMIT.get() }">
154-
<i class="fa fa-download"></i> ${ _('SQL Query history') }
155-
</a>
156-
</li>
157-
% endif
158-
% if 'search' in app_names:
159-
<li>
160-
<a href="javascript:void(0)" class="installAllBtn" data-loading-text="${ _('Installing...') }"
161-
data-sample-url="${ url('search:install_examples') }" data-sample-data='["log_analytics_demo", "twitter_demo", "yelp_demo"]'>
162-
<i class="fa fa-download"></i> ${ apps['search'].nice_name }
163-
</a>
164-
</li>
165-
% endif
166-
% if 'spark' in app_names:
167-
<li>
168-
<a href="javascript:void(0)" class="installBtn" data-loading-text="${ _('Installing...') }"
169-
data-sample-url="${ url('notebook:install_examples') }">
170-
<i class="fa fa-download"></i> ${ apps['spark'].nice_name }
171-
</a>
172-
</li>
173-
% endif
174-
% if 'oozie' in app_names:
175-
<li>
176-
<a href="javascript:void(0)" class="installBtn" data-loading-text="${ _('Installing...') }"
177-
data-sample-url="${ url('oozie:install_examples') }">
178-
<i class="fa fa-download"></i> ${ apps['oozie'].nice_name }
179-
</a>
180-
</li>
181-
% endif
182-
% if 'hbase' in app_names:
183-
<li>
184-
<a href="javascript:void(0)" class="installBtn" data-loading-text="${ _('Installing...') }"
185-
data-sample-url="${ url('hbase:install_examples') }">
186-
<i class="fa fa-download"></i> ${ apps['hbase'].nice_name }
187-
</a>
188-
</li>
189-
% endif
190-
% if 'pig' in app_names:
191-
<li>
192-
<a href="javascript:void(0)" class="installBtn" data-loading-text="${ _('Installing...') }"
193-
data-sample-url="${ url('pig:install_examples') }">
194-
<i class="fa fa-download"></i> ${ apps['pig'].nice_name }
195-
</a>
196-
</li>
197-
% endif
198-
% if 'oozie' in app_names:
199-
<li>
200-
<a href="javascript:void(0)" class="installBtn" data-loading-text="${ _('Installing...') }"
201-
data-sample-url="${ url('oozie:install_examples') }">
202-
<i class="fa fa-download"></i> ${ _('Job Editor') }
203-
</a>
204-
</li>
205-
% elif 'jobsub' in app_names:
206-
<li>
207-
<a href="javascript:void(0)" class="installBtn" data-loading-text="${ _('Installing...') }"
208-
data-sample-url="${ url('oozie:install_examples') }">
209-
<i class="fa fa-download"></i> ${ apps['jobsub'].nice_name }
210-
</a>
211-
</li>
212-
% endif
213-
% endif
214-
</ul>
215-
</div>
216-
</div>
217-
218-
<div id="step4" class="stepDetails hide">
219-
<div>
220-
<h3>${ _('Create or import users') }</h3>
221-
<a href="${ url('useradmin:useradmin.views.list_users') }"
222-
% if not is_embeddable:
223-
target="_blank"
224-
% endif
225-
><i class="fa fa-user"></i> ${ _('User Admin') }</a>
226-
</div>
227-
228-
<div class="margin-top-30">
229-
<h3>${ _('Anonymous usage analytics') }</h3>
230-
<label class="checkbox">
231-
<input class="updatePreferences" type="checkbox" name="collect_usage" style="margin-right: 10px"
232-
title="${ _('Check to enable usage analytics') }" ${ collect_usage and 'checked' or '' }/>
233-
${ _('Help improve Hue with anonymous usage analytics.') }
234-
<a href="javascript:void(0)" style="display: inline" data-trigger="hover" data-toggle="popover"
235-
data-placement="right" rel="popover"
236-
title="${ _('How does it work?') }"
237-
data-content="${ _('Hue is using Google Analytics to see how many times an application or specific section of an application is used, nothing more.') }">
238-
<i class="fa fa-question-circle"></i>
239-
</a>
240-
</label>
241-
</div>
242-
243-
% if not is_embeddable:
244-
<div class="margin-top-30">
245-
<h3>${ _('Skip wizard next time') }</h3>
246-
<label class="checkbox">
247-
<input id="updateSkipWizard" type="checkbox" style="margin-right: 10px" title="${ _('Check to skip this wizard next time.') }"/>
248-
${ _('Skip the Quick Start Wizard at next login and land directly on your starred application.') }
249-
</label>
250-
</div>
251-
% endif
252-
253-
</div>
254-
</div>
255-
256-
</div>
257-
</div>
258-
<div class="card-body">
259-
<div class="form-actions">
260-
<a id="backBtn" class="btn disabled">${ _('Back') }</a>
261-
<a id="nextBtn" class="btn btn-primary disable-feedback">${ _('Next') }</a>
262-
<a id="doneBtn" class="btn btn-primary disable-feedback hide">${ _('Done') }</a>
263-
<span class="pull-right muted" style="padding-right:30px">${ _('Hue and the Hue logo are trademarks of Cloudera, Inc.') }</span>
264-
</div>
265-
</div>
266-
% else:
267-
<div class="card-body">
268-
<p>
269-
${ _('Learn more about Hue and SQL Querying on') } <a href="https://gethue.com" target="_blank">https://gethue.com</a>.
270-
<br/>
271-
<br/>
272-
<span class="pull-right muted">${ _('Hue and the Hue logo are trademarks of Cloudera, Inc.') }</span>
273-
% if not user.is_authenticated:
274-
<br/>
275-
<a href="${ url('desktop_views_home2') }" class="btn btn-primary" style="margin-top: 50px;margin-bottom: 20px">
276-
<i class="fa fa-sign-in"></i> ${ _('Sign in now!') }
277-
</a>
278-
% endif
279-
</p>
280-
</div>
281-
% endif
282-
283-
</div>
284-
</div>
285-
22+
<div id="Overview">
23+
<OverviewTab class='antd cuix' data-reactcomponent='Overview'></OverviewTab>
28624
</div>
28725

288-
% if is_admin(user):
289-
<style type="text/css">
290-
.steps {
291-
min-height: 300px;
292-
}
293-
294-
input[type=submit] {
295-
margin-left: 50px;
296-
}
297-
298-
ul.samples li {
299-
padding-bottom: 5px;
300-
}
301-
302-
.nav-pills.nav-vertical-pills li {
303-
float: none;
304-
margin-bottom: 10px;
305-
}
306-
307-
.nav-pills.nav-vertical-pills li a {
308-
line-height: 20px;
309-
}
310-
311-
</style>
312-
313-
<script src="${ static('desktop/js/hue.routie.js') }" type="text/javascript" charset="utf-8"></script>
31426
<script src="${ static('desktop/js/admin-wizard-inline.js') }" type="text/javascript"></script>
315-
% endif
316-
317-
% if not is_embeddable:
318-
${ commonfooter(request, messages) | n,unicode }
319-
% endif

apps/about/src/about/views.py

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ def admin_wizard(request):
3131
else:
3232
apps = []
3333
app_names = [app.name for app in sorted(apps, key=lambda app: app.menu_index)]
34+
# instead of here, move this to config
3435

3536
return render('admin_wizard.mako', request, {
3637
'version': hue_version(),

desktop/core/src/desktop/api2.py

+3
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,9 @@ def get_config(request):
148148
config['storage_browser']['enable_extract_uploaded_archive'] = ENABLE_EXTRACT_UPLOADED_ARCHIVE.get()
149149
config['clusters'] = list(get_clusters(request.user).values())
150150
config['documents'] = {'types': list(Document2.objects.documents(user=request.user).order_by().values_list('type', flat=True).distinct())}
151+
apps = appmanager.get_apps(request.user)
152+
app_names = [app.name for app in sorted(apps, key=lambda app: app.menu_index)]
153+
config['app_names'] = app_names
151154
config['status'] = 0
152155

153156
return JsonResponse(config)

desktop/core/src/desktop/api_public.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def download_hue_logs(request):
7171
return logs_api.download_hue_logs(django_request)
7272

7373

74-
@api_view(["POST"])
74+
@api_view(["GET"])
7575
def check_config(request):
7676
django_request = get_django_request(request)
7777
return desktop_api.check_config(django_request)

0 commit comments

Comments
 (0)