mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-10-10 21:26:01 +02:00
slightly updated settings error (#2217)
* update settings issues * slightly updated settings error
This commit is contained in:
@@ -16,6 +16,10 @@ import { Inter } from "next/font/google";
|
|||||||
import Head from "next/head";
|
import Head from "next/head";
|
||||||
import { EnterpriseSettings } from "./admin/settings/interfaces";
|
import { EnterpriseSettings } from "./admin/settings/interfaces";
|
||||||
import { redirect } from "next/navigation";
|
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({
|
const inter = Inter({
|
||||||
subsets: ["latin"],
|
subsets: ["latin"],
|
||||||
@@ -53,14 +57,27 @@ export default async function RootLayout({
|
|||||||
const combinedSettings = await fetchSettingsSS();
|
const combinedSettings = await fetchSettingsSS();
|
||||||
if (!combinedSettings) {
|
if (!combinedSettings) {
|
||||||
// Just display a simple full page error if fetching fails.
|
// Just display a simple full page error if fetching fails.
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<html lang="en">
|
<html lang="en" className={`${inter.variable} font-sans`}>
|
||||||
<Head>
|
<Head>
|
||||||
<title>Settings Unavailable</title>
|
<title>Settings Unavailable | Danswer</title>
|
||||||
</Head>
|
</Head>
|
||||||
<body>
|
<body className="bg-background text-default">
|
||||||
<div className="error">
|
<div className="flex flex-col items-center justify-center min-h-screen">
|
||||||
Settings could not be loaded. Please try again later.
|
<div className="mb-2 flex items-center max-w-[175px]">
|
||||||
|
<HeaderTitle>Danswer</HeaderTitle>
|
||||||
|
<Logo height={40} width={40} />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<Card className="p-8 max-w-md">
|
||||||
|
<h1 className="text-2xl font-bold mb-4 text-error">Error</h1>
|
||||||
|
<p className="text-text-500">
|
||||||
|
Your Danswer instance was not configured properly and your
|
||||||
|
settings could not be loaded. Please contact your admin to fix
|
||||||
|
this error.
|
||||||
|
</p>
|
||||||
|
</Card>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@@ -61,7 +61,7 @@ export async function fetchSettingsSS(): Promise<CombinedSettings | null> {
|
|||||||
let enterpriseSettings: EnterpriseSettings | null = null;
|
let enterpriseSettings: EnterpriseSettings | null = null;
|
||||||
if (tasks.length > 1) {
|
if (tasks.length > 1) {
|
||||||
if (!results[1].ok) {
|
if (!results[1].ok) {
|
||||||
if (results[1].status !== 403 && results[1].status !== 404) {
|
if (results[1].status !== 403) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`fetchEnterpriseSettingsSS failed: status=${results[1].status} body=${await results[1].text()}`
|
`fetchEnterpriseSettingsSS failed: status=${results[1].status} body=${await results[1].text()}`
|
||||||
);
|
);
|
||||||
|
Reference in New Issue
Block a user