• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

stacklok / toolhive-studio / 20850324431

09 Jan 2026 11:22AM UTC coverage: 53.072% (+0.1%) from 52.941%
20850324431

Pull #1408

github

web-flow
Merge f81dc8a00 into d8ac916b9
Pull Request #1408: feat(workloads): add proxy_mode and proxy_port fields to MCP server forms

2125 of 4186 branches covered (50.76%)

Branch coverage included in aggregate %.

17 of 19 new or added lines in 4 files covered. (89.47%)

3 existing lines in 2 files now uncovered.

3334 of 6100 relevant lines covered (54.66%)

124.41 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

55.56
/renderer/src/common/components/workloads/form-fields-proxy.tsx
1
import {
2
  FormControl,
3
  FormField,
4
  FormItem,
5
  FormLabel,
6
  FormMessage,
7
} from '@/common/components/ui/form'
8
import { Input } from '@/common/components/ui/input'
9
import {
10
  Select,
11
  SelectContent,
12
  SelectItem,
13
  SelectTrigger,
14
  SelectValue,
15
} from '@/common/components/ui/select'
16
import { TooltipInfoIcon } from '@/common/components/ui/tooltip-info-icon'
17
import type { Control, FieldValues, Path } from 'react-hook-form'
18

19
type ProxyFields = {
20
  proxy_mode: 'sse' | 'streamable-http'
21
  proxy_port?: number
22
}
23

24
interface FormFieldsProxyProps<T extends FieldValues & ProxyFields> {
25
  control: Control<T>
26
}
27

28
export function FormFieldsProxy<T extends FieldValues & ProxyFields>({
29
  control,
30
}: FormFieldsProxyProps<T>) {
31
  return (
258✔
32
    <>
33
      <FormField
34
        control={control}
35
        name={'proxy_mode' as Path<T>}
36
        render={({ field }) => (
262✔
37
          <FormItem>
38
            <div className="flex items-center gap-1">
39
              <FormLabel htmlFor={field.name}>Proxy mode</FormLabel>
40
              <TooltipInfoIcon>
41
                The proxy transport mode that clients should use to connect to
42
                this server.
43
              </TooltipInfoIcon>
44
            </div>
45
            <FormControl>
46
              <Select
47
                onValueChange={field.onChange}
48
                value={field.value}
49
                name={field.name}
50
              >
51
                <SelectTrigger id={field.name} className="w-full">
52
                  <SelectValue placeholder="Select proxy mode" />
53
                </SelectTrigger>
54
                <SelectContent>
55
                  <SelectItem value="sse">SSE</SelectItem>
56
                  <SelectItem value="streamable-http">
57
                    Streamable HTTP
58
                  </SelectItem>
59
                </SelectContent>
60
              </Select>
61
            </FormControl>
62
            <FormMessage />
63
          </FormItem>
64
        )}
65
      />
66

67
      <FormField
68
        control={control}
69
        name={'proxy_port' as Path<T>}
70
        render={({ field }) => (
262✔
71
          <FormItem>
72
            <div className="flex items-center gap-1">
73
              <FormLabel htmlFor={field.name}>Proxy port</FormLabel>
74
              <TooltipInfoIcon className="max-w-72">
75
                Port for the HTTP proxy to listen on. If not specified, ToolHive
76
                will automatically assign a random port.
77
              </TooltipInfoIcon>
78
            </div>
79
            <FormControl>
80
              <Input
81
                id={field.name}
82
                autoCorrect="off"
83
                autoComplete="off"
84
                type="number"
85
                data-1p-ignore
86
                placeholder="Leave empty for random port"
87
                value={field.value ?? ''}
524✔
88
                onChange={(e) => {
NEW
89
                  const value = e.target.value
×
NEW
90
                  field.onChange(value === '' ? undefined : parseInt(value, 10))
×
91
                }}
92
                name={field.name}
93
              />
94
            </FormControl>
95
            <FormMessage />
96
          </FormItem>
97
        )}
98
      />
99
    </>
100
  )
101
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc