文件操作 - apiKeysMock.ts
返回文件管理
返回主菜单
删除本文件
文件: /usr/share/grafana/public/app/features/api-keys/__mocks__/apiKeysMock.ts
编辑文件内容
import { ApiKey, OrgRole } from 'app/types'; export const getMultipleMockKeys = (numberOfKeys: number): ApiKey[] => { const keys: ApiKey[] = []; for (let i = 1; i <= numberOfKeys; i++) { keys.push({ id: i, name: `test-${i}`, role: OrgRole.Viewer, secondsToLive: null, expiration: '2019-06-04', }); } return keys; }; export const getMockKey = (): ApiKey => { return { id: 1, name: 'test', role: OrgRole.Admin, secondsToLive: null, expiration: '2019-06-04', }; };
修改文件时间
将文件时间修改为当前时间的前一年
删除文件