core/dashboard/widget-auto-refresh-context/auto-refresh-select-control.component.ts
providers |
{
provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => AutoRefreshSelectControlComponent), multi: true
}
|
selector | c8y-auto-refresh-select-control |
templateUrl | ./auto-refresh-select-control.component.html |
Properties |
|
Methods |
onIntervalChange | ||||||
onIntervalChange(autoRefreshSeconds: number)
|
||||||
Parameters :
Returns :
void
|
registerOnChange | ||||||
registerOnChange(fn: any)
|
||||||
Parameters :
Returns :
void
|
registerOnTouched | ||||||
registerOnTouched(fn: any)
|
||||||
Parameters :
Returns :
void
|
writeValue | ||||||
writeValue(autoRefreshSeconds: number)
|
||||||
Parameters :
Returns :
void
|
autoRefreshSeconds |
Type : number
|
Readonly DEFAULT_INTERVAL_VALUES |
Default value : DEFAULT_INTERVAL_VALUES
|
onChange |
Type : function
|
onTouched |
Default value : () => {...}
|
Readonly SECONDS_UNTIL_REFRESH |
Default value : gettext('{{ seconds }} s`until refresh`')
|
Readonly START_INTERVAL_VALUE |
Default value : DEFAULT_INTERVAL_VALUE
|
<div class="c8y-select-wrapper">
<select
class="form-control text-12"
[attr.aria-label]="'Refresh interval in seconds' | translate"
[tooltip]="'Refresh interval in seconds' | translate"
placement="bottom"
[adaptivePosition]="false"
[delay]="500"
[container]="'body'"
mode
[(ngModel)]="autoRefreshSeconds"
(ngModelChange)="onIntervalChange($event)"
[ngModelOptions]="{ standalone: true }"
>
<option
*ngFor="let refreshInterval of DEFAULT_INTERVAL_VALUES"
[ngValue]="refreshInterval"
[attr.selected]="refreshInterval === START_INTERVAL_VALUE ? '' : null"
>
{{ SECONDS_UNTIL_REFRESH | translate: { seconds: refreshInterval / 1000 } }}
</option>
</select>
<span></span>
</div>