mirror of
https://github.com/portainer/portainer.git
synced 2025-07-24 07:49:41 +02:00
feat(k8sconfigure): migrate configure to react [EE-5524] (#10218)
This commit is contained in:
parent
0f1e77a6d5
commit
515b02813b
59 changed files with 1819 additions and 833 deletions
|
@ -1,6 +1,20 @@
|
|||
import { useQuery } from 'react-query';
|
||||
|
||||
import PortainerError from '@/portainer/error';
|
||||
import axios from '@/portainer/services/axios';
|
||||
import { EnvironmentId } from '@/react/portainer/environments/types';
|
||||
import { withError } from '@/react-tools/react-query';
|
||||
|
||||
export function useIsRBACEnabledQuery(environmentId: EnvironmentId) {
|
||||
return useQuery<boolean, Error>(
|
||||
['environments', environmentId, 'rbacEnabled'],
|
||||
() => getIsRBACEnabled(environmentId),
|
||||
{
|
||||
enabled: !!environmentId,
|
||||
...withError('Unable to check if RBAC is enabled.'),
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
export async function getIsRBACEnabled(environmentId: EnvironmentId) {
|
||||
try {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue