EVOLUTION-MANAGER
Edit File: DataSourceDashboards.4d0490a94b199a11f40c.js
(window.webpackJsonp=window.webpackJsonp||[]).push([[9],{"5BCB":function(e,t,r){"use strict";var n=r("mrSG"),a=r("ZFWI"),i=r("NXk7"),o=r("WnbS"),u=r("3SGO"),c=r("HUMP"),s=r("okuo"),d=r("Vw/f"),l=r("FFN/"),f=r("Obii");function p(e){var t,r,a,i,o,u,c,s,d=[{id:"tsdb",title:"Time series databases",plugins:[]},{id:"logging",title:"Logging & document databases",plugins:[]},{id:"sql",title:"SQL",plugins:[]},{id:"cloud",title:"Cloud",plugins:[]},{id:"enterprise",title:"Enterprise plugins",plugins:[]},{id:"other",title:"Others",plugins:[]}],l={},p={},m=[b({id:"grafana-splunk-datasource",name:"Splunk",description:"Visualize & explore Splunk logs",imgUrl:"public/img/plugins/splunk_logo_128.png"}),b({id:"grafana-oracle-datasource",name:"Oracle",description:"Visualize & explore Oracle SQL",imgUrl:"public/img/plugins/oracle.png"}),b({id:"grafana-dynatrace-datasource",name:"Dynatrace",description:"Visualize & explore Dynatrace data",imgUrl:"public/img/plugins/dynatrace.png"}),b({id:"grafana-servicenow-datasource",description:"ServiceNow integration & data source",name:"ServiceNow",imgUrl:"public/img/plugins/servicenow.svg"}),b({id:"grafana-datadog-datasource",description:"DataDog integration & data source",name:"DataDog",imgUrl:"public/img/plugins/datadog.png"}),b({id:"grafana-newrelic-datasource",description:"New Relic integration & data source",name:"New Relic",imgUrl:"public/img/plugins/newrelic.svg"})];try{for(var h=Object(n.__values)(d),v=h.next();!v.done;v=h.next()){var y=v.value;l[y.id]=y}}catch(e){t={error:e}}finally{try{v&&!v.done&&(r=h.return)&&r.call(h)}finally{if(t)throw t.error}}var O=function(e){var t,r;if(m.find(function(t){return t.id===e.id})&&(e.category="enterprise"),e.info.links)try{for(var a=(t=void 0,Object(n.__values)(e.info.links)),i=a.next();!i.done;i=a.next()){i.value.name="Learn more"}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}(d.find(function(t){return t.id===e.category})||l.other).plugins.push(e),p[e.id]=e};try{for(var j=Object(n.__values)(e),_=j.next();!_.done;_=j.next()){O(I=_.value)}}catch(e){a={error:e}}finally{try{_&&!_.done&&(i=j.return)&&i.call(j)}finally{if(a)throw a.error}}try{for(var w=Object(n.__values)(d),S=w.next();!S.done;S=w.next()){if("cloud"===(y=S.value).id&&y.plugins.push({id:"gcloud",name:"Grafana Cloud",type:f.PluginType.datasource,module:"phantom",baseUrl:"",info:{description:"Hosted Graphite, Prometheus and Loki",logos:{small:"public/img/grafana_icon.svg",large:"asd"},author:{name:"Grafana Labs"},links:[{url:"https://grafana.com/products/cloud/",name:"Learn more"}],screenshots:[],updated:"2019-05-10",version:"1.0.0"}}),"enterprise"===y.id)try{for(var D=(c=void 0,Object(n.__values)(m)),x=D.next();!x.done;x=D.next()){var I=x.value;p[I.id]||y.plugins.push(I)}}catch(e){c={error:e}}finally{try{x&&!x.done&&(s=D.return)&&s.call(D)}finally{if(c)throw c.error}}g(y.plugins)}}catch(e){o={error:e}}finally{try{S&&!S.done&&(u=w.return)&&u.call(w)}finally{if(o)throw o.error}}return d}function g(e){var t={prometheus:100,graphite:95,loki:90,mysql:80,postgres:79,gcloud:-1};e.sort(function(e,r){var n=t[e.id]||0,a=t[r.id]||0;return n>a?-1:n<a?1:e.name>r.name?-1:1})}function b(e){return{id:e.id,name:e.name,type:f.PluginType.datasource,module:"phantom",baseUrl:"",info:{description:e.description,logos:{small:e.imgUrl,large:e.imgUrl},author:{name:"Grafana Labs"},links:[{url:"https://grafana.com/grafana/plugins/"+e.id,name:"Install now"}],screenshots:[],updated:"2019-05-10",version:"1.0.0"}}}var m=r("frIo");r.d(t,"c",function(){return h}),r.d(t,"g",function(){return v}),r.d(t,"f",function(){return y}),r.d(t,"d",function(){return O}),r.d(t,"a",function(){return j}),r.d(t,"e",function(){return _}),r.d(t,"h",function(){return w}),r.d(t,"b",function(){return S});var h=function(e,t){return void 0===t&&(t={loadDataSource:O,getDataSource:m.a,getDataSourceMeta:m.b,importDataSourcePlugin:d.b}),function(r,a){return Object(n.__awaiter)(void 0,void 0,void 0,function(){var i,o,u,c;return Object(n.__generator)(this,function(n){switch(n.label){case 0:if(isNaN(e))return r(Object(l.g)(new Error("Invalid ID"))),[2];n.label=1;case 1:return n.trys.push([1,4,,5]),[4,r(t.loadDataSource(e))];case 2:return n.sent(),a().dataSourceSettings.plugin?[2]:(i=t.getDataSource(a().dataSources,e),o=t.getDataSourceMeta(a().dataSources,i.type),[4,t.importDataSourcePlugin(o)]);case 3:return u=n.sent(),r(Object(l.h)(u)),[3,5];case 4:return c=n.sent(),console.log("Failed to import plugin module",c),r(Object(l.g)(c)),[3,5];case 5:return[2]}})})}},v=function(e,t){return void 0===t&&(t={getDatasourceSrv:o.a,getBackendSrv:i.b}),function(r,a){return Object(n.__awaiter)(void 0,void 0,void 0,function(){var a;return Object(n.__generator)(this,function(i){switch(i.label){case 0:return[4,t.getDatasourceSrv().get(e)];case 1:return(a=i.sent()).testDatasource?(r(Object(l.o)()),t.getBackendSrv().withNoBackendCache(function(){return Object(n.__awaiter)(void 0,void 0,void 0,function(){var e,t,i;return Object(n.__generator)(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,a.testDatasource()];case 1:return e=n.sent(),r(Object(l.p)(e)),[3,3];case 2:return t=n.sent(),i="",i=t.statusText?"HTTP Error "+t.statusText:t.message,r(Object(l.n)({message:i})),[3,3];case 3:return[2]}})})}),[2]):[2]}})})}};function y(){var e=this;return function(t){return Object(n.__awaiter)(e,void 0,void 0,function(){var e;return Object(n.__generator)(this,function(r){switch(r.label){case 0:return[4,Object(i.b)().get("/api/datasources")];case 1:return e=r.sent(),t(Object(l.e)(e)),[2]}})})}}function O(e){var t=this;return function(r){return Object(n.__awaiter)(t,void 0,void 0,function(){var t,a,o;return Object(n.__generator)(this,function(n){switch(n.label){case 0:return[4,Object(i.b)().get("/api/datasources/"+e)];case 1:return t=n.sent(),[4,Object(s.a)(t.type)];case 2:return a=n.sent(),[4,Object(d.b)(a)];case 3:return o=n.sent(),r(Object(l.a)(t)),r(Object(l.b)(a)),r(Object(u.d)(Object(c.a)(t,o))),[2]}})})}}function j(e){var t=this;return function(r,a){return Object(n.__awaiter)(t,void 0,void 0,function(){var t,o,c;return Object(n.__generator)(this,function(n){switch(n.label){case 0:return[4,r(y())];case 1:return n.sent(),t=a().dataSources.dataSources,o={name:e.name,type:e.id,access:"proxy",isDefault:0===t.length},D(t,o.name)&&(o.name=function(e,t){for(;D(e,t);)I(t)?t=""+E(t)+(r=k(t),isNaN(r)?1:r+1):t+="-1";var r;return t}(t,o.name)),[4,Object(i.b)().post("/api/datasources",o)];case 2:return c=n.sent(),r(Object(u.c)({path:"/datasources/edit/"+c.id})),[2]}})})}}function _(){var e=this;return function(t){return Object(n.__awaiter)(e,void 0,void 0,function(){var e,r;return Object(n.__generator)(this,function(n){switch(n.label){case 0:return t(Object(l.c)()),[4,Object(i.b)().get("/api/plugins",{enabled:1,type:"datasource"})];case 1:return e=n.sent(),r=p(e),t(Object(l.d)({plugins:e,categories:r})),[2]}})})}}function w(e){var t=this;return function(r){return Object(n.__awaiter)(t,void 0,void 0,function(){return Object(n.__generator)(this,function(t){switch(t.label){case 0:return[4,Object(i.b)().put("/api/datasources/"+e.id,e)];case 1:return t.sent(),[4,x()];case 2:return t.sent(),[2,r(O(e.id))]}})})}}function S(){var e=this;return function(t,r){return Object(n.__awaiter)(e,void 0,void 0,function(){var e;return Object(n.__generator)(this,function(n){switch(n.label){case 0:return e=r().dataSources.dataSource,[4,Object(i.b)().delete("/api/datasources/"+e.id)];case 1:return n.sent(),[4,x()];case 2:return n.sent(),t(Object(u.c)({path:"/datasources"})),[2]}})})}}function D(e,t){return e.filter(function(e){return e.name.toLowerCase()===t.toLowerCase()}).length>0}function x(){return Object(i.b)().get("/api/frontend/settings").then(function(e){a.b.datasources=e.datasources,a.b.defaultDatasource=e.defaultDatasource,Object(o.a)().init()})}function I(e){return e.endsWith("-",e.length-1)}function k(e){return parseInt(e.slice(-1),10)}function E(e){return e.slice(0,e.length-1)}},BLAY:function(e,t,r){"use strict";r.r(t),function(e){r.d(t,"DataSourceDashboards",function(){return m});var n=r("mrSG"),a=r("q1tI"),i=r.n(a),o=r("0cfB"),u=r("/MKj"),c=r("ZGyg"),s=r("vHOe"),d=r("lzJ5"),l=r("X+V3"),f=r("5BCB"),p=r("jGYO"),g=r("J4KJ"),b=r("frIo"),m=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.onImport=function(e,r){var n=t.props,a=n.dataSource,i=n.importDashboard,o={pluginId:e.pluginId,path:e.path,overwrite:r,inputs:[]};a&&o.inputs.push({name:"*",type:"datasource",pluginId:a.type,value:a.name}),i(o,e.title)},t.onRemove=function(e){t.props.removeDashboard(e.importedUri)},t}return Object(n.__extends)(t,e),t.prototype.componentDidMount=function(){return Object(n.__awaiter)(this,void 0,void 0,function(){var e,t,r;return Object(n.__generator)(this,function(n){switch(n.label){case 0:return e=this.props,t=e.loadDataSource,r=e.pageId,[4,t(r)];case 1:return n.sent(),this.props.loadPluginDashboards(),[2]}})})},t.prototype.render=function(){var e=this,t=this.props,r=t.dashboards,n=t.navModel,a=t.isLoading;return i.a.createElement(c.a,{navModel:n},i.a.createElement(c.a.Contents,{isLoading:a},i.a.createElement(s.a,{dashboards:r,onImport:function(t,r){return e.onImport(t,r)},onRemove:function(t){return e.onRemove(t)}})))},t}(a.PureComponent);var h={importDashboard:g.j,loadDataSource:f.d,loadPluginDashboards:p.a,removeDashboard:g.l};t.default=Object(o.hot)(e)(Object(u.connect)(function(e){var t=Object(l.a)(e.location);return{navModel:Object(d.a)(e.navIndex,"datasource-dashboards-"+t),pageId:t,dashboards:e.plugins.dashboards,dataSource:Object(b.a)(e.dataSources,t),isLoading:e.plugins.isLoadingPluginDashboards}},h)(m))}.call(this,r("3UD+")(e))},HUMP:function(e,t,r){"use strict";r.d(t,"a",function(){return o}),r.d(t,"b",function(){return u});var n=r("mrSG"),a=r("Obii"),i=r("ZFWI");function o(e,t){var r,a,o=t.meta,u={img:o.info.logos.large,id:"datasource-"+e.id,subTitle:"Type: "+o.name,url:"",text:e.name,breadcrumbs:[{title:"Data Sources",url:"datasources"}],children:[{active:!1,icon:"fa fa-fw fa-sliders",id:"datasource-settings-"+e.id,text:"Settings",url:"datasources/edit/"+e.id+"/"}]};if(t.configPages)try{for(var c=Object(n.__values)(t.configPages),s=c.next();!s.done;s=c.next()){var d=s.value;u.children.push({active:!1,text:d.title,icon:d.icon,url:"datasources/edit/"+e.id+"/?page="+d.id,id:"datasource-page-"+d.id})}}catch(e){r={error:e}}finally{try{s&&!s.done&&(a=c.return)&&a.call(c)}finally{if(r)throw r.error}}return o.includes&&void 0!==o.includes.find(function(e){return"dashboard"===e.type})&&u.children.push({active:!1,icon:"fa fa-fw fa-th-large",id:"datasource-dashboards-"+e.id,text:"Dashboards",url:"datasources/edit/"+e.id+"/dashboards"}),i.b.licenseInfo.hasLicense&&u.children.push({active:!1,icon:"fa fa-fw fa-lock",id:"datasource-permissions-"+e.id,text:"Permissions",url:"datasources/edit/"+e.id+"/permissions"}),u}function u(e){var t,r,i,u=o({access:"",basicAuth:!1,basicAuthUser:"",basicAuthPassword:"",withCredentials:!1,database:"",id:1,isDefault:!1,jsonData:{authType:"credentials",defaultRegion:"eu-west-2"},name:"Loading",orgId:1,password:"",readOnly:!1,type:"Loading",typeLogoUrl:"public/img/icn-datasource.svg",url:"",user:""},{meta:{id:"1",type:a.PluginType.datasource,name:"",info:{author:{name:"",url:""},description:"",links:[{name:"",url:""}],logos:{large:"",small:""},screenshots:[],updated:"",version:""},includes:[],module:"",baseUrl:""}});try{for(var c=Object(n.__values)(u.children),s=c.next();!s.done;s=c.next()){var d=s.value;if(d.id.indexOf(e)>0){d.active=!0,i=d;break}}}catch(e){t={error:e}}finally{try{s&&!s.done&&(r=c.return)&&r.call(c)}finally{if(t)throw t.error}}return{main:u,node:i}}},frIo:function(e,t,r){"use strict";r.d(t,"d",function(){return n}),r.d(t,"c",function(){return a}),r.d(t,"a",function(){return i}),r.d(t,"b",function(){return o}),r.d(t,"g",function(){return u}),r.d(t,"f",function(){return c}),r.d(t,"e",function(){return s});var n=function(e){var t=new RegExp(e.searchQuery,"i");return e.dataSources.filter(function(e){return t.test(e.name)||t.test(e.database)})},a=function(e){var t=new RegExp(e.dataSourceTypeSearchQuery,"i");return e.plugins.filter(function(e){return t.test(e.name)})},i=function(e,t){return e.dataSource.id===parseInt(t,10)?e.dataSource:{}},o=function(e,t){return e.dataSourceMeta.id===t?e.dataSourceMeta:{}},u=function(e){return e.searchQuery},c=function(e){return e.layoutMode},s=function(e){return e.dataSourcesCount}},vHOe:function(e,t,r){"use strict";var n=r("q1tI"),a=r.n(n);t.a=function(e){var t=e.dashboards,r=e.onImport,n=e.onRemove;return a.a.createElement("table",{className:"filter-table"},a.a.createElement("tbody",null,t.map(function(e,t){return a.a.createElement("tr",{key:e.dashboardId+"-"+t},a.a.createElement("td",{className:"width-1"},a.a.createElement("i",{className:"gicon gicon-dashboard"})),a.a.createElement("td",null,e.imported?a.a.createElement("a",{href:e.importedUrl},e.title):a.a.createElement("span",null,e.title)),a.a.createElement("td",{style:{textAlign:"right"}},e.imported?a.a.createElement("button",{className:"btn btn-secondary btn-small",onClick:function(){return r(e,!0)}},function(e){return e.revision!==e.importedRevision?"Update":"Re-import"}(e)):a.a.createElement("button",{className:"btn btn-secondary btn-small",onClick:function(){return r(e,!1)}},"Import"),e.imported&&a.a.createElement("button",{className:"btn btn-danger btn-small",onClick:function(){return n(e)}},a.a.createElement("i",{className:"fa fa-trash"}))))})))}}}]); //# sourceMappingURL=DataSourceDashboards.4d0490a94b199a11f40c.js.map