blob: 080890e2693b5bf2a5702ac0091947fe1b247797 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
import { Component, OnInit } from '@angular/core';
import { RefreshIntervalService } from '~/app/shared/services/refresh-interval.service';
@Component({
selector: 'cd-refresh-selector',
templateUrl: './refresh-selector.component.html',
styleUrls: ['./refresh-selector.component.scss']
})
export class RefreshSelectorComponent implements OnInit {
selectedInterval: number;
intervalList: { [key: string]: number } = {
'5 s': 5000,
'10 s': 10000,
'15 s': 15000,
'30 s': 30000,
'1 min': 60000,
'3 min': 180000,
'5 min': 300000
};
intervalKeys = Object.keys(this.intervalList);
constructor(private refreshIntervalService: RefreshIntervalService) {}
ngOnInit() {
this.selectedInterval = this.refreshIntervalService.getRefreshInterval() || 5000;
}
changeRefreshInterval(interval: number) {
this.refreshIntervalService.setRefreshInterval(interval);
}
}
|