Javascript 将maxDataPoints放入grafana数据源中
我正在使用grafana 5.1.4。我构建了一个自定义数据源。但是属性maxDataPoints no在datasource配置中显示 这是我的文件结构: query.options.html中的我的代码:Javascript 将maxDataPoints放入grafana数据源中,javascript,dashboard,grafana,Javascript,Dashboard,Grafana,我正在使用grafana 5.1.4。我构建了一个自定义数据源。但是属性maxDataPoints no在datasource配置中显示 这是我的文件结构: query.options.html中的我的代码: <section class="grafana-metric-options"> <div class="gf-form"> </div> <div class="gf-form-inline"> <div class="gf
<section class="grafana-metric-options">
<div class="gf-form">
</div>
<div class="gf-form-inline">
<div class="gf-form max-width-15">
<span class="gf-form-label">Max data points</span>
<input type="text"
class="gf-form-input"
ng-model="ctrl.panelCtrl.panel.maxDataPoints"
bs-tooltip="'Override max data points, automatically set to graph width in pixels.'"
data-placement="right"
ng-model-onblur ng-change="ctrl.panelCtrl.refresh()"
spellcheck='false'
placeholder="auto">
</input>
</div>
</div>
Q:我可以访问
plugin.json
的属性值吗?如果是,我如何从控制器访问maxDataPoints
属性
A:您只能访问plugin.json
中的部分属性值。这些值可以在PluginMeta
类中找到,它的一个实例可以在Datasource
类的instanceSettings.meta
变量中找到
不幸的是,maxDataPoints
属性不是您可以访问的属性之一
如果您有一个有效的用例
,您可以尝试输入一个pull请求,请求Grafana团队为您公开它
这个e决定从所有plugin.json
向客户端提供什么。是的,如果要公开maxDataPoint
属性,则必须扩展该代码
"queryOptions": {
"maxDataPoints": true
}