Selaa lähdekoodia

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

Romain Rigaux 8 vuotta sitten
vanhempi
commit
1071df964c
1 muutettua tiedostoa jossa 4 lisäystä ja 1 poistoa
  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.indexingStarted = ko.observable(false);
 
 
       self.isValidDestination = ko.pureComputed(function() {
       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 () {
       self.readyToIndex = ko.computed(function () {
         var validFields = self.destination.columns().length || self.destination.outputFormat() == 'database';
         var validFields = self.destination.columns().length || self.destination.outputFormat() == 'database';