diff --git a/src/app.html b/src/app.html index b4100c2..0787360 100644 --- a/src/app.html +++ b/src/app.html @@ -40,8 +40,8 @@ } if (localStorage.theme === 'system') { - document.documentElement.classList.add(prefersDarkTheme ? 'dark' : 'light'); - metaThemeColorTag.setAttribute('content', prefersDarkTheme ? '#171717' : '#ffffff'); + document.documentElement.classList.add('light'); + metaThemeColorTag.setAttribute('content', '#171717'); } else if (localStorage.theme === 'oled-dark') { document.documentElement.style.setProperty('--color-gray-800', '#101010'); document.documentElement.style.setProperty('--color-gray-850', '#050505'); @@ -61,19 +61,19 @@ metaThemeColorTag.setAttribute('content', '#171717'); } - window.matchMedia('(prefers-color-scheme: dark)').addListener((e) => { - if (localStorage.theme === 'system') { - if (e.matches) { - document.documentElement.classList.add('dark'); - document.documentElement.classList.remove('light'); - metaThemeColorTag.setAttribute('content', '#171717'); - } else { - document.documentElement.classList.add('light'); - document.documentElement.classList.remove('dark'); - metaThemeColorTag.setAttribute('content', '#ffffff'); - } - } - }); + // window.matchMedia('(prefers-color-scheme: dark)').addListener((e) => { + // if (localStorage.theme === 'system') { + // if (e.matches) { + // document.documentElement.classList.add('dark'); + // document.documentElement.classList.remove('light'); + // metaThemeColorTag.setAttribute('content', '#171717'); + // } else { + // document.documentElement.classList.add('light'); + // document.documentElement.classList.remove('dark'); + // metaThemeColorTag.setAttribute('content', '#ffffff'); + // } + // } + // }); })(); diff --git a/src/lib/components/chat/Header.svelte b/src/lib/components/chat/Header.svelte new file mode 100644 index 0000000..b99e412 --- /dev/null +++ b/src/lib/components/chat/Header.svelte @@ -0,0 +1,136 @@ + + +
+
+ +
+

Hi,我是您的AI小助手e小星

+

需要我帮您做点什么?

