chore: update broadcast

This commit is contained in:
Zhang Minghan 2024-03-09 23:40:17 +08:00
parent 80fd32add3
commit 9c6b11cbc6
5 changed files with 24 additions and 4 deletions

View File

@ -18,7 +18,14 @@ import {
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { extractMessage } from "@/utils/processor.ts"; import { extractMessage } from "@/utils/processor.ts";
import { Button } from "@/components/ui/button.tsx"; import { Button } from "@/components/ui/button.tsx";
import { Eye, Loader2, MoreVertical, Plus, RotateCcw } from "lucide-react"; import {
AlertCircle,
Eye,
Loader2,
MoreVertical,
Plus,
RotateCcw,
} from "lucide-react";
import { useToast } from "@/components/ui/use-toast.ts"; import { useToast } from "@/components/ui/use-toast.ts";
import { import {
Dialog, Dialog,
@ -38,6 +45,7 @@ import {
DropdownMenuTrigger, DropdownMenuTrigger,
} from "@/components/ui/dropdown-menu.tsx"; } from "@/components/ui/dropdown-menu.tsx";
import EditorProvider from "@/components/EditorProvider.tsx"; import EditorProvider from "@/components/EditorProvider.tsx";
import { Alert, AlertDescription } from "@/components/ui/alert.tsx";
type CreateBroadcastDialogProps = { type CreateBroadcastDialogProps = {
onCreated?: () => void; onCreated?: () => void;
@ -162,6 +170,7 @@ function BroadcastTable() {
<Button <Button
variant={`outline`} variant={`outline`}
size={`icon`} size={`icon`}
className={`select-none`}
onClick={async () => { onClick={async () => {
setData(await getBroadcastList()); setData(await getBroadcastList());
}} }}
@ -173,6 +182,13 @@ function BroadcastTable() {
onCreated={async () => setData(await getBroadcastList())} onCreated={async () => setData(await getBroadcastList())}
/> />
</div> </div>
<Alert className={`pb-2 mb-4`}>
<AlertCircle className={`h-4 w-4`} />
<AlertDescription className={`break-all whitespace-pre-wrap`}>
{t("admin.broadcast-tip")}
</AlertDescription>
</Alert>
{data.length ? ( {data.length ? (
<Table> <Table>
<TableHeader> <TableHeader>

View File

@ -440,6 +440,7 @@
"broadcast-content": "公告内容", "broadcast-content": "公告内容",
"create-broadcast": "发布公告", "create-broadcast": "发布公告",
"broadcast-placeholder": "请输入通知内容 (支持 Markdown / HTML)", "broadcast-placeholder": "请输入通知内容 (支持 Markdown / HTML)",
"broadcast-tip": "通知仅会显示最新一条,并且只会通知一次。系统设置中可设置站点公告,首次接收将会弹窗显示于首页并支持后续查看。",
"post": "发布", "post": "发布",
"post-success": "发布成功", "post-success": "发布成功",
"post-success-prompt": "公告发布成功。", "post-success-prompt": "公告发布成功。",

View File

@ -673,7 +673,8 @@
"billing": "Income", "billing": "Income",
"chatnio-format-only": "This format is unique to Chat Nio", "chatnio-format-only": "This format is unique to Chat Nio",
"exit": "Log out of the background", "exit": "Log out of the background",
"view": "View" "view": "View",
"broadcast-tip": "Notifications will only show the most recent one and will only be notified once. Site announcements can be set in the system settings. The pop-up window will be displayed on the homepage for the first time and subsequent viewing will be supported."
}, },
"mask": { "mask": {
"title": "Mask Settings", "title": "Mask Settings",

View File

@ -673,7 +673,8 @@
"billing": "収入", "billing": "収入",
"chatnio-format-only": "このフォーマットはChat Nioに固有です", "chatnio-format-only": "このフォーマットはChat Nioに固有です",
"exit": "バックグラウンドからログアウト", "exit": "バックグラウンドからログアウト",
"view": "確認" "view": "確認",
"broadcast-tip": "通知には最新の通知のみが表示され、一度だけ通知されます。サイトのお知らせは、システム設定で設定できます。ポップアップウィンドウがホームページに初めて表示され、その後の表示がサポートされます。"
}, },
"mask": { "mask": {
"title": "プリセット設定", "title": "プリセット設定",

View File

@ -673,7 +673,8 @@
"billing": "Доходы", "billing": "Доходы",
"chatnio-format-only": "Этот формат уникален для Chat Nio", "chatnio-format-only": "Этот формат уникален для Chat Nio",
"exit": "Выйти из фонового режима", "exit": "Выйти из фонового режима",
"view": "проверить" "view": "проверить",
"broadcast-tip": "Уведомления будут отображаться только самые последние и будут уведомлены только один раз. Объявления сайта можно задать в системных настройках. Всплывающее окно будет отображаться на главной странице в первый раз и будет поддерживаться последующий просмотр."
}, },
"mask": { "mask": {
"title": "Настройки маски", "title": "Настройки маски",