-
-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e87fee2
commit 46e8a4a
Showing
50 changed files
with
1,251 additions
and
1,965 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,26 @@ | ||
import { Axios } from "./axios"; | ||
import { USERS_LIST_URL, USER_PASSWORD_URL, USER_ROLES_URL, USER_URL } from "./constants"; | ||
import { Axios } from './axios'; | ||
import { USERS_LIST_URL, USER_PASSWORD_URL, USER_ROLES_URL, USER_URL } from './constants'; | ||
|
||
export const getUsers = () => { | ||
return Axios().get(USERS_LIST_URL); | ||
} | ||
return Axios().get(USERS_LIST_URL); | ||
}; | ||
|
||
export const postUser = (username: string, roles?: object[]) => { | ||
return Axios().post(USER_URL(username), roles ); | ||
} | ||
return Axios().post(USER_URL(username), roles); | ||
}; | ||
|
||
export const deleteUser = (username: string) => { | ||
return Axios().delete(USER_URL(username)); | ||
} | ||
return Axios().delete(USER_URL(username)); | ||
}; | ||
|
||
export const putUserRoles = (username: string, roles: object[]) => { | ||
return Axios().put(USER_ROLES_URL(username), roles); | ||
} | ||
export const putUserRoles = (username: string, roles: string[]) => { | ||
return Axios().put(USER_ROLES_URL(username), roles); | ||
}; | ||
|
||
export const getUserRoles = (username: string) => { | ||
return Axios().get(USER_ROLES_URL(username)); | ||
} | ||
return Axios().get(USER_ROLES_URL(username)); | ||
}; | ||
|
||
export const postUserResetPassword = (username: string) => { | ||
return Axios().post(USER_PASSWORD_URL(username)); | ||
} | ||
return Axios().post(USER_PASSWORD_URL(username)); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import dayjs from 'dayjs'; | ||
|
||
type FixedDuration = { | ||
name: string; | ||
milliseconds: number; | ||
}; | ||
|
||
export const REFRESH_INTERVALS: number[] = [10000, 30000, 60000, 300000, 600000, 1200000]; | ||
|
||
export const FIXED_DURATIONS: ReadonlyArray<FixedDuration> = [ | ||
{ | ||
name: 'last 10 minutes', | ||
milliseconds: dayjs.duration({ minutes: 10 }).asMilliseconds(), | ||
}, | ||
{ | ||
name: 'last 1 hour', | ||
milliseconds: dayjs.duration({ hours: 1 }).asMilliseconds(), | ||
}, | ||
{ | ||
name: 'last 5 hours', | ||
milliseconds: dayjs.duration({ hours: 5 }).asMilliseconds(), | ||
}, | ||
{ | ||
name: 'last 24 hours', | ||
milliseconds: dayjs.duration({ days: 1 }).asMilliseconds(), | ||
}, | ||
{ | ||
name: 'last 3 days', | ||
milliseconds: dayjs.duration({ days: 3 }).asMilliseconds(), | ||
}, | ||
{ | ||
name: 'last 7 days', | ||
milliseconds: dayjs.duration({ days: 7 }).asMilliseconds(), | ||
}, | ||
] as const; |
Oops, something went wrong.