mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat: enable enterprise users to specify a custom logo (#5566)
* feat: enable enterprise users to specify a custom logo This adds a field in deployment settings that allows users to specify the URL to a custom logo that will display in the dashboard. This also groups service banner into a new appearance settings page. It adds a Fieldset component to allow for modular fields moving forward. * Fix tests
This commit is contained in:
+6
-6
@@ -723,15 +723,15 @@ export const getFile = async (fileId: string): Promise<ArrayBuffer> => {
|
||||
return response.data
|
||||
}
|
||||
|
||||
export const getServiceBanner = async (): Promise<TypesGen.ServiceBanner> => {
|
||||
const response = await axios.get(`/api/v2/service-banner`)
|
||||
export const getAppearance = async (): Promise<TypesGen.AppearanceConfig> => {
|
||||
const response = await axios.get(`/api/v2/appearance`)
|
||||
return response.data
|
||||
}
|
||||
|
||||
export const setServiceBanner = async (
|
||||
b: TypesGen.ServiceBanner,
|
||||
): Promise<TypesGen.ServiceBanner> => {
|
||||
const response = await axios.put(`/api/v2/service-banner`, b)
|
||||
export const updateAppearance = async (
|
||||
b: TypesGen.AppearanceConfig,
|
||||
): Promise<TypesGen.AppearanceConfig> => {
|
||||
const response = await axios.put(`/api/v2/appearance`, b)
|
||||
return response.data
|
||||
}
|
||||
|
||||
|
||||
@@ -23,5 +23,5 @@ export enum FeatureNames {
|
||||
SCIM = "scim",
|
||||
TemplateRBAC = "template_rbac",
|
||||
HighAvailability = "high_availability",
|
||||
ServiceBanners = "service_banners",
|
||||
Appearance = "appearance",
|
||||
}
|
||||
|
||||
@@ -31,6 +31,12 @@ export interface AgentStatsReportResponse {
|
||||
readonly tx_bytes: number
|
||||
}
|
||||
|
||||
// From codersdk/appearance.go
|
||||
export interface AppearanceConfig {
|
||||
readonly logo_url: string
|
||||
readonly service_banner: ServiceBannerConfig
|
||||
}
|
||||
|
||||
// From codersdk/roles.go
|
||||
export interface AssignableRoles extends Role {
|
||||
readonly assignable: boolean
|
||||
@@ -611,8 +617,8 @@ export interface ServerSentEvent {
|
||||
readonly data: any
|
||||
}
|
||||
|
||||
// From codersdk/servicebanner.go
|
||||
export interface ServiceBanner {
|
||||
// From codersdk/appearance.go
|
||||
export interface ServiceBannerConfig {
|
||||
readonly enabled: boolean
|
||||
readonly message?: string
|
||||
readonly background_color?: string
|
||||
@@ -739,6 +745,11 @@ export interface UpdateActiveTemplateVersion {
|
||||
readonly id: string
|
||||
}
|
||||
|
||||
// From codersdk/branding.go
|
||||
export interface UpdateBrandingRequest {
|
||||
readonly logo_url: string
|
||||
}
|
||||
|
||||
// From codersdk/updatecheck.go
|
||||
export interface UpdateCheckResponse {
|
||||
readonly current: boolean
|
||||
|
||||
Reference in New Issue
Block a user