refactor(ui): DiffView CSS module + drop duplicate snapshot type
This commit is contained in:
@@ -63,3 +63,30 @@
|
|||||||
.logTimestamp {
|
.logTimestamp {
|
||||||
color: var(--text-muted);
|
color: var(--text-muted);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ConfigPanel.tsx / DiffView */
|
||||||
|
.diffList {
|
||||||
|
font-family: monospace;
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.diffEntry {
|
||||||
|
margin-bottom: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.diffPath {
|
||||||
|
color: var(--text-muted);
|
||||||
|
margin-bottom: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.diffRemoved {
|
||||||
|
background: var(--red-bg, rgba(239, 68, 68, 0.15));
|
||||||
|
border-left: 2px solid var(--red, #ef4444);
|
||||||
|
padding: 2px 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.diffAdded {
|
||||||
|
background: var(--green-bg, rgba(34, 197, 94, 0.15));
|
||||||
|
border-left: 2px solid var(--green, #22c55e);
|
||||||
|
padding: 2px 6px;
|
||||||
|
}
|
||||||
|
|||||||
@@ -115,28 +115,12 @@ function DiffView({ diffs }: { diffs: FieldDiff[] }) {
|
|||||||
return <div className={styles.emptyState}>No differences in this section.</div>;
|
return <div className={styles.emptyState}>No differences in this section.</div>;
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<div style={{ fontFamily: 'monospace', fontSize: 12 }}>
|
<div className={styles.diffList}>
|
||||||
{diffs.map((d) => (
|
{diffs.map((d) => (
|
||||||
<div key={d.path} style={{ marginBottom: 8 }}>
|
<div key={d.path} className={styles.diffEntry}>
|
||||||
<div style={{ color: 'var(--text-muted)' }}>{d.path}</div>
|
<div className={styles.diffPath}>{d.path}</div>
|
||||||
<div
|
<div className={styles.diffRemoved}>- {JSON.stringify(d.oldValue)}</div>
|
||||||
style={{
|
<div className={styles.diffAdded}>+ {JSON.stringify(d.newValue)}</div>
|
||||||
background: 'var(--red-bg, rgba(239,68,68,0.15))',
|
|
||||||
borderLeft: '2px solid var(--red, #ef4444)',
|
|
||||||
padding: '2px 6px',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
- {JSON.stringify(d.oldValue)}
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
background: 'var(--green-bg, rgba(34,197,94,0.15))',
|
|
||||||
borderLeft: '2px solid var(--green, #22c55e)',
|
|
||||||
padding: '2px 6px',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
+ {JSON.stringify(d.newValue)}
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,11 +1,7 @@
|
|||||||
|
import type { Deployment } from '../../../../api/queries/admin/apps';
|
||||||
import type { DeploymentPageFormState } from '../hooks/useDeploymentPageState';
|
import type { DeploymentPageFormState } from '../hooks/useDeploymentPageState';
|
||||||
|
|
||||||
interface DeployedConfigSnapshot {
|
type DeployedConfigSnapshot = NonNullable<Deployment['deployedConfigSnapshot']>;
|
||||||
jarVersionId: string;
|
|
||||||
agentConfig: Record<string, unknown> | null;
|
|
||||||
containerConfig: Record<string, unknown>;
|
|
||||||
sensitiveKeys: string[] | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Maps a deployment snapshot to the page's form-state shape.
|
* Maps a deployment snapshot to the page's form-state shape.
|
||||||
|
|||||||
Reference in New Issue
Block a user