feat: add Runtime Type and Custom Arguments fields to deployment Resources tab
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -20,6 +20,8 @@ export interface AppVersion {
|
||||
jarChecksum: string;
|
||||
jarFilename: string;
|
||||
jarSizeBytes: number;
|
||||
detectedRuntimeType: string | null;
|
||||
detectedMainClass: string | null;
|
||||
uploadedAt: string;
|
||||
}
|
||||
|
||||
|
||||
@@ -209,6 +209,8 @@ function CreateAppView({ environments, selectedEnv }: { environments: Environmen
|
||||
const [deployStrategy, setDeployStrategy] = useState('blue-green');
|
||||
const [stripPrefix, setStripPrefix] = useState(true);
|
||||
const [sslOffloading, setSslOffloading] = useState(true);
|
||||
const [runtimeType, setRuntimeType] = useState(String(defaults.runtimeType ?? 'auto'));
|
||||
const [customArgs, setCustomArgs] = useState(String(defaults.customArgs ?? ''));
|
||||
|
||||
const [configTab, setConfigTab] = useState<'monitoring' | 'resources' | 'variables'>('monitoring');
|
||||
const [busy, setBusy] = useState(false);
|
||||
@@ -222,6 +224,8 @@ function CreateAppView({ environments, selectedEnv }: { environments: Environmen
|
||||
setCpuRequest(String(d.cpuRequest ?? 500));
|
||||
setCpuLimit(String(d.cpuLimit ?? ''));
|
||||
setPorts(Array.isArray(d.exposedPorts) ? d.exposedPorts as number[] : []);
|
||||
setRuntimeType(String(d.runtimeType ?? 'auto'));
|
||||
setCustomArgs(String(d.customArgs ?? ''));
|
||||
}, [envId, environments]);
|
||||
|
||||
useEffect(() => {
|
||||
@@ -261,6 +265,8 @@ function CreateAppView({ environments, selectedEnv }: { environments: Environmen
|
||||
deploymentStrategy: deployStrategy,
|
||||
stripPathPrefix: stripPrefix,
|
||||
sslOffloading: sslOffloading,
|
||||
runtimeType: runtimeType,
|
||||
customArgs: customArgs || null,
|
||||
};
|
||||
await updateContainerConfig.mutateAsync({ appId: app.slug, config: containerConfig });
|
||||
|
||||
@@ -821,6 +827,12 @@ function ConfigSubTab({ app, environment }: { app: App; environment?: Environmen
|
||||
const [deployStrategy, setDeployStrategy] = useState('blue-green');
|
||||
const [stripPrefix, setStripPrefix] = useState(true);
|
||||
const [sslOffloading, setSslOffloading] = useState(true);
|
||||
const [runtimeType, setRuntimeType] = useState(String(merged.runtimeType ?? 'auto'));
|
||||
const [customArgs, setCustomArgs] = useState(String(merged.customArgs ?? ''));
|
||||
|
||||
// Versions query for runtime detection hints
|
||||
const { data: versions = [] } = useAppVersions(app.slug);
|
||||
const latestVersion = versions?.[0] ?? null;
|
||||
|
||||
// Sync from server data
|
||||
const syncFromServer = useCallback(() => {
|
||||
@@ -848,6 +860,8 @@ function ConfigSubTab({ app, environment }: { app: App; environment?: Environmen
|
||||
setDeployStrategy(String(merged.deploymentStrategy ?? 'blue-green'));
|
||||
setStripPrefix(merged.stripPathPrefix !== false);
|
||||
setSslOffloading(merged.sslOffloading !== false);
|
||||
setRuntimeType(String(merged.runtimeType ?? 'auto'));
|
||||
setCustomArgs(String(merged.customArgs ?? ''));
|
||||
}, [agentConfig, merged]);
|
||||
|
||||
useEffect(() => { syncFromServer(); }, [syncFromServer]);
|
||||
@@ -897,6 +911,8 @@ function ConfigSubTab({ app, environment }: { app: App; environment?: Environmen
|
||||
deploymentStrategy: deployStrategy,
|
||||
stripPathPrefix: stripPrefix,
|
||||
sslOffloading: sslOffloading,
|
||||
runtimeType: runtimeType,
|
||||
customArgs: customArgs || null,
|
||||
};
|
||||
try {
|
||||
await updateContainerConfig.mutateAsync({ appId: app.slug, config: containerConfig });
|
||||
@@ -1092,6 +1108,37 @@ function ConfigSubTab({ app, environment }: { app: App; environment?: Environmen
|
||||
<div className={sectionStyles.section}>
|
||||
<SectionHeader>Container Resources</SectionHeader>
|
||||
<div className={styles.configGrid}>
|
||||
<span className={styles.configLabel}>Runtime Type</span>
|
||||
<div>
|
||||
<Select disabled={!editing} value={runtimeType} onChange={(e) => setRuntimeType(e.target.value)}
|
||||
options={[
|
||||
{ value: 'auto', label: 'Auto (detect from JAR)' },
|
||||
{ value: 'spring-boot', label: 'Spring Boot' },
|
||||
{ value: 'quarkus', label: 'Quarkus' },
|
||||
{ value: 'plain-java', label: 'Plain Java' },
|
||||
{ value: 'native', label: 'Native' },
|
||||
]} />
|
||||
{latestVersion?.detectedRuntimeType && (
|
||||
<span className={styles.configHint} style={{ color: 'var(--success)' }}>
|
||||
Detected: {latestVersion.detectedRuntimeType}
|
||||
</span>
|
||||
)}
|
||||
{latestVersion && !latestVersion.detectedRuntimeType && (
|
||||
<span className={styles.configHint} style={{ color: 'var(--amber)' }}>
|
||||
Detection failed — select runtime type manually
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<span className={styles.configLabel}>Custom Arguments</span>
|
||||
<div>
|
||||
<Input disabled={!editing} value={customArgs} onChange={(e) => setCustomArgs(e.target.value)}
|
||||
placeholder="-Xmx256m -Dfoo=bar" className={styles.inputLg} />
|
||||
<span className={styles.configHint}>
|
||||
{runtimeType === 'native' ? 'Arguments passed to the native binary' : 'Additional JVM arguments appended to the start command'}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<span className={styles.configLabel}>Memory Limit</span>
|
||||
<div className={styles.configInline}>
|
||||
<Input disabled={!editing} value={memoryLimit} onChange={(e) => setMemoryLimit(e.target.value)} className={styles.inputLg} />
|
||||
|
||||
Reference in New Issue
Block a user