mirror of
https://github.com/coaidev/coai.git
synced 2025-05-22 14:30:14 +09:00
feat: add admin link
This commit is contained in:
parent
4b50ab2185
commit
aefe8a06ee
@ -2,7 +2,13 @@ import { useState } from "react";
|
|||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { useSelector } from "react-redux";
|
import { useSelector } from "react-redux";
|
||||||
import { Button } from "@/components/ui/button.tsx";
|
import { Button } from "@/components/ui/button.tsx";
|
||||||
import { ChevronRight, FolderKanban, Newspaper, Users2 } from "lucide-react";
|
import {
|
||||||
|
ChevronRight,
|
||||||
|
FolderKanban,
|
||||||
|
Newspaper,
|
||||||
|
Shield,
|
||||||
|
Users2,
|
||||||
|
} from "lucide-react";
|
||||||
import router from "@/router.tsx";
|
import router from "@/router.tsx";
|
||||||
import {
|
import {
|
||||||
Dialog,
|
Dialog,
|
||||||
@ -11,7 +17,7 @@ import {
|
|||||||
DialogHeader,
|
DialogHeader,
|
||||||
DialogTitle,
|
DialogTitle,
|
||||||
} from "@/components/ui/dialog.tsx";
|
} from "@/components/ui/dialog.tsx";
|
||||||
import { selectAuthenticated } from "@/store/auth.ts";
|
import { selectAdmin, selectAuthenticated } from "@/store/auth.ts";
|
||||||
import { appLogo } from "@/conf/env.ts";
|
import { appLogo } from "@/conf/env.ts";
|
||||||
import {
|
import {
|
||||||
infoArticleSelector,
|
infoArticleSelector,
|
||||||
@ -40,6 +46,7 @@ function ChatSpace() {
|
|||||||
const [open, setOpen] = useState(false);
|
const [open, setOpen] = useState(false);
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const contact = useSelector(infoContactSelector);
|
const contact = useSelector(infoContactSelector);
|
||||||
|
const admin = useSelector(selectAdmin);
|
||||||
|
|
||||||
const generationGroup = useSelector(infoGenerationSelector);
|
const generationGroup = useSelector(infoGenerationSelector);
|
||||||
const generation = hitGroup(generationGroup);
|
const generation = hitGroup(generationGroup);
|
||||||
@ -55,6 +62,14 @@ function ChatSpace() {
|
|||||||
alt={``}
|
alt={``}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
{admin && (
|
||||||
|
<Button variant={`outline`} onClick={() => router.navigate("/admin")}>
|
||||||
|
<Shield className={`h-4 w-4 mr-1.5`} />
|
||||||
|
{t("admin.users")}
|
||||||
|
<ChevronRight className={`h-4 w-4 ml-2`} />
|
||||||
|
</Button>
|
||||||
|
)}
|
||||||
|
|
||||||
{contact.length > 0 && (
|
{contact.length > 0 && (
|
||||||
<Button variant={`outline`} onClick={() => setOpen(true)}>
|
<Button variant={`outline`} onClick={() => setOpen(true)}>
|
||||||
<Users2 className={`h-4 w-4 mr-1.5`} />
|
<Users2 className={`h-4 w-4 mr-1.5`} />
|
||||||
|
@ -54,13 +54,13 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"market": {
|
"market": {
|
||||||
"title": "Model Market",
|
"title": "Model Marketplace",
|
||||||
"model": "Explore more models",
|
"model": "Explore more models",
|
||||||
"explore": "Explore",
|
"explore": "Explore",
|
||||||
"search": "Search model name or description",
|
"search": "Search model name or description",
|
||||||
"model-api": "Model ID name of the API request",
|
"model-api": "Model ID name of the API request",
|
||||||
"list": "Model List",
|
"list": "Model List",
|
||||||
"go": "Go to the model market"
|
"go": "Go to the model marketplace"
|
||||||
},
|
},
|
||||||
"conversation": {
|
"conversation": {
|
||||||
"title": "Conversation",
|
"title": "Conversation",
|
||||||
|
Loading…
Reference in New Issue
Block a user