mirror of
https://github.com/portainer/portainer.git
synced 2025-07-20 13:59:40 +02:00
feat(namespace): migrate create ns to react [EE-2226] (#10377)
This commit is contained in:
parent
31bcba96c6
commit
7218eb0892
83 changed files with 1869 additions and 358 deletions
|
@ -0,0 +1,41 @@
|
|||
import { useEnvironmentId } from '@/react/hooks/useEnvironmentId';
|
||||
import { isBE } from '@/react/portainer/feature-flags/feature-flags.service';
|
||||
import { useUnauthorizedRedirect } from '@/react/hooks/useUnauthorizedRedirect';
|
||||
|
||||
import { PageHeader } from '@@/PageHeader';
|
||||
|
||||
import { CreateNamespaceForm } from './CreateNamespaceForm';
|
||||
|
||||
export function CreateNamespaceView() {
|
||||
const environmentId = useEnvironmentId();
|
||||
|
||||
useUnauthorizedRedirect(
|
||||
{
|
||||
authorizations: 'K8sResourcePoolsW',
|
||||
forceEnvironmentId: environmentId,
|
||||
adminOnlyCE: !isBE,
|
||||
},
|
||||
{
|
||||
to: 'kubernetes.resourcePools',
|
||||
params: {
|
||||
id: environmentId,
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
return (
|
||||
<div className="form-horizontal">
|
||||
<PageHeader
|
||||
title="Create a namespace"
|
||||
breadcrumbs="Create a namespace"
|
||||
reload
|
||||
/>
|
||||
|
||||
<div className="row">
|
||||
<div className="col-sm-12">
|
||||
<CreateNamespaceForm />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue