How to use the @grafana/ui.RefreshPicker.isLive function in @grafana/ui

To help you get started, we’ve selected a few @grafana/ui examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github grafana / grafana / public / app / core / utils / explore.ts View on Github external
export const refreshIntervalToSortOrder = (refreshInterval?: string) =>
  RefreshPicker.isLive(refreshInterval) ? SortOrder.Ascending : SortOrder.Descending;
github GridProtectionAlliance / openHistorian / Source / Applications / openHistorian / openHistorian / Grafana / public / app / core / utils / explore.ts View on Github external
export const refreshIntervalToSortOrder = (refreshInterval?: string) =>
  RefreshPicker.isLive(refreshInterval) ? SortOrder.Ascending : SortOrder.Descending;
github GridProtectionAlliance / openHistorian / Source / Applications / openHistorian / openHistorian / Grafana / public / app / features / explore / state / reducers.ts View on Github external
if (changeModeAction.match(action)) {
    return {
      ...state,
      mode: action.payload.mode,
      graphResult: null,
      tableResult: null,
      logsResult: null,
      queryResponse: createEmptyQueryResponse(),
      loading: false,
    };
  }

  if (changeRefreshIntervalAction.match(action)) {
    const { refreshInterval } = action.payload;
    const live = RefreshPicker.isLive(refreshInterval);
    const sortOrder = refreshIntervalToSortOrder(refreshInterval);
    const logsResult = sortLogsResult(state.logsResult, sortOrder);

    if (RefreshPicker.isLive(state.refreshInterval) && !live) {
      stopQueryState(state.querySubscription);
    }

    return {
      ...state,
      refreshInterval,
      queryResponse: {
        ...state.queryResponse,
        state: live ? LoadingState.Streaming : LoadingState.Done,
      },
      isLive: live,
      isPaused: live ? false : state.isPaused,
github grafana / grafana / public / app / features / explore / state / reducers.ts View on Github external
mapper: (state, action): ExploreItemState => {
      const { refreshInterval } = action.payload;
      const live = RefreshPicker.isLive(refreshInterval);
      const sortOrder = refreshIntervalToSortOrder(refreshInterval);
      const logsResult = sortLogsResult(state.logsResult, sortOrder);

      if (RefreshPicker.isLive(state.refreshInterval) && !live) {
        stopQueryState(state.querySubscription);
      }

      return {
        ...state,
        refreshInterval,
        queryResponse: {
          ...state.queryResponse,
          state: live ? LoadingState.Streaming : LoadingState.Done,
        },
        isLive: live,
        isPaused: live ? false : state.isPaused,
github GridProtectionAlliance / openHistorian / Source / Applications / openHistorian / openHistorian / Grafana / public / app / features / explore / state / reducers.ts View on Github external
mode: action.payload.mode,
      graphResult: null,
      tableResult: null,
      logsResult: null,
      queryResponse: createEmptyQueryResponse(),
      loading: false,
    };
  }

  if (changeRefreshIntervalAction.match(action)) {
    const { refreshInterval } = action.payload;
    const live = RefreshPicker.isLive(refreshInterval);
    const sortOrder = refreshIntervalToSortOrder(refreshInterval);
    const logsResult = sortLogsResult(state.logsResult, sortOrder);

    if (RefreshPicker.isLive(state.refreshInterval) && !live) {
      stopQueryState(state.querySubscription);
    }

    return {
      ...state,
      refreshInterval,
      queryResponse: {
        ...state.queryResponse,
        state: live ? LoadingState.Streaming : LoadingState.Done,
      },
      isLive: live,
      isPaused: live ? false : state.isPaused,
      loading: live,
      logsResult,
    };
  }
github grafana / grafana / public / app / features / explore / state / reducers.ts View on Github external
mapper: (state, action): ExploreItemState => {
      const { refreshInterval } = action.payload;
      const live = RefreshPicker.isLive(refreshInterval);
      const sortOrder = refreshIntervalToSortOrder(refreshInterval);
      const logsResult = sortLogsResult(state.logsResult, sortOrder);

      if (RefreshPicker.isLive(state.refreshInterval) && !live) {
        stopQueryState(state.querySubscription);
      }

      return {
        ...state,
        refreshInterval,
        queryResponse: {
          ...state.queryResponse,
          state: live ? LoadingState.Streaming : LoadingState.Done,
        },
        isLive: live,
        isPaused: live ? false : state.isPaused,
        loading: live,
        logsResult,
      };
    },