{"version":3,"sources":["../src/query_ctrl.js"],"names":["QueryCtrl","GenericDatasourceQueryCtrl","$scope","$injector","scope","target","type","query","datasource","metricFindQuery","rawQuery","panelCtrl","refresh","templateUrl"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAQA,e,kBAAAA,S;;;;;;;;;;;;;;;;;;;;;4CAGKC,0B;;;AAEX,4CAAYC,MAAZ,EAAoBC,SAApB,EAAgC;AAAA;;AAAA,8JACxBD,MADwB,EAChBC,SADgB;;AAG9B,gBAAKC,KAAL,GAAaF,MAAb;AACA,gBAAKG,MAAL,CAAYA,MAAZ,GAAqB,MAAKA,MAAL,CAAYA,MAAZ,IAAsB,eAA3C;AACA,gBAAKA,MAAL,CAAYC,IAAZ,GAAmB,MAAKD,MAAL,CAAYC,IAAZ,IAAoB,WAAvC;AAL8B;AAM/B;;;;qCAEUC,K,EAAO;AAChB,mBAAO,KAAKC,UAAL,CAAgBC,eAAhB,CAAgCF,SAAS,EAAzC,CAAP;AACD;;;6CAEkB;AACjB,iBAAKF,MAAL,CAAYK,QAAZ,GAAuB,CAAC,KAAKL,MAAL,CAAYK,QAApC;AACD;;;6CAEkB;AACjB,iBAAKC,SAAL,CAAeC,OAAf,GADiB,CACS;AAC3B;;;;QApB6CZ,S;;;;AAuBhDC,iCAA2BY,WAA3B,GAAyC,4BAAzC","file":"query_ctrl.js","sourcesContent":["import {QueryCtrl} from 'app/plugins/sdk';\nimport './css/query-editor.css!'\n\nexport class GenericDatasourceQueryCtrl extends QueryCtrl {\n\n constructor($scope, $injector) {\n super($scope, $injector);\n\n this.scope = $scope;\n this.target.target = this.target.target || 'select metric';\n this.target.type = this.target.type || 'timeserie';\n }\n\n getOptions(query) {\n return this.datasource.metricFindQuery(query || '');\n }\n\n toggleEditorMode() {\n this.target.rawQuery = !this.target.rawQuery;\n }\n\n onChangeInternal() {\n this.panelCtrl.refresh(); // Asks the panel to refresh data.\n }\n}\n\nGenericDatasourceQueryCtrl.templateUrl = 'partials/query.editor.html';\n\n"]}