Browse Source

Threshold change button #161 (#171)

* remove blur event handler from threshold input fields
* Send threshold parameters to server via button click
* disable 'Apply' button on Learning || Pending statuses
master
sanke1 5 years ago committed by rozetko
parent
commit
22f4f15a55
  1. 5
      src/panel/graph_panel/controllers/analytic_controller.ts
  2. 12
      src/panel/graph_panel/partials/tab_analytics.html

5
src/panel/graph_panel/controllers/analytic_controller.ts

@ -76,6 +76,11 @@ export class AnalyticController {
return result;
}
async sendThresholdParamsToServer(id: AnalyticUnitId) {
await this.saveThreshold(id);
await this._runStatusWaiter(this._analyticUnitsSet.byId(id));
}
createNew() {
this._newAnalyticUnit = new AnalyticUnit();
this._creatingNewAnalyticType = true;

12
src/panel/graph_panel/partials/tab_analytics.html

@ -68,9 +68,7 @@
ng-model="ctrl.analyticsController.getThreshold(analyticUnit.id).condition"
ng-options="type for type in ctrl.analyticsController.conditions"
ng-if="analyticUnit.detectorType === 'threshold'"
ng-blur="ctrl.analyticsController.saveThreshold(analyticUnit.id)"
/>
<input
class="gf-form-input width-5"
type="number"
@ -79,8 +77,16 @@
analyticUnit.detectorType === 'threshold' &&
ctrl.analyticsController.getThreshold(analyticUnit.id).condition != 'NO_DATA'
"
ng-blur="ctrl.analyticsController.saveThreshold(analyticUnit.id)"
/>
<!-- TODO set .saving flag to thresholds, when learning is in progress -->
<button
class="btn btn-inverse"
ng-if="analyticUnit.detectorType === 'threshold'"
ng-click="ctrl.analyticsController.sendThresholdParamsToServer(analyticUnit.id)"
ng-disabled="analyticUnit.status === 'PENDING' || analyticUnit.status === 'LEARNING'"
>
Apply
</button>
<label class="gf-form-label">
<a

Loading…
Cancel
Save