Submit
Path:
~
/
/
usr
/
share
/
grafana
/
public
/
app
/
features
/
api-keys
/
state
/
File Content:
actions.ts
import { getBackendSrv } from 'app/core/services/backend_srv'; import { ThunkResult } from 'app/types'; import { apiKeysLoaded, includeExpiredToggled, isFetching, setMigrationResult } from './reducers'; export function loadApiKeys(): ThunkResult<void> { return async (dispatch) => { dispatch(isFetching()); const [keys, keysIncludingExpired] = await Promise.all([ getBackendSrv().get('/api/auth/keys?includeExpired=false&accesscontrol=true'), getBackendSrv().get('/api/auth/keys?includeExpired=true&accesscontrol=true'), ]); dispatch(apiKeysLoaded({ keys, keysIncludingExpired })); }; } export function deleteApiKey(id: number): ThunkResult<void> { return async (dispatch) => { getBackendSrv() .delete(`/api/auth/keys/${id}`) .then(() => dispatch(loadApiKeys())); }; } export function migrateApiKey(id: number): ThunkResult<void> { return async (dispatch) => { try { await getBackendSrv().post(`/api/serviceaccounts/migrate/${id}`); } finally { dispatch(loadApiKeys()); } }; } export function migrateAll(): ThunkResult<void> { return async (dispatch) => { try { const payload = await getBackendSrv().post('/api/serviceaccounts/migrate'); dispatch(setMigrationResult(payload)); } finally { dispatch(loadApiKeys()); } }; } export function toggleIncludeExpired(): ThunkResult<void> { return (dispatch) => { dispatch(includeExpiredToggled()); }; }
Edit
Rename
Chmod
Delete
FILE
FOLDER
INFO
Name
Size
Permission
Action
actions.ts
1475 bytes
0644
reducers.test.ts
1768 bytes
0644
reducers.ts
1569 bytes
0644
selectors.test.ts
4518 bytes
0644
selectors.ts
694 bytes
0644
N4ST4R_ID | Naxtarrr