Ver código fonte

[elasticsearch] Do not set a placeholder to index name, if it's already specified.

stop-cran 7 anos atrás
pai
commit
20214b3d6a

+ 8 - 4
public/app/plugins/datasource/elasticsearch/config_ctrl.ts

@@ -28,9 +28,13 @@ export class ElasticConfigCtrl {
   ];
 
   indexPatternTypeChanged() {
-    const def = _.find(this.indexPatternTypes, {
-      value: this.current.jsonData.interval,
-    });
-    this.current.database = def.example || 'es-index-name';
+    if (!this.current.database ||
+        this.current.database.length === 0 ||
+        this.current.database.startsWith('[logstash-]')) {
+        const def = _.find(this.indexPatternTypes, {
+          value: this.current.jsonData.interval,
+        });
+        this.current.database = def.example || 'es-index-name';
+    }
   }
 }