mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-07 19:22:14 +09:00
feat(instance): make the status page URL configurable (#1159)
This commit is contained in:
@@ -479,6 +479,8 @@ export function buildAPIConfigFromMaster(master: MasterConfig): APIConfig {
|
||||
wordmarkUrl: master.instance.branding.wordmark_url,
|
||||
faviconUrl: master.instance.branding.favicon_url,
|
||||
themeColor: master.instance.branding.theme_color,
|
||||
statusPageUrl: master.instance.branding.status_page_url,
|
||||
statusPageIncidentHistoryUrl: master.instance.branding.status_page_incident_history_url,
|
||||
},
|
||||
setup: {
|
||||
configured: master.instance.setup.configured,
|
||||
|
||||
@@ -305,6 +305,11 @@ export function InstanceConfigAdminController(app: HonoApp) {
|
||||
wordmark_url: readOptionalField(data.app_public.branding, 'wordmark_url'),
|
||||
favicon_url: readOptionalField(data.app_public.branding, 'favicon_url'),
|
||||
theme_color: readOptionalField(data.app_public.branding, 'theme_color'),
|
||||
status_page_url: readOptionalField(data.app_public.branding, 'status_page_url'),
|
||||
status_page_incident_history_url: readOptionalField(
|
||||
data.app_public.branding,
|
||||
'status_page_incident_history_url',
|
||||
),
|
||||
})
|
||||
: undefined,
|
||||
legal: data.app_public.legal
|
||||
|
||||
@@ -324,6 +324,8 @@ export interface APIConfig {
|
||||
wordmarkUrl?: string;
|
||||
faviconUrl?: string;
|
||||
themeColor?: string;
|
||||
statusPageUrl?: string;
|
||||
statusPageIncidentHistoryUrl?: string;
|
||||
};
|
||||
setup: {
|
||||
configured: boolean;
|
||||
|
||||
@@ -319,6 +319,8 @@ function getDefaultAppPublicConfig(): InstanceAppPublicConfig {
|
||||
wordmark_url: normalizeOptionalString(Config.instance.branding.wordmarkUrl),
|
||||
favicon_url: normalizeOptionalString(Config.instance.branding.faviconUrl),
|
||||
theme_color: normalizeOptionalString(Config.instance.branding.themeColor),
|
||||
status_page_url: normalizeOptionalString(Config.instance.branding.statusPageUrl),
|
||||
status_page_incident_history_url: normalizeOptionalString(Config.instance.branding.statusPageIncidentHistoryUrl),
|
||||
},
|
||||
setup: {
|
||||
configured: !Config.instance.selfHosted || Config.instance.setup.configured,
|
||||
@@ -519,6 +521,11 @@ function buildAppPublicConfig(config: z.infer<typeof StoredInstanceAppPublicSche
|
||||
wordmark_url: normalizeOptionalPublicString(branding.wordmark_url, defaults.branding.wordmark_url),
|
||||
favicon_url: normalizeOptionalPublicString(branding.favicon_url, defaults.branding.favicon_url),
|
||||
theme_color: normalizeOptionalPublicString(branding.theme_color, defaults.branding.theme_color),
|
||||
status_page_url: normalizeOptionalPublicString(branding.status_page_url, defaults.branding.status_page_url),
|
||||
status_page_incident_history_url: normalizeOptionalPublicString(
|
||||
branding.status_page_incident_history_url,
|
||||
defaults.branding.status_page_incident_history_url,
|
||||
),
|
||||
},
|
||||
setup: {
|
||||
configured: setup.configured ?? defaults.setup.configured,
|
||||
|
||||
@@ -29384,6 +29384,14 @@
|
||||
"theme_color": {
|
||||
"anyOf": [{"type": "string"}, {"type": "null"}],
|
||||
"description": "Optional browser theme color"
|
||||
},
|
||||
"status_page_url": {
|
||||
"anyOf": [{"type": "string"}, {"type": "null"}],
|
||||
"description": "Optional public status page URL"
|
||||
},
|
||||
"status_page_incident_history_url": {
|
||||
"anyOf": [{"type": "string"}, {"type": "null"}],
|
||||
"description": "Optional public status page incident history URL"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
@@ -29393,7 +29401,9 @@
|
||||
"logo_url",
|
||||
"wordmark_url",
|
||||
"favicon_url",
|
||||
"theme_color"
|
||||
"theme_color",
|
||||
"status_page_url",
|
||||
"status_page_incident_history_url"
|
||||
],
|
||||
"additionalProperties": false,
|
||||
"description": "Branding values safe to expose to clients"
|
||||
|
||||
Reference in New Issue
Block a user