From 7da6d33451cb59ab40484ce849a7697d704fee56 Mon Sep 17 00:00:00 2001 From: pablodanswer Date: Thu, 22 Aug 2024 19:19:00 -0700 Subject: [PATCH] slightly updated settings error (#2217) * update settings issues * slightly updated settings error --- web/src/app/layout.tsx | 27 ++++++++++++++++++----- web/src/components/chat_search/Header.tsx | 18 +++++++-------- web/src/components/settings/lib.ts | 2 +- 3 files changed, 32 insertions(+), 15 deletions(-) diff --git a/web/src/app/layout.tsx b/web/src/app/layout.tsx index 97ad8ae2bc7b..d1f9f61ccb49 100644 --- a/web/src/app/layout.tsx +++ b/web/src/app/layout.tsx @@ -16,6 +16,10 @@ import { Inter } from "next/font/google"; import Head from "next/head"; import { EnterpriseSettings } from "./admin/settings/interfaces"; import { redirect } from "next/navigation"; +import { Button, Card } from "@tremor/react"; +import LogoType from "@/components/header/LogoType"; +import { HeaderTitle } from "@/components/header/HeaderTitle"; +import { Logo } from "@/components/Logo"; const inter = Inter({ subsets: ["latin"], @@ -53,14 +57,27 @@ export default async function RootLayout({ const combinedSettings = await fetchSettingsSS(); if (!combinedSettings) { // Just display a simple full page error if fetching fails. + return ( - + - Settings Unavailable + Settings Unavailable | Danswer - -
- Settings could not be loaded. Please try again later. + +
+
+ Danswer + +
+ + +

Error

+

+ Your Danswer instance was not configured properly and your + settings could not be loaded. Please contact your admin to fix + this error. +

+
diff --git a/web/src/components/chat_search/Header.tsx b/web/src/components/chat_search/Header.tsx index 0cb99745d826..0480d4637368 100644 --- a/web/src/components/chat_search/Header.tsx +++ b/web/src/components/chat_search/Header.tsx @@ -77,15 +77,15 @@ export default function FunctionalHeader({ style={{ transition: "width 0.30s ease-out" }} className={` mobile:hidden - flex-none - mx-auto - overflow-y-hidden - transition-all - duration-300 - ease-in-out - h-full - ${sidebarToggled ? "w-[250px]" : "w-[0px]"} - `} + flex-none + mx-auto + overflow-y-hidden + transition-all + duration-300 + ease-in-out + h-full + ${sidebarToggled ? "w-[250px]" : "w-[0px]"} + `} />
diff --git a/web/src/components/settings/lib.ts b/web/src/components/settings/lib.ts index dd77e1c0642b..18036346f515 100644 --- a/web/src/components/settings/lib.ts +++ b/web/src/components/settings/lib.ts @@ -61,7 +61,7 @@ export async function fetchSettingsSS(): Promise { let enterpriseSettings: EnterpriseSettings | null = null; if (tasks.length > 1) { if (!results[1].ok) { - if (results[1].status !== 403 && results[1].status !== 404) { + if (results[1].status !== 403) { throw new Error( `fetchEnterpriseSettingsSS failed: status=${results[1].status} body=${await results[1].text()}` );