Browse Source

Redetect all analytic units

master
rozetko 6 years ago
parent
commit
32a6187c95
  1. 8
      src/panel/graph_panel/controllers/analytic_controller.ts
  2. 4
      src/panel/graph_panel/graph_ctrl.ts
  3. 11
      src/panel/graph_panel/partials/tab_analytics.html

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

@ -270,6 +270,14 @@ export class AnalyticController {
return newIds; return newIds;
} }
redetectAll() {
this.analyticUnits.forEach(a => {
a.segments.clear();
this._runStatusWaiter(a);
this._analyticService.runDetect(a.id);
});
}
// TODO: move to renderer // TODO: move to renderer
updateFlotEvents(isEditMode: boolean, options: any): void { updateFlotEvents(isEditMode: boolean, options: any): void {
if(options.grid.markings === undefined) { if(options.grid.markings === undefined) {

4
src/panel/graph_panel/graph_ctrl.ts

@ -553,6 +553,10 @@ class GraphCtrl extends MetricsPanelCtrl {
this.analyticsController.createNew(); this.analyticsController.createNew();
} }
redetectAll() {
this.analyticsController.redetectAll();
}
async saveNew() { async saveNew() {
try { try {
const panelId = this.panel.id; const panelId = this.panel.id;

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

@ -85,7 +85,7 @@
</a> </a>
</label> </label>
<select class="gf-form-input width-10" <select class="gf-form-input width-12"
ng-model="ctrl.analyticsController.labelingMode" ng-model="ctrl.analyticsController.labelingMode"
ng-options="type.value as type.name for type in [ ng-options="type.value as type.name for type in [
{ name:'Label Positive', value: 'LABELING' }, { name:'Label Positive', value: 'LABELING' },
@ -205,13 +205,18 @@
</div> </div>
<div class="gf-form-button-row" ng-if="!ctrl.analyticsController.creatingAnalyticUnit"> <div class="gf-form-button-row" ng-if="!ctrl.analyticsController.creatingAnalyticUnit">
<button class="btn btn-inverse" ng-click="ctrl.createNew()"> <button class="btn btn-inverse width-12" ng-click="ctrl.createNew()">
<i class="fa fa-plus"></i> <i class="fa fa-plus"></i>
Add Analytic Unit Add Analytic Unit
</button> </button>
</div> </div>
<div class="gf-form-button-row"> <div class="gf-form-button-row">
<button class="gf-form-label width-10 pointer" ng-click="ctrl.showHelp = !ctrl.showHelp"> <button class="gf-form-label width-12 pointer" ng-click="ctrl.redetectAll()">
Re-detect all analytic units
</button>
</div>
<div class="gf-form-button-row">
<button class="gf-form-label width-12 pointer" ng-click="ctrl.showHelp = !ctrl.showHelp">
Show Help Show Help
<i class="fa fa-caret-down" ng-show="ctrl.showHelp"></i> <i class="fa fa-caret-down" ng-show="ctrl.showHelp"></i>
<i class="fa fa-caret-right" ng-hide="ctrl.showHelp"></i> <i class="fa fa-caret-right" ng-hide="ctrl.showHelp"></i>

Loading…
Cancel
Save