feat(ui): distinguish dev/prod via VITE_DEPLOY_ENV
Both instances run with NODE_ENV=production, so import.meta.env.PROD was always true and the header always showed 'Production'. deploy.sh now passes VITE_DEPLOY_ENV=<branch> into the build and Header reads it to label the system indicator dev vs prod correctly.
This commit is contained in:
@ -16,7 +16,7 @@ git fetch --prune origin
|
|||||||
git checkout "$BRANCH"
|
git checkout "$BRANCH"
|
||||||
git pull --ff-only origin "$BRANCH"
|
git pull --ff-only origin "$BRANCH"
|
||||||
npm ci
|
npm ci
|
||||||
npm run build
|
VITE_DEPLOY_ENV="$BRANCH" npm run build
|
||||||
sudo systemctl restart "$SVC"
|
sudo systemctl restart "$SVC"
|
||||||
echo "Deployed $BRANCH ($SVC). Status:"
|
echo "Deployed $BRANCH ($SVC). Status:"
|
||||||
systemctl --no-pager status "$SVC" | head -n 5
|
systemctl --no-pager status "$SVC" | head -n 5
|
||||||
|
|||||||
@ -63,8 +63,8 @@ export default function Header({
|
|||||||
|
|
||||||
{/* System Indicator */}
|
{/* System Indicator */}
|
||||||
<div className="hidden md:flex items-center gap-2 px-3 py-1 bg-slate-800/60 rounded-full border border-slate-700/50 text-xs font-mono text-slate-300">
|
<div className="hidden md:flex items-center gap-2 px-3 py-1 bg-slate-800/60 rounded-full border border-slate-700/50 text-xs font-mono text-slate-300">
|
||||||
<span className={`w-2 h-2 rounded-full animate-pulse ${import.meta.env.PROD ? 'bg-emerald-500' : 'bg-amber-400'}`} />
|
<span className={`w-2 h-2 rounded-full animate-pulse ${(import.meta.env.VITE_DEPLOY_ENV === 'dev' || import.meta.env.DEV) ? 'bg-amber-400' : 'bg-emerald-500'}`} />
|
||||||
<span>System: {import.meta.env.PROD ? 'Production' : 'Development'}</span>
|
<span>System: {(import.meta.env.VITE_DEPLOY_ENV === 'dev' || import.meta.env.DEV) ? 'Development' : 'Production'}</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Mail Inbox */}
|
{/* Mail Inbox */}
|
||||||
|
|||||||
Reference in New Issue
Block a user