Skip to content

Commit

Permalink
merge(#11): 支持HTTP调试
Browse files Browse the repository at this point in the history
feat(debug): 支持HTTP调试
  • Loading branch information
bietiaop authored Dec 18, 2024
2 parents b4b4d36 + 2b22570 commit 5c1dd01
Show file tree
Hide file tree
Showing 24 changed files with 2,993 additions and 69 deletions.
75 changes: 38 additions & 37 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,31 +16,31 @@
"@monaco-editor/react": "^4.6.0",
"@nextui-org/avatar": "^2.2.4",
"@nextui-org/breadcrumbs": "^2.2.4",
"@nextui-org/button": "2.2.4",
"@nextui-org/card": "^2.2.4",
"@nextui-org/checkbox": "^2.3.4",
"@nextui-org/button": "2.2.7",
"@nextui-org/card": "^2.2.7",
"@nextui-org/checkbox": "^2.3.6",
"@nextui-org/chip": "^2.2.4",
"@nextui-org/code": "2.2.4",
"@nextui-org/dropdown": "^2.3.4",
"@nextui-org/dropdown": "^2.3.7",
"@nextui-org/image": "^2.2.3",
"@nextui-org/input": "2.4.4",
"@nextui-org/input": "2.4.6",
"@nextui-org/kbd": "2.2.4",
"@nextui-org/link": "2.2.4",
"@nextui-org/listbox": "^2.3.4",
"@nextui-org/modal": "^2.2.4",
"@nextui-org/navbar": "2.2.4",
"@nextui-org/popover": "^2.3.4",
"@nextui-org/select": "^2.4.4",
"@nextui-org/slider": "^2.4.4",
"@nextui-org/snippet": "2.2.5",
"@nextui-org/link": "2.2.5",
"@nextui-org/listbox": "^2.3.7",
"@nextui-org/modal": "^2.2.5",
"@nextui-org/navbar": "2.2.5",
"@nextui-org/popover": "^2.3.7",
"@nextui-org/select": "^2.4.7",
"@nextui-org/slider": "^2.4.5",
"@nextui-org/snippet": "2.2.8",
"@nextui-org/spinner": "^2.2.4",
"@nextui-org/switch": "2.2.4",
"@nextui-org/system": "2.4.1",
"@nextui-org/tabs": "^2.2.4",
"@nextui-org/theme": "2.4.1",
"@nextui-org/tooltip": "^2.2.4",
"@nextui-org/switch": "2.2.6",
"@nextui-org/system": "2.4.4",
"@nextui-org/tabs": "^2.2.5",
"@nextui-org/theme": "2.4.3",
"@nextui-org/tooltip": "^2.2.5",
"@react-aria/visually-hidden": "3.8.18",
"@reduxjs/toolkit": "^2.4.0",
"@reduxjs/toolkit": "^2.5.0",
"@uidotdev/usehooks": "^2.4.1",
"@xterm/addon-fit": "^0.10.0",
"@xterm/addon-web-links": "^0.11.0",
Expand All @@ -50,40 +50,41 @@
"axios": "^1.7.9",
"clsx": "2.1.1",
"event-source-polyfill": "^1.0.31",
"framer-motion": "^11.13.1",
"monaco-editor": "^0.52.0",
"motion": "^11.13.1",
"framer-motion": "^11.14.4",
"monaco-editor": "^0.52.2",
"motion": "^11.14.4",
"qface": "^1.4.1",
"qrcode.react": "^4.1.0",
"react": "18.3.1",
"react-dom": "18.3.1",
"qrcode.react": "^4.2.0",
"react": "19.0.0",
"react-dom": "19.0.0",
"react-error-boundary": "^4.1.2",
"react-hook-form": "^7.54.0",
"react-hook-form": "^7.54.1",
"react-hot-toast": "^2.4.1",
"react-icons": "^5.4.0",
"react-redux": "^9.1.2",
"react-redux": "^9.2.0",
"react-responsive": "^10.0.0",
"react-router-dom": "7.0.2",
"react-use-websocket": "^4.11.1",
"react-window": "^1.8.10",
"tailwind-variants": "0.3.0",
"tailwindcss": "3.4.16"
"tailwindcss": "3.4.16",
"zod": "^3.24.1"
},
"devDependencies": {
"@commitlint/cli": "^19.6.0",
"@commitlint/cli": "^19.6.1",
"@commitlint/config-conventional": "^19.6.0",
"@eslint/js": "^9.16.0",
"@eslint/js": "^9.17.0",
"@react-types/shared": "^3.26.0",
"@types/event-source-polyfill": "^1.0.5",
"@types/node": "22.10.1",
"@types/react": "18.3.3",
"@types/react-dom": "18.3.0",
"@types/node": "22.10.2",
"@types/react": "19.0.1",
"@types/react-dom": "19.0.2",
"@types/react-window": "^1.8.8",
"@typescript-eslint/eslint-plugin": "8.17.0",
"@typescript-eslint/parser": "8.17.0",
"@typescript-eslint/eslint-plugin": "8.18.0",
"@typescript-eslint/parser": "8.18.0",
"@vitejs/plugin-react": "^4.3.4",
"autoprefixer": "10.4.20",
"eslint": "^9.16.0",
"eslint": "^9.17.0",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-jsx-a11y": "^6.10.2",
Expand All @@ -94,7 +95,7 @@
"eslint-plugin-unused-imports": "4.1.4",
"globals": "^15.13.0",
"husky": "^9.1.7",
"lint-staged": "^15.2.10",
"lint-staged": "^15.2.11",
"postcss": "8.4.49",
"prettier": "3.4.2",
"typescript": "5.7.2",
Expand Down
84 changes: 79 additions & 5 deletions src/components/button/add_button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ import {

import { Button } from '@nextui-org/button'
import { IoAddCircleOutline } from 'react-icons/io5'
import { Tooltip } from '@nextui-org/tooltip'
import { FaRegCircleQuestion } from 'react-icons/fa6'

export interface AddButtonProps {
onOpen: (key: keyof OneBotConfig['network']) => void
Expand Down Expand Up @@ -49,7 +51,7 @@ const AddButton: React.FC<AddButtonProps> = (props) => {
<DropdownItem
key="title"
isReadOnly
className="cursor-default"
className="cursor-default hover:!bg-transparent"
textValue="title"
>
<div className="flex items-center gap-2 justify-center">
Expand All @@ -61,43 +63,115 @@ const AddButton: React.FC<AddButtonProps> = (props) => {
</DropdownItem>
<DropdownItem
key="httpServers"
textValue="httpServers"
startContent={
<div className="w-6 h-6">
<HTTPServerIcon />
</div>
}
>
HTTP服务器
<div className="flex gap-1 items-center">
HTTP服务器
<Tooltip
content="「由NapCat建立」一个HTTP服务器,你可以「使用框架连接」此服务器或者「自己构造请求发送」至此服务器。NapCat会根据你配置的IP和端口等建立一个地址,你或者你的框架应该连接到这个地址。"
showArrow
className="max-w-64"
>
<Button
isIconOnly
radius="full"
size="sm"
variant="light"
className="w-4 h-4 min-w-0"
>
<FaRegCircleQuestion />
</Button>
</Tooltip>
</div>
</DropdownItem>
<DropdownItem
key="httpClients"
textValue="httpClients"
startContent={
<div className="w-6 h-6">
<HTTPClientIcon />
</div>
}
>
HTTP客户端
<div className="flex gap-1 items-center">
HTTP客户端
<Tooltip
content="「由框架或者你自己建立」的一个用于「接收」NapCat向你发送请求的客户端,通常框架会提供一个HTTP地址。这个地址是你使用的框架提供的,NapCat会主动连接它。"
showArrow
className="max-w-64"
>
<Button
isIconOnly
radius="full"
size="sm"
variant="light"
className="w-4 h-4 min-w-0"
>
<FaRegCircleQuestion />
</Button>
</Tooltip>
</div>
</DropdownItem>
<DropdownItem
key="websocketServers"
textValue="websocketServers"
startContent={
<div className="w-6 h-6">
<WebsocketIcon />
</div>
}
>
Websocket服务器
<div className="flex gap-1 items-center">
Websocket服务器
<Tooltip
content="「由NapCat建立」一个WebSocket服务器,你的框架应该连接到此服务器。NapCat会根据你配置的IP和端口等建立一个WebSocket地址,你或者你的框架应该连接到这个地址。"
showArrow
className="max-w-64"
>
<Button
isIconOnly
radius="full"
size="sm"
variant="light"
className="w-4 h-4 min-w-0"
>
<FaRegCircleQuestion />
</Button>
</Tooltip>
</div>
</DropdownItem>
<DropdownItem
key="websocketClients"
textValue="websocketClients"
startContent={
<div className="w-6 h-6">
<PCIcon />
</div>
}
>
Websocket客户端
<div className="flex gap-1 items-center">
Websocket客户端
<Tooltip
content="「由框架或者你自己建立」的WebSocket,通常框架会「提供」一个ws地址,NapCat会主动连接它。"
showArrow
className="max-w-64"
>
<Button
isIconOnly
radius="full"
size="sm"
variant="light"
className="w-4 h-4 min-w-0"
>
<FaRegCircleQuestion />
</Button>
</Tooltip>
</div>
</DropdownItem>
</DropdownMenu>
</Dropdown>
Expand Down
2 changes: 1 addition & 1 deletion src/components/code_editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const CodeEditor = React.forwardRef<CodeEditorRef, CodeEditorProps>(
if (typeof ref === 'function') {
ref(editor)
} else {
;(ref as React.MutableRefObject<CodeEditorRef>).current = editor
;(ref as React.RefObject<CodeEditorRef>).current = editor
}
}
if (props.onMount) {
Expand Down
2 changes: 1 addition & 1 deletion src/components/display_card/common_card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ const NetworkDisplayCard = <T extends keyof NetworkType>({
<Switch
isDisabled={editing}
isSelected={enable}
onClick={handleEnable}
onChange={handleEnable}
/>
}
tag={showType && typeLabel}
Expand Down
Loading

0 comments on commit 5c1dd01

Please sign in to comment.