mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-10 19:28:51 +00:00
Minor styling updates
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
import { SetStateAction, useEffect, useState } from 'react';
|
import { SetStateAction, useEffect, useState } from 'react';
|
||||||
|
import Image from 'next/image';
|
||||||
|
|
||||||
import { WorkspaceEnv } from '~/pages/dashboard/[id]';
|
import { WorkspaceEnv } from '@app/hooks/api/types';
|
||||||
|
|
||||||
import getSecretsForProject from '../utilities/secrets/getSecretsForProject';
|
import getSecretsForProject from '../utilities/secrets/getSecretsForProject';
|
||||||
import { Modal, ModalContent } from '../v2';
|
import { Modal, ModalContent } from '../v2';
|
||||||
@@ -33,9 +34,10 @@ const CompareSecretsModal = ({
|
|||||||
const [secrets, setSecrets] = useState<Secrets[]>([]);
|
const [secrets, setSecrets] = useState<Secrets[]>([]);
|
||||||
|
|
||||||
const getEnvSecrets = async () => {
|
const getEnvSecrets = async () => {
|
||||||
const workspaceEnvironments = workspaceEnvs.filter((env) => env !== selectedEnv);
|
const workspaceEnvironments = workspaceEnvs?.filter((env) => env !== selectedEnv);
|
||||||
const newSecrets = await Promise.all(
|
const newSecrets = await Promise.all(
|
||||||
workspaceEnvironments.map(async (env) => {
|
workspaceEnvironments.map(async (env) => {
|
||||||
|
// #TODO: optimize this query somehow...
|
||||||
const allSecrets = await getSecretsForProject({ env: env.slug, workspaceId });
|
const allSecrets = await getSecretsForProject({ env: env.slug, workspaceId });
|
||||||
const secret =
|
const secret =
|
||||||
allSecrets.find((item) => item.key === currentSecret.key)?.value ?? 'Not found';
|
allSecrets.find((item) => item.key === currentSecret.key)?.value ?? 'Not found';
|
||||||
@@ -57,16 +59,27 @@ const CompareSecretsModal = ({
|
|||||||
<Modal isOpen={compareModal} onOpenChange={setCompareModal}>
|
<Modal isOpen={compareModal} onOpenChange={setCompareModal}>
|
||||||
<ModalContent title={currentSecret?.key} onOpenAutoFocus={(e) => e.preventDefault()}>
|
<ModalContent title={currentSecret?.key} onOpenAutoFocus={(e) => e.preventDefault()}>
|
||||||
<div className="space-y-4">
|
<div className="space-y-4">
|
||||||
{secrets.map((item) => (
|
{secrets.length === 0 ? (
|
||||||
<div key={`${currentSecret.key}${item.label}`} className="space-y-1">
|
<div className="flex items-center bg-bunker-900 justify-center h-full py-4 rounded-md">
|
||||||
|
<Image
|
||||||
|
src="/images/loading/loading.gif"
|
||||||
|
height={60}
|
||||||
|
width={100}
|
||||||
|
alt="infisical loading indicator"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
|
secrets.map((item) => (
|
||||||
|
<div key={`${currentSecret.key}${item.label}`} className="space-y-0.5">
|
||||||
<p className="text-sm text-bunker-300">{item.label}</p>
|
<p className="text-sm text-bunker-300">{item.label}</p>
|
||||||
<input
|
<input
|
||||||
defaultValue={item.secret}
|
defaultValue={item.secret}
|
||||||
className="h-no-capture text-md min-w-16 no-scrollbar::-webkit-scrollbar peer z-10 w-full rounded-md bg-bunker-800 px-2 py-1.5 font-mono text-gray-400 caret-white outline-none duration-200 no-scrollbar focus:ring-2 focus:ring-primary/50 "
|
className="h-no-capture border border-mineshaft-500 text-md min-w-16 no-scrollbar::-webkit-scrollbar peer z-10 w-full rounded-md bg-bunker-800 px-2 py-1.5 font-mono text-gray-400 caret-white outline-none duration-200 no-scrollbar focus:ring-2 focus:ring-primary/50 "
|
||||||
readOnly
|
readOnly
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
))}
|
))
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</ModalContent>
|
</ModalContent>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|||||||
@@ -6,8 +6,7 @@ import { faX } from '@fortawesome/free-solid-svg-icons';
|
|||||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||||
|
|
||||||
import SecretVersionList from '@app/ee/components/SecretVersionList';
|
import SecretVersionList from '@app/ee/components/SecretVersionList';
|
||||||
|
import { WorkspaceEnv } from '@app/hooks/api/types';
|
||||||
import { WorkspaceEnv } from '~/pages/dashboard/[id]';
|
|
||||||
|
|
||||||
import Button from '../basic/buttons/Button';
|
import Button from '../basic/buttons/Button';
|
||||||
import Toggle from '../basic/Toggle';
|
import Toggle from '../basic/Toggle';
|
||||||
@@ -181,7 +180,7 @@ const SideBar = ({
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
<div className="mt-full mt-4 mb-[4.7rem] flex max-w-sm flex-col justify-start space-y-2 px-4">
|
<div className="mt-full mt-4 mb-4 flex max-w-sm flex-col justify-start space-y-2 px-4">
|
||||||
<div>
|
<div>
|
||||||
<Button
|
<Button
|
||||||
text="Compare secret across environments"
|
text="Compare secret across environments"
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ export const ModalContent = forwardRef<HTMLDivElement, ModalContentProps>(
|
|||||||
<Card
|
<Card
|
||||||
isRounded
|
isRounded
|
||||||
className={twMerge(
|
className={twMerge(
|
||||||
'fixed top-1/2 left-1/2 max-w-lg -translate-y-2/4 -translate-x-2/4 animate-popIn drop-shadow-md',
|
'fixed top-1/2 left-1/2 max-w-lg -translate-y-2/4 -translate-x-2/4 animate-popIn drop-shadow-2xl z-50',
|
||||||
className
|
className
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -539,6 +539,9 @@ export default function Dashboard() {
|
|||||||
modifyValueOverride={listenChangeValueOverride}
|
modifyValueOverride={listenChangeValueOverride}
|
||||||
modifyComment={listenChangeComment}
|
modifyComment={listenChangeComment}
|
||||||
buttonReady={buttonReady}
|
buttonReady={buttonReady}
|
||||||
|
workspaceEnvs={workspaceEnvs}
|
||||||
|
selectedEnv={selectedEnv}
|
||||||
|
workspaceId={workspaceId}
|
||||||
savePush={savePush}
|
savePush={savePush}
|
||||||
sharedToHide={sharedToHide}
|
sharedToHide={sharedToHide}
|
||||||
setSharedToHide={setSharedToHide}
|
setSharedToHide={setSharedToHide}
|
||||||
@@ -870,7 +873,6 @@ export default function Dashboard() {
|
|||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<div className="relative z-10 w-10/12 mr-auto h-full ml-2 bg-bunker-800 flex flex-col items-center justify-center">
|
<div className="relative z-10 w-10/12 mr-auto h-full ml-2 bg-bunker-800 flex flex-col items-center justify-center">
|
||||||
<div className="absolute top-0 bg-bunker h-14 border-b border-mineshaft-700 w-full" />
|
|
||||||
<Image src="/images/loading/loading.gif" height={70} width={120} alt="loading animation" />
|
<Image src="/images/loading/loading.gif" height={70} width={120} alt="loading animation" />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -207,7 +207,6 @@ export default function Users() {
|
|||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<div className="relative z-10 w-10/12 mr-auto h-full ml-2 bg-bunker-800 flex flex-col items-center justify-center">
|
<div className="relative z-10 w-10/12 mr-auto h-full ml-2 bg-bunker-800 flex flex-col items-center justify-center">
|
||||||
<div className="absolute top-0 bg-bunker h-14 border-b border-mineshaft-700 w-full" />
|
|
||||||
<Image src="/images/loading/loading.gif" height={70} width={120} alt="loading animation" />
|
<Image src="/images/loading/loading.gif" height={70} width={120} alt="loading animation" />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user