|
@@ -256,7 +256,7 @@ except ImportError, e:
|
|
|
${ _('Table') }
|
|
${ _('Table') }
|
|
|
</label>
|
|
</label>
|
|
|
<div data-bind="visible: saveTarget() == 'hive-table'" class="inline">
|
|
<div data-bind="visible: saveTarget() == 'hive-table'" class="inline">
|
|
|
- <input data-bind="hivechooser: savePath" type="text" name="target_table" class="input-xlarge margin-left-10" placeholder="${_('Table name or <database>.<table>')}">
|
|
|
|
|
|
|
+ <input data-bind="hivechooser: savePath" type="text" name="target_table" class="input-xlarge margin-left-10" pattern="^[a-zA-Z0-9_]*$" title="${ _('Only alphanumeric and underscore characters') }" placeholder="${_('Table name or <database>.<table>')}">
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -278,7 +278,7 @@ except ImportError, e:
|
|
|
</div>
|
|
</div>
|
|
|
<div class="modal-footer">
|
|
<div class="modal-footer">
|
|
|
<button class="btn" data-dismiss="modal">${_('Cancel')}</button>
|
|
<button class="btn" data-dismiss="modal">${_('Cancel')}</button>
|
|
|
- <button data-bind="click: trySaveResults, css: {'disabled': isPathEmpty}" class="btn btn-primary disable-feedback">${_('Save')}</button>
|
|
|
|
|
|
|
+ <button data-bind="click: trySaveResults, css: {'disabled': ! isValidDestination()}" class="btn btn-primary disable-feedback">${_('Save')}</button>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
@@ -331,12 +331,12 @@ except ImportError, e:
|
|
|
|
|
|
|
|
self.checkDownloadInterval = -1;
|
|
self.checkDownloadInterval = -1;
|
|
|
|
|
|
|
|
- self.isPathEmpty = ko.pureComputed(function () {
|
|
|
|
|
- return self.savePath() === '';
|
|
|
|
|
|
|
+ self.isValidDestination = ko.pureComputed(function () {
|
|
|
|
|
+ return self.savePath() !== '' && (self.saveTarget() != 'hive-table' || /^[a-zA-Z0-9_]*$/.test(self.savePath()));
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
self.trySaveResults = function () {
|
|
self.trySaveResults = function () {
|
|
|
- if (!self.isPathEmpty()) {
|
|
|
|
|
|
|
+ if (self.isValidDestination()) {
|
|
|
self.saveResults();
|
|
self.saveResults();
|
|
|
$("#saveResultsModal button.btn-primary").button('loading');
|
|
$("#saveResultsModal button.btn-primary").button('loading');
|
|
|
$("#saveResultsModal .loader").show();
|
|
$("#saveResultsModal .loader").show();
|