fix: detect app-installer .env files through volume mounts

This commit is contained in:
KodekaTeam committed 2026-06-22 11:26:53 +07:00
1 parent 0f22a0caa0
commit 1435f5a6d7
4 files changed
+341 -118

No files matched your search

+17
View File
@@ -716,6 +716,12 @@ body {
border: none;
outline: none;
}
.btn:disabled,
.btn[aria-disabled="true"] {
cursor: not-allowed;
opacity: 0.48;
filter: grayscale(0.25);
}
.btn-sm {
max-height: 35px;
padding: 6px 12px;
@@ -733,6 +739,11 @@ body {
/* transform: translateY(-1px); */
/* box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4); */
}
.btn-primary:disabled,
.btn-primary[aria-disabled="true"] {
background: rgba(59, 130, 246, 0.18);
color: rgba(255, 255, 255, 0.52);
}
.btn-ghost {
background: transparent;
color: var(--text-secondary);
@@ -744,6 +755,12 @@ body {
color: var(--text-primary);
border-color: var(--border-hover);
}
.btn-ghost:disabled,
.btn-ghost[aria-disabled="true"] {
background: transparent;
color: var(--text-muted);
border-color: var(--border);
}
.btn-warning {
background: rgba(245, 158, 11, 0.15);
color: #f59e0b;
@@ -6,6 +6,7 @@ import {
CheckCircle2,
ClipboardCheck,
Loader2,
FileWarning,
RotateCcw,
Save,
ShieldAlert,
@@ -159,6 +160,7 @@ export default function EnvironmentTabPanel({
[editorContent],
);
const editableSource = getEditableSource(environment.editor.source);
const editorDisabled = !environment.editor.found;
const canSave =
Boolean(environment.editor.found && environment.editor.path) &&
editableSource !== null;
@@ -235,32 +237,68 @@ export default function EnvironmentTabPanel({
}}
>
<div>
<textarea
value={editorContent}
onChange={(event) => {
setEditorDraft({
source: environment.editor.content,
content: event.target.value,
status: "idle",
});
setEditorNotice(null);
}}
spellCheck={false}
style={{
width: "100%",
minHeight: 480,
resize: "vertical",
border: "1px solid var(--border)",
borderRadius: 7,
background: "var(--terminal-surface)",
color: "var(--terminal-body)",
padding: 12,
fontFamily: "var(--font--code)",
fontSize: 12,
lineHeight: 1.6,
outline: "none",
}}
/>
{editorDisabled ? (
<div
style={{
minHeight: 480,
border: "1px solid var(--border)",
borderRadius: 7,
background: "var(--terminal-surface)",
display: "flex",
flexDirection: "column",
alignItems: "center",
justifyContent: "center",
gap: 10,
color: "var(--terminal-body)",
textAlign: "center",
padding: 24,
}}
>
<FileWarning
size={30}
style={{ color: "var(--accent-yellow)" }}
/>
<strong>Project .env file is unavailable</strong>
<span
style={{
color: "var(--text-muted)",
fontSize: 12,
lineHeight: 1.5,
maxWidth: 560,
}}
>
{environment.editor.message ||
"No project .env file was found in the deployment or mounted project path."}
</span>
</div>
) : (
<textarea
value={editorContent}
onChange={(event) => {
setEditorDraft({
source: environment.editor.content,
content: event.target.value,
status: "idle",
});
setEditorNotice(null);
}}
spellCheck={false}
style={{
width: "100%",
minHeight: 480,
resize: "vertical",
border: "1px solid var(--border)",
borderRadius: 7,
background: "var(--terminal-surface)",
color: "var(--terminal-body)",
padding: 12,
fontFamily: "var(--font--code)",
fontSize: 12,
lineHeight: 1.6,
outline: "none",
}}
/>
)}
<div
style={{
display: "flex",
@@ -279,7 +317,7 @@ export default function EnvironmentTabPanel({
<button
type="button"
className="btn btn-ghost"
disabled={saving}
disabled={saving || editorDisabled}
onClick={() => {
setEditorDraft({
source: editorDraft.source,
@@ -299,7 +337,7 @@ export default function EnvironmentTabPanel({
<button
type="button"
className="btn btn-ghost"
disabled={saving}
disabled={saving || editorDisabled}
onClick={() => {
const validation = validateDotenvContent(editorContent);
setEditorNotice(validation);
@@ -371,10 +409,10 @@ export default function EnvironmentTabPanel({
: editorDirty
? "You have unsaved editor changes."
: environment.editor.found
? environment.editor.source === "container"
? "Editor is loaded from container filesystem .env."
: "Editor is loaded from project .env file."
: "Project .env was not found. Runtime env is shown as read-only fallback."}
? environment.editor.source === "container"
? "Editor is loaded from container filesystem .env."
: "Editor is loaded from project .env file."
: "Editor is disabled because no project .env file was found."}
</p>
<p
style={{