mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-24 17:48:30 +02:00
Better CSS
This commit is contained in:
@@ -98,53 +98,53 @@ export function EnvironmentEditor({
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={classNames(className, 'h-full grid grid-rows-[auto_auto_minmax(0,1fr)] gap-2')}>
|
<div className={classNames(className, 'h-full grid grid-rows-[auto_minmax(0,1fr)] gap-2')}>
|
||||||
<Heading className="w-full flex items-center gap-0.5">
|
<div className="flex flex-col gap-4">
|
||||||
<EnvironmentColorIndicator clickToEdit environment={environment ?? null} />
|
<Heading className="w-full flex items-center gap-0.5">
|
||||||
{!hideName && <div className="mr-2">{environment?.name}</div>}
|
<EnvironmentColorIndicator clickToEdit environment={environment ?? null} />
|
||||||
{isEncryptionEnabled ? (
|
{!hideName && <div className="mr-2">{environment?.name}</div>}
|
||||||
!allVariableAreEncrypted ? (
|
{isEncryptionEnabled ? (
|
||||||
<BadgeButton color="notice" onClick={() => encryptEnvironment(environment)}>
|
!allVariableAreEncrypted ? (
|
||||||
Encrypt All Variables
|
<BadgeButton color="notice" onClick={() => encryptEnvironment(environment)}>
|
||||||
</BadgeButton>
|
Encrypt All Variables
|
||||||
|
</BadgeButton>
|
||||||
|
) : (
|
||||||
|
<BadgeButton color="secondary" onClick={setupOrConfigureEncryption}>
|
||||||
|
Encryption Settings
|
||||||
|
</BadgeButton>
|
||||||
|
)
|
||||||
) : (
|
) : (
|
||||||
<BadgeButton color="secondary" onClick={setupOrConfigureEncryption}>
|
<BadgeButton color="secondary" onClick={() => valueVisibility.set((v) => !v)}>
|
||||||
Encryption Settings
|
{valueVisibility.value ? 'Hide Values' : 'Show Values'}
|
||||||
</BadgeButton>
|
</BadgeButton>
|
||||||
)
|
)}
|
||||||
) : (
|
<BadgeButton
|
||||||
<BadgeButton color="secondary" onClick={() => valueVisibility.set((v) => !v)}>
|
color="secondary"
|
||||||
{valueVisibility.value ? 'Hide Values' : 'Show Values'}
|
rightSlot={<EnvironmentSharableTooltip />}
|
||||||
|
onClick={async () => {
|
||||||
|
await patchModel(environment, { public: !environment.public });
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{environment.public ? 'Sharable' : 'Private'}
|
||||||
</BadgeButton>
|
</BadgeButton>
|
||||||
|
</Heading>
|
||||||
|
{environment.public && (!isEncryptionEnabled || !allVariableAreEncrypted) && (
|
||||||
|
<DismissibleBanner
|
||||||
|
id={`warn-unencrypted-${environment.id}`}
|
||||||
|
color="notice"
|
||||||
|
className="mr-3"
|
||||||
|
actions={[
|
||||||
|
{
|
||||||
|
label: 'Encrypt Variables',
|
||||||
|
onClick: () => encryptEnvironment(environment),
|
||||||
|
color: 'success',
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
>
|
||||||
|
This sharable environment contains plain-text secrets
|
||||||
|
</DismissibleBanner>
|
||||||
)}
|
)}
|
||||||
<BadgeButton
|
</div>
|
||||||
color="secondary"
|
|
||||||
rightSlot={<EnvironmentSharableTooltip />}
|
|
||||||
onClick={async () => {
|
|
||||||
await patchModel(environment, { public: !environment.public });
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{environment.public ? 'Sharable' : 'Private'}
|
|
||||||
</BadgeButton>
|
|
||||||
</Heading>
|
|
||||||
{environment.public && (!isEncryptionEnabled || !allVariableAreEncrypted) ? (
|
|
||||||
<DismissibleBanner
|
|
||||||
id={`warn-unencrypted-${environment.id}`}
|
|
||||||
color="notice"
|
|
||||||
className="mr-3"
|
|
||||||
actions={[
|
|
||||||
{
|
|
||||||
label: 'Encrypt Variables',
|
|
||||||
onClick: () => encryptEnvironment(environment),
|
|
||||||
color: 'success',
|
|
||||||
},
|
|
||||||
]}
|
|
||||||
>
|
|
||||||
This sharable environment contains plain-text secrets
|
|
||||||
</DismissibleBanner>
|
|
||||||
) : (
|
|
||||||
<span />
|
|
||||||
)}
|
|
||||||
<PairOrBulkEditor
|
<PairOrBulkEditor
|
||||||
className="h-full"
|
className="h-full"
|
||||||
allowMultilineValues
|
allowMultilineValues
|
||||||
|
|||||||
Reference in New Issue
Block a user