@ -696,8 +696,11 @@ export class AnalyticController {
.forEach(unit => unit.inspect = false);
}
public async updateSeasonality(id: AnalyticUnitId) {
public async updateSeasonality(id: AnalyticUnitId, value?: number) {
const analyticUnit = this._analyticUnitsSet.byId(id) as AnomalyAnalyticUnit;
if(value !== undefined) {
analyticUnit.seasonalityPeriod.value = value;
await this.saveAnalyticUnit(analyticUnit);
@ -682,8 +682,8 @@ class GraphCtrl extends MetricsPanelCtrl {
this.refresh();
onSeasonalityChange(id: AnalyticUnitId) {
this.analyticsController.updateSeasonality(id);
onSeasonalityChange(id: AnalyticUnitId, value?: number) {
this.analyticsController.updateSeasonality(id, value);
@ -253,8 +253,9 @@
<label class="gf-form-label width-9"> Seasonality Period </label>
<input
type="number" class="gf-form-input width-5"
ng-model="analyticUnit.seasonalityPeriod.value"
ng-blur="ctrl.onSeasonalityChange(analyticUnit.id)"
ng-init="seasonalityValue = analyticUnit.seasonalityPeriod.value"
ng-model="seasonalityValue"
ng-blur="ctrl.onSeasonalityChange(analyticUnit.id, seasonalityValue)"
min="0"
>
</div>