fix(routing-rules): backend selector showed (undefined:undefined) instead of scheme
The Backend interface declared address/port fields that don't exist on the Backend model (those belong to BackendServer). The table column and the backend select dropdown both rendered "name (undefined:undefined)". Fixed by replacing phantom fields with scheme, matching the same fix applied to Domains pages in v1.1.121. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -32,7 +32,7 @@ interface RuleFormValues {
|
||||
}
|
||||
|
||||
interface Domain { id: number; name: string }
|
||||
interface Backend { id: number; name: string; address: string; port: number }
|
||||
interface Backend { id: number; name: string; scheme: string }
|
||||
|
||||
async function listRules(): Promise<RoutingRule[]> {
|
||||
const r = await apiClient.get('/routing-rules')
|
||||
@@ -83,7 +83,7 @@ export default function RoutingRulesPage() {
|
||||
const domainName = (id: number) => domains?.find((d) => d.id === id)?.name ?? `#${id}`
|
||||
const backendLabel = (id: number) => {
|
||||
const b = backends?.find((x) => x.id === id)
|
||||
return b ? `${b.name} (${b.address}:${b.port})` : `#${id}`
|
||||
return b ? `${b.name} (${b.scheme})` : `#${id}`
|
||||
}
|
||||
const backendHealth = (id: number) => {
|
||||
if (!haproxyStats?.length) return null
|
||||
@@ -290,7 +290,7 @@ export default function RoutingRulesPage() {
|
||||
</Form.Item>
|
||||
<Form.Item label={t('routing.backend')} name="backend_id" rules={[{ required: true }]}>
|
||||
<Select
|
||||
options={(backends ?? []).map((b) => ({ value: b.id, label: `${b.name} (${b.address}:${b.port})` }))}
|
||||
options={(backends ?? []).map((b) => ({ value: b.id, label: `${b.name} (${b.scheme})` }))}
|
||||
placeholder={t('routing.selectBackend')}
|
||||
/>
|
||||
</Form.Item>
|
||||
|
||||
Reference in New Issue
Block a user