mirror of
https://github.com/grafana/grafana.git
synced 2025-02-12 16:45:43 -06:00
12 lines
326 B
TypeScript
12 lines
326 B
TypeScript
import { ApiKeysState } from 'app/types';
|
|
|
|
export const getApiKeysCount = (state: ApiKeysState) => state.keys.length;
|
|
|
|
export const getApiKeys = (state: ApiKeysState) => {
|
|
const regex = RegExp(state.searchQuery, 'i');
|
|
|
|
return state.keys.filter(key => {
|
|
return regex.test(key.name) || regex.test(key.role);
|
|
});
|
|
};
|