mirror of
https://github.com/DrizzleTime/Foxel.git
synced 2026-09-05 23:57:19 +08:00
feat: add favicon configuration
This commit is contained in:
@@ -37,10 +37,13 @@ async def get_all_config(
|
|||||||
|
|
||||||
@router.get("/status")
|
@router.get("/status")
|
||||||
async def get_system_status():
|
async def get_system_status():
|
||||||
|
logo = await ConfigCenter.get("APP_LOGO", "/logo.svg")
|
||||||
|
favicon = await ConfigCenter.get("APP_FAVICON", logo)
|
||||||
system_info = {
|
system_info = {
|
||||||
"version": VERSION,
|
"version": VERSION,
|
||||||
"title": await ConfigCenter.get("APP_NAME", "Foxel"),
|
"title": await ConfigCenter.get("APP_NAME", "Foxel"),
|
||||||
"logo": await ConfigCenter.get("APP_LOGO", "/logo.svg"),
|
"logo": logo,
|
||||||
|
"favicon": favicon,
|
||||||
"is_initialized": await has_users(),
|
"is_initialized": await has_users(),
|
||||||
"app_domain": await ConfigCenter.get("APP_DOMAIN"),
|
"app_domain": await ConfigCenter.get("APP_DOMAIN"),
|
||||||
"file_domain": await ConfigCenter.get("FILE_DOMAIN"),
|
"file_domain": await ConfigCenter.get("FILE_DOMAIN"),
|
||||||
|
|||||||
+7
-2
@@ -18,9 +18,14 @@ function AppInner() {
|
|||||||
const status = await getStatus();
|
const status = await getStatus();
|
||||||
setStatus(status);
|
setStatus(status);
|
||||||
document.title = status.title;
|
document.title = status.title;
|
||||||
const favicon = document.querySelector("link[rel*='icon']") as HTMLLinkElement;
|
let favicon = document.querySelector("link[rel*='icon']") as HTMLLinkElement | null;
|
||||||
|
if (!favicon) {
|
||||||
|
favicon = document.createElement('link');
|
||||||
|
favicon.rel = 'icon';
|
||||||
|
document.head.appendChild(favicon);
|
||||||
|
}
|
||||||
if (favicon) {
|
if (favicon) {
|
||||||
favicon.href = status.logo;
|
favicon.href = status.favicon || status.logo;
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("Failed to check initialization status:", error);
|
console.error("Failed to check initialization status:", error);
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ export interface SystemStatus {
|
|||||||
version: string;
|
version: string;
|
||||||
title: string;
|
title: string;
|
||||||
logo: string;
|
logo: string;
|
||||||
|
favicon: string;
|
||||||
is_initialized: boolean;
|
is_initialized: boolean;
|
||||||
app_domain?: string;
|
app_domain?: string;
|
||||||
file_domain?: string;
|
file_domain?: string;
|
||||||
|
|||||||
@@ -328,6 +328,7 @@ export const en = {
|
|||||||
'Clear Vector DB': 'Clear Vector DB',
|
'Clear Vector DB': 'Clear Vector DB',
|
||||||
'App Name': 'App Name',
|
'App Name': 'App Name',
|
||||||
'Logo URL': 'Logo URL',
|
'Logo URL': 'Logo URL',
|
||||||
|
'Favicon URL': 'Favicon URL',
|
||||||
'App Domain': 'App Domain',
|
'App Domain': 'App Domain',
|
||||||
'File Domain': 'File Domain',
|
'File Domain': 'File Domain',
|
||||||
'Vision API URL': 'Vision API URL',
|
'Vision API URL': 'Vision API URL',
|
||||||
|
|||||||
@@ -333,6 +333,7 @@ export const zh = {
|
|||||||
'Clear Vector DB': '清空向量库',
|
'Clear Vector DB': '清空向量库',
|
||||||
'App Name': '应用名称',
|
'App Name': '应用名称',
|
||||||
'Logo URL': 'LOGO地址',
|
'Logo URL': 'LOGO地址',
|
||||||
|
'Favicon URL': 'Favicon 地址',
|
||||||
'App Domain': '应用域名',
|
'App Domain': '应用域名',
|
||||||
'File Domain': '文件域名',
|
'File Domain': '文件域名',
|
||||||
'Vision API URL': '视觉模型 API 地址',
|
'Vision API URL': '视觉模型 API 地址',
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ interface SystemSettingsPageProps {
|
|||||||
const APP_CONFIG_KEYS: { key: string, label: string, default?: string }[] = [
|
const APP_CONFIG_KEYS: { key: string, label: string, default?: string }[] = [
|
||||||
{ key: 'APP_NAME', label: 'App Name' },
|
{ key: 'APP_NAME', label: 'App Name' },
|
||||||
{ key: 'APP_LOGO', label: 'Logo URL' },
|
{ key: 'APP_LOGO', label: 'Logo URL' },
|
||||||
|
{ key: 'APP_FAVICON', label: 'Favicon URL', default: '/logo.svg' },
|
||||||
{ key: 'APP_DOMAIN', label: 'App Domain' },
|
{ key: 'APP_DOMAIN', label: 'App Domain' },
|
||||||
{ key: 'FILE_DOMAIN', label: 'File Domain' },
|
{ key: 'FILE_DOMAIN', label: 'File Domain' },
|
||||||
];
|
];
|
||||||
|
|||||||
Reference in New Issue
Block a user