feat(settings): wire frontend to Coolify SoT response shape
- McpEnvVar: infisical_value → coolify_value + has_duplicates - McpEnvResponse: drop Infisical metadata fields - EnvVarRow: 'Coolify:' label, 'ערוך ב-Coolify' external link - DriftBadge: infisicalAvailable → coolifyAvailable - EnvironmentTab: Coolify app badge, duplicates count
This commit is contained in:
@@ -12,22 +12,20 @@ import { EnvVarEditor } from "./env-var-editor";
|
||||
|
||||
type Props = {
|
||||
spec: McpEnvVar;
|
||||
infisicalProjectId: string;
|
||||
infisicalEnv: string;
|
||||
infisicalAvailable: boolean;
|
||||
coolifyAppUuid: string;
|
||||
coolifyAvailable: boolean;
|
||||
onPendingRedeploy: () => void;
|
||||
};
|
||||
|
||||
export function EnvVarRow({
|
||||
spec,
|
||||
infisicalProjectId,
|
||||
infisicalEnv,
|
||||
infisicalAvailable,
|
||||
coolifyAppUuid,
|
||||
coolifyAvailable,
|
||||
onPendingRedeploy,
|
||||
}: Props) {
|
||||
const [draft, setDraft] = useState<string>(spec.infisical_value ?? "");
|
||||
const [draft, setDraft] = useState<string>(spec.coolify_value ?? "");
|
||||
const update = useUpdateMcpEnv();
|
||||
const dirty = draft !== (spec.infisical_value ?? "");
|
||||
const dirty = draft !== (spec.coolify_value ?? "");
|
||||
|
||||
function handleSave() {
|
||||
update.mutate(
|
||||
@@ -42,8 +40,8 @@ export function EnvVarRow({
|
||||
);
|
||||
}
|
||||
|
||||
const infisicalUrl =
|
||||
`https://secret.dev.marcus-law.co.il/project/${infisicalProjectId}/secrets/overview?env=${infisicalEnv}`;
|
||||
const coolifyEnvUrl =
|
||||
`https://coolify.nautilus.marcusgroup.org/project/applications/${coolifyAppUuid}/environment-variables`;
|
||||
|
||||
return (
|
||||
<div className="rounded-md border border-rule p-4 bg-rule-soft/20 hover:bg-rule-soft/40 transition-colors">
|
||||
@@ -62,7 +60,12 @@ export function EnvVarRow({
|
||||
secret
|
||||
</Badge>
|
||||
)}
|
||||
<DriftBadge drift={spec.drift} infisicalAvailable={infisicalAvailable} />
|
||||
<DriftBadge drift={spec.drift} coolifyAvailable={coolifyAvailable} />
|
||||
{spec.has_duplicates && (
|
||||
<Badge variant="outline" className="text-[0.7rem] text-warn border-warn/40">
|
||||
duplicates
|
||||
</Badge>
|
||||
)}
|
||||
</div>
|
||||
<p className="text-sm text-ink-muted mt-1">{spec.description}</p>
|
||||
</div>
|
||||
@@ -70,7 +73,7 @@ export function EnvVarRow({
|
||||
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 gap-3 text-sm">
|
||||
<div className="flex items-center gap-2">
|
||||
<span className="text-[0.72rem] text-ink-muted w-20">Infisical:</span>
|
||||
<span className="text-[0.72rem] text-ink-muted w-20">Coolify:</span>
|
||||
{spec.is_editable ? (
|
||||
<EnvVarEditor
|
||||
spec={spec}
|
||||
@@ -80,7 +83,7 @@ export function EnvVarRow({
|
||||
/>
|
||||
) : (
|
||||
<span className="font-mono text-ink" dir="ltr">
|
||||
{spec.infisical_value ?? <em className="text-ink-muted">— לא מוגדר —</em>}
|
||||
{spec.coolify_value ?? <em className="text-ink-muted">— לא מוגדר —</em>}
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
@@ -95,12 +98,12 @@ export function EnvVarRow({
|
||||
<div className="flex items-center justify-end gap-2 mt-3">
|
||||
{!spec.is_editable && (
|
||||
<a
|
||||
href={infisicalUrl}
|
||||
href={coolifyEnvUrl}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="text-[0.78rem] text-gold-deep hover:underline flex items-center gap-1"
|
||||
>
|
||||
ערוך ב-Infisical
|
||||
ערוך ב-Coolify
|
||||
<ExternalLink className="w-3 h-3" />
|
||||
</a>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user