feat: move proxy settings page to deployment options#8246
Conversation
Workspace proxy settings page is now an admin feature
|
Does this close #8153? |
Yes |
| case "recursive_inline": | ||
| // recursive_inline is a helper to make recursive tables look nicer. | ||
| // It skips prefixing the parent name to the child name. If you do this, | ||
| // make sure the child name is unique across all nested structs in the parent. | ||
| recursiveOpt = true | ||
| skipParentNameOpt = true |
There was a problem hiding this comment.
I had to do this to make the table names nice. Otherwise it is like Proxy Region Url instead of just URL
| onSelectRegion={onSelect} | ||
| preferred={ | ||
| preferredProxy ? proxy.id === preferredProxy.id : false | ||
| } |
There was a problem hiding this comment.
The deployment page removes the ability to select a proxy. That is all done in the dropdown now.
| // Code generated by 'make site/src/api/typesGenerated.ts'. DO NOT EDIT. | ||
|
|
||
| // From codersdk/genericmap.go | ||
| export interface Buzz { | ||
| readonly foo: Foo | ||
| readonly bazz: string | ||
| } | ||
|
|
||
| // From codersdk/genericmap.go | ||
| export interface Foo { | ||
| readonly bar: string | ||
| } | ||
|
|
||
| // From codersdk/genericmap.go | ||
| export interface FooBuzz<R extends Custom> { | ||
| readonly something: R[] | ||
| } | ||
|
|
||
| // From codersdk/genericmap.go | ||
| export type Custom = Foo | Buzz |
There was a problem hiding this comment.
The typesgenerated addition just allows this.
| // Not yet supported | ||
| //type FooBuzzMap[R Custom] struct { | ||
| // Something map[string]R `json:"something"` | ||
| //} | ||
|
|
||
| // Not yet supported | ||
| //type FooBuzzAnonymousUnion[R Foo | Buzz] struct { | ||
| // Something []R `json:"something"` | ||
| //} |
There was a problem hiding this comment.
I might get to this later in another PR. I do not need this in this PR.
| return TypescriptType{ValueType: underlying.ValueType + "[]", AboveTypeLine: underlying.AboveTypeLine}, nil | ||
| var genValue = "" | ||
| if underlying.GenericValue != "" { | ||
| genValue = underlying.GenericValue + "[]" | ||
| } | ||
| return TypescriptType{ | ||
| ValueType: underlying.ValueType + "[]", | ||
| GenericValue: genValue, | ||
| AboveTypeLine: underlying.AboveTypeLine, | ||
| GenericTypes: underlying.GenericTypes, | ||
| }, nil |
There was a problem hiding this comment.
The only reason this did not exist is because we did not need it yet. It's a trivial addition.
There was a problem hiding this comment.
Can you add the description for workspace proxies in the dropdown? Users may not know what this region does (is it where I provision workspaces, is it my preferred DERP when I ssh, etc?)
Workspace proxies are used to reduce the latency of web-based connections to your workspaces.
@bpmct I added that to this ticket: #8155 This PR has already grown a lot and I am stuck on how to style some dropdown additions. |
| }, | ||
| } | ||
| out, err := cliui.DisplayTable(inlineIn, "", []string{"name", "age"}) | ||
| log.Println("rendered table:\n" + out) |
There was a problem hiding this comment.
Yes, it's helpful to build the expected output. Test logs only log in the error case by default (unless you do go test -v)
| warnBadge: { | ||
| border: `1px solid ${theme.palette.warning.light}`, | ||
| backgroundColor: theme.palette.warning.dark, | ||
| }, |
There was a problem hiding this comment.
Nice! We do now support writing styled components as opposed to classes, which we may want to lean into so we can get rid of makeStyles eventually. Not something that needs to be changed here - just a heads up.
There was a problem hiding this comment.
Huh TIL. Will have to see some examples in the future.
There was a problem hiding this comment.
| let query = async (): Promise<Region[]> => { | ||
| const resp = await getWorkspaceProxyRegions() | ||
| return resp.regions | ||
| } | ||
|
|
||
| if (permissions.editWorkspaceProxies) { | ||
| // Admins should query the more detailed endpoint. | ||
| query = async (): Promise<Region[]> => { | ||
| const resp = await getWorkspaceProxies() | ||
| return resp.regions | ||
| } | ||
| } |
There was a problem hiding this comment.
| let query = async (): Promise<Region[]> => { | |
| const resp = await getWorkspaceProxyRegions() | |
| return resp.regions | |
| } | |
| if (permissions.editWorkspaceProxies) { | |
| // Admins should query the more detailed endpoint. | |
| query = async (): Promise<Region[]> => { | |
| const resp = await getWorkspaceProxies() | |
| return resp.regions | |
| } | |
| } | |
| const query = async (): Promise<Region[]> => { | |
| const endpoint = permissions.editWorkspaceProxies ? getWorkspaceProxies : getWorkspaceProxyRegions | |
| const resp = await endpoint() | |
| return resp.regions | |
| } |
There was a problem hiding this comment.
There is always a smaller way 😄
Kira-Pilot
left a comment
There was a problem hiding this comment.
Pulled down - seems to be working smoothly!
The Workspace proxy settings page was not showing any more information, so it was moved to the "Deployment" page only viewable by admins. More details can be shown there.
Closes #8153
Images
Regular user (member)
Admin
Notice the more accurate badges. Instead of just
HealthyandUnhealthy. Not shown are the error messages that cause those errors. Need to figure out a way to include them with good styling.Additional Changes
RegionorWorkspaceProxybased on the user's permsFuture work
Each workspace proxy has 0 or more warnings and errors. We should show these, I just do not know the best way to style it 😢.