+
+
+
+ {#each list as item, itemIndex (item.id)} +
+

{item.title}

+
+ {#each item.introduce as itemP, index (index)} +

{itemP.label}

+ {/each} +
+
+ {#each item.buttons as but, index (index)} + + {/each} +
+
+ {/each} +
+
+ + diff --git a/src/lib/components/chat/MessageInput.svelte b/src/lib/components/chat/MessageInput.svelte index 7a780f3..cf0d8f7 100644 --- a/src/lib/components/chat/MessageInput.svelte +++ b/src/lib/components/chat/MessageInput.svelte @@ -1175,7 +1175,7 @@ {#if $config?.features?.enable_code_interpreter && ($_user.role === 'admin' || $_user?.permissions?.features?.code_interpreter)} - + --> {/if} {/if} diff --git a/src/lib/components/chat/Overview/Flow.svelte b/src/lib/components/chat/Overview/Flow.svelte index f7ff307..bd4ddcf 100644 --- a/src/lib/components/chat/Overview/Flow.svelte +++ b/src/lib/components/chat/Overview/Flow.svelte @@ -17,13 +17,7 @@ {edges} fitView minZoom={0.001} - colorMode={$theme.includes('dark') - ? 'dark' - : $theme === 'system' - ? window.matchMedia('(prefers-color-scheme: dark)').matches - ? 'dark' - : 'light' - : 'light'} + colorMode={'light'} nodesConnectable={false} nodesDraggable={false} on:nodeclick={(e) => dispatch('nodeclick', e.detail)} diff --git a/src/lib/components/chat/Placeholder.svelte b/src/lib/components/chat/Placeholder.svelte index 4ae56f1..406ac9d 100644 --- a/src/lib/components/chat/Placeholder.svelte +++ b/src/lib/components/chat/Placeholder.svelte @@ -15,6 +15,7 @@ import Tooltip from '$lib/components/common/Tooltip.svelte'; import EyeSlash from '$lib/components/icons/EyeSlash.svelte'; import MessageInput from './MessageInput.svelte'; + import Header from './Header.svelte'; const i18n = getContext('i18n'); @@ -105,44 +106,8 @@ class="w-full text-3xl text-gray-800 dark:text-gray-100 font-medium text-center flex items-center gap-4 font-primary" >
-
-
-
- {#each models as model, modelIdx} - tag.name.toUpperCase()) - .join(', ')} - placement="top" - > - - - {/each} -
-
- -
- {#if models[selectedModelIdx]?.name} - {models[selectedModelIdx]?.name} - {:else} - {$i18n.t('Hello, {{name}}', { name: $user.name })} - {/if} -
+
+
@@ -210,7 +175,8 @@
-
+ +
diff --git a/src/lib/components/chat/Settings/General.svelte b/src/lib/components/chat/Settings/General.svelte index 00cf1d7..beca6e9 100644 --- a/src/lib/components/chat/Settings/General.svelte +++ b/src/lib/components/chat/Settings/General.svelte @@ -123,11 +123,8 @@ const metaThemeColor = document.querySelector('meta[name="theme-color"]'); if (metaThemeColor) { if (_theme.includes('system')) { - const systemTheme = window.matchMedia('(prefers-color-scheme: dark)').matches - ? 'dark' - : 'light'; - console.log('Setting system meta theme color: ' + systemTheme); - metaThemeColor.setAttribute('content', systemTheme === 'light' ? '#ffffff' : '#171717'); + const systemTheme = window.matchMedia('light'); + metaThemeColor.setAttribute('content','#171717'); } else { console.log('Setting meta theme color: ' + _theme); metaThemeColor.setAttribute( diff --git a/src/routes/(app)/+layout.svelte b/src/routes/(app)/+layout.svelte index 09dbefd..61ad5f4 100644 --- a/src/routes/(app)/+layout.svelte +++ b/src/routes/(app)/+layout.svelte @@ -224,7 +224,7 @@ -{#if version && compareVersion(version.latest, version.current) && ($settings?.showUpdateToast ?? true)} +
{#if loaded} {#if !['user', 'admin'].includes($user.role)} diff --git a/src/routes/(app)/admin/+layout.svelte b/src/routes/(app)/admin/+layout.svelte index b759319..7638047 100644 --- a/src/routes/(app)/admin/+layout.svelte +++ b/src/routes/(app)/admin/+layout.svelte @@ -50,7 +50,7 @@ class="flex gap-1 scrollbar-none overflow-x-auto w-fit text-center text-sm font-medium rounded-full bg-transparent pt-1" > {$i18n.t('Users')} diff --git a/static/favicon.png b/static/favicon.png index 63735ad..8bcd5b7 100644 Binary files a/static/favicon.png and b/static/favicon.png differ diff --git a/static/favicon/apple-touch-icon.png b/static/favicon/apple-touch-icon.png index 77ae5bd..8bcd5b7 100644 Binary files a/static/favicon/apple-touch-icon.png and b/static/favicon/apple-touch-icon.png differ diff --git a/static/favicon/favicon.ico b/static/favicon/favicon.ico deleted file mode 100644 index 3d8002c..0000000 Binary files a/static/favicon/favicon.ico and /dev/null differ diff --git a/static/favicon/favicon.png b/static/favicon/favicon.png new file mode 100644 index 0000000..8bcd5b7 Binary files /dev/null and b/static/favicon/favicon.png differ diff --git a/static/favicon/favicon.svg b/static/favicon/favicon.svg deleted file mode 100644 index af01b22..0000000 --- a/static/favicon/favicon.svg +++ /dev/null @@ -1,3 +0,0 @@ - \ No newline at end of file diff --git a/static/img/bg-chat.png b/static/img/bg-chat.png new file mode 100644 index 0000000..a7412f4 Binary files /dev/null and b/static/img/bg-chat.png differ diff --git a/static/img/icon/document.png b/static/img/icon/document.png new file mode 100644 index 0000000..c923099 Binary files /dev/null and b/static/img/icon/document.png differ diff --git a/static/img/icon/document_active.png b/static/img/icon/document_active.png new file mode 100644 index 0000000..6331fcc Binary files /dev/null and b/static/img/icon/document_active.png differ diff --git a/static/img/icon/knowledge.png b/static/img/icon/knowledge.png new file mode 100644 index 0000000..919b232 Binary files /dev/null and b/static/img/icon/knowledge.png differ diff --git a/static/img/icon/knowledge_active.png b/static/img/icon/knowledge_active.png new file mode 100644 index 0000000..f81f561 Binary files /dev/null and b/static/img/icon/knowledge_active.png differ diff --git a/static/img/icon/record.png b/static/img/icon/record.png new file mode 100644 index 0000000..f6d0d20 Binary files /dev/null and b/static/img/icon/record.png differ diff --git a/static/img/icon/record_active.png b/static/img/icon/record_active.png new file mode 100644 index 0000000..0fd003d Binary files /dev/null and b/static/img/icon/record_active.png differ diff --git a/static/img/icon/upload.png b/static/img/icon/upload.png new file mode 100644 index 0000000..fde1aec Binary files /dev/null and b/static/img/icon/upload.png differ diff --git a/static/img/icon/upload_active.png b/static/img/icon/upload_active.png new file mode 100644 index 0000000..b7b2fdb Binary files /dev/null and b/static/img/icon/upload_active.png differ diff --git a/static/img/icon/work.png b/static/img/icon/work.png new file mode 100644 index 0000000..d3b9a79 Binary files /dev/null and b/static/img/icon/work.png differ diff --git a/static/img/icon/work_active.png b/static/img/icon/work_active.png new file mode 100644 index 0000000..4911632 Binary files /dev/null and b/static/img/icon/work_active.png differ diff --git a/static/img/knowledge.png b/static/img/knowledge.png new file mode 100644 index 0000000..e82003a Binary files /dev/null and b/static/img/knowledge.png differ diff --git a/static/img/record.png b/static/img/record.png new file mode 100644 index 0000000..fbec16e Binary files /dev/null and b/static/img/record.png differ diff --git a/static/img/user.png b/static/img/user.png new file mode 100644 index 0000000..cbf8896 Binary files /dev/null and b/static/img/user.png differ diff --git a/static/img/work.png b/static/img/work.png new file mode 100644 index 0000000..761e07d Binary files /dev/null and b/static/img/work.png differ diff --git a/static/static/favicon.jpg b/static/static/favicon.jpg new file mode 100644 index 0000000..8bcd5b7 Binary files /dev/null and b/static/static/favicon.jpg differ diff --git a/static/static/favicon.png b/static/static/favicon.png deleted file mode 100644 index 63735ad..0000000 Binary files a/static/static/favicon.png and /dev/null differ diff --git a/tailwind.config.js b/tailwind.config.js index f7a00c3..77ab7a9 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -3,25 +3,11 @@ import containerQuries from '@tailwindcss/container-queries'; /** @type {import('tailwindcss').Config} */ export default { - darkMode: 'class', + darkMode: '', content: ['./src/**/*.{html,js,svelte,ts}'], theme: { extend: { colors: { - gray: { - 50: 'var(--color-gray-50, #f9f9f9)', - 100: 'var(--color-gray-100, #ececec)', - 200: 'var(--color-gray-200, #e3e3e3)', - 300: 'var(--color-gray-300, #cdcdcd)', - 400: 'var(--color-gray-400, #b4b4b4)', - 500: 'var(--color-gray-500, #9b9b9b)', - 600: 'var(--color-gray-600, #676767)', - 700: 'var(--color-gray-700, #4e4e4e)', - 800: 'var(--color-gray-800, #333)', - 850: 'var(--color-gray-850, #262626)', - 900: 'var(--color-gray-900, #fefeff)', - 950: 'var(--color-gray-950, #0d0d0d)' - }, blue: { 50: 'var(--color-blue-50, #2a75f0)', } diff --git a/vite.config.ts b/vite.config.ts index fdbbde4..fa89bc1 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -48,5 +48,6 @@ export default defineConfig({ }, worker: { format: 'es' - } + }, + base: '/openwebui/' });