From fca90592d64f5fc2ddb3416bce8ab5f717548cd2 Mon Sep 17 00:00:00 2001 From: pk5ls20 Date: Wed, 5 Feb 2025 08:29:37 +0800 Subject: [PATCH 1/2] try fix: #755 --- src/core/packet/message/element.ts | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/src/core/packet/message/element.ts b/src/core/packet/message/element.ts index 3a1197ba..e37167ed 100644 --- a/src/core/packet/message/element.ts +++ b/src/core/packet/message/element.ts @@ -137,18 +137,9 @@ export class PacketMsgReplyElement extends IPacketMsgElement { pbReserve: { messageId: this.messageId, }, - toUin: BigInt(0), + toUin: BigInt(this.targetUin), + type: 1, } - }, { - text: this.isGroupReply ? { - str: 'nya~', - pbReserve: new NapProtoMsg(MentionExtra).encode({ - type: this.targetUin === 0 ? 1 : 2, - uin: 0, - field5: 0, - uid: String(this.targetUid), - }), - } : undefined, }]; } From 593fb13b619b392186e5255998df1d77012822f1 Mon Sep 17 00:00:00 2001 From: bietiaop <1527109126@qq.com> Date: Wed, 5 Feb 2025 10:38:12 +0800 Subject: [PATCH 2/2] =?UTF-8?q?style:=20=E8=AF=AD=E4=B9=89=E5=8C=96?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- napcat.webui/package.json | 1 + napcat.webui/src/components/audio_player.tsx | 2 +- .../src/components/button/add_button.tsx | 2 +- .../src/components/button/save_buttons.tsx | 2 +- .../chat_input/components/audio_insert.tsx | 16 ++--- .../chat_input/components/dice_insert.tsx | 2 +- .../chat_input/components/emoji_picker.tsx | 4 +- .../chat_input/components/file_insert.tsx | 8 +-- .../chat_input/components/image_insert.tsx | 8 +-- .../chat_input/components/music_insert.tsx | 6 +- .../chat_input/components/reply_insert.tsx | 4 +- .../chat_input/components/rps_insert.tsx | 2 +- .../chat_input/components/video_insert.tsx | 8 +-- .../src/components/chat_input/index.tsx | 2 +- .../src/components/chat_input/modal.tsx | 4 +- .../components/display_card/common_card.tsx | 2 +- .../src/components/display_network_item.tsx | 2 +- .../file_manage/create_file_modal.tsx | 6 +- .../file_manage/file_edit_modal.tsx | 4 +- .../file_manage/file_preview_modal.tsx | 2 +- .../src/components/file_manage/file_table.tsx | 12 ++-- .../src/components/file_manage/move_modal.tsx | 10 +-- .../components/file_manage/rename_modal.tsx | 4 +- napcat.webui/src/components/hitokoto.tsx | 4 +- .../src/components/hover_titled_card.tsx | 2 +- .../src/components/input/image_input.tsx | 2 +- .../components/log_com/log_level_select.tsx | 6 +- napcat.webui/src/components/modal.tsx | 4 +- .../src/components/napcat_repo_info.tsx | 6 +- .../components/network_edit/generic_form.tsx | 2 +- .../src/components/onebot/api/debug.tsx | 4 +- .../components/onebot/api/display_struct.tsx | 4 +- .../src/components/onebot/api/nav_list.tsx | 14 ++-- .../components/onebot/display_card/render.tsx | 2 +- .../onebot/display_card/response.tsx | 2 +- .../src/components/onebot/send_modal.tsx | 6 +- .../src/components/onebot/ws_status.tsx | 4 +- napcat.webui/src/components/qq_info_card.tsx | 8 +-- napcat.webui/src/components/qr_code_login.tsx | 2 +- napcat.webui/src/components/sidebar/index.tsx | 4 +- napcat.webui/src/components/sidebar/menus.tsx | 8 ++- napcat.webui/src/components/system_info.tsx | 16 ++--- .../src/components/system_status_display.tsx | 6 +- napcat.webui/src/components/tabs/index.tsx | 2 +- napcat.webui/src/layouts/default.tsx | 6 +- napcat.webui/src/pages/dashboard/about.tsx | 25 +++---- .../src/pages/dashboard/debug/http/index.tsx | 2 +- .../pages/dashboard/debug/websocket/index.tsx | 2 +- .../src/pages/dashboard/file_manager.tsx | 14 ++-- napcat.webui/src/pages/dashboard/index.tsx | 2 +- napcat.webui/src/pages/dashboard/terminal.tsx | 4 +- napcat.webui/tailwind.config.js | 71 ++++++++++++++++++- 52 files changed, 208 insertions(+), 139 deletions(-) diff --git a/napcat.webui/package.json b/napcat.webui/package.json index 373b98ba..bdef9b0d 100644 --- a/napcat.webui/package.json +++ b/napcat.webui/package.json @@ -32,6 +32,7 @@ "@heroui/pagination": "^2.2.9", "@heroui/popover": "2.3.10", "@heroui/select": "2.4.10", + "@heroui/skeleton": "^2.2.6", "@heroui/slider": "2.4.8", "@heroui/snippet": "2.2.11", "@heroui/spinner": "2.2.7", diff --git a/napcat.webui/src/components/audio_player.tsx b/napcat.webui/src/components/audio_player.tsx index e884ef0c..f88b31af 100644 --- a/napcat.webui/src/components/audio_player.tsx +++ b/napcat.webui/src/components/audio_player.tsx @@ -231,7 +231,7 @@ export default function AudioPlayer(props: AudioPlayerProps) { : 'top-3 -left-8 rounded-l-full bg-opacity-50 backdrop-blur-md' )} variant="solid" - color="danger" + color="primary" size="sm" onPress={() => setIsCollapsed(!isCollapsed)} > diff --git a/napcat.webui/src/components/button/add_button.tsx b/napcat.webui/src/components/button/add_button.tsx index 1b3f8f70..571766e7 100644 --- a/napcat.webui/src/components/button/add_button.tsx +++ b/napcat.webui/src/components/button/add_button.tsx @@ -33,7 +33,7 @@ const AddButton: React.FC = (props) => { > @@ -120,7 +120,7 @@ const AudioInsert = () => { {showPreview && audioPreview && ( @@ -65,7 +65,7 @@ const EmojiPicker = ({ onInsertEmoji, onOpenChange }: EmojiPickerProps) => { {visibleEmojis.map((emoji) => ( @@ -45,7 +45,7 @@ const FileInsert = () => { @@ -33,7 +33,7 @@ const ImageInsert = ({ insertImage, onOpenChange }: ImageInsertProps) => { @@ -132,7 +132,7 @@ const MusicInsert = () => { @@ -38,7 +38,7 @@ const ReplyInsert = ({ insertReply }: ReplyInsertProps) => { }} /> @@ -45,7 +45,7 @@ const VideoInsert = () => { - diff --git a/napcat.webui/src/components/display_card/common_card.tsx b/napcat.webui/src/components/display_card/common_card.tsx index 860d781c..caf8a361 100644 --- a/napcat.webui/src/components/display_card/common_card.tsx +++ b/napcat.webui/src/components/display_card/common_card.tsx @@ -78,7 +78,7 @@ const NetworkDisplayCard = ({ {debug ? '关闭调试' : '开启调试'} - diff --git a/napcat.webui/src/components/file_manage/file_edit_modal.tsx b/napcat.webui/src/components/file_manage/file_edit_modal.tsx index ca42e09c..cc906e63 100644 --- a/napcat.webui/src/components/file_manage/file_edit_modal.tsx +++ b/napcat.webui/src/components/file_manage/file_edit_modal.tsx @@ -81,10 +81,10 @@ export default function FileEditModal({ - - diff --git a/napcat.webui/src/components/file_manage/file_preview_modal.tsx b/napcat.webui/src/components/file_manage/file_preview_modal.tsx index 897d3a77..e416eb48 100644 --- a/napcat.webui/src/components/file_manage/file_preview_modal.tsx +++ b/napcat.webui/src/components/file_manage/file_preview_modal.tsx @@ -82,7 +82,7 @@ export default function FilePreviewModal({ {contentElement} - diff --git a/napcat.webui/src/components/file_manage/file_table.tsx b/napcat.webui/src/components/file_manage/file_table.tsx index 8886f8d1..296489a7 100644 --- a/napcat.webui/src/components/file_manage/file_table.tsx +++ b/napcat.webui/src/components/file_manage/file_table.tsx @@ -116,7 +116,7 @@ export default function FileTable({ isCompact showControls showShadow - color="danger" + color="primary" page={page} total={pages} onChange={(page) => setPage(page)} @@ -195,7 +195,7 @@ export default function FileTable({ - diff --git a/napcat.webui/src/components/file_manage/rename_modal.tsx b/napcat.webui/src/components/file_manage/rename_modal.tsx index 3d0f256c..0ddf1dde 100644 --- a/napcat.webui/src/components/file_manage/rename_modal.tsx +++ b/napcat.webui/src/components/file_manage/rename_modal.tsx @@ -31,10 +31,10 @@ export default function RenameModal({ - - diff --git a/napcat.webui/src/components/hitokoto.tsx b/napcat.webui/src/components/hitokoto.tsx index 0cceb261..e31c77d7 100644 --- a/napcat.webui/src/components/hitokoto.tsx +++ b/napcat.webui/src/components/hitokoto.tsx @@ -33,7 +33,7 @@ export default function Hitokoto() {
{loading && } {error ? ( -
一言加载失败:{error.message}
+
一言加载失败:{error.message}
) : ( <>
{data?.hitokoto}
@@ -52,7 +52,7 @@ export default function Hitokoto() { isLoading={loading} isIconOnly radius="full" - color="danger" + color="primary" variant="flat" > diff --git a/napcat.webui/src/components/hover_titled_card.tsx b/napcat.webui/src/components/hover_titled_card.tsx index c336fc99..9f875a9e 100644 --- a/napcat.webui/src/components/hover_titled_card.tsx +++ b/napcat.webui/src/components/hover_titled_card.tsx @@ -34,7 +34,7 @@ export default function HoverTiltedCard({ rotateAmplitude = 14, showTooltip = false, overlayContent = ( -
+
NapCat
), diff --git a/napcat.webui/src/components/input/image_input.tsx b/napcat.webui/src/components/input/image_input.tsx index 0e5bb75e..2d33e263 100644 --- a/napcat.webui/src/components/input/image_input.tsx +++ b/napcat.webui/src/components/input/image_input.tsx @@ -43,7 +43,7 @@ const ImageInput: React.FC = ({ onChange, value, label }) => { onChange('') if (inputRef.current) inputRef.current.value = '' }} - color="danger" + color="primary" variant="flat" size="sm" > diff --git a/napcat.webui/src/components/log_com/log_level_select.tsx b/napcat.webui/src/components/log_com/log_level_select.tsx index 1b78d3f9..c6f72a08 100644 --- a/napcat.webui/src/components/log_com/log_level_select.tsx +++ b/napcat.webui/src/components/log_com/log_level_select.tsx @@ -16,13 +16,13 @@ const logLevelColor: { | 'secondary' | 'success' | 'warning' - | 'danger' + | 'primary' } = { [LogLevel.DEBUG]: 'default', [LogLevel.INFO]: 'primary', [LogLevel.WARN]: 'warning', - [LogLevel.ERROR]: 'danger', - [LogLevel.FATAL]: 'danger' + [LogLevel.ERROR]: 'primary', + [LogLevel.FATAL]: 'primary' } const LogLevelSelect = (props: LogLevelSelectProps) => { const { selectedKeys, onSelectionChange } = props diff --git a/napcat.webui/src/components/modal.tsx b/napcat.webui/src/components/modal.tsx index b84d61e3..a007d1f4 100644 --- a/napcat.webui/src/components/modal.tsx +++ b/napcat.webui/src/components/modal.tsx @@ -65,7 +65,7 @@ const Modal: React.FC = React.memo((props) => { {showCancel && ( )} = (props) => { -
-
+
AI总结
@@ -234,8 +234,8 @@ const SystemInfo: React.FC = (props) => { error: qqVersionError } = useRequest(WebUIManager.getQQVersion) return ( - - + + 系统信息 diff --git a/napcat.webui/src/components/system_status_display.tsx b/napcat.webui/src/components/system_status_display.tsx index 7670a969..8dc8379c 100644 --- a/napcat.webui/src/components/system_status_display.tsx +++ b/napcat.webui/src/components/system_status_display.tsx @@ -55,7 +55,7 @@ const SystemStatusDisplay: React.FC = ({ data }) => { } return ( - +
= ({ data }) => {
-

+

CPU

@@ -88,7 +88,7 @@ const SystemStatusDisplay: React.FC = ({ data }) => { unit="%" />
-

+

内存

diff --git a/napcat.webui/src/components/tabs/index.tsx b/napcat.webui/src/components/tabs/index.tsx index 9a9afc32..bacdb5e2 100644 --- a/napcat.webui/src/components/tabs/index.tsx +++ b/napcat.webui/src/components/tabs/index.tsx @@ -62,7 +62,7 @@ export const Tab = forwardRef( className={clsx( 'px-2 py-1 flex items-center gap-1 text-sm font-medium border-b-2 transition-colors', isSelected - ? 'border-danger text-danger' + ? 'border-primary text-primary' : 'border-transparent hover:border-default', className )} diff --git a/napcat.webui/src/layouts/default.tsx b/napcat.webui/src/layouts/default.tsx index 1f575f75..9d95fc45 100644 --- a/napcat.webui/src/layouts/default.tsx +++ b/napcat.webui/src/layouts/default.tsx @@ -79,7 +79,7 @@ const Layout: React.FC<{ children: React.ReactNode }> = ({ children }) => { }, [location.pathname]) return (
= ({ children }) => {
diff --git a/napcat.webui/src/pages/dashboard/about.tsx b/napcat.webui/src/pages/dashboard/about.tsx index 4a56e2c1..affef24f 100644 --- a/napcat.webui/src/pages/dashboard/about.tsx +++ b/napcat.webui/src/pages/dashboard/about.tsx @@ -1,6 +1,7 @@ import { Card, CardBody } from '@heroui/card' import { Image } from '@heroui/image' import { Link } from '@heroui/link' +import { Skeleton } from '@heroui/skeleton' import { Spinner } from '@heroui/spinner' import { useRequest } from 'ahooks' import { useMemo } from 'react' @@ -22,7 +23,7 @@ function VersionInfo() { return (
-
NapCat
+
NapCat
{error ? ( error.message ) : loading ? ( @@ -30,7 +31,7 @@ function VersionInfo() { ) : ( - -
- ) + return } return ( {alt} @@ -107,12 +104,12 @@ export default function AboutPage() {
-

NapCat 是什么?

+

NapCat 是什么?

基于TypeScript构建的Bot框架,通过相应的启动器或者框架,主动调用QQ Node模块提供给客户端的接口,实现Bot的功能.

-

魔法版介绍

+

魔法版介绍

猫猫框架通过魔法的手段获得了 QQ 的发送消息、接收消息等接口。 为了方便使用,猫猫框架将通过一种名为 OneBot 的约定将你的 HTTP / @@ -131,7 +128,7 @@ export default function AboutPage() { href="https://qm.qq.com/q/F9cgs1N3Mc" > - + 官方社群1 @@ -146,7 +143,7 @@ export default function AboutPage() { href="https://qm.qq.com/q/hSt0u9PVn" > - + 官方社群2 @@ -161,7 +158,7 @@ export default function AboutPage() { href="https://t.me/MelodicMoonlight" > - + Telegram @@ -176,7 +173,7 @@ export default function AboutPage() { href="https://napcat.napneko.icu/" > - + 使用文档 diff --git a/napcat.webui/src/pages/dashboard/debug/http/index.tsx b/napcat.webui/src/pages/dashboard/debug/http/index.tsx index e47faa84..6f71e35b 100644 --- a/napcat.webui/src/pages/dashboard/debug/http/index.tsx +++ b/napcat.webui/src/pages/dashboard/debug/http/index.tsx @@ -41,7 +41,7 @@ export default function HttpDebug() { >

- + diff --git a/napcat.webui/src/pages/dashboard/terminal.tsx b/napcat.webui/src/pages/dashboard/terminal.tsx index 4b2864e6..34c22c0d 100644 --- a/napcat.webui/src/pages/dashboard/terminal.tsx +++ b/napcat.webui/src/pages/dashboard/terminal.tsx @@ -133,7 +133,7 @@ export default function TerminalPage() { size="sm" className="min-w-0 w-4 h-4 flex-shrink-0" onPress={() => closeTerminal(tab.id)} - color={selectedTab === tab.id ? 'danger' : 'default'} + color={selectedTab === tab.id ? 'primary' : 'default'} > @@ -143,7 +143,7 @@ export default function TerminalPage() {