Language switching and merging
Add the webuiInitialize variable, dev: '', build:'/webui'
This commit is contained in:
@@ -1,17 +0,0 @@
|
|||||||
<!doctype html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8" />
|
|
||||||
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
|
|
||||||
<meta http-equiv="Pragma" content="no-cache" />
|
|
||||||
<meta http-equiv="Expires" content="0" />
|
|
||||||
<link rel="icon" type="image/svg+xml" href="./logo.png" />
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
||||||
<title>Lightrag</title>
|
|
||||||
<script type="module" crossorigin src="./assets/index-DwcJE583.js"></script>
|
|
||||||
<link rel="stylesheet" crossorigin href="./assets/index-BV5s8k-a.css">
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div id="root"></div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
@@ -5,8 +5,13 @@ import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@
|
|||||||
import { useSettingsStore } from '@/stores/settings'
|
import { useSettingsStore } from '@/stores/settings'
|
||||||
import { PaletteIcon } from 'lucide-react'
|
import { PaletteIcon } from 'lucide-react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
|
import { cn } from '@/lib/utils'
|
||||||
|
|
||||||
export default function AppSettings() {
|
interface AppSettingsProps {
|
||||||
|
className?: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export default function AppSettings({ className }: AppSettingsProps) {
|
||||||
const [opened, setOpened] = useState<boolean>(false)
|
const [opened, setOpened] = useState<boolean>(false)
|
||||||
const { t } = useTranslation()
|
const { t } = useTranslation()
|
||||||
|
|
||||||
@@ -27,7 +32,7 @@ export default function AppSettings() {
|
|||||||
return (
|
return (
|
||||||
<Popover open={opened} onOpenChange={setOpened}>
|
<Popover open={opened} onOpenChange={setOpened}>
|
||||||
<PopoverTrigger asChild>
|
<PopoverTrigger asChild>
|
||||||
<Button variant="outline" size="icon" className="h-9 w-9">
|
<Button variant="ghost" size="icon" className={cn("h-9 w-9", className)}>
|
||||||
<PaletteIcon className="h-5 w-5" />
|
<PaletteIcon className="h-5 w-5" />
|
||||||
</Button>
|
</Button>
|
||||||
</PopoverTrigger>
|
</PopoverTrigger>
|
||||||
|
@@ -9,8 +9,7 @@ import { Card, CardContent, CardHeader } from '@/components/ui/Card'
|
|||||||
import Input from '@/components/ui/Input'
|
import Input from '@/components/ui/Input'
|
||||||
import Button from '@/components/ui/Button'
|
import Button from '@/components/ui/Button'
|
||||||
import { ZapIcon } from 'lucide-react'
|
import { ZapIcon } from 'lucide-react'
|
||||||
import ThemeToggle from '@/components/ThemeToggle'
|
import AppSettings from '@/components/AppSettings'
|
||||||
import LanguageToggle from '@/components/LanguageToggle'
|
|
||||||
|
|
||||||
const LoginPage = () => {
|
const LoginPage = () => {
|
||||||
const navigate = useNavigate()
|
const navigate = useNavigate()
|
||||||
@@ -44,8 +43,7 @@ const LoginPage = () => {
|
|||||||
return (
|
return (
|
||||||
<div className="flex h-screen w-screen items-center justify-center bg-gradient-to-br from-emerald-50 to-teal-100 dark:from-gray-900 dark:to-gray-800">
|
<div className="flex h-screen w-screen items-center justify-center bg-gradient-to-br from-emerald-50 to-teal-100 dark:from-gray-900 dark:to-gray-800">
|
||||||
<div className="absolute top-4 right-4 flex items-center gap-2">
|
<div className="absolute top-4 right-4 flex items-center gap-2">
|
||||||
<LanguageToggle />
|
<AppSettings className="bg-white/30 dark:bg-gray-800/30 backdrop-blur-sm rounded-md" />
|
||||||
<ThemeToggle />
|
|
||||||
</div>
|
</div>
|
||||||
<Card className="w-full max-w-[480px] shadow-lg mx-4">
|
<Card className="w-full max-w-[480px] shadow-lg mx-4">
|
||||||
<CardHeader className="flex items-center justify-center space-y-2 pb-8 pt-6">
|
<CardHeader className="flex items-center justify-center space-y-2 pb-8 pt-6">
|
||||||
|
@@ -1,7 +1,6 @@
|
|||||||
import Button from '@/components/ui/Button'
|
import Button from '@/components/ui/Button'
|
||||||
import { SiteInfo } from '@/lib/constants'
|
import { SiteInfo, webuiPrefix } from '@/lib/constants'
|
||||||
import AppSettings from '@/components/AppSettings'
|
import AppSettings from '@/components/AppSettings'
|
||||||
import LanguageToggle from '@/components/LanguageToggle'
|
|
||||||
import { TabsList, TabsTrigger } from '@/components/ui/Tabs'
|
import { TabsList, TabsTrigger } from '@/components/ui/Tabs'
|
||||||
import { useSettingsStore } from '@/stores/settings'
|
import { useSettingsStore } from '@/stores/settings'
|
||||||
import { useAuthStore } from '@/stores/state'
|
import { useAuthStore } from '@/stores/state'
|
||||||
@@ -67,7 +66,7 @@ export default function SiteHeader() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<header className="border-border/40 bg-background/95 supports-[backdrop-filter]:bg-background/60 sticky top-0 z-50 flex h-10 w-full border-b px-4 backdrop-blur">
|
<header className="border-border/40 bg-background/95 supports-[backdrop-filter]:bg-background/60 sticky top-0 z-50 flex h-10 w-full border-b px-4 backdrop-blur">
|
||||||
<a href="/" className="mr-6 flex items-center gap-2">
|
<a href={webuiPrefix} className="mr-6 flex items-center gap-2">
|
||||||
<ZapIcon className="size-4 text-emerald-400" aria-hidden="true" />
|
<ZapIcon className="size-4 text-emerald-400" aria-hidden="true" />
|
||||||
{/* <img src='/logo.png' className="size-4" /> */}
|
{/* <img src='/logo.png' className="size-4" /> */}
|
||||||
<span className="font-bold md:inline-block">{SiteInfo.name}</span>
|
<span className="font-bold md:inline-block">{SiteInfo.name}</span>
|
||||||
@@ -85,6 +84,9 @@ export default function SiteHeader() {
|
|||||||
</a>
|
</a>
|
||||||
</Button>
|
</Button>
|
||||||
<AppSettings />
|
<AppSettings />
|
||||||
|
<Button variant="ghost" size="icon" side="bottom" tooltip={t('header.logout')} onClick={handleLogout}>
|
||||||
|
<LogOutIcon className="size-4" aria-hidden="true" />
|
||||||
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
</header>
|
</header>
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
import { ButtonVariantType } from '@/components/ui/Button'
|
import { ButtonVariantType } from '@/components/ui/Button'
|
||||||
|
|
||||||
export const backendBaseUrl = 'http://localhost:9621/'
|
export const backendBaseUrl = ''
|
||||||
export const webuiPrefix = ''
|
export const webuiPrefix = ''
|
||||||
|
|
||||||
export const controlButtonVariant: ButtonVariantType = 'ghost'
|
export const controlButtonVariant: ButtonVariantType = 'ghost'
|
||||||
|
@@ -12,6 +12,7 @@
|
|||||||
"retrieval": "Retrieval",
|
"retrieval": "Retrieval",
|
||||||
"api": "API",
|
"api": "API",
|
||||||
"projectRepository": "Project Repository",
|
"projectRepository": "Project Repository",
|
||||||
|
"logout": "Logout",
|
||||||
"themeToggle": {
|
"themeToggle": {
|
||||||
"switchToLight": "Switch to light theme",
|
"switchToLight": "Switch to light theme",
|
||||||
"switchToDark": "Switch to dark theme"
|
"switchToDark": "Switch to dark theme"
|
||||||
|
@@ -12,6 +12,7 @@
|
|||||||
"retrieval": "检索",
|
"retrieval": "检索",
|
||||||
"api": "API",
|
"api": "API",
|
||||||
"projectRepository": "项目仓库",
|
"projectRepository": "项目仓库",
|
||||||
|
"logout": "退出登录",
|
||||||
"themeToggle": {
|
"themeToggle": {
|
||||||
"switchToLight": "切换到浅色主题",
|
"switchToLight": "切换到浅色主题",
|
||||||
"switchToDark": "切换到深色主题"
|
"switchToDark": "切换到深色主题"
|
||||||
|
Reference in New Issue
Block a user