|
@@ -1128,13 +1128,14 @@ from notebook.conf import ENABLE_QUERY_BUILDER, ENABLE_QUERY_SCHEDULING, ENABLE_
|
|
|
<!-- ko if: statementType() == 'file' -->
|
|
<!-- ko if: statementType() == 'file' -->
|
|
|
<div class="margin-top-10">
|
|
<div class="margin-top-10">
|
|
|
<label class="pull-left" style="margin-top: 6px;margin-right: 10px;">${_('Query File')}</label>
|
|
<label class="pull-left" style="margin-top: 6px;margin-right: 10px;">${_('Query File')}</label>
|
|
|
- <input type="text" class="pull-left input-xxlarge filechooser-input" data-bind="value: statementPath, valueUpdate: 'afterkeydown', filechooser: statementPath, filechooserOptions: { skipInitialPathIfEmpty: true, linkMarkup: true }" placeholder="${ _('Path to file, e.g. /user/hue/sample.sql, s3a://hue/sample.sql') }"/>
|
|
|
|
|
|
|
+ <input type="text" class="pull-left input-xxlarge filechooser-input" data-bind="value: statementPath, valueUpdate: 'afterkeydown', filechooser: statementPath, filechooserOptions: { skipInitialPathIfEmpty: true, linkMarkup: true }" placeholder="${ _('Path to file, e.g. /user/hue/sample.sql') }"/>
|
|
|
<!-- ko if: statementPath() -->
|
|
<!-- ko if: statementPath() -->
|
|
|
<div class="inline-block" style="margin-top: 4px">
|
|
<div class="inline-block" style="margin-top: 4px">
|
|
|
<a data-bind="attr: { href: '/filebrowser/view=' + statementPath() }" target="_blank" title="${ _('Open in new tab') }">
|
|
<a data-bind="attr: { href: '/filebrowser/view=' + statementPath() }" target="_blank" title="${ _('Open in new tab') }">
|
|
|
<i class="fa fa-external-link-square"></i>
|
|
<i class="fa fa-external-link-square"></i>
|
|
|
</a>
|
|
</a>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+ <a class="btn" data-bind="tooltip: { placement: 'bottom', title: 'Save content back to file' }, click: function() { huePubSub.publish('show.saveToFile.modal'); }"><i class="fa fa-save"></i></a>
|
|
|
<!-- /ko -->
|
|
<!-- /ko -->
|
|
|
</div>
|
|
</div>
|
|
|
<div class="clearfix margin-bottom-20"></div>
|
|
<div class="clearfix margin-bottom-20"></div>
|
|
@@ -1905,6 +1906,18 @@ from notebook.conf import ENABLE_QUERY_BUILDER, ENABLE_QUERY_SCHEDULING, ENABLE_
|
|
|
<!-- /ko -->
|
|
<!-- /ko -->
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
+<div id="saveToFileModal" class="modal hide fade">
|
|
|
|
|
+ <div class="modal-header">
|
|
|
|
|
+ <button type="button" class="close" data-dismiss="modal" aria-label="${ _('Close') }"><span aria-hidden="true">×</span></button>
|
|
|
|
|
+ <h2 class="modal-title">${_('Are you sure you want to save back to File?')}</h2>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <div class="modal-footer">
|
|
|
|
|
+ <a class="btn" data-dismiss="modal">${_('Cancel')}</a>
|
|
|
|
|
+ <input type="button" class="btn btn-primary disable-feedback" value="${_('Save')}" data-dismiss="modal" data-bind="click: function() { huePubSub.publish('save.snippet.to.file'); }"/>
|
|
|
|
|
+ </div>
|
|
|
|
|
+</div>
|
|
|
|
|
+
|
|
|
|
|
|
|
|
<div id="authModal" class="modal hide fade">
|
|
<div id="authModal" class="modal hide fade">
|
|
|
<div class="modal-header">
|
|
<div class="modal-header">
|
|
@@ -2914,6 +2927,10 @@ from notebook.conf import ENABLE_QUERY_BUILDER, ENABLE_QUERY_SCHEDULING, ENABLE_
|
|
|
redrawFixedHeaders(200);
|
|
redrawFixedHeaders(200);
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|
|
+ huePubSub.subscribe('show.saveToFile.modal', function () {
|
|
|
|
|
+ $('#saveToFileModal').modal('show');
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
huePubSub.subscribe('tab.switched', function (tab) {
|
|
huePubSub.subscribe('tab.switched', function (tab) {
|
|
|
if (tab !== 'queryResults') {
|
|
if (tab !== 'queryResults') {
|
|
|
$('.hue-datatable-search').hide();
|
|
$('.hue-datatable-search').hide();
|