-
-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Refactored components to utilize React Query hooks - Removed legacy data fetching mechanisms and unused state management hooks
- Loading branch information
1 parent
90ff06c
commit 7b4d0f3
Showing
52 changed files
with
1,279 additions
and
1,977 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
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,34 @@ | ||
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: 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.