mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-07 12:27:28 +00:00
misc: re-added EST
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 865 KiB After Width: | Height: | Size: 894 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 652 KiB After Width: | Height: | Size: 666 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 507 KiB After Width: | Height: | Size: 447 KiB |
+1
@@ -76,6 +76,7 @@ export const CertificateTemplateEnrollmentModal = ({ popUp, handlePopUpToggle }:
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (data) {
|
if (data) {
|
||||||
reset({
|
reset({
|
||||||
|
method: EnrollmentMethod.EST,
|
||||||
caChain: data.caChain,
|
caChain: data.caChain,
|
||||||
isEnabled: data.isEnabled,
|
isEnabled: data.isEnabled,
|
||||||
disableBootstrapCertValidation: data.disableBootstrapCertValidation
|
disableBootstrapCertValidation: data.disableBootstrapCertValidation
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import { Helmet } from "react-helmet";
|
|||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import {
|
import {
|
||||||
faCertificate,
|
faCertificate,
|
||||||
|
faCog,
|
||||||
faEllipsis,
|
faEllipsis,
|
||||||
faPencil,
|
faPencil,
|
||||||
faPlus,
|
faPlus,
|
||||||
@@ -12,6 +13,7 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
|||||||
import { format } from "date-fns";
|
import { format } from "date-fns";
|
||||||
import { twMerge } from "tailwind-merge";
|
import { twMerge } from "tailwind-merge";
|
||||||
|
|
||||||
|
import { UpgradePlanModal } from "@app/components/license/UpgradePlanModal";
|
||||||
import { createNotification } from "@app/components/notifications";
|
import { createNotification } from "@app/components/notifications";
|
||||||
import { ProjectPermissionCan } from "@app/components/permissions";
|
import { ProjectPermissionCan } from "@app/components/permissions";
|
||||||
import {
|
import {
|
||||||
@@ -40,12 +42,14 @@ import {
|
|||||||
import {
|
import {
|
||||||
ProjectPermissionPkiTemplateActions,
|
ProjectPermissionPkiTemplateActions,
|
||||||
ProjectPermissionSub,
|
ProjectPermissionSub,
|
||||||
|
useSubscription,
|
||||||
useWorkspace
|
useWorkspace
|
||||||
} from "@app/context";
|
} from "@app/context";
|
||||||
import { usePopUp } from "@app/hooks";
|
import { usePopUp } from "@app/hooks";
|
||||||
import { useDeleteCertTemplateV2 } from "@app/hooks/api";
|
import { useDeleteCertTemplateV2 } from "@app/hooks/api";
|
||||||
import { useListCertificateTemplates } from "@app/hooks/api/certificateTemplates/queries";
|
import { useListCertificateTemplates } from "@app/hooks/api/certificateTemplates/queries";
|
||||||
|
|
||||||
|
import { CertificateTemplateEnrollmentModal } from "../CertificatesPage/components/CertificateTemplateEnrollmentModal";
|
||||||
import { PkiTemplateForm } from "./components/PkiTemplateForm";
|
import { PkiTemplateForm } from "./components/PkiTemplateForm";
|
||||||
|
|
||||||
const PER_PAGE_INIT = 25;
|
const PER_PAGE_INIT = 25;
|
||||||
@@ -56,9 +60,13 @@ export const PkiTemplateListPage = () => {
|
|||||||
const [perPage, setPerPage] = useState(PER_PAGE_INIT);
|
const [perPage, setPerPage] = useState(PER_PAGE_INIT);
|
||||||
const { handlePopUpToggle, popUp, handlePopUpOpen, handlePopUpClose } = usePopUp([
|
const { handlePopUpToggle, popUp, handlePopUpOpen, handlePopUpClose } = usePopUp([
|
||||||
"certificateTemplate",
|
"certificateTemplate",
|
||||||
"deleteTemplate"
|
"deleteTemplate",
|
||||||
|
"enrollmentOptions",
|
||||||
|
"estUpgradePlan"
|
||||||
] as const);
|
] as const);
|
||||||
|
|
||||||
|
const { subscription } = useSubscription();
|
||||||
|
|
||||||
const { data, isPending } = useListCertificateTemplates({
|
const { data, isPending } = useListCertificateTemplates({
|
||||||
projectId: currentWorkspace.id,
|
projectId: currentWorkspace.id,
|
||||||
offset: (page - 1) * perPage,
|
offset: (page - 1) * perPage,
|
||||||
@@ -92,7 +100,7 @@ export const PkiTemplateListPage = () => {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Helmet>
|
<Helmet>
|
||||||
<title>{t("common.head-title", { title: "PKI Subscribers" })}</title>
|
<title>{t("common.head-title", { title: "PKI Templates" })}</title>
|
||||||
</Helmet>
|
</Helmet>
|
||||||
<div className="h-full bg-bunker-800">
|
<div className="h-full bg-bunker-800">
|
||||||
<div className="container mx-auto flex flex-col justify-between text-white">
|
<div className="container mx-auto flex flex-col justify-between text-white">
|
||||||
@@ -177,7 +185,33 @@ export const PkiTemplateListPage = () => {
|
|||||||
</DropdownMenuItem>
|
</DropdownMenuItem>
|
||||||
)}
|
)}
|
||||||
</ProjectPermissionCan>
|
</ProjectPermissionCan>
|
||||||
|
<ProjectPermissionCan
|
||||||
|
I={ProjectPermissionPkiTemplateActions.Edit}
|
||||||
|
a={ProjectPermissionSub.CertificateTemplates}
|
||||||
|
>
|
||||||
|
{(isAllowed) => (
|
||||||
|
<DropdownMenuItem
|
||||||
|
className={twMerge(
|
||||||
|
!isAllowed &&
|
||||||
|
"pointer-events-none cursor-not-allowed opacity-50"
|
||||||
|
)}
|
||||||
|
onClick={(e) => {
|
||||||
|
e.stopPropagation();
|
||||||
|
if (!subscription.pkiEst) {
|
||||||
|
handlePopUpOpen("estUpgradePlan");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
handlePopUpOpen("enrollmentOptions", {
|
||||||
|
id: template.id
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
disabled={!isAllowed}
|
||||||
|
icon={<FontAwesomeIcon icon={faCog} />}
|
||||||
|
>
|
||||||
|
Manage Enrollment
|
||||||
|
</DropdownMenuItem>
|
||||||
|
)}
|
||||||
|
</ProjectPermissionCan>
|
||||||
<ProjectPermissionCan
|
<ProjectPermissionCan
|
||||||
I={ProjectPermissionPkiTemplateActions.Delete}
|
I={ProjectPermissionPkiTemplateActions.Delete}
|
||||||
a={ProjectPermissionSub.CertificateTemplates}
|
a={ProjectPermissionSub.CertificateTemplates}
|
||||||
@@ -251,7 +285,13 @@ export const PkiTemplateListPage = () => {
|
|||||||
/>
|
/>
|
||||||
</ModalContent>
|
</ModalContent>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
<CertificateTemplateEnrollmentModal popUp={popUp} handlePopUpToggle={handlePopUpToggle} />
|
||||||
</div>
|
</div>
|
||||||
|
<UpgradePlanModal
|
||||||
|
isOpen={popUp.estUpgradePlan.isOpen}
|
||||||
|
onOpenChange={(isOpen) => handlePopUpToggle("estUpgradePlan", isOpen)}
|
||||||
|
text="You can only configure template enrollment methods if you switch to Infisical's Enterprise plan."
|
||||||
|
/>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user