Initial ES6 migration. module.js and datasource.js are migrated to ES6.
This commit is contained in:
61
src/datasource-zabbix/partials/annotations.editor.html
Normal file
61
src/datasource-zabbix/partials/annotations.editor.html
Normal file
@@ -0,0 +1,61 @@
|
||||
<div class="editor-row">
|
||||
<div class="section tight-form-container" style="margin-bottom: 20px">
|
||||
<h5>Filter Triggers</h5>
|
||||
<div class="tight-form">
|
||||
<ul class="tight-form-list">
|
||||
<li class="tight-form-item" style="width: 80px">
|
||||
Group
|
||||
</li>
|
||||
<li>
|
||||
<input type="text"
|
||||
ng-model="annotation.group"
|
||||
class="input-large tight-form-input">
|
||||
</li>
|
||||
<li class="tight-form-item" style="width: 50px">
|
||||
Host
|
||||
</li>
|
||||
<li>
|
||||
<input type="text"
|
||||
ng-model="annotation.host"
|
||||
class="input-large tight-form-input last">
|
||||
</li>
|
||||
</ul>
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
<div class="tight-form">
|
||||
<ul class="tight-form-list">
|
||||
<li class="tight-form-item" style="width: 80px">
|
||||
Application
|
||||
</li>
|
||||
<li>
|
||||
<input type="text"
|
||||
ng-model="annotation.application"
|
||||
class="input-large tight-form-input">
|
||||
</li>
|
||||
<li class="tight-form-item" style="width: 50px">
|
||||
Trigger
|
||||
</li>
|
||||
<li>
|
||||
<input type="text"
|
||||
ng-model="annotation.trigger"
|
||||
class="input-large tight-form-input last">
|
||||
</li>
|
||||
</ul>
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="editor-row">
|
||||
<div class="section">
|
||||
<h5>Options</h5>
|
||||
<div class="editor-option">
|
||||
<label class="small">Minimum severity
|
||||
</label>
|
||||
<select class="small" style="width: 113px" ng-init='annotation.minseverity = annotation.minseverity || 0' ng-model='annotation.minseverity' ng-options="v as k for (k, v) in {'Not classified': 0, 'Information': 1, 'Warning': 2, 'Average': 3, 'High': 4, 'Disaster': 5}" ng-change="render()"></select>
|
||||
</div>
|
||||
<editor-opt-bool text="Show OK events" model="annotation.showOkEvents"></editor-opt-bool>
|
||||
<editor-opt-bool text="Hide acknowledged events" model="annotation.hideAcknowledged"></editor-opt-bool>
|
||||
<editor-opt-bool text="Show hostname" model="annotation.showHostname"></editor-opt-bool>
|
||||
</div>
|
||||
</div>
|
||||
56
src/datasource-zabbix/partials/config.html
Normal file
56
src/datasource-zabbix/partials/config.html
Normal file
@@ -0,0 +1,56 @@
|
||||
<datasource-http-settings current="ctrl.current">
|
||||
</datasource-http-settings>
|
||||
|
||||
<h5>Zabbix API details</h5>
|
||||
|
||||
<div class="tight-form">
|
||||
<ul class="tight-form-list">
|
||||
<li class="tight-form-item" style="width: 80px">
|
||||
User
|
||||
</li>
|
||||
<li>
|
||||
<input type="text" class="tight-form-input input-large"
|
||||
ng-model='ctrl.current.jsonData.username'
|
||||
placeholder="">
|
||||
</li>
|
||||
<li class="tight-form-item" style="width: 80px">
|
||||
Password
|
||||
</li>
|
||||
<li>
|
||||
<input type="password" class="tight-form-input input-large"
|
||||
ng-model='ctrl.current.jsonData.password'
|
||||
placeholder="">
|
||||
</li>
|
||||
</ul>
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
<div class="tight-form last">
|
||||
<ul class="tight-form-list">
|
||||
<li class="tight-form-item" style="width: 200px">
|
||||
Cache update interval
|
||||
</li>
|
||||
<li>
|
||||
<input type="text" class="tight-form-input input-small"
|
||||
ng-model='ctrl.current.jsonData.cacheTTL'
|
||||
placeholder="1h">
|
||||
</li>
|
||||
<li class="tight-form-item" style="width: 80px">
|
||||
Trends
|
||||
<input class="cr1" id="ctrl.current.jsonData.trends" type="checkbox"
|
||||
ng-model="ctrl.current.jsonData.trends"
|
||||
ng-checked="ctrl.current.jsonData.trends">
|
||||
<label for="ctrl.current.jsonData.trends" class="cr1"></label>
|
||||
</li>
|
||||
<li ng-if="ctrl.current.jsonData.trends"
|
||||
class="tight-form-item"
|
||||
style="width: 105px">
|
||||
Use trends from
|
||||
</li>
|
||||
<li ng-if="ctrl.current.jsonData.trends">
|
||||
<input type="text" class="tight-form-input input-small"
|
||||
ng-model='ctrl.current.jsonData.trendsFrom'
|
||||
placeholder="7d">
|
||||
</li>
|
||||
</ul>
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
221
src/datasource-zabbix/partials/query.editor.html
Normal file
221
src/datasource-zabbix/partials/query.editor.html
Normal file
@@ -0,0 +1,221 @@
|
||||
<div class="tight-form">
|
||||
<ul class="tight-form-list pull-right">
|
||||
<li class="tight-form-item small" ng-show="ctrl.target.datasource">
|
||||
<em>{{ctrl.target.datasource}}</em>
|
||||
</li>
|
||||
<li class="tight-form-item">
|
||||
<div class="dropdown">
|
||||
<a class="pointer dropdown-toggle"
|
||||
data-toggle="dropdown"
|
||||
tabindex="1">
|
||||
<i class="fa fa-bars"></i>
|
||||
</a>
|
||||
<ul class="dropdown-menu pull-right" role="menu">
|
||||
|
||||
<!-- Switch editor mode -->
|
||||
<li role="menuitem" ng-show="ctrl.target.mode">
|
||||
<a class="pointer" tabindex="1"
|
||||
ng-click="ctrl.switchEditorMode(0)">Numeric metrics</a>
|
||||
</li>
|
||||
<li role="menuitem" ng-show="ctrl.target.mode != 1">
|
||||
<a class="pointer" tabindex="1"
|
||||
ng-click="ctrl.switchEditorMode(1)">IT services</a>
|
||||
</li>
|
||||
<li role="menuitem" ng-show="ctrl.target.mode != 2">
|
||||
<a class="pointer" tabindex="1"
|
||||
ng-click="ctrl.switchEditorMode(2)">Text metrics</a>
|
||||
</li>
|
||||
<li class="divider" role="menuitem"></li>
|
||||
|
||||
<!-- From app/features/panel/partials/query_editor_row.html -->
|
||||
<li role="menuitem">
|
||||
<a tabindex="1" ng-click="ctrl.duplicateQuery()">Duplicate</a>
|
||||
</li>
|
||||
<li role="menuitem">
|
||||
<a tabindex="1" ng-click="ctrl.moveQuery(-1)">Move up</a>
|
||||
</li>
|
||||
<li role="menuitem">
|
||||
<a tabindex="1" ng-click="ctrl.moveQuery(1)">Move down</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</li>
|
||||
<li class="tight-form-item last">
|
||||
<a class="pointer" tabindex="1" ng-click="ctrl.removeQuery(target)">
|
||||
<i class="fa fa-trash"></i>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="tight-form-list">
|
||||
<li class="tight-form-item" style="min-width: 15px; text-align: center">
|
||||
{{ctrl.target.refId}}
|
||||
</li>
|
||||
<li>
|
||||
<a class="tight-form-item" ng-click="ctrl.toggleHideQuery()" role="menuitem">
|
||||
<i class="fa fa-eye"></i>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<!-- IT Service editor -->
|
||||
<ul class="tight-form-list" role="menu" ng-show="ctrl.target.mode == 1">
|
||||
<li class="tight-form-item input-small">IT Service</li>
|
||||
<li>
|
||||
<select class="tight-form-input input-large"
|
||||
ng-change="ctrl.selectITService()"
|
||||
ng-model="ctrl.target.itservice"
|
||||
bs-tooltip="ctrl.target.itservice.name.length > 25 ? ctrl.target.itservice.name : ''"
|
||||
ng-options="itservice.name for itservice in ctrl.itserviceList track by itservice.name">
|
||||
<option value="">-- Select IT service --</option>
|
||||
</select>
|
||||
</li>
|
||||
<li class="tight-form-item input-medium">IT service property</li>
|
||||
<li>
|
||||
<select class="tight-form-input input-medium"
|
||||
ng-change="ctrl.selectITService()"
|
||||
ng-model="ctrl.target.slaProperty"
|
||||
ng-options="slaProperty.name for slaProperty in ctrl.slaPropertyList track by slaProperty.name">
|
||||
<option value="">-- Property --</option>
|
||||
</select>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="tight-form-list" role="menu" ng-hide="ctrl.target.mode == 1">
|
||||
|
||||
<!-- Select Host Group -->
|
||||
<li class="tight-form-item input-small" style="width: 5em">Group</li>
|
||||
<li>
|
||||
<input type="text"
|
||||
ng-model="ctrl.target.group.filter"
|
||||
bs-typeahead="ctrl.getGroupNames"
|
||||
ng-change="ctrl.onTargetPartChange(ctrl.target.group)"
|
||||
ng-blur="ctrl.onTargetBlur()"
|
||||
data-min-length=0
|
||||
data-items=100
|
||||
class="input-medium tight-form-input"
|
||||
ng-style="ctrl.target.group.style">
|
||||
</li>
|
||||
|
||||
<!-- Select Host -->
|
||||
<li class="tight-form-item input-small" style="width: 3em">Host</li>
|
||||
<li>
|
||||
<input type="text"
|
||||
ng-model="ctrl.target.host.filter"
|
||||
bs-typeahead="ctrl.getHostNames"
|
||||
ng-change="ctrl.onTargetPartChange(ctrl.target.host)"
|
||||
ng-blur="ctrl.onTargetBlur()"
|
||||
data-min-length=0
|
||||
data-items=100
|
||||
class="input-large tight-form-input"
|
||||
ng-style="ctrl.target.host.style">
|
||||
</li>
|
||||
<li class="tight-form-item" ng-hide="ctrl.target.mode == 2">
|
||||
Show disabled items
|
||||
<editor-checkbox text=""
|
||||
model="ctrl.target.showDisabledItems"
|
||||
change="ctrl.onTargetBlur()">
|
||||
</editor-checkbox>
|
||||
</li>
|
||||
|
||||
<!-- Downsampling function -->
|
||||
<!-- <li class="tight-form-item input-medium" ng-hide="ctrl.target.mode == 2">
|
||||
Downsampling
|
||||
</li>
|
||||
<li ng-hide="ctrl.target.mode == 2">
|
||||
<select class="tight-form-input input-small"
|
||||
ng-change="ctrl.targetBlur()"
|
||||
ng-model="ctrl.target.downsampleFunction"
|
||||
bs-tooltip="'Downsampling function'"
|
||||
ng-options="func.name for func in downsampleFunctionList track by func.name">
|
||||
</select>
|
||||
<a bs-tooltip="ctrl.target.errors.metric"
|
||||
style="color: rgb(229, 189, 28)"
|
||||
ng-show="ctrl.target.errors.metric">
|
||||
<i class="icon-warning-sign"></i>
|
||||
</a>
|
||||
</li> -->
|
||||
</ul>
|
||||
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
|
||||
<div class="tight-form" ng-hide="ctrl.target.mode == 1">
|
||||
<ul class="tight-form-list" role="menu">
|
||||
<li class="tight-form-item" style="width: 44px"> </li>
|
||||
|
||||
<!-- Select Application -->
|
||||
<li class="tight-form-item" style="width: 5em">Application</li>
|
||||
<li>
|
||||
<input type="text"
|
||||
ng-model="ctrl.target.application.filter"
|
||||
bs-typeahead="ctrl.getApplicationNames"
|
||||
ng-change="ctrl.onTargetPartChange(ctrl.target.application)"
|
||||
ng-blur="ctrl.onTargetBlur()"
|
||||
data-min-length=0
|
||||
data-items=100
|
||||
class="input-medium tight-form-input"
|
||||
ng-style="ctrl.target.application.style">
|
||||
</li>
|
||||
|
||||
<!-- Select Item -->
|
||||
<li class="tight-form-item input-small" style="width: 3em">Item</li>
|
||||
<li>
|
||||
<input type="text"
|
||||
ng-model="ctrl.target.item.filter"
|
||||
bs-typeahead="ctrl.getItemNames"
|
||||
ng-change="ctrl.onTargetPartChange(ctrl.target.item)"
|
||||
ng-blur="ctrl.onTargetBlur()"
|
||||
data-min-length=0
|
||||
data-items=100
|
||||
class="input-large tight-form-input"
|
||||
ng-style="ctrl.target.item.style">
|
||||
</li>
|
||||
<li class="tight-form-item query-keyword">Options</li>
|
||||
<li ng-repeat="func in ctrl.target.functions">
|
||||
<span metric-function-editor class="tight-form-item tight-form-func">
|
||||
</span>
|
||||
</li>
|
||||
<li class="dropdown" add-metric-function>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
<div class="tight-form" ng-hide="ctrl.target.mode === 1" ng-if="ctrl.target.options">
|
||||
<ul class="tight-form-list" role="menu">
|
||||
<li class="tight-form-item" style="width: 44px"> </li>
|
||||
<li class="tight-form-item query-keyword" style="width: 5em">Options</li>
|
||||
</ul>
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
|
||||
<div class="tight-form" ng-show="ctrl.target.mode == 2">
|
||||
<ul class="tight-form-list" role="menu">
|
||||
<li class="tight-form-item" style="width: 44px"> </li>
|
||||
|
||||
<!-- Text metric regex -->
|
||||
<li class="tight-form-item" style="width: 5em" ng-show="ctrl.target.mode == 2">
|
||||
Text filter
|
||||
</li>
|
||||
<li ng-show="ctrl.target.mode == 2">
|
||||
<input type="text"
|
||||
class="tight-form-input" style="width: 417px"
|
||||
ng-model="ctrl.target.textFilter"
|
||||
spellcheck='false'
|
||||
placeholder="Text filter (regex)"
|
||||
ng-blur="ctrl.targetBlur()">
|
||||
</li>
|
||||
<li class="tight-form-item" ng-show="ctrl.target.mode == 2">
|
||||
Use capture groups
|
||||
<input class="cr1" id="ctrl.target.useCaptureGroups" type="checkbox"
|
||||
ng-model="ctrl.target.useCaptureGroups"
|
||||
ng-checked="ctrl.target.useCaptureGroups"
|
||||
ng-change="ctrl.targetBlur()">
|
||||
<label for="ctrl.target.useCaptureGroups" class="cr1"></label>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
|
||||
96
src/datasource-zabbix/partials/query.options.html
Normal file
96
src/datasource-zabbix/partials/query.options.html
Normal file
@@ -0,0 +1,96 @@
|
||||
<section class="grafana-metric-options">
|
||||
|
||||
<div class="tight-form">
|
||||
<ul class="tight-form-list">
|
||||
<li class="tight-form-item tight-form-item-icon">
|
||||
<i class="fa fa-wrench"></i>
|
||||
</li>
|
||||
<li class="tight-form-item">
|
||||
Max data points
|
||||
</li>
|
||||
<li>
|
||||
<input type="text"
|
||||
class="input-mini tight-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">
|
||||
</li>
|
||||
</ul>
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
<div class="tight-form last">
|
||||
<ul class="tight-form-list">
|
||||
<li class="tight-form-item tight-form-item-icon">
|
||||
<i class="fa fa-info-circle"></i>
|
||||
</li>
|
||||
<li class="tight-form-item">
|
||||
<a ng-click="ctrl.panelCtrl.toggleEditorHelp(1)" bs-tooltip="'click to show helpful info'" data-placement="bottom">
|
||||
Max data points
|
||||
</a>
|
||||
</li>
|
||||
<li class="tight-form-item">
|
||||
<a ng-click="ctrl.panelCtrl.toggleEditorHelp(2)" bs-tooltip="'click to show helpful info'" data-placement="bottom">
|
||||
IT services
|
||||
</a>
|
||||
</li>
|
||||
<li class="tight-form-item">
|
||||
<a ng-click="ctrl.panelCtrl.toggleEditorHelp(3)" bs-tooltip="'click to show helpful info'" data-placement="bottom">
|
||||
IT service property
|
||||
</a>
|
||||
</li>
|
||||
<li class="tight-form-item">
|
||||
<a ng-click="ctrl.panelCtrl.toggleEditorHelp(4)" bs-tooltip="'click to show helpful info'" data-placement="bottom">
|
||||
Text filter
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<div class="editor-row">
|
||||
<div class="pull-left" style="margin-top: 30px;">
|
||||
|
||||
<div class="grafana-info-box span8" ng-if="ctrl.panelCtrl.editorHelpIndex === 1">
|
||||
<h5>Max data points</h5>
|
||||
<ul>
|
||||
<li>Grafana-Zabbix plugin uses maxDataPoints parameter to consolidate the real number of values down to this
|
||||
number
|
||||
</li>
|
||||
<li>If there are more real values, then by default they will be consolidated using averages</li>
|
||||
<li>This could hide real peaks and max values in your series</li>
|
||||
<li>Point consolidation will effect series legend values (min,max,total,current)</li>
|
||||
<li>If you override maxDataPoint and set a high value performance can be severely effected</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="grafana-info-box span8" ng-if="ctrl.panelCtrl.editorHelpIndex === 2">
|
||||
<h5>IT services</h5>
|
||||
<ul>
|
||||
<li>Select "IT services" in targets menu to activate IT services mode.</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="grafana-info-box span8" ng-if="ctrl.panelCtrl.editorHelpIndex === 3">
|
||||
<h5>IT service property</h5>
|
||||
<ul>
|
||||
<li>Zabbix returns the following availability information about IT service</li>
|
||||
<li>Status - current status of the IT service</li>
|
||||
<li>SLA - SLA for the given time interval</li>
|
||||
<li>OK time - time the service was in OK state, in seconds</li>
|
||||
<li>Problem time - time the service was in problem state, in seconds</li>
|
||||
<li>Down time - time the service was in scheduled downtime, in seconds</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="grafana-info-box span8" ng-if="ctrl.panelCtrl.editorHelpIndex === 4">
|
||||
<h5>Text filter</h5>
|
||||
<ul>
|
||||
<li>Use regex to extract a part of the returned value.</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user