mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-09-28 04:49:21 +02:00
cosmetic updates
This commit is contained in:
@@ -14,6 +14,7 @@ from pydantic import BaseModel
|
|||||||
from sqlalchemy.orm import Session
|
from sqlalchemy.orm import Session
|
||||||
|
|
||||||
from onyx.auth.users import current_admin_user
|
from onyx.auth.users import current_admin_user
|
||||||
|
from onyx.auth.users import current_chat_accesssible_user
|
||||||
from onyx.auth.users import current_curator_or_admin_user
|
from onyx.auth.users import current_curator_or_admin_user
|
||||||
from onyx.auth.users import current_user
|
from onyx.auth.users import current_user
|
||||||
from onyx.background.celery.celery_utils import get_deletion_attempt_snapshot
|
from onyx.background.celery.celery_utils import get_deletion_attempt_snapshot
|
||||||
@@ -1055,7 +1056,7 @@ class BasicCCPairInfo(BaseModel):
|
|||||||
|
|
||||||
@router.get("/connector-status")
|
@router.get("/connector-status")
|
||||||
def get_basic_connector_indexing_status(
|
def get_basic_connector_indexing_status(
|
||||||
_: User = Depends(current_user),
|
_: User = Depends(current_chat_accesssible_user),
|
||||||
db_session: Session = Depends(get_session),
|
db_session: Session = Depends(get_session),
|
||||||
) -> list[BasicCCPairInfo]:
|
) -> list[BasicCCPairInfo]:
|
||||||
cc_pairs = get_connector_credential_pairs(db_session, eager_load_connector=True)
|
cc_pairs = get_connector_credential_pairs(db_session, eager_load_connector=True)
|
||||||
|
@@ -17,6 +17,8 @@ import { getSecondsUntilExpiration } from "@/lib/time";
|
|||||||
import AuthFlowContainer from "@/components/auth/AuthFlowContainer";
|
import AuthFlowContainer from "@/components/auth/AuthFlowContainer";
|
||||||
import CardSection from "@/components/admin/CardSection";
|
import CardSection from "@/components/admin/CardSection";
|
||||||
import { NEXT_PUBLIC_FORGOT_PASSWORD_ENABLED } from "@/lib/constants";
|
import { NEXT_PUBLIC_FORGOT_PASSWORD_ENABLED } from "@/lib/constants";
|
||||||
|
import { SettingsContext } from "@/components/settings/SettingsProvider";
|
||||||
|
import { useContext } from "react";
|
||||||
|
|
||||||
const Page = async (props: {
|
const Page = async (props: {
|
||||||
searchParams?: Promise<{ [key: string]: string | string[] | undefined }>;
|
searchParams?: Promise<{ [key: string]: string | string[] | undefined }>;
|
||||||
@@ -148,6 +150,23 @@ const Page = async (props: {
|
|||||||
</div>
|
</div>
|
||||||
</CardSection>
|
</CardSection>
|
||||||
)}
|
)}
|
||||||
|
{currentUser?.is_anonymous_user && (
|
||||||
|
<div className="mt-4 w-full justify-center">
|
||||||
|
<Text className="mt-4 mx-auto">
|
||||||
|
You are currently logged in as an anonymous user. You can access
|
||||||
|
the chat experience{" "}
|
||||||
|
<Link
|
||||||
|
href={`/auth/login${
|
||||||
|
searchParams?.next ? `?next=${searchParams.next}` : ""
|
||||||
|
}`}
|
||||||
|
className="text-link font-medium"
|
||||||
|
>
|
||||||
|
here
|
||||||
|
</Link>
|
||||||
|
.
|
||||||
|
</Text>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</AuthFlowContainer>
|
</AuthFlowContainer>
|
||||||
);
|
);
|
||||||
|
@@ -183,7 +183,15 @@ export function ChatPage({
|
|||||||
|
|
||||||
const [userSettingsToggled, setUserSettingsToggled] = useState(false);
|
const [userSettingsToggled, setUserSettingsToggled] = useState(false);
|
||||||
|
|
||||||
const { assistants: availableAssistants, finalAssistants } = useAssistants();
|
const {
|
||||||
|
assistants: availableAssistants,
|
||||||
|
finalAssistants,
|
||||||
|
hiddenAssistants,
|
||||||
|
visibleAssistants,
|
||||||
|
} = useAssistants();
|
||||||
|
console.log("visibleAssistants", visibleAssistants);
|
||||||
|
console.log("availableAssistants", availableAssistants);
|
||||||
|
console.log("hiddenAssistants", hiddenAssistants);
|
||||||
|
|
||||||
const [showApiKeyModal, setShowApiKeyModal] = useState(
|
const [showApiKeyModal, setShowApiKeyModal] = useState(
|
||||||
!shouldShowWelcomeModal
|
!shouldShowWelcomeModal
|
||||||
@@ -243,10 +251,10 @@ export function ChatPage({
|
|||||||
(assistant) => assistant.id === existingChatSessionAssistantId
|
(assistant) => assistant.id === existingChatSessionAssistantId
|
||||||
)
|
)
|
||||||
: defaultAssistantId !== undefined
|
: defaultAssistantId !== undefined
|
||||||
? availableAssistants.find(
|
? availableAssistants.find(
|
||||||
(assistant) => assistant.id === defaultAssistantId
|
(assistant) => assistant.id === defaultAssistantId
|
||||||
)
|
)
|
||||||
: undefined
|
: undefined
|
||||||
);
|
);
|
||||||
// Gather default temperature settings
|
// Gather default temperature settings
|
||||||
const search_param_temperature = searchParams.get(
|
const search_param_temperature = searchParams.get(
|
||||||
@@ -256,12 +264,12 @@ export function ChatPage({
|
|||||||
const defaultTemperature = search_param_temperature
|
const defaultTemperature = search_param_temperature
|
||||||
? parseFloat(search_param_temperature)
|
? parseFloat(search_param_temperature)
|
||||||
: selectedAssistant?.tools.some(
|
: selectedAssistant?.tools.some(
|
||||||
(tool) =>
|
(tool) =>
|
||||||
tool.in_code_tool_id === "SearchTool" ||
|
tool.in_code_tool_id === "SearchTool" ||
|
||||||
tool.in_code_tool_id === "InternetSearchTool"
|
tool.in_code_tool_id === "InternetSearchTool"
|
||||||
)
|
)
|
||||||
? 0
|
? 0
|
||||||
: 0.7;
|
: 0.7;
|
||||||
|
|
||||||
const setSelectedAssistantFromId = (assistantId: number) => {
|
const setSelectedAssistantFromId = (assistantId: number) => {
|
||||||
// NOTE: also intentionally look through available assistants here, so that
|
// NOTE: also intentionally look through available assistants here, so that
|
||||||
@@ -1177,8 +1185,8 @@ export function ChatPage({
|
|||||||
const currentAssistantId = alternativeAssistantOverride
|
const currentAssistantId = alternativeAssistantOverride
|
||||||
? alternativeAssistantOverride.id
|
? alternativeAssistantOverride.id
|
||||||
: alternativeAssistant
|
: alternativeAssistant
|
||||||
? alternativeAssistant.id
|
? alternativeAssistant.id
|
||||||
: liveAssistant.id;
|
: liveAssistant.id;
|
||||||
|
|
||||||
resetInputBar();
|
resetInputBar();
|
||||||
let messageUpdates: Message[] | null = null;
|
let messageUpdates: Message[] | null = null;
|
||||||
|
@@ -63,6 +63,7 @@ export default async function RootLayout({
|
|||||||
getCurrentUserSS(),
|
getCurrentUserSS(),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
console.log("assistantsData", assistantsData);
|
||||||
const productGating =
|
const productGating =
|
||||||
combinedSettings?.settings.product_gating ?? GatingType.NONE;
|
combinedSettings?.settings.product_gating ?? GatingType.NONE;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user