本文整理汇总了TypeScript中ui/timefilter.timefilter类的典型用法代码示例。如果您正苦于以下问题:TypeScript timefilter类的具体用法?TypeScript timefilter怎么用?TypeScript timefilter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了timefilter类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: initAutoRefresh
function initAutoRefresh() {
const { value } = timefilter.getRefreshInterval();
if (value === 0) {
// the auto refresher starts in an off state
// so switch it on and set the interval to 30s
timefilter.setRefreshInterval({
pause: false,
value: DEFAULT_REFRESH_INTERVAL_MS,
});
}
setAutoRefresh();
}
开发者ID:elastic,项目名称:kibana,代码行数:13,代码来源:use_refresh_interval.ts
示例2: setAutoRefresh
function setAutoRefresh() {
const { value, pause } = timefilter.getRefreshInterval();
if (pause) {
clearRefreshInterval();
} else {
setRefreshInterval(value);
}
getJobs(true);
}
开发者ID:elastic,项目名称:kibana,代码行数:9,代码来源:use_refresh_interval.ts
示例3: initAutoRefreshUpdate
function initAutoRefreshUpdate() {
// update the interval if it changes
timefilter.on('refreshIntervalUpdate', () => {
setAutoRefresh();
});
}
开发者ID:elastic,项目名称:kibana,代码行数:6,代码来源:use_refresh_interval.ts
示例4: useEffect
useEffect(() => {
let jobsRefreshInterval: null | number = null;
timefilter.disableTimeRangeSelector();
timefilter.enableAutoRefreshSelector();
initAutoRefresh();
initAutoRefreshUpdate();
function initAutoRefresh() {
const { value } = timefilter.getRefreshInterval();
if (value === 0) {
// the auto refresher starts in an off state
// so switch it on and set the interval to 30s
timefilter.setRefreshInterval({
pause: false,
value: DEFAULT_REFRESH_INTERVAL_MS,
});
}
setAutoRefresh();
}
function initAutoRefreshUpdate() {
// update the interval if it changes
timefilter.on('refreshIntervalUpdate', () => {
setAutoRefresh();
});
}
function setAutoRefresh() {
const { value, pause } = timefilter.getRefreshInterval();
if (pause) {
clearRefreshInterval();
} else {
setRefreshInterval(value);
}
getJobs(true);
}
function setRefreshInterval(interval: number) {
clearRefreshInterval();
if (interval >= MINIMUM_REFRESH_INTERVAL_MS) {
setBlockRefresh(false);
const intervalId = window.setInterval(() => {
getJobs();
}, interval);
jobsRefreshInterval = intervalId;
}
}
function clearRefreshInterval() {
setBlockRefresh(true);
if (jobsRefreshInterval !== null) {
window.clearInterval(jobsRefreshInterval);
}
}
// useEffect cleanup
return () => {
clearRefreshInterval();
};
}, []); // [] as comparator makes sure this only runs once
开发者ID:elastic,项目名称:kibana,代码行数:63,代码来源:use_refresh_interval.ts
示例5: moment
.then(resp => {
timefilter.setTime({
from: moment(resp.start.epoch).toISOString(),
to: moment(resp.end.epoch).toISOString(),
});
})
开发者ID:elastic,项目名称:kibana,代码行数:6,代码来源:full_time_range_selector_service.ts
注:本文中的ui/timefilter.timefilter类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论