mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-06-07 13:39:50 +02:00
Always pull latest data when visiting main search page
This commit is contained in:
parent
ac35719038
commit
292c78b193
@ -1,13 +1,10 @@
|
|||||||
import { ErrorCallout } from "@/components/ErrorCallout";
|
import { ErrorCallout } from "@/components/ErrorCallout";
|
||||||
import { fetchSS } from "@/lib/utilsSS";
|
import { fetchSS } from "@/lib/utilsSS";
|
||||||
import { FaRobot } from "react-icons/fa";
|
|
||||||
import { Persona } from "../interfaces";
|
import { Persona } from "../interfaces";
|
||||||
import { PersonaEditor } from "../PersonaEditor";
|
import { PersonaEditor } from "../PersonaEditor";
|
||||||
import { DocumentSet } from "@/lib/types";
|
import { DocumentSet } from "@/lib/types";
|
||||||
import { RobotIcon } from "@/components/icons/icons";
|
|
||||||
import { BackButton } from "@/components/BackButton";
|
import { BackButton } from "@/components/BackButton";
|
||||||
import { Card, Title, Text, Divider, Button } from "@tremor/react";
|
import { Card, Title } from "@tremor/react";
|
||||||
import { FiTrash } from "react-icons/fi";
|
|
||||||
import { DeletePersonaButton } from "./DeletePersonaButton";
|
import { DeletePersonaButton } from "./DeletePersonaButton";
|
||||||
|
|
||||||
export default async function Page({
|
export default async function Page({
|
||||||
|
@ -10,8 +10,14 @@ import { cookies } from "next/headers";
|
|||||||
import { SearchType } from "@/lib/search/interfaces";
|
import { SearchType } from "@/lib/search/interfaces";
|
||||||
import { Persona } from "./admin/personas/interfaces";
|
import { Persona } from "./admin/personas/interfaces";
|
||||||
import { WelcomeModal } from "@/components/WelcomeModal";
|
import { WelcomeModal } from "@/components/WelcomeModal";
|
||||||
|
import { unstable_noStore as noStore } from "next/cache";
|
||||||
|
|
||||||
export default async function Home() {
|
export default async function Home() {
|
||||||
|
// Disable caching so we always get the up to date connector / document set / persona info
|
||||||
|
// importantly, this prevents users from adding a connector, going back to the main page,
|
||||||
|
// and then getting hit with a "No Connectors" popup
|
||||||
|
noStore();
|
||||||
|
|
||||||
const tasks = [
|
const tasks = [
|
||||||
getAuthDisabledSS(),
|
getAuthDisabledSS(),
|
||||||
getCurrentUserSS(),
|
getCurrentUserSS(),
|
||||||
|
@ -2,9 +2,15 @@ interface ModalProps {
|
|||||||
children: JSX.Element | string;
|
children: JSX.Element | string;
|
||||||
title?: JSX.Element | string;
|
title?: JSX.Element | string;
|
||||||
onOutsideClick?: () => void;
|
onOutsideClick?: () => void;
|
||||||
|
className?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function Modal({ children, title, onOutsideClick }: ModalProps) {
|
export function Modal({
|
||||||
|
children,
|
||||||
|
title,
|
||||||
|
onOutsideClick,
|
||||||
|
className,
|
||||||
|
}: ModalProps) {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<div
|
<div
|
||||||
@ -18,6 +24,7 @@ export function Modal({ children, title, onOutsideClick }: ModalProps) {
|
|||||||
className={`
|
className={`
|
||||||
bg-gray-800 rounded-sm shadow-lg
|
bg-gray-800 rounded-sm shadow-lg
|
||||||
shadow-lg relative w-1/2 text-sm
|
shadow-lg relative w-1/2 text-sm
|
||||||
|
${className}
|
||||||
`}
|
`}
|
||||||
onClick={(event) => event.stopPropagation()}
|
onClick={(event) => event.stopPropagation()}
|
||||||
>
|
>
|
||||||
|
@ -7,13 +7,8 @@ import { useState } from "react";
|
|||||||
import { FiX } from "react-icons/fi";
|
import { FiX } from "react-icons/fi";
|
||||||
|
|
||||||
export function WelcomeModal() {
|
export function WelcomeModal() {
|
||||||
const [isClosed, setIsClosed] = useState(false);
|
|
||||||
if (isClosed) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Modal>
|
<Modal className="max-w-4xl">
|
||||||
<div className="px-6 py-4">
|
<div className="px-6 py-4">
|
||||||
<h2 className="text-xl font-bold mb-4 pb-2 border-b border-gray-700 flex">
|
<h2 className="text-xl font-bold mb-4 pb-2 border-b border-gray-700 flex">
|
||||||
Welcome to Danswer 🎉
|
Welcome to Danswer 🎉
|
||||||
|
Loading…
x
Reference in New Issue
Block a user