-
Notifications
You must be signed in to change notification settings - Fork 937
feat: move proxy settings page to deployment options #8246
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I might get to this later in another PR. I do not need this in this PR.
scripts/apitypings/main.go
Outdated
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this log intentional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Huh TIL. Will have to see some examples in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
site/src/contexts/ProxyContext.tsx
Outdated
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is always a smaller way 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
Healthy
andUnhealthy
. Not shown are the error messages that cause those errors. Need to figure out a way to include them with good styling.Additional Changes
Region
orWorkspaceProxy
based 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 😢.