mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
Add Service Banners (#5272)
This commit is contained in:
@@ -663,3 +663,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`)
|
||||
return response.data
|
||||
}
|
||||
|
||||
export const setServiceBanner = async (
|
||||
b: TypesGen.ServiceBanner,
|
||||
): Promise<TypesGen.ServiceBanner> => {
|
||||
const response = await axios.put(`/api/v2/service-banner`, b)
|
||||
return response.data
|
||||
}
|
||||
|
||||
@@ -22,4 +22,6 @@ export enum FeatureNames {
|
||||
BrowserOnly = "browser_only",
|
||||
SCIM = "scim",
|
||||
TemplateRBAC = "template_rbac",
|
||||
HighAvailability = "high_availability",
|
||||
ServiceBanners = "service_banners",
|
||||
}
|
||||
|
||||
@@ -604,6 +604,13 @@ export interface ServerSentEvent {
|
||||
readonly data: any
|
||||
}
|
||||
|
||||
// From codersdk/servicebanner.go
|
||||
export interface ServiceBanner {
|
||||
readonly enabled: boolean
|
||||
readonly message?: string
|
||||
readonly background_color?: string
|
||||
}
|
||||
|
||||
// From codersdk/deploymentconfig.go
|
||||
export interface TLSConfig {
|
||||
readonly enable: DeploymentConfigField<boolean>
|
||||
|
||||
Reference in New Issue
Block a user