Skip to content

Commit

Permalink
fix: override config is not advanced when type is runtime cmd
Browse files Browse the repository at this point in the history
  • Loading branch information
motoki317 committed Dec 8, 2023
1 parent d3c61b5 commit e3600d5
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 38 deletions.
76 changes: 44 additions & 32 deletions dashboard/src/components/templates/app/BuildConfigs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ interface RuntimeConfigProps {

const RuntimeConfigs: Component<RuntimeConfigProps> = (props) => {
const [useDB, setUseDB] = createSignal(false)
const buildType = () => getValue(props.formStore, 'case')

createEffect(() => {
if (
Expand All @@ -31,6 +32,43 @@ const RuntimeConfigs: Component<RuntimeConfigProps> = (props) => {
}
})

const containerOverrideConfig = (
<>
<Field of={props.formStore} name="config.runtimeConfig.entrypoint">
{(field, fieldProps) => (
<TextField
label="Entrypoint"
info={{
props: {
content: 'コンテナのEntrypoint',
},
}}
{...fieldProps}
value={field.value ?? ''}
error={field.error}
readOnly={!props.hasPermission}
/>
)}
</Field>
<Field of={props.formStore} name="config.runtimeConfig.command">
{(field, fieldProps) => (
<TextField
label="Command"
info={{
props: {
content: 'コンテナのCommand',
},
}}
{...fieldProps}
value={field.value ?? ''}
error={field.error}
readOnly={!props.hasPermission}
/>
)}
</Field>
</>
)

return (
<>
<ToolTip>
Expand Down Expand Up @@ -97,39 +135,13 @@ const RuntimeConfigs: Component<RuntimeConfigProps> = (props) => {
</ToolTip>
</FormItem>
</Show>
<Show when={buildType() === 'runtimeCmd'}>
{containerOverrideConfig}
</Show>
<FormItem title="高度な設定">
<Field of={props.formStore} name="config.runtimeConfig.entrypoint">
{(field, fieldProps) => (
<TextField
label="Entrypoint"
info={{
props: {
content: '(Advanced) コンテナのEntrypoint',
},
}}
{...fieldProps}
value={field.value ?? ''}
error={field.error}
readOnly={!props.hasPermission}
/>
)}
</Field>
<Field of={props.formStore} name="config.runtimeConfig.command">
{(field, fieldProps) => (
<TextField
label="Command"
info={{
props: {
content: '(Advanced) コンテナのCommand',
},
}}
{...fieldProps}
value={field.value ?? ''}
error={field.error}
readOnly={!props.hasPermission}
/>
)}
</Field>
<Show when={buildType() !== 'runtimeCmd'}>
{containerOverrideConfig}
</Show>
</FormItem>
</>
)
Expand Down
8 changes: 2 additions & 6 deletions dashboard/src/components/templates/app/SelectBuildType.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ const SelectBuildType: Component<{
</RadioGroup.ItemIndicator>
</RadioGroup.ItemControl>
</ItemTitle>
<Description>静的ファイルを配信します。ビルドが必要な場合もこちらを選びます</Description>
<Description>静的ファイルを配信します。ビルド(任意)を実行できます</Description>
</RadioGroup.ItemLabel>
</RadioGroup.Item>
</ItemsContainer>
Expand Down Expand Up @@ -246,11 +246,7 @@ const SelectBuildType: Component<{
</RadioGroup.ItemIndicator>
</RadioGroup.ItemControl>
</ItemTitle>
<Description>
{runType() === 'runtime'
? 'ベースDockerイメージと、ビルドコマンドを手動で設定します。'
: 'ビルド時のベースDockerイメージと、ビルドコマンドを手動で設定します。ビルドが必要無い場合は、こちらを選びます。'}
</Description>
<Description>ベースイメージとビルドコマンド(任意)を設定します。</Description>
</RadioGroup.ItemLabel>
</RadioGroup.Item>
<RadioGroup.Item class={itemStyle} value="dockerfile">
Expand Down

0 comments on commit e3600d5

Please sign in to comment.