瀏覽代碼

HUE-6948 [indexer] Warn when indexer name is invalid

Romain Rigaux 8 年之前
父節點
當前提交
1071df9
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4 1
      desktop/libs/indexer/src/indexer/templates/importer.mako

+ 4 - 1
desktop/libs/indexer/src/indexer/templates/importer.mako

@@ -1453,7 +1453,10 @@ ${ assist.assistPanel() }
       self.indexingStarted = ko.observable(false);
 
       self.isValidDestination = ko.pureComputed(function() {
-         return self.destination.name().length > 0 && (['table', 'database'].indexOf(self.destination.outputFormat()) == -1 || /^([a-zA-Z0-9_]+\.)?[a-zA-Z0-9_]+$/.test(self.destination.name()));
+         return self.destination.name().length > 0 && (
+           (['table', 'database'].indexOf(self.destination.outputFormat()) == -1 || /^([a-zA-Z0-9_]+\.)?[a-zA-Z0-9_]+$/.test(self.destination.name())) &&
+           (['index'].indexOf(self.destination.outputFormat()) == -1 || /^[^\\/:]+$/.test(self.destination.name()))
+         );
       });
       self.readyToIndex = ko.computed(function () {
         var validFields = self.destination.columns().length || self.destination.outputFormat() == 'database';