diff --git a/src/app/environment/page.tsx b/src/app/environment/page.tsx index 9bb5d2a..d051c0b 100644 --- a/src/app/environment/page.tsx +++ b/src/app/environment/page.tsx @@ -33,16 +33,6 @@ export default function EnvironmentPage() { fetch(); }, []); - const currentGroup = envGroups[selectedApp]; - - const toggleSecret = (key: string) => { - setShowSecrets((prev) => ({ ...prev, [key]: !prev[key] })); - }; - - const maskValue = (value: string) => { - return "•".repeat(Math.min(value.length, 24)); - }; - const handleSave = async () => { setIsSaving(true); try { @@ -54,6 +44,12 @@ export default function EnvironmentPage() { } }; + const currentGroup = envGroups[selectedApp] || { + id: "", + name: "", + variables: {}, + }; + return (

- {currentGroup?.variables.length} variables •{" "} - {currentGroup?.variables.filter((v) => v.secret).length} secrets + {Object.keys(currentGroup?.variables).length} variables •{" "} + { + Object.values(currentGroup?.variables).filter((v) => v.secret) + .length + }{" "} + secrets

@@ -129,9 +129,9 @@ export default function EnvironmentPage() { {/* Rows */}
- {currentGroup?.variables.map((variable, i) => ( + {Object.entries(currentGroup?.variables).map(([key, variable]) => (
{variable.secret && } - {variable.key} + {key}
{/* Value */}
{ + const newValue = e.target.value; + + setEnvGroups((prev) => ({ + ...prev, + [selectedApp]: { + ...prev[selectedApp], + variables: { + ...prev[selectedApp].variables, + [key]: { + ...prev[selectedApp].variables[key], + value: newValue, + }, + }, + }, + })); + }} className="font-mono text-xs h-8 bg-background border-border" />
@@ -168,9 +178,14 @@ export default function EnvironmentPage() {