Add Service Banners (#5272)

This commit is contained in:
Ammar Bandukwala
2022-12-06 18:38:38 +00:00
committed by GitHub
parent df389d429c
commit 1cfe5de1c5
36 changed files with 959 additions and 4 deletions
+12
View File
@@ -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
}
+2
View File
@@ -22,4 +22,6 @@ export enum FeatureNames {
BrowserOnly = "browser_only",
SCIM = "scim",
TemplateRBAC = "template_rbac",
HighAvailability = "high_availability",
ServiceBanners = "service_banners",
}
+7
View File
@@ -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>