Skip to content

Commit

Permalink
🐛 ワイルドカード出ないドメインの選択時にもホスト名入力欄が出ていた
Browse files Browse the repository at this point in the history
  • Loading branch information
eyemono-moe committed Oct 10, 2023
1 parent 4881c98 commit 16fa058
Showing 1 changed file with 30 additions and 23 deletions.
53 changes: 30 additions & 23 deletions dashboard/src/components/templates/WebsiteSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,10 @@ export const WebsiteSetting = (props: WebsiteSettingProps) => {

const matchDomain = wildCardDomains().find((d) => fqdn.endsWith(d.domain.replace(/\*/g, '')))
if (matchDomain === undefined) {
throw new Error('Invalid FQDN')
return {
host: '',
domain: systemInfo()?.domains[0],
}
}
return {
host: fqdn.slice(0, -matchDomain.domain.length + 1),
Expand Down Expand Up @@ -164,16 +167,18 @@ export const WebsiteSetting = (props: WebsiteSettingProps) => {
</ToolTip>
</HttpSelectContainer>
<span>://</span>
<TextInput
placeholder="example.trap.show"
value={host()}
onInput={(e) => setHost(e.target.value)}
tooltip={{
props: {
content: 'ホスト名',
},
}}
/>
<Show when={domain()?.domain.startsWith('*')}>
<TextInput
placeholder="example.trap.show"
value={host()}
onInput={(e) => setHost(e.target.value)}
tooltip={{
props: {
content: 'ホスト名',
},
}}
/>
</Show>
<ToolTip
props={{
content: 'ドメイン',
Expand Down Expand Up @@ -209,18 +214,20 @@ export const WebsiteSetting = (props: WebsiteSettingProps) => {
/>
<Show when={props.isRuntimeApp}>
<span></span>
<TextInput
placeholder="80"
type="number"
min="0"
value={props.website.httpPort || ''}
onChange={(e) => props.setWebsite('httpPort', +e.target.value)}
tooltip={{
props: {
content: 'アプリのHTTP Port番号',
},
}}
/>
<HttpSelectContainer>
<TextInput
placeholder="80"
type="number"
min="0"
value={props.website.httpPort || ''}
onChange={(e) => props.setWebsite('httpPort', +e.target.value)}
tooltip={{
props: {
content: 'アプリのHTTP Port番号',
},
}}
/>
</HttpSelectContainer>
<span>/TCP</span>
</Show>
</URLContainer>
Expand Down

0 comments on commit 16fa058

Please sign in to comment.