refactor: 主要功能实现
目前的工作已经实现的功能: - 基本 FastAPI 路由; - 基本 AI 聊天和创作功能; - 用户信息管理、权限验证、JWT 令牌签发和验证、端点保护; - HTML 验证码邮件发送和验证码验证。
This commit is contained in:
Vendored
+4
@@ -18,6 +18,7 @@ declare global {
|
||||
const getCurrentWatcher: typeof import('vue').getCurrentWatcher
|
||||
const h: typeof import('vue').h
|
||||
const inject: typeof import('vue').inject
|
||||
const injectHead: typeof import('@unhead/vue').injectHead
|
||||
const isProxy: typeof import('vue').isProxy
|
||||
const isReactive: typeof import('vue').isReactive
|
||||
const isReadonly: typeof import('vue').isReadonly
|
||||
@@ -57,11 +58,14 @@ declare global {
|
||||
const useCssModule: typeof import('vue').useCssModule
|
||||
const useCssVars: typeof import('vue').useCssVars
|
||||
const useDialog: typeof import('naive-ui').useDialog
|
||||
const useHead: typeof import('@unhead/vue').useHead
|
||||
const useHeadSafe: typeof import('@unhead/vue').useHeadSafe
|
||||
const useId: typeof import('vue').useId
|
||||
const useLoadingBar: typeof import('naive-ui').useLoadingBar
|
||||
const useMessage: typeof import('naive-ui').useMessage
|
||||
const useModel: typeof import('vue').useModel
|
||||
const useNotification: typeof import('naive-ui').useNotification
|
||||
const useSeoMeta: typeof import('@unhead/vue').useSeoMeta
|
||||
const useSlots: typeof import('vue').useSlots
|
||||
const useTemplateRef: typeof import('vue').useTemplateRef
|
||||
const watch: typeof import('vue').watch
|
||||
|
||||
Vendored
+118
@@ -12,19 +12,137 @@ export {}
|
||||
/* prettier-ignore */
|
||||
declare module 'vue' {
|
||||
export interface GlobalComponents {
|
||||
AiiModelAddModal: typeof import('./src/components/chatroom/AiiModelAddModal.vue')['default']
|
||||
AiiProviderAddModal: typeof import('./src/components/chatroom/AiiProviderAddModal.vue')['default']
|
||||
ChangeEmailModal: typeof import('./src/components/admin/ChangeEmailModal.vue')['default']
|
||||
ChatControlPanel: typeof import('./src/components/chatroom/ChatControlPanel.vue')['default']
|
||||
ChatMessage: typeof import('./src/components/chatroom/ChatMessage.vue')['default']
|
||||
ChatPromptQuicker: typeof import('./src/components/chatroom/ChatPromptQuicker.vue')['default']
|
||||
ChatroomCard: typeof import('./src/components/chatroom/ChatroomCard.vue')['default']
|
||||
ChatroomCreatorModal: typeof import('./src/components/chatroom/ChatroomCreatorModal.vue')['default']
|
||||
ChatTable: typeof import('./src/components/chatroom/ChatTable.vue')['default']
|
||||
ConfigCard: typeof import('./src/components/admin/ConfigCard.vue')['default']
|
||||
FileModal: typeof import('./src/components/file/FileModal.vue')['default']
|
||||
FileThumbnail: typeof import('./src/components/file/FileThumbnail.vue')['default']
|
||||
InDev: typeof import('./src/components/InDev.vue')['default']
|
||||
NAlert: typeof import('naive-ui')['NAlert']
|
||||
NAvatar: typeof import('naive-ui')['NAvatar']
|
||||
NButton: typeof import('naive-ui')['NButton']
|
||||
NButtonGroup: typeof import('naive-ui')['NButtonGroup']
|
||||
NCard: typeof import('naive-ui')['NCard']
|
||||
NCode: typeof import('naive-ui')['NCode']
|
||||
NConfigProvider: typeof import('naive-ui')['NConfigProvider']
|
||||
NDataTable: typeof import('naive-ui')['NDataTable']
|
||||
NDrawer: typeof import('naive-ui')['NDrawer']
|
||||
NDrawerContent: typeof import('naive-ui')['NDrawerContent']
|
||||
NEllipsis: typeof import('naive-ui')['NEllipsis']
|
||||
NEmpty: typeof import('naive-ui')['NEmpty']
|
||||
NFlex: typeof import('naive-ui')['NFlex']
|
||||
NForm: typeof import('naive-ui')['NForm']
|
||||
NFormItem: typeof import('naive-ui')['NFormItem']
|
||||
NGlobalStyle: typeof import('naive-ui')['NGlobalStyle']
|
||||
NGrid: typeof import('naive-ui')['NGrid']
|
||||
NGridItem: typeof import('naive-ui')['NGridItem']
|
||||
NH2: typeof import('naive-ui')['NH2']
|
||||
NH3: typeof import('naive-ui')['NH3']
|
||||
NImage: typeof import('naive-ui')['NImage']
|
||||
NInput: typeof import('naive-ui')['NInput']
|
||||
NInputNumber: typeof import('naive-ui')['NInputNumber']
|
||||
NInputOtp: typeof import('naive-ui')['NInputOtp']
|
||||
NMenu: typeof import('naive-ui')['NMenu']
|
||||
NMessageProvider: typeof import('naive-ui')['NMessageProvider']
|
||||
NModal: typeof import('naive-ui')['NModal']
|
||||
NModalProvider: typeof import('naive-ui')['NModalProvider']
|
||||
NP: typeof import('naive-ui')['NP']
|
||||
NRadio: typeof import('naive-ui')['NRadio']
|
||||
NRadioButton: typeof import('naive-ui')['NRadioButton']
|
||||
NRadioGroup: typeof import('naive-ui')['NRadioGroup']
|
||||
NSelect: typeof import('naive-ui')['NSelect']
|
||||
NSwitch: typeof import('naive-ui')['NSwitch']
|
||||
NTabPane: typeof import('naive-ui')['NTabPane']
|
||||
NTabs: typeof import('naive-ui')['NTabs']
|
||||
NTag: typeof import('naive-ui')['NTag']
|
||||
NText: typeof import('naive-ui')['NText']
|
||||
NUpload: typeof import('naive-ui')['NUpload']
|
||||
NUploadDragger: typeof import('naive-ui')['NUploadDragger']
|
||||
PageHeader: typeof import('./src/components/PageHeader.vue')['default']
|
||||
RouterLink: typeof import('vue-router')['RouterLink']
|
||||
RouterView: typeof import('vue-router')['RouterView']
|
||||
ScriptDrawer: typeof import('./src/components/chatroom/ScriptDrawer.vue')['default']
|
||||
SelectFileModal: typeof import('./src/components/file/SelectFileModal.vue')['default']
|
||||
UploadFileModal: typeof import('./src/components/file/UploadFileModal.vue')['default']
|
||||
UploadModal: typeof import('./src/components/UploadModal.vue')['default']
|
||||
UserAction: typeof import('./src/components/admin/UserAction.vue')['default']
|
||||
UserPasswordModal: typeof import('./src/components/admin/UserPasswordModal.vue')['default']
|
||||
VerifyCodeModal: typeof import('./src/components/admin/VerifyCodeModal.vue')['default']
|
||||
XamlModal: typeof import('./src/components/XamlModal.vue')['default']
|
||||
}
|
||||
}
|
||||
|
||||
// For TSX support
|
||||
declare global {
|
||||
const AiiModelAddModal: typeof import('./src/components/chatroom/AiiModelAddModal.vue')['default']
|
||||
const AiiProviderAddModal: typeof import('./src/components/chatroom/AiiProviderAddModal.vue')['default']
|
||||
const ChangeEmailModal: typeof import('./src/components/admin/ChangeEmailModal.vue')['default']
|
||||
const ChatControlPanel: typeof import('./src/components/chatroom/ChatControlPanel.vue')['default']
|
||||
const ChatMessage: typeof import('./src/components/chatroom/ChatMessage.vue')['default']
|
||||
const ChatPromptQuicker: typeof import('./src/components/chatroom/ChatPromptQuicker.vue')['default']
|
||||
const ChatroomCard: typeof import('./src/components/chatroom/ChatroomCard.vue')['default']
|
||||
const ChatroomCreatorModal: typeof import('./src/components/chatroom/ChatroomCreatorModal.vue')['default']
|
||||
const ChatTable: typeof import('./src/components/chatroom/ChatTable.vue')['default']
|
||||
const ConfigCard: typeof import('./src/components/admin/ConfigCard.vue')['default']
|
||||
const FileModal: typeof import('./src/components/file/FileModal.vue')['default']
|
||||
const FileThumbnail: typeof import('./src/components/file/FileThumbnail.vue')['default']
|
||||
const InDev: typeof import('./src/components/InDev.vue')['default']
|
||||
const NAlert: typeof import('naive-ui')['NAlert']
|
||||
const NAvatar: typeof import('naive-ui')['NAvatar']
|
||||
const NButton: typeof import('naive-ui')['NButton']
|
||||
const NButtonGroup: typeof import('naive-ui')['NButtonGroup']
|
||||
const NCard: typeof import('naive-ui')['NCard']
|
||||
const NCode: typeof import('naive-ui')['NCode']
|
||||
const NConfigProvider: typeof import('naive-ui')['NConfigProvider']
|
||||
const NDataTable: typeof import('naive-ui')['NDataTable']
|
||||
const NDrawer: typeof import('naive-ui')['NDrawer']
|
||||
const NDrawerContent: typeof import('naive-ui')['NDrawerContent']
|
||||
const NEllipsis: typeof import('naive-ui')['NEllipsis']
|
||||
const NEmpty: typeof import('naive-ui')['NEmpty']
|
||||
const NFlex: typeof import('naive-ui')['NFlex']
|
||||
const NForm: typeof import('naive-ui')['NForm']
|
||||
const NFormItem: typeof import('naive-ui')['NFormItem']
|
||||
const NGlobalStyle: typeof import('naive-ui')['NGlobalStyle']
|
||||
const NGrid: typeof import('naive-ui')['NGrid']
|
||||
const NGridItem: typeof import('naive-ui')['NGridItem']
|
||||
const NH2: typeof import('naive-ui')['NH2']
|
||||
const NH3: typeof import('naive-ui')['NH3']
|
||||
const NImage: typeof import('naive-ui')['NImage']
|
||||
const NInput: typeof import('naive-ui')['NInput']
|
||||
const NInputNumber: typeof import('naive-ui')['NInputNumber']
|
||||
const NInputOtp: typeof import('naive-ui')['NInputOtp']
|
||||
const NMenu: typeof import('naive-ui')['NMenu']
|
||||
const NMessageProvider: typeof import('naive-ui')['NMessageProvider']
|
||||
const NModal: typeof import('naive-ui')['NModal']
|
||||
const NModalProvider: typeof import('naive-ui')['NModalProvider']
|
||||
const NP: typeof import('naive-ui')['NP']
|
||||
const NRadio: typeof import('naive-ui')['NRadio']
|
||||
const NRadioButton: typeof import('naive-ui')['NRadioButton']
|
||||
const NRadioGroup: typeof import('naive-ui')['NRadioGroup']
|
||||
const NSelect: typeof import('naive-ui')['NSelect']
|
||||
const NSwitch: typeof import('naive-ui')['NSwitch']
|
||||
const NTabPane: typeof import('naive-ui')['NTabPane']
|
||||
const NTabs: typeof import('naive-ui')['NTabs']
|
||||
const NTag: typeof import('naive-ui')['NTag']
|
||||
const NText: typeof import('naive-ui')['NText']
|
||||
const NUpload: typeof import('naive-ui')['NUpload']
|
||||
const NUploadDragger: typeof import('naive-ui')['NUploadDragger']
|
||||
const PageHeader: typeof import('./src/components/PageHeader.vue')['default']
|
||||
const RouterLink: typeof import('vue-router')['RouterLink']
|
||||
const RouterView: typeof import('vue-router')['RouterView']
|
||||
const ScriptDrawer: typeof import('./src/components/chatroom/ScriptDrawer.vue')['default']
|
||||
const SelectFileModal: typeof import('./src/components/file/SelectFileModal.vue')['default']
|
||||
const UploadFileModal: typeof import('./src/components/file/UploadFileModal.vue')['default']
|
||||
const UploadModal: typeof import('./src/components/UploadModal.vue')['default']
|
||||
const UserAction: typeof import('./src/components/admin/UserAction.vue')['default']
|
||||
const UserPasswordModal: typeof import('./src/components/admin/UserPasswordModal.vue')['default']
|
||||
const VerifyCodeModal: typeof import('./src/components/admin/VerifyCodeModal.vue')['default']
|
||||
const XamlModal: typeof import('./src/components/XamlModal.vue')['default']
|
||||
}
|
||||
@@ -15,7 +15,11 @@
|
||||
"format": "oxfmt src/"
|
||||
},
|
||||
"dependencies": {
|
||||
"@microsoft/fetch-event-source": "^2.0.1",
|
||||
"@types/markdown-it": "^14.1.2",
|
||||
"@unhead/vue": "3.0.0-beta.9",
|
||||
"axios": "^1.15.2",
|
||||
"markdown-it": "^14.1.1",
|
||||
"pinia": "^3.0.4",
|
||||
"vue": "^3.5.32",
|
||||
"vue-router": "^5.0.4"
|
||||
|
||||
Generated
+483
-76
@@ -23,9 +23,21 @@ importers:
|
||||
|
||||
.:
|
||||
dependencies:
|
||||
'@microsoft/fetch-event-source':
|
||||
specifier: ^2.0.1
|
||||
version: 2.0.1
|
||||
'@types/markdown-it':
|
||||
specifier: ^14.1.2
|
||||
version: 14.1.2
|
||||
'@unhead/vue':
|
||||
specifier: 3.0.0-beta.9
|
||||
version: 3.0.0-beta.9(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0)(vite@8.0.10(@types/node@24.12.2)(jiti@2.6.1)(sass-embedded@1.99.0)(sass@1.99.0)(yaml@2.8.3))(vue@3.6.0-beta.10(typescript@6.0.3))
|
||||
axios:
|
||||
specifier: ^1.15.2
|
||||
version: 1.15.2
|
||||
markdown-it:
|
||||
specifier: ^14.1.1
|
||||
version: 14.1.1
|
||||
pinia:
|
||||
specifier: ^3.0.4
|
||||
version: 3.0.4(typescript@6.0.3)(vue@3.6.0-beta.10(typescript@6.0.3))
|
||||
@@ -192,6 +204,11 @@ packages:
|
||||
engines: {node: '>=6.0.0'}
|
||||
hasBin: true
|
||||
|
||||
'@babel/parser@7.29.3':
|
||||
resolution: {integrity: sha512-b3ctpQwp+PROvU/cttc4OYl4MzfJUWy6FZg+PMXfzmt/+39iHVF0sDfqay8TQM3JA2EUOyKcFZt75jWriQijsA==}
|
||||
engines: {node: '>=6.0.0'}
|
||||
hasBin: true
|
||||
|
||||
'@babel/plugin-proposal-decorators@7.29.0':
|
||||
resolution: {integrity: sha512-CVBVv3VY/XRMxRYq5dwr2DS7/MvqPm23cOCjbwNnVrfOqcWlnefua1uUs0sjdKOGjvPUG633o07uWzJq4oI6dA==}
|
||||
engines: {node: '>=6.9.0'}
|
||||
@@ -339,6 +356,9 @@ packages:
|
||||
'@juggle/resize-observer@3.4.0':
|
||||
resolution: {integrity: sha512-dfLbk+PwWvFzSxwk3n5ySL0hfBog779o8h68wK/7/APo/7cgyWp5jcXockbxdk5kFRkbeXWm4Fbi9FrdN381sA==}
|
||||
|
||||
'@microsoft/fetch-event-source@2.0.1':
|
||||
resolution: {integrity: sha512-W6CLUJ2eBMw3Rec70qrsEW0jOm/3twwJv21mrmj2yORiaVmVYGS4sSS5yUwvQc1ZlDLYGPnClVWmUUMagKNsfA==}
|
||||
|
||||
'@napi-rs/wasm-runtime@1.1.4':
|
||||
resolution: {integrity: sha512-3NQNNgA1YSlJb/kMH1ildASP9HW7/7kYnRI2szWJaofaS1hWmbGI4H+d3+22aGzXXN9IJ+n+GiFVcGipJP18ow==}
|
||||
peerDependencies:
|
||||
@@ -357,6 +377,136 @@ packages:
|
||||
resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==}
|
||||
engines: {node: '>= 8'}
|
||||
|
||||
'@oxc-parser/binding-android-arm-eabi@0.106.0':
|
||||
resolution: {integrity: sha512-uoo8Bbc0/UrsQHlpdelqz8+jQ5hQqJs6MKjeiGqSU0E5Dkben2PuxXjg2jmabT+TzclysNEyE7eKHGTA7uVVqQ==}
|
||||
engines: {node: ^20.19.0 || >=22.12.0}
|
||||
cpu: [arm]
|
||||
os: [android]
|
||||
|
||||
'@oxc-parser/binding-android-arm64@0.106.0':
|
||||
resolution: {integrity: sha512-7+hnrpce0uX96Hu8seWMJXqDnBTtSikibn1xa1yCa/musU1XZOLznhdWKA1usaPnwLBXP+7+h6nrdvKZ4HoT5Q==}
|
||||
engines: {node: ^20.19.0 || >=22.12.0}
|
||||
cpu: [arm64]
|
||||
os: [android]
|
||||
|
||||
'@oxc-parser/binding-darwin-arm64@0.106.0':
|
||||
resolution: {integrity: sha512-J7d6j8PwicRXTL4I00eWhqupuq0Pei9EafTzoB7ccluNo5fXNspkIH1NtGpgxPsLyUkZy5Nb5J3Y80TpdX6yQA==}
|
||||
engines: {node: ^20.19.0 || >=22.12.0}
|
||||
cpu: [arm64]
|
||||
os: [darwin]
|
||||
|
||||
'@oxc-parser/binding-darwin-x64@0.106.0':
|
||||
resolution: {integrity: sha512-5LhQlSACZPeyxbcE8WNMW1s88ExWGRnk0LQbQ3Co3gYkmgw12x2q6RnPT0N9BC6490VnWsynFafwCMPSrMnjfg==}
|
||||
engines: {node: ^20.19.0 || >=22.12.0}
|
||||
cpu: [x64]
|
||||
os: [darwin]
|
||||
|
||||
'@oxc-parser/binding-freebsd-x64@0.106.0':
|
||||
resolution: {integrity: sha512-IInBOOMzB54rV/s8K5Feu6krWNHMR/V52prXy+9B0GhjOSQ2Q7EAd8y1gXWgjKB0NMDychCLgdaInanUn45eyQ==}
|
||||
engines: {node: ^20.19.0 || >=22.12.0}
|
||||
cpu: [x64]
|
||||
os: [freebsd]
|
||||
|
||||
'@oxc-parser/binding-linux-arm-gnueabihf@0.106.0':
|
||||
resolution: {integrity: sha512-p0IQvugmAsA2288b30FP5ncbcp6juBQrsZNZD6SDiWRY3X3g5OH5puVtihE5KMNkeHmmd3S8MEHFCv0G1tYGPA==}
|
||||
engines: {node: ^20.19.0 || >=22.12.0}
|
||||
cpu: [arm]
|
||||
os: [linux]
|
||||
|
||||
'@oxc-parser/binding-linux-arm-musleabihf@0.106.0':
|
||||
resolution: {integrity: sha512-VgJPJVygSyFEfFtv6hscx9AbnewsxDUCxWmgrB/GHktoMlDQSDBh9aG1lENiiJnB2FLR8WG15446X3Mw2I4Zog==}
|
||||
engines: {node: ^20.19.0 || >=22.12.0}
|
||||
cpu: [arm]
|
||||
os: [linux]
|
||||
|
||||
'@oxc-parser/binding-linux-arm64-gnu@0.106.0':
|
||||
resolution: {integrity: sha512-Gqs6q/pwlpgzx5qE2RtlTnY7hJuS1a5PYBT3unpSAMUE0LrbV7kQ8thmQo1ngI1tnCImWpuuXjZ2YbI0iKquXw==}
|
||||
engines: {node: ^20.19.0 || >=22.12.0}
|
||||
cpu: [arm64]
|
||||
os: [linux]
|
||||
libc: [glibc]
|
||||
|
||||
'@oxc-parser/binding-linux-arm64-musl@0.106.0':
|
||||
resolution: {integrity: sha512-Bvtp8SK4MyahReapEPodracfBV9ed7+5WCHyjhSWoljrapJIU4OOLSsRyZ9zV2KhkjuD66DZq/qQv6pC73zzWQ==}
|
||||
engines: {node: ^20.19.0 || >=22.12.0}
|
||||
cpu: [arm64]
|
||||
os: [linux]
|
||||
libc: [musl]
|
||||
|
||||
'@oxc-parser/binding-linux-ppc64-gnu@0.106.0':
|
||||
resolution: {integrity: sha512-DIXyavnpbBo+F/4G04LZ4xuuGXDY4m9qHB/HWtVj9z+Frb/r+SPAuptqAZFtJ9avcwbAOe3LO+K8BWHmK6+lnw==}
|
||||
engines: {node: ^20.19.0 || >=22.12.0}
|
||||
cpu: [ppc64]
|
||||
os: [linux]
|
||||
libc: [glibc]
|
||||
|
||||
'@oxc-parser/binding-linux-riscv64-gnu@0.106.0':
|
||||
resolution: {integrity: sha512-VdqTcLTET72nPcJkSz3xrpcxab7q2/z04d6y+Th1mUTyXs2b/9VC3BcDmaFAfmhz8GX/5FVuzUTQzda1mTsh/g==}
|
||||
engines: {node: ^20.19.0 || >=22.12.0}
|
||||
cpu: [riscv64]
|
||||
os: [linux]
|
||||
libc: [glibc]
|
||||
|
||||
'@oxc-parser/binding-linux-riscv64-musl@0.106.0':
|
||||
resolution: {integrity: sha512-FgHBGg9DHQ0dePOWQ9rNN+DHueJa1XWHc9u0VJCVY+XXAx3iT2ASj21xZ1wA+Rh92CyuuZ7RpQ6Y+O57fieNlg==}
|
||||
engines: {node: ^20.19.0 || >=22.12.0}
|
||||
cpu: [riscv64]
|
||||
os: [linux]
|
||||
libc: [musl]
|
||||
|
||||
'@oxc-parser/binding-linux-s390x-gnu@0.106.0':
|
||||
resolution: {integrity: sha512-fEIx2bUggt+s1eTaRVzhy5VgdrO1B8tUKxOPpGwwdF9VSP0KnLPaAv/gA4trJPxuIjjJRRVoK42v9R4O1jkbLg==}
|
||||
engines: {node: ^20.19.0 || >=22.12.0}
|
||||
cpu: [s390x]
|
||||
os: [linux]
|
||||
libc: [glibc]
|
||||
|
||||
'@oxc-parser/binding-linux-x64-gnu@0.106.0':
|
||||
resolution: {integrity: sha512-DbDQkdK8ZuS/jnRx8UbESQ5ypCJpD7VpERB/RWZfSdA2+B4TbonDwNWbTU+q2VJTbh5Xq1X65eQyz4/MIfiFSQ==}
|
||||
engines: {node: ^20.19.0 || >=22.12.0}
|
||||
cpu: [x64]
|
||||
os: [linux]
|
||||
libc: [glibc]
|
||||
|
||||
'@oxc-parser/binding-linux-x64-musl@0.106.0':
|
||||
resolution: {integrity: sha512-D0PbaLv1MyNFDmjY4UqLQFlC+0GPCvrzI/8VlAvG7ztAZx0KdFYT3pPGsHjKshUJW9+e42JK29abLd0bZ4I95w==}
|
||||
engines: {node: ^20.19.0 || >=22.12.0}
|
||||
cpu: [x64]
|
||||
os: [linux]
|
||||
libc: [musl]
|
||||
|
||||
'@oxc-parser/binding-openharmony-arm64@0.106.0':
|
||||
resolution: {integrity: sha512-uXSzts/ghlqmWm1cQTctyxdAnvha5dzVW5JkEB30J4M47yj2FcCtzUGdZO/sgXxggD/QM7EANlB66cOyk/NsoA==}
|
||||
engines: {node: ^20.19.0 || >=22.12.0}
|
||||
cpu: [arm64]
|
||||
os: [openharmony]
|
||||
|
||||
'@oxc-parser/binding-wasm32-wasi@0.106.0':
|
||||
resolution: {integrity: sha512-oU8wkw9U1vhkICQIJLX8uy1lCPJqXf7aAidaqT2wJOce4a9XmGr2YNseEKbmVV/1TQaSHpHZNsDXglYicb4qKQ==}
|
||||
engines: {node: '>=14.0.0'}
|
||||
cpu: [wasm32]
|
||||
|
||||
'@oxc-parser/binding-win32-arm64-msvc@0.106.0':
|
||||
resolution: {integrity: sha512-zYRSn6MNlL8qcUIPRQWDu1JdgVqZa5iR4Drld8FBue3fHQGL0XrNQEd8qoWmuNo7FI0WiBRRuVgtkPaNoSsYmg==}
|
||||
engines: {node: ^20.19.0 || >=22.12.0}
|
||||
cpu: [arm64]
|
||||
os: [win32]
|
||||
|
||||
'@oxc-parser/binding-win32-ia32-msvc@0.106.0':
|
||||
resolution: {integrity: sha512-FRHVO84i5WgQDk0XI4oRt2qDhRUXyot2EGBSogp34LoE5hsondyuZ244+Fod9czgscmgSb6Aon8PaEhHQ0lJYg==}
|
||||
engines: {node: ^20.19.0 || >=22.12.0}
|
||||
cpu: [ia32]
|
||||
os: [win32]
|
||||
|
||||
'@oxc-parser/binding-win32-x64-msvc@0.106.0':
|
||||
resolution: {integrity: sha512-ydMjY15RdfRZZa7RrP+jjeudbDFDqKo5CGDTxvYBJ4jpROvVo0ThqN85vvNfVJ55gEUSjodCqvmA30qNTBZd/A==}
|
||||
engines: {node: ^20.19.0 || >=22.12.0}
|
||||
cpu: [x64]
|
||||
os: [win32]
|
||||
|
||||
'@oxc-project/types@0.106.0':
|
||||
resolution: {integrity: sha512-QdsH3rZq480VnOHSHgPYOhjL8O8LBdcnSjM408BpPCCUc0JYYZPG9Gafl9i3OcGk/7137o+gweb4cCv3WAUykg==}
|
||||
|
||||
'@oxc-project/types@0.127.0':
|
||||
resolution: {integrity: sha512-aIYXQBo4lCbO4z0R3FHeucQHpF46l2LbMdxRvqvuRuW2OxdnSkcng5B8+K12spgLDj93rtN3+J2Vac/TIO+ciQ==}
|
||||
|
||||
@@ -814,12 +964,21 @@ packages:
|
||||
'@types/json-schema@7.0.15':
|
||||
resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==}
|
||||
|
||||
'@types/linkify-it@5.0.0':
|
||||
resolution: {integrity: sha512-sVDA58zAw4eWAffKOaQH5/5j3XeayukzDk+ewSsnv3p4yJEZHCCzMDiZM8e0OUrRvmpGZ85jf4yDHkHsgBNr9Q==}
|
||||
|
||||
'@types/lodash-es@4.17.12':
|
||||
resolution: {integrity: sha512-0NgftHUcV4v34VhXm8QBSftKVXtbkBG3ViCjs6+eJ5a6y6Mi/jiFGPc1sC7QK+9BFhWrURE3EOggmWaSxL9OzQ==}
|
||||
|
||||
'@types/lodash@4.17.24':
|
||||
resolution: {integrity: sha512-gIW7lQLZbue7lRSWEFql49QJJWThrTFFeIMJdp3eH4tKoxm1OvEPg02rm4wCCSHS0cL3/Fizimb35b7k8atwsQ==}
|
||||
|
||||
'@types/markdown-it@14.1.2':
|
||||
resolution: {integrity: sha512-promo4eFwuiW+TfGxhi+0x3czqTYJkG8qB17ZUJiVF10Xm7NLVRSLUsfRTU/6h1e24VvRnXCx+hG7li58lkzog==}
|
||||
|
||||
'@types/mdurl@2.0.0':
|
||||
resolution: {integrity: sha512-RGdgjQUZba5p6QEFAVx2OGb8rQDL/cPRG7GiedRzMcJ1tYnUANBncjbSB1NRGwbvjcPeikRABz2nshyPk1bhWg==}
|
||||
|
||||
'@types/node@24.12.2':
|
||||
resolution: {integrity: sha512-A1sre26ke7HDIuY/M23nd9gfB+nrmhtYyMINbjI1zHJxYteKR6qSMX56FsmjMcDb3SMcjJg5BiRRgOCC/yBD0g==}
|
||||
|
||||
@@ -882,6 +1041,15 @@ packages:
|
||||
resolution: {integrity: sha512-LdDNl6C5iJExcM0Yh0PwAIBb9PrSiCsWamF/JyEZawm3kFDnRoaq3LGE4bpyRao/fWeGKKyw7icx0YxrLFC5Cg==}
|
||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||
|
||||
'@unhead/vue@3.0.0-beta.9':
|
||||
resolution: {integrity: sha512-X66jeffzB+IH3cXBPLhbBAFCsTuTVYD0+0N5aelNw5MbE9CpNnLJCIcwUyqh/UdEwaBMehRNPlGY+fiRrapRqQ==}
|
||||
peerDependencies:
|
||||
vite: '>=6'
|
||||
vue: '>=3.5.18'
|
||||
peerDependenciesMeta:
|
||||
vite:
|
||||
optional: true
|
||||
|
||||
'@vitejs/plugin-vue-jsx@5.1.5':
|
||||
resolution: {integrity: sha512-jIAsvHOEtWpslLOI2MeElGFxH7M8pM83BU/Tor4RLyiwH0FM4nUW3xdvbw20EeU9wc5IspQwMq225K3CMnJEpA==}
|
||||
engines: {node: ^20.19.0 || >=22.12.0}
|
||||
@@ -946,20 +1114,20 @@ packages:
|
||||
peerDependencies:
|
||||
'@babel/core': ^7.0.0-0
|
||||
|
||||
'@vue/compiler-core@3.6.0-beta.10':
|
||||
resolution: {integrity: sha512-hzkiI5eeO3YgCBlXRXM6HT8E7l2aE3FY4bBBdzHkXDEXy+13gDpztU/TdJQmr6OsER51tNponBOpqwkaZvpL7g==}
|
||||
'@vue/compiler-core@3.6.0-beta.12':
|
||||
resolution: {integrity: sha512-SrmembMU15mawXHGq4VlQzcFKH8Y6AyD2qGaXDgcSpVYUdC5jVQZqXn1DBd4xanWVUGb3Tj1b/8lqGD7UkV+Xw==}
|
||||
|
||||
'@vue/compiler-dom@3.6.0-beta.10':
|
||||
resolution: {integrity: sha512-syaKfkW2D4VFFndlNYweR/EqYWxpf1zCF2URtDcN8IJXV3jvsfOSZA+p8+kyNSbDtBEq8CAeulUXrRfORrM0mQ==}
|
||||
'@vue/compiler-dom@3.6.0-beta.12':
|
||||
resolution: {integrity: sha512-t43TXnDvrpPQam9XIG8FImTDryYSvZ1bk0SPvkp3PaJ4Qz5mJT/X4OUcdaR9ihhyaF+xOuVH/OFvwlO6ZM1NUA==}
|
||||
|
||||
'@vue/compiler-sfc@3.6.0-beta.10':
|
||||
resolution: {integrity: sha512-Pw6EkQB1a4wfh137rIgYwMwqc8v8JcsIwspzfGYG7a+St38gcnNGJFGVvfJh689EOLgfv1Z8was6ktrESfowwQ==}
|
||||
'@vue/compiler-sfc@3.6.0-beta.12':
|
||||
resolution: {integrity: sha512-jmaZT/MU62Q4fByoDK3iHHcUMmfScQrlmjk/hG0kYQ1vCzRwWloFeyqsNoRqqaBSS9Q4xmvZi4/sXvwPd1zf0Q==}
|
||||
|
||||
'@vue/compiler-ssr@3.6.0-beta.10':
|
||||
resolution: {integrity: sha512-Pp5QQYgEhtv3C7irbeZP64gAWQjrsSnMlaNtBfgge/Cla/xE+HCQqE+8aJUndirtkmFutEA8CvHJ9K4FDHlOjQ==}
|
||||
'@vue/compiler-ssr@3.6.0-beta.12':
|
||||
resolution: {integrity: sha512-jtpElHVq/KD9cKM+eze35bCTY/A5/tCjbMinMbJtqpl6ElHPN9jMJofImeojuzdowdDcpgoE+hDpiS8syg3fzA==}
|
||||
|
||||
'@vue/compiler-vapor@3.6.0-beta.10':
|
||||
resolution: {integrity: sha512-9DqhmWnv06wefy/gBIix0bfphEDba0La96tt8jbNZb9+CbnbB0VyNCz70ynXyhbvrM5K9yhGcIqNfhkNhcepAQ==}
|
||||
'@vue/compiler-vapor@3.6.0-beta.12':
|
||||
resolution: {integrity: sha512-p71W1LZI0H8MMxxuWhr0CSa0iMMlmMjh+RscVhMBy8Q+LDYIWVbWUhAgHww38DMlvCELr/rx73xfbTfjpVbGlw==}
|
||||
|
||||
'@vue/devtools-api@7.7.9':
|
||||
resolution: {integrity: sha512-kIE8wvwlcZ6TJTbNeU2HQNtaxLx3a84aotTITUuL/4bzfPxzajGBOoqjMhwZJ8L9qFYDU/lAYMEEm11dnZOD6g==}
|
||||
@@ -998,27 +1166,27 @@ packages:
|
||||
'@vue/language-core@3.2.7':
|
||||
resolution: {integrity: sha512-Gn4q/tRxbpVGLEuARQ43p3YELlNAFgRUVCgW9U5Cr+5q4vfD2bWDWpl3ABbJMXUt5xlE1dF8dkigg2aUq7JYYw==}
|
||||
|
||||
'@vue/reactivity@3.6.0-beta.10':
|
||||
resolution: {integrity: sha512-YOdRI7G9SAI/Ic3dBUE1Mwzvb7J5h4Oqe0FijSi0y3mI4MWkMxNvWSSLkjqALSfAgixxjSRRfSR9Ln2jm53WeQ==}
|
||||
'@vue/reactivity@3.6.0-beta.12':
|
||||
resolution: {integrity: sha512-YByP7NXJiWpFhhCLqjkIgRmGKd4gesVRjIkCK0ERbYZf/oj7zd59Ai5Mjf7sFN+iKpISYIHx5EPh6oxyJyndOw==}
|
||||
|
||||
'@vue/runtime-core@3.6.0-beta.10':
|
||||
resolution: {integrity: sha512-5cFbYbxtTm7H2Ch1qEdmUFySrPI/+aSmUJsJpMltG5gQJCuWN3kjVqeZp2AZB7pI3a2Jkq2NJC0gR++4eAw1xw==}
|
||||
'@vue/runtime-core@3.6.0-beta.12':
|
||||
resolution: {integrity: sha512-sMbz0ncmTBuoSXqY6dP3tTshhxcg82fUOSxKY8japIbhNAwbsFmsa3m7LABjDrk5nIEeUfKrqtz2TlpKSiJ5Xw==}
|
||||
|
||||
'@vue/runtime-dom@3.6.0-beta.10':
|
||||
resolution: {integrity: sha512-w02s59Gq1NoZtSCpVKRWzk9No9BEq/eq9n1+KLre5WvYMIYjK0XBNN9cltZfE0/j5uZQlb87i4qR51YxFFbHog==}
|
||||
'@vue/runtime-dom@3.6.0-beta.12':
|
||||
resolution: {integrity: sha512-iuf+5/7wZh+rp+ddl6DH6ehCsduuV9Ts1AWoIlQoWvznFKv90e1PAG/rutcmvPIpXZHYhNPL0VyXQBgnBWRD4g==}
|
||||
|
||||
'@vue/runtime-vapor@3.6.0-beta.10':
|
||||
resolution: {integrity: sha512-MQOs7WughaIUFB6nL02kIHgjPpmiZeXnCLP303kihdfaS3vdsYzvc9u6cnTTtvfSGbyHq8F15rcz5QoRlF+zew==}
|
||||
'@vue/runtime-vapor@3.6.0-beta.12':
|
||||
resolution: {integrity: sha512-9hQhFNnAzdtolLSoAg7Wml6Q6rX6WbfnjmjanStuMwodBsg8CEnzdU4TsVFNyHdKCqJ1rs1DTTAnz7yoIR5pDw==}
|
||||
peerDependencies:
|
||||
'@vue/runtime-dom': 3.6.0-beta.10
|
||||
'@vue/runtime-dom': 3.6.0-beta.12
|
||||
|
||||
'@vue/server-renderer@3.6.0-beta.10':
|
||||
resolution: {integrity: sha512-K9bq8O1Hv2fHS0/aVkAxvvukkdy+U8W/nfFRQLcCCvQ92uLuMYsBp8+E3KZRdGaQbAAeuIf4GwJVCGXHTQEg9Q==}
|
||||
'@vue/server-renderer@3.6.0-beta.12':
|
||||
resolution: {integrity: sha512-vvxrc68syjO7bhwTgvyAErm3nLFB97p01y0VI2qMIJtj25Q6md2FNP0K4Mr53VXD4FaV8MupwlcrcXGTK/Ch9A==}
|
||||
peerDependencies:
|
||||
vue: 3.6.0-beta.10
|
||||
vue: 3.6.0-beta.12
|
||||
|
||||
'@vue/shared@3.6.0-beta.10':
|
||||
resolution: {integrity: sha512-13JUfIAd06F+IBnObE8mExDAMOknPIBjPBUN2JeemmuQwj5i20GduCLbHLVbxSkpFD0RGH4z2mOxUUdD+8M/Aw==}
|
||||
'@vue/shared@3.6.0-beta.12':
|
||||
resolution: {integrity: sha512-vPxq7puT/X3+VZtKFb1FkAdkytZrb30r6ezkS+wFi8nlUo3AnqGGWKlRAfDGX1a4EUqpvbeqVrU9WtEipaf9NQ==}
|
||||
|
||||
'@vue/tsconfig@0.9.1':
|
||||
resolution: {integrity: sha512-buvjm+9NzLCJL29KY1j1991YYJ5e6275OiK+G4jtmfIb+z4POywbdm0wXusT9adVWqe0xqg70TbI7+mRx4uU9w==}
|
||||
@@ -1055,6 +1223,9 @@ packages:
|
||||
resolution: {integrity: sha512-HqZ5rWlFjGiV0tDm3UxxgNRqsOTniqoKZu0pIAfh7TZQMGuZK+hH0drySty0si0QXj1ieop4+SkSfPZBPPkHig==}
|
||||
engines: {node: '>=14'}
|
||||
|
||||
argparse@2.0.1:
|
||||
resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==}
|
||||
|
||||
ast-kit@2.2.0:
|
||||
resolution: {integrity: sha512-m1Q/RaVOnTp9JxPX+F+Zn7IcLYMzM8kZofDImfsKZd8MbR+ikdOzTeztStWqfrqIxZnYWryyI9ePm3NGjnZgGw==}
|
||||
engines: {node: '>=20.19.0'}
|
||||
@@ -1204,6 +1375,10 @@ packages:
|
||||
electron-to-chromium@1.5.345:
|
||||
resolution: {integrity: sha512-F9JXQGiMrz6yVNPI2qOVPvB9HzjH5cGzhs8oJ6A28V5L/YnzN/0KsuiibqF+F1Fd9qxFzD1BUnYSd8JfULxTwg==}
|
||||
|
||||
entities@4.5.0:
|
||||
resolution: {integrity: sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==}
|
||||
engines: {node: '>=0.12'}
|
||||
|
||||
entities@7.0.1:
|
||||
resolution: {integrity: sha512-TWrgLOFUQTH994YUyl1yT4uyavY5nNB5muff+RtWaqNVCAK408b5ZnnbNAUEWLTCpum9w6arT70i1XdQ4UeOPA==}
|
||||
engines: {node: '>=0.12'}
|
||||
@@ -1430,6 +1605,9 @@ packages:
|
||||
hookable@5.5.3:
|
||||
resolution: {integrity: sha512-Yc+BQe8SvoXH1643Qez1zqLRmbA5rCL+sSmk6TVos0LWVfNIB7PGncdlId77WzLGSIB5KaWgTaNTs2lNVEI6VQ==}
|
||||
|
||||
hookable@6.1.1:
|
||||
resolution: {integrity: sha512-U9LYDy1CwhMCnprUfeAZWZGByVbhd54hwepegYTK7Pi5NvqEj63ifz5z+xukznehT7i6NIZRu89Ay1AZmRsLEQ==}
|
||||
|
||||
ignore@5.3.2:
|
||||
resolution: {integrity: sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==}
|
||||
engines: {node: '>= 4'}
|
||||
@@ -1602,6 +1780,9 @@ packages:
|
||||
resolution: {integrity: sha512-NXYBzinNrblfraPGyrbPoD19C1h9lfI/1mzgWYvXUTe414Gz/X1FD2XBZSZM7rRTrMA8JL3OtAaGifrIKhQ5yQ==}
|
||||
engines: {node: '>= 12.0.0'}
|
||||
|
||||
linkify-it@5.0.0:
|
||||
resolution: {integrity: sha512-5aHCbzQRADcdP+ATqnDuhhJ/MRIqDkZX5pyjFHRRysS8vZ5AbqGEoFIb6pYHPZ+L/OC2Lc+xT8uHVVR5CAK/wQ==}
|
||||
|
||||
local-pkg@1.1.2:
|
||||
resolution: {integrity: sha512-arhlxbFRmoQHl33a0Zkle/YWlmNwoyt6QNZEIJcqNbdrsix5Lvc4HyyI3EnwxTYlZYc32EbYrQ8SzEZ7dqgg9A==}
|
||||
engines: {node: '>=14'}
|
||||
@@ -1619,6 +1800,9 @@ packages:
|
||||
lru-cache@5.1.1:
|
||||
resolution: {integrity: sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==}
|
||||
|
||||
magic-regexp@0.10.0:
|
||||
resolution: {integrity: sha512-Uly1Bu4lO1hwHUW0CQeSWuRtzCMNO00CmXtS8N6fyvB3B979GOEEeAkiTUDsmbYLAbvpUS/Kt5c4ibosAzVyVg==}
|
||||
|
||||
magic-string-ast@1.0.3:
|
||||
resolution: {integrity: sha512-CvkkH1i81zl7mmb94DsRiFeG9V2fR2JeuK8yDgS8oiZSFa++wWLEgZ5ufEOyLHbvSbD1gTRKv9NdX69Rnvr9JA==}
|
||||
engines: {node: '>=20.19.0'}
|
||||
@@ -1626,10 +1810,17 @@ packages:
|
||||
magic-string@0.30.21:
|
||||
resolution: {integrity: sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==}
|
||||
|
||||
markdown-it@14.1.1:
|
||||
resolution: {integrity: sha512-BuU2qnTti9YKgK5N+IeMubp14ZUKUUw7yeJbkjtosvHiP0AZ5c8IAgEMk79D0eC8F23r4Ac/q8cAIFdm2FtyoA==}
|
||||
hasBin: true
|
||||
|
||||
math-intrinsics@1.1.0:
|
||||
resolution: {integrity: sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==}
|
||||
engines: {node: '>= 0.4'}
|
||||
|
||||
mdurl@2.0.0:
|
||||
resolution: {integrity: sha512-Lf+9+2r+Tdp5wXDXC4PcIBjTDtq4UKjCPMQhKIuzpJNW0b96kVqSwW0bT7FhRSfmAiFYgP+SCRvdrDozfh0U5w==}
|
||||
|
||||
memorystream@0.3.1:
|
||||
resolution: {integrity: sha512-S3UwM3yj5mtUSEfP41UZmt/0SCoVYUcU1rkXv+BQ5Ig8ndL4sPoJNBUJERafdPb5jjHJGuMgytgKvKIf58XNBw==}
|
||||
engines: {node: '>= 0.10.0'}
|
||||
@@ -1716,6 +1907,15 @@ packages:
|
||||
resolution: {integrity: sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==}
|
||||
engines: {node: '>= 0.8.0'}
|
||||
|
||||
oxc-parser@0.106.0:
|
||||
resolution: {integrity: sha512-KSqA8PNgqi+wadUoGJXWyTr0mLuMzEABXQK5hKlj+cEWID+Rhw8xiqLappTDaCUpOqnKCpyO9N5RlzlFxR+TBw==}
|
||||
engines: {node: ^20.19.0 || >=22.12.0}
|
||||
|
||||
oxc-walker@0.7.0:
|
||||
resolution: {integrity: sha512-54B4KUhrzbzc4sKvKwVYm7E2PgeROpGba0/2nlNZMqfDyca+yOor5IMb4WLGBatGDT0nkzYdYuzylg7n3YfB7A==}
|
||||
peerDependencies:
|
||||
oxc-parser: '>=0.98.0'
|
||||
|
||||
oxfmt@0.45.0:
|
||||
resolution: {integrity: sha512-0o/COoN9fY50bjVeM7PQsNgbhndKurBIeTIcspW033OumksjJJmIVDKjAk5HMwU/GHTxSOdGDdhJ6BRzGPmsHg==}
|
||||
engines: {node: ^20.19.0 || >=22.12.0}
|
||||
@@ -1798,6 +1998,10 @@ packages:
|
||||
resolution: {integrity: sha512-W62t/Se6rA0Az3DfCL0AqJwXuKwBeYg6nOaIgzP+xZ7N5BFCI7DYi1qs6ygUYT6rvfi6t9k65UMLJC+PHZpDAA==}
|
||||
engines: {node: ^10 || ^12 || >=14}
|
||||
|
||||
postcss@8.5.14:
|
||||
resolution: {integrity: sha512-SoSL4+OSEtR99LHFZQiJLkT59C5B1amGO1NzTwj7TT1qCUgUO6hxOvzkOYxD+vMrXBM3XJIKzokoERdqQq/Zmg==}
|
||||
engines: {node: ^10 || ^12 || >=14}
|
||||
|
||||
prelude-ls@1.2.1:
|
||||
resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==}
|
||||
engines: {node: '>= 0.8.0'}
|
||||
@@ -1806,6 +2010,10 @@ packages:
|
||||
resolution: {integrity: sha512-cJ+oHTW1VAEa8cJslgmUZrc+sjRKgAKl3Zyse6+PV38hZe/V6Z14TbCuXcan9F9ghlz4QrFr2c92TNF82UkYHA==}
|
||||
engines: {node: '>=10'}
|
||||
|
||||
punycode.js@2.3.1:
|
||||
resolution: {integrity: sha512-uxFIHU0YlHYhDQtV4R9J6a52SLx28BCjT+4ieh7IGbgwVJWO+km431c4yRlREUAsAmt/uMjQUyQHNEPf0M39CA==}
|
||||
engines: {node: '>=6'}
|
||||
|
||||
punycode@2.3.1:
|
||||
resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==}
|
||||
engines: {node: '>=6'}
|
||||
@@ -1828,6 +2036,10 @@ packages:
|
||||
resolution: {integrity: sha512-9u/XQ1pvrQtYyMpZe7DXKv2p5CNvyVwzUB6uhLAnQwHMSgKMBR62lc7AHljaeteeHXn11XTAaLLUVZYVZyuRBQ==}
|
||||
engines: {node: '>= 20.19.0'}
|
||||
|
||||
regexp-tree@0.1.27:
|
||||
resolution: {integrity: sha512-iETxpjK6YoRWJG5o6hXLwvjYAoW+FEZn9os0PD/b6AP6xQwsa/Y7lCVgIixBbUPMfhu+i2LtdeAqVTgGlQarfA==}
|
||||
hasBin: true
|
||||
|
||||
reusify@1.1.0:
|
||||
resolution: {integrity: sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==}
|
||||
engines: {iojs: '>=1.0.0', node: '>=0.10.0'}
|
||||
@@ -2062,6 +2274,9 @@ packages:
|
||||
resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==}
|
||||
engines: {node: '>= 0.8.0'}
|
||||
|
||||
type-level-regexp@0.1.17:
|
||||
resolution: {integrity: sha512-wTk4DH3cxwk196uGLK/E9pE45aLfeKJacKmcEgEOA/q5dnPGNxXt0cfYdFxb57L+sEpf1oJH4Dnx/pnRcku9jg==}
|
||||
|
||||
typescript-eslint@8.59.1:
|
||||
resolution: {integrity: sha512-xqDcFVBmlrltH64lklOVp1wYxgJr6LVdg3NamBgH2OOQDLFdTKfIZXF5PfghrnXQKXZGTQs8tr1vL7fJvq8CTQ==}
|
||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||
@@ -2074,12 +2289,23 @@ packages:
|
||||
engines: {node: '>=14.17'}
|
||||
hasBin: true
|
||||
|
||||
uc.micro@2.1.0:
|
||||
resolution: {integrity: sha512-ARDJmphmdvUk6Glw7y9DQ2bFkKBHwQHLi2lsaH6PPmz/Ka9sFOBsBluozhDltWmnv9u/cF6Rt87znRTPV+yp/A==}
|
||||
|
||||
ufo@1.6.4:
|
||||
resolution: {integrity: sha512-JFNbkD1Svwe0KvGi8GOeLcP4kAWQ609twvCdcHxq1oSL8svv39ZuSvajcD8B+5D0eL4+s1Is2D/O6KN3qcTeRA==}
|
||||
|
||||
undici-types@7.16.0:
|
||||
resolution: {integrity: sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==}
|
||||
|
||||
unhead@3.0.0-beta.9:
|
||||
resolution: {integrity: sha512-1GVW+FnpPk3/kdrkqELkhu7XgD6brEezJAESLfy05Y581T1CdpMklcBkKMm7Q5vY1nivrLEVos6C7j9lKEM9oQ==}
|
||||
peerDependencies:
|
||||
vite: '>=6'
|
||||
peerDependenciesMeta:
|
||||
vite:
|
||||
optional: true
|
||||
|
||||
unimport@5.7.0:
|
||||
resolution: {integrity: sha512-njnL6sp8lEA8QQbZrt+52p/g4X0rw3bnGGmUcJnt1jeG8+iiqO779aGz0PirCtydAIVcuTBRlJ52F0u46z309Q==}
|
||||
engines: {node: '>=18.12.0'}
|
||||
@@ -2422,6 +2648,10 @@ snapshots:
|
||||
dependencies:
|
||||
'@babel/types': 7.29.0
|
||||
|
||||
'@babel/parser@7.29.3':
|
||||
dependencies:
|
||||
'@babel/types': 7.29.0
|
||||
|
||||
'@babel/plugin-proposal-decorators@7.29.0(@babel/core@7.29.0)':
|
||||
dependencies:
|
||||
'@babel/core': 7.29.0
|
||||
@@ -2585,6 +2815,8 @@ snapshots:
|
||||
|
||||
'@juggle/resize-observer@3.4.0': {}
|
||||
|
||||
'@microsoft/fetch-event-source@2.0.1': {}
|
||||
|
||||
'@napi-rs/wasm-runtime@1.1.4(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0)':
|
||||
dependencies:
|
||||
'@emnapi/core': 1.10.0
|
||||
@@ -2604,6 +2836,73 @@ snapshots:
|
||||
'@nodelib/fs.scandir': 2.1.5
|
||||
fastq: 1.20.1
|
||||
|
||||
'@oxc-parser/binding-android-arm-eabi@0.106.0':
|
||||
optional: true
|
||||
|
||||
'@oxc-parser/binding-android-arm64@0.106.0':
|
||||
optional: true
|
||||
|
||||
'@oxc-parser/binding-darwin-arm64@0.106.0':
|
||||
optional: true
|
||||
|
||||
'@oxc-parser/binding-darwin-x64@0.106.0':
|
||||
optional: true
|
||||
|
||||
'@oxc-parser/binding-freebsd-x64@0.106.0':
|
||||
optional: true
|
||||
|
||||
'@oxc-parser/binding-linux-arm-gnueabihf@0.106.0':
|
||||
optional: true
|
||||
|
||||
'@oxc-parser/binding-linux-arm-musleabihf@0.106.0':
|
||||
optional: true
|
||||
|
||||
'@oxc-parser/binding-linux-arm64-gnu@0.106.0':
|
||||
optional: true
|
||||
|
||||
'@oxc-parser/binding-linux-arm64-musl@0.106.0':
|
||||
optional: true
|
||||
|
||||
'@oxc-parser/binding-linux-ppc64-gnu@0.106.0':
|
||||
optional: true
|
||||
|
||||
'@oxc-parser/binding-linux-riscv64-gnu@0.106.0':
|
||||
optional: true
|
||||
|
||||
'@oxc-parser/binding-linux-riscv64-musl@0.106.0':
|
||||
optional: true
|
||||
|
||||
'@oxc-parser/binding-linux-s390x-gnu@0.106.0':
|
||||
optional: true
|
||||
|
||||
'@oxc-parser/binding-linux-x64-gnu@0.106.0':
|
||||
optional: true
|
||||
|
||||
'@oxc-parser/binding-linux-x64-musl@0.106.0':
|
||||
optional: true
|
||||
|
||||
'@oxc-parser/binding-openharmony-arm64@0.106.0':
|
||||
optional: true
|
||||
|
||||
'@oxc-parser/binding-wasm32-wasi@0.106.0(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0)':
|
||||
dependencies:
|
||||
'@napi-rs/wasm-runtime': 1.1.4(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0)
|
||||
transitivePeerDependencies:
|
||||
- '@emnapi/core'
|
||||
- '@emnapi/runtime'
|
||||
optional: true
|
||||
|
||||
'@oxc-parser/binding-win32-arm64-msvc@0.106.0':
|
||||
optional: true
|
||||
|
||||
'@oxc-parser/binding-win32-ia32-msvc@0.106.0':
|
||||
optional: true
|
||||
|
||||
'@oxc-parser/binding-win32-x64-msvc@0.106.0':
|
||||
optional: true
|
||||
|
||||
'@oxc-project/types@0.106.0': {}
|
||||
|
||||
'@oxc-project/types@0.127.0': {}
|
||||
|
||||
'@oxfmt/binding-android-arm-eabi@0.45.0':
|
||||
@@ -2851,12 +3150,21 @@ snapshots:
|
||||
|
||||
'@types/json-schema@7.0.15': {}
|
||||
|
||||
'@types/linkify-it@5.0.0': {}
|
||||
|
||||
'@types/lodash-es@4.17.12':
|
||||
dependencies:
|
||||
'@types/lodash': 4.17.24
|
||||
|
||||
'@types/lodash@4.17.24': {}
|
||||
|
||||
'@types/markdown-it@14.1.2':
|
||||
dependencies:
|
||||
'@types/linkify-it': 5.0.0
|
||||
'@types/mdurl': 2.0.0
|
||||
|
||||
'@types/mdurl@2.0.0': {}
|
||||
|
||||
'@types/node@24.12.2':
|
||||
dependencies:
|
||||
undici-types: 7.16.0
|
||||
@@ -2952,6 +3260,20 @@ snapshots:
|
||||
'@typescript-eslint/types': 8.59.1
|
||||
eslint-visitor-keys: 5.0.1
|
||||
|
||||
'@unhead/vue@3.0.0-beta.9(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0)(vite@8.0.10(@types/node@24.12.2)(jiti@2.6.1)(sass-embedded@1.99.0)(sass@1.99.0)(yaml@2.8.3))(vue@3.6.0-beta.10(typescript@6.0.3))':
|
||||
dependencies:
|
||||
hookable: 6.1.1
|
||||
magic-string: 0.30.21
|
||||
oxc-parser: 0.106.0(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0)
|
||||
oxc-walker: 0.7.0(oxc-parser@0.106.0(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0))
|
||||
unhead: 3.0.0-beta.9(vite@8.0.10(@types/node@24.12.2)(jiti@2.6.1)(sass-embedded@1.99.0)(sass@1.99.0)(yaml@2.8.3))
|
||||
vue: 3.6.0-beta.10(typescript@6.0.3)
|
||||
optionalDependencies:
|
||||
vite: 8.0.10(@types/node@24.12.2)(jiti@2.6.1)(sass-embedded@1.99.0)(sass@1.99.0)(yaml@2.8.3)
|
||||
transitivePeerDependencies:
|
||||
- '@emnapi/core'
|
||||
- '@emnapi/runtime'
|
||||
|
||||
'@vitejs/plugin-vue-jsx@5.1.5(vite@8.0.10(@types/node@24.12.2)(jiti@2.6.1)(sass-embedded@1.99.0)(sass@1.99.0)(yaml@2.8.3))(vue@3.6.0-beta.10(typescript@6.0.3))':
|
||||
dependencies:
|
||||
'@babel/core': 7.29.0
|
||||
@@ -2984,7 +3306,7 @@ snapshots:
|
||||
|
||||
'@vue-macros/common@3.1.2(vue@3.6.0-beta.10(typescript@6.0.3))':
|
||||
dependencies:
|
||||
'@vue/compiler-sfc': 3.6.0-beta.10
|
||||
'@vue/compiler-sfc': 3.6.0-beta.12
|
||||
ast-kit: 2.2.0
|
||||
local-pkg: 1.1.2
|
||||
magic-string-ast: 1.0.3
|
||||
@@ -3006,7 +3328,7 @@ snapshots:
|
||||
'@babel/types': 7.29.0
|
||||
'@vue/babel-helper-vue-transform-on': 1.5.0
|
||||
'@vue/babel-plugin-resolve-type': 1.5.0(@babel/core@7.29.0)
|
||||
'@vue/shared': 3.6.0-beta.10
|
||||
'@vue/shared': 3.6.0-beta.12
|
||||
optionalDependencies:
|
||||
'@babel/core': 7.29.0
|
||||
transitivePeerDependencies:
|
||||
@@ -3022,7 +3344,7 @@ snapshots:
|
||||
'@babel/types': 7.29.0
|
||||
'@vue/babel-helper-vue-transform-on': 2.0.1
|
||||
'@vue/babel-plugin-resolve-type': 2.0.1(@babel/core@7.29.0)
|
||||
'@vue/shared': 3.6.0-beta.10
|
||||
'@vue/shared': 3.6.0-beta.12
|
||||
optionalDependencies:
|
||||
'@babel/core': 7.29.0
|
||||
transitivePeerDependencies:
|
||||
@@ -3035,7 +3357,7 @@ snapshots:
|
||||
'@babel/helper-module-imports': 7.28.6
|
||||
'@babel/helper-plugin-utils': 7.28.6
|
||||
'@babel/parser': 7.29.2
|
||||
'@vue/compiler-sfc': 3.6.0-beta.10
|
||||
'@vue/compiler-sfc': 3.6.0-beta.12
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
@@ -3046,46 +3368,46 @@ snapshots:
|
||||
'@babel/helper-module-imports': 7.28.6
|
||||
'@babel/helper-plugin-utils': 7.28.6
|
||||
'@babel/parser': 7.29.2
|
||||
'@vue/compiler-sfc': 3.6.0-beta.10
|
||||
'@vue/compiler-sfc': 3.6.0-beta.12
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
'@vue/compiler-core@3.6.0-beta.10':
|
||||
'@vue/compiler-core@3.6.0-beta.12':
|
||||
dependencies:
|
||||
'@babel/parser': 7.29.2
|
||||
'@vue/shared': 3.6.0-beta.10
|
||||
'@babel/parser': 7.29.3
|
||||
'@vue/shared': 3.6.0-beta.12
|
||||
entities: 7.0.1
|
||||
estree-walker: 2.0.2
|
||||
source-map-js: 1.2.1
|
||||
|
||||
'@vue/compiler-dom@3.6.0-beta.10':
|
||||
'@vue/compiler-dom@3.6.0-beta.12':
|
||||
dependencies:
|
||||
'@vue/compiler-core': 3.6.0-beta.10
|
||||
'@vue/shared': 3.6.0-beta.10
|
||||
'@vue/compiler-core': 3.6.0-beta.12
|
||||
'@vue/shared': 3.6.0-beta.12
|
||||
|
||||
'@vue/compiler-sfc@3.6.0-beta.10':
|
||||
'@vue/compiler-sfc@3.6.0-beta.12':
|
||||
dependencies:
|
||||
'@babel/parser': 7.29.2
|
||||
'@vue/compiler-core': 3.6.0-beta.10
|
||||
'@vue/compiler-dom': 3.6.0-beta.10
|
||||
'@vue/compiler-ssr': 3.6.0-beta.10
|
||||
'@vue/compiler-vapor': 3.6.0-beta.10
|
||||
'@vue/shared': 3.6.0-beta.10
|
||||
'@babel/parser': 7.29.3
|
||||
'@vue/compiler-core': 3.6.0-beta.12
|
||||
'@vue/compiler-dom': 3.6.0-beta.12
|
||||
'@vue/compiler-ssr': 3.6.0-beta.12
|
||||
'@vue/compiler-vapor': 3.6.0-beta.12
|
||||
'@vue/shared': 3.6.0-beta.12
|
||||
estree-walker: 2.0.2
|
||||
magic-string: 0.30.21
|
||||
postcss: 8.5.12
|
||||
postcss: 8.5.14
|
||||
source-map-js: 1.2.1
|
||||
|
||||
'@vue/compiler-ssr@3.6.0-beta.10':
|
||||
'@vue/compiler-ssr@3.6.0-beta.12':
|
||||
dependencies:
|
||||
'@vue/compiler-dom': 3.6.0-beta.10
|
||||
'@vue/shared': 3.6.0-beta.10
|
||||
'@vue/compiler-dom': 3.6.0-beta.12
|
||||
'@vue/shared': 3.6.0-beta.12
|
||||
|
||||
'@vue/compiler-vapor@3.6.0-beta.10':
|
||||
'@vue/compiler-vapor@3.6.0-beta.12':
|
||||
dependencies:
|
||||
'@babel/parser': 7.29.2
|
||||
'@vue/compiler-dom': 3.6.0-beta.10
|
||||
'@vue/shared': 3.6.0-beta.10
|
||||
'@babel/parser': 7.29.3
|
||||
'@vue/compiler-dom': 3.6.0-beta.12
|
||||
'@vue/shared': 3.6.0-beta.12
|
||||
estree-walker: 2.0.2
|
||||
source-map-js: 1.2.1
|
||||
|
||||
@@ -3142,42 +3464,42 @@ snapshots:
|
||||
'@vue/language-core@3.2.7':
|
||||
dependencies:
|
||||
'@volar/language-core': 2.4.28
|
||||
'@vue/compiler-dom': 3.6.0-beta.10
|
||||
'@vue/shared': 3.6.0-beta.10
|
||||
'@vue/compiler-dom': 3.6.0-beta.12
|
||||
'@vue/shared': 3.6.0-beta.12
|
||||
alien-signals: 3.1.2
|
||||
muggle-string: 0.4.1
|
||||
path-browserify: 1.0.1
|
||||
picomatch: 4.0.4
|
||||
|
||||
'@vue/reactivity@3.6.0-beta.10':
|
||||
'@vue/reactivity@3.6.0-beta.12':
|
||||
dependencies:
|
||||
'@vue/shared': 3.6.0-beta.10
|
||||
'@vue/shared': 3.6.0-beta.12
|
||||
|
||||
'@vue/runtime-core@3.6.0-beta.10':
|
||||
'@vue/runtime-core@3.6.0-beta.12':
|
||||
dependencies:
|
||||
'@vue/reactivity': 3.6.0-beta.10
|
||||
'@vue/shared': 3.6.0-beta.10
|
||||
'@vue/reactivity': 3.6.0-beta.12
|
||||
'@vue/shared': 3.6.0-beta.12
|
||||
|
||||
'@vue/runtime-dom@3.6.0-beta.10':
|
||||
'@vue/runtime-dom@3.6.0-beta.12':
|
||||
dependencies:
|
||||
'@vue/reactivity': 3.6.0-beta.10
|
||||
'@vue/runtime-core': 3.6.0-beta.10
|
||||
'@vue/shared': 3.6.0-beta.10
|
||||
'@vue/reactivity': 3.6.0-beta.12
|
||||
'@vue/runtime-core': 3.6.0-beta.12
|
||||
'@vue/shared': 3.6.0-beta.12
|
||||
csstype: 3.2.3
|
||||
|
||||
'@vue/runtime-vapor@3.6.0-beta.10(@vue/runtime-dom@3.6.0-beta.10)':
|
||||
'@vue/runtime-vapor@3.6.0-beta.12(@vue/runtime-dom@3.6.0-beta.12)':
|
||||
dependencies:
|
||||
'@vue/reactivity': 3.6.0-beta.10
|
||||
'@vue/runtime-dom': 3.6.0-beta.10
|
||||
'@vue/shared': 3.6.0-beta.10
|
||||
'@vue/reactivity': 3.6.0-beta.12
|
||||
'@vue/runtime-dom': 3.6.0-beta.12
|
||||
'@vue/shared': 3.6.0-beta.12
|
||||
|
||||
'@vue/server-renderer@3.6.0-beta.10(vue@3.6.0-beta.10(typescript@6.0.3))':
|
||||
'@vue/server-renderer@3.6.0-beta.12(vue@3.6.0-beta.10(typescript@6.0.3))':
|
||||
dependencies:
|
||||
'@vue/compiler-ssr': 3.6.0-beta.10
|
||||
'@vue/shared': 3.6.0-beta.10
|
||||
'@vue/compiler-ssr': 3.6.0-beta.12
|
||||
'@vue/shared': 3.6.0-beta.12
|
||||
vue: 3.6.0-beta.10(typescript@6.0.3)
|
||||
|
||||
'@vue/shared@3.6.0-beta.10': {}
|
||||
'@vue/shared@3.6.0-beta.12': {}
|
||||
|
||||
'@vue/tsconfig@0.9.1(typescript@6.0.3)(vue@3.6.0-beta.10(typescript@6.0.3))':
|
||||
optionalDependencies:
|
||||
@@ -3203,6 +3525,8 @@ snapshots:
|
||||
|
||||
ansis@4.2.0: {}
|
||||
|
||||
argparse@2.0.1: {}
|
||||
|
||||
ast-kit@2.2.0:
|
||||
dependencies:
|
||||
'@babel/parser': 7.29.2
|
||||
@@ -3335,6 +3659,8 @@ snapshots:
|
||||
|
||||
electron-to-chromium@1.5.345: {}
|
||||
|
||||
entities@4.5.0: {}
|
||||
|
||||
entities@7.0.1: {}
|
||||
|
||||
error-stack-parser-es@1.0.5: {}
|
||||
@@ -3561,6 +3887,8 @@ snapshots:
|
||||
|
||||
hookable@5.5.3: {}
|
||||
|
||||
hookable@6.1.1: {}
|
||||
|
||||
ignore@5.3.2: {}
|
||||
|
||||
ignore@7.0.5: {}
|
||||
@@ -3673,6 +4001,10 @@ snapshots:
|
||||
lightningcss-win32-arm64-msvc: 1.32.0
|
||||
lightningcss-win32-x64-msvc: 1.32.0
|
||||
|
||||
linkify-it@5.0.0:
|
||||
dependencies:
|
||||
uc.micro: 2.1.0
|
||||
|
||||
local-pkg@1.1.2:
|
||||
dependencies:
|
||||
mlly: 1.8.2
|
||||
@@ -3691,6 +4023,16 @@ snapshots:
|
||||
dependencies:
|
||||
yallist: 3.1.1
|
||||
|
||||
magic-regexp@0.10.0:
|
||||
dependencies:
|
||||
estree-walker: 3.0.3
|
||||
magic-string: 0.30.21
|
||||
mlly: 1.8.2
|
||||
regexp-tree: 0.1.27
|
||||
type-level-regexp: 0.1.17
|
||||
ufo: 1.6.4
|
||||
unplugin: 2.3.11
|
||||
|
||||
magic-string-ast@1.0.3:
|
||||
dependencies:
|
||||
magic-string: 0.30.21
|
||||
@@ -3699,8 +4041,19 @@ snapshots:
|
||||
dependencies:
|
||||
'@jridgewell/sourcemap-codec': 1.5.5
|
||||
|
||||
markdown-it@14.1.1:
|
||||
dependencies:
|
||||
argparse: 2.0.1
|
||||
entities: 4.5.0
|
||||
linkify-it: 5.0.0
|
||||
mdurl: 2.0.0
|
||||
punycode.js: 2.3.1
|
||||
uc.micro: 2.1.0
|
||||
|
||||
math-intrinsics@1.1.0: {}
|
||||
|
||||
mdurl@2.0.0: {}
|
||||
|
||||
memorystream@0.3.1: {}
|
||||
|
||||
merge2@1.4.1: {}
|
||||
@@ -3803,6 +4156,39 @@ snapshots:
|
||||
type-check: 0.4.0
|
||||
word-wrap: 1.2.5
|
||||
|
||||
oxc-parser@0.106.0(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0):
|
||||
dependencies:
|
||||
'@oxc-project/types': 0.106.0
|
||||
optionalDependencies:
|
||||
'@oxc-parser/binding-android-arm-eabi': 0.106.0
|
||||
'@oxc-parser/binding-android-arm64': 0.106.0
|
||||
'@oxc-parser/binding-darwin-arm64': 0.106.0
|
||||
'@oxc-parser/binding-darwin-x64': 0.106.0
|
||||
'@oxc-parser/binding-freebsd-x64': 0.106.0
|
||||
'@oxc-parser/binding-linux-arm-gnueabihf': 0.106.0
|
||||
'@oxc-parser/binding-linux-arm-musleabihf': 0.106.0
|
||||
'@oxc-parser/binding-linux-arm64-gnu': 0.106.0
|
||||
'@oxc-parser/binding-linux-arm64-musl': 0.106.0
|
||||
'@oxc-parser/binding-linux-ppc64-gnu': 0.106.0
|
||||
'@oxc-parser/binding-linux-riscv64-gnu': 0.106.0
|
||||
'@oxc-parser/binding-linux-riscv64-musl': 0.106.0
|
||||
'@oxc-parser/binding-linux-s390x-gnu': 0.106.0
|
||||
'@oxc-parser/binding-linux-x64-gnu': 0.106.0
|
||||
'@oxc-parser/binding-linux-x64-musl': 0.106.0
|
||||
'@oxc-parser/binding-openharmony-arm64': 0.106.0
|
||||
'@oxc-parser/binding-wasm32-wasi': 0.106.0(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0)
|
||||
'@oxc-parser/binding-win32-arm64-msvc': 0.106.0
|
||||
'@oxc-parser/binding-win32-ia32-msvc': 0.106.0
|
||||
'@oxc-parser/binding-win32-x64-msvc': 0.106.0
|
||||
transitivePeerDependencies:
|
||||
- '@emnapi/core'
|
||||
- '@emnapi/runtime'
|
||||
|
||||
oxc-walker@0.7.0(oxc-parser@0.106.0(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0)):
|
||||
dependencies:
|
||||
magic-regexp: 0.10.0
|
||||
oxc-parser: 0.106.0(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0)
|
||||
|
||||
oxfmt@0.45.0:
|
||||
dependencies:
|
||||
tinypool: 2.1.0
|
||||
@@ -3907,10 +4293,18 @@ snapshots:
|
||||
picocolors: 1.1.1
|
||||
source-map-js: 1.2.1
|
||||
|
||||
postcss@8.5.14:
|
||||
dependencies:
|
||||
nanoid: 3.3.11
|
||||
picocolors: 1.1.1
|
||||
source-map-js: 1.2.1
|
||||
|
||||
prelude-ls@1.2.1: {}
|
||||
|
||||
proxy-from-env@2.1.0: {}
|
||||
|
||||
punycode.js@2.3.1: {}
|
||||
|
||||
punycode@2.3.1: {}
|
||||
|
||||
quansync@0.2.11: {}
|
||||
@@ -3927,6 +4321,8 @@ snapshots:
|
||||
|
||||
readdirp@5.0.0: {}
|
||||
|
||||
regexp-tree@0.1.27: {}
|
||||
|
||||
reusify@1.1.0: {}
|
||||
|
||||
rfdc@1.4.1: {}
|
||||
@@ -4127,6 +4523,8 @@ snapshots:
|
||||
dependencies:
|
||||
prelude-ls: 1.2.1
|
||||
|
||||
type-level-regexp@0.1.17: {}
|
||||
|
||||
typescript-eslint@8.59.1(eslint@10.2.1(jiti@2.6.1))(typescript@6.0.3):
|
||||
dependencies:
|
||||
'@typescript-eslint/eslint-plugin': 8.59.1(@typescript-eslint/parser@8.59.1(eslint@10.2.1(jiti@2.6.1))(typescript@6.0.3))(eslint@10.2.1(jiti@2.6.1))(typescript@6.0.3)
|
||||
@@ -4140,10 +4538,19 @@ snapshots:
|
||||
|
||||
typescript@6.0.3: {}
|
||||
|
||||
uc.micro@2.1.0: {}
|
||||
|
||||
ufo@1.6.4: {}
|
||||
|
||||
undici-types@7.16.0: {}
|
||||
|
||||
unhead@3.0.0-beta.9(vite@8.0.10(@types/node@24.12.2)(jiti@2.6.1)(sass-embedded@1.99.0)(sass@1.99.0)(yaml@2.8.3)):
|
||||
dependencies:
|
||||
hookable: 6.1.1
|
||||
magic-string: 0.30.21
|
||||
optionalDependencies:
|
||||
vite: 8.0.10(@types/node@24.12.2)(jiti@2.6.1)(sass-embedded@1.99.0)(sass@1.99.0)(yaml@2.8.3)
|
||||
|
||||
unimport@5.7.0:
|
||||
dependencies:
|
||||
acorn: 8.16.0
|
||||
@@ -4267,7 +4674,7 @@ snapshots:
|
||||
'@babel/plugin-syntax-import-meta': 7.10.4(@babel/core@7.29.0)
|
||||
'@babel/plugin-transform-typescript': 7.28.6(@babel/core@7.29.0)
|
||||
'@vue/babel-plugin-jsx': 1.5.0(@babel/core@7.29.0)
|
||||
'@vue/compiler-dom': 3.6.0-beta.10
|
||||
'@vue/compiler-dom': 3.6.0-beta.12
|
||||
kolorist: 1.8.0
|
||||
magic-string: 0.30.21
|
||||
vite: 8.0.10(@types/node@24.12.2)(jiti@2.6.1)(sass-embedded@1.99.0)(sass@1.99.0)(yaml@2.8.3)
|
||||
@@ -4339,12 +4746,12 @@ snapshots:
|
||||
|
||||
vue@3.6.0-beta.10(typescript@6.0.3):
|
||||
dependencies:
|
||||
'@vue/compiler-dom': 3.6.0-beta.10
|
||||
'@vue/compiler-sfc': 3.6.0-beta.10
|
||||
'@vue/runtime-dom': 3.6.0-beta.10
|
||||
'@vue/runtime-vapor': 3.6.0-beta.10(@vue/runtime-dom@3.6.0-beta.10)
|
||||
'@vue/server-renderer': 3.6.0-beta.10(vue@3.6.0-beta.10(typescript@6.0.3))
|
||||
'@vue/shared': 3.6.0-beta.10
|
||||
'@vue/compiler-dom': 3.6.0-beta.12
|
||||
'@vue/compiler-sfc': 3.6.0-beta.12
|
||||
'@vue/runtime-dom': 3.6.0-beta.12
|
||||
'@vue/runtime-vapor': 3.6.0-beta.12(@vue/runtime-dom@3.6.0-beta.12)
|
||||
'@vue/server-renderer': 3.6.0-beta.12(vue@3.6.0-beta.10(typescript@6.0.3))
|
||||
'@vue/shared': 3.6.0-beta.12
|
||||
optionalDependencies:
|
||||
typescript: 6.0.3
|
||||
|
||||
|
||||
+35
-5
@@ -1,13 +1,43 @@
|
||||
<script setup lang="ts"></script>
|
||||
<script setup lang="ts">
|
||||
import PageHeader from '@/components/PageHeader.vue'
|
||||
import {dateZhCN, zhCN} from 'naive-ui'
|
||||
import {useNowUser} from '@/stores/now-user.ts'
|
||||
import {onMounted} from 'vue'
|
||||
import {useHead} from "@unhead/vue";
|
||||
|
||||
const NOWUSER = useNowUser()
|
||||
|
||||
useHead({
|
||||
titleTemplate: "%s | NayHome"
|
||||
})
|
||||
|
||||
onMounted(async () => {
|
||||
const user_id = localStorage.getItem('user-id')
|
||||
const access_token = localStorage.getItem('access-token')
|
||||
if (user_id && access_token) {
|
||||
try {
|
||||
await NOWUSER.loadUserInfo(Number(user_id), access_token)
|
||||
} catch {
|
||||
localStorage.removeItem("user-id")
|
||||
localStorage.removeItem('access-token')
|
||||
console.log("已移除 localstorage 中存储的验证信息。")
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<n-config-provider id="aapp">
|
||||
<div class="header-container"></div>
|
||||
<n-config-provider id="aapp" :date-locale="dateZhCN" :locale="zhCN">
|
||||
<div class="header-container">
|
||||
<page-header/>
|
||||
</div>
|
||||
<div class="content-container">
|
||||
<router-view></router-view>
|
||||
<n-message-provider>
|
||||
<router-view></router-view>
|
||||
</n-message-provider>
|
||||
</div>
|
||||
<div class="footer-container">🌸 Nya Home ~</div>
|
||||
<n-global-style />
|
||||
<n-global-style/>
|
||||
</n-config-provider>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
/* ===== 简约滚动条美化 ===== */
|
||||
|
||||
/* 适用于 Webkit 内核(Chrome/Edge/Safari) */
|
||||
::-webkit-scrollbar {
|
||||
width: 6px; /* 垂直滚动条宽度 */
|
||||
height: 6px; /* 水平滚动条高度 */
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-track {
|
||||
background: transparent; /* 轨道透明,极简 */
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb {
|
||||
background: rgba(0, 0, 0, 0.15); /* 滑块半透明灰 */
|
||||
border-radius: 3px; /* 小圆角 */
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb:hover {
|
||||
background: rgba(0, 0, 0, 0.25); /* 悬停稍微深一点 */
|
||||
}
|
||||
|
||||
/* Firefox 兼容 */
|
||||
* {
|
||||
scrollbar-width: thin;
|
||||
scrollbar-color: rgba(0, 0, 0, 0.15) transparent;
|
||||
}
|
||||
|
||||
/* ===== a 标签美化 ===== */
|
||||
|
||||
a {
|
||||
color: inherit; /* 继承父元素颜色,不区分已访问 */
|
||||
text-decoration: none; /* 无下划线 */
|
||||
}
|
||||
|
||||
a:hover {
|
||||
text-decoration: underline; /* hover 显示下划线 */
|
||||
text-decoration-color: #22c55e; /* 绿色 */
|
||||
text-decoration-thickness: 2px; /* 可选:下划线粗细 */
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
div.message {
|
||||
position: relative;
|
||||
padding: 4px 12px;
|
||||
font-size: 1rem;
|
||||
height: max-content;
|
||||
|
||||
.modify-button {
|
||||
position: absolute;
|
||||
bottom: 10px;
|
||||
right: 10px;
|
||||
}
|
||||
|
||||
.collapse-button {
|
||||
position: absolute;
|
||||
bottom: 10px;
|
||||
right: 50px;
|
||||
}
|
||||
}
|
||||
|
||||
div.user-message {
|
||||
border: 2px solid #e1ff20;
|
||||
border-radius: 4px;
|
||||
background: #fffbb1;
|
||||
}
|
||||
|
||||
div.aii-message {
|
||||
border: 2px solid #20ff54;
|
||||
border-radius: 4px;
|
||||
background: #b1ffd0;
|
||||
}
|
||||
|
||||
div.aii-message-streaming {
|
||||
border: 2px solid #20d2ff;
|
||||
border-radius: 4px;
|
||||
background: #b1f8ff;
|
||||
|
||||
div.thinking {
|
||||
border: 1px solid #e9ff20;
|
||||
border-radius: 4px;
|
||||
padding: 4px 8px;
|
||||
margin: 6px 3px;
|
||||
background: rgb(34 197 94 / 0.2);
|
||||
}
|
||||
}
|
||||
|
||||
// 折叠消息
|
||||
div.collapse {
|
||||
overflow: hidden;
|
||||
min-height: 80px;
|
||||
}
|
||||
|
||||
div.xaml-block {
|
||||
background: rgb(102 237 197 / 0.2);
|
||||
border: 1px solid rgb(102 237 197);
|
||||
border-radius: 4px;
|
||||
padding: 10px;
|
||||
margin-top: 6px;
|
||||
|
||||
.title {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.text {
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,22 @@
|
||||
html,
|
||||
body {
|
||||
height: 100%;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
div#app {
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
div#aapp {
|
||||
height: 100dvh;
|
||||
|
||||
max-height: 100vh;
|
||||
overflow: hidden;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
@@ -14,5 +30,17 @@ div#aapp {
|
||||
|
||||
div.content-container {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
overflow: hidden;
|
||||
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
|
||||
div.nyahome-card {
|
||||
border-radius: 6px;
|
||||
border: 1px solid rgb(44 44 44 / 0.4);
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
<script setup lang="ts">
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="in-dev">
|
||||
<n-text class="in-dev-title">功能开发中</n-text>
|
||||
<n-text class="in-dev-content">
|
||||
已经被画在饼上辽,请耐心等待喵!
|
||||
</n-text>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
div.in-dev {
|
||||
width: 100%;
|
||||
height: 100px;
|
||||
|
||||
border-radius: 8px;
|
||||
border: 2px solid #ffa600;
|
||||
background: linear-gradient(20deg, #ffd699, #fff6e6);
|
||||
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
.in-dev-title {
|
||||
font-size: 1.2rem;
|
||||
}
|
||||
|
||||
.in-dev-content {
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,32 @@
|
||||
<script setup lang="ts"></script>
|
||||
|
||||
<template>
|
||||
<div id="page-header">
|
||||
<n-text class="nav-text">🌸 Nya Home ~</n-text>
|
||||
<router-link to="/" style="margin-left: auto">
|
||||
<n-button secondary type="tertiary" size="large">首页</n-button>
|
||||
</router-link>
|
||||
<router-link to="/chatroom">
|
||||
<n-button secondary type="tertiary" size="large">聊天室</n-button>
|
||||
</router-link>
|
||||
<router-link to="/marketplace">
|
||||
<n-button secondary type="tertiary" size="large">剧本市场</n-button>
|
||||
</router-link>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped lang="scss">
|
||||
div#page-header {
|
||||
padding: 4px;
|
||||
width: 100%;
|
||||
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
|
||||
.nav-text {
|
||||
font-size: 22px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,104 @@
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue'
|
||||
import { createErrorBlock, createXamlBlock, type Xaml } from '@/components/xaml-block.tsx'
|
||||
|
||||
const showModal = defineModel('showModal', { required: true })
|
||||
|
||||
const mode = ref<'xaml' | 'visual'>('xaml')
|
||||
const xamlContent = ref('')
|
||||
|
||||
/**
|
||||
* 目前使用的是芒果手搓的一个极简 xaml 解析函数,不会语法验证,也不支持任何高级的 xaml 特性,甚至在遇到错误时不会报错而只是循环下去。
|
||||
* 以后会尝试搓一个更厉害的,或者用上一个更厉害的方案。目前版本仅作原理验证。
|
||||
*/
|
||||
|
||||
// 记录循环次数,在循环次数异常大时直接结束解析
|
||||
let count_ = 0
|
||||
|
||||
function parseXamlsContent(content: string): Xaml[] {
|
||||
const final_xamls: Xaml[] = []
|
||||
|
||||
let content_ = content
|
||||
while (content_.indexOf('<') >= 0) {
|
||||
count_ += 1
|
||||
if (count_ > 100) {
|
||||
throw TypeError('Xaml 解析循环超过上限次数,已终止。')
|
||||
}
|
||||
|
||||
console.log(`(${count_})[接下来] ${content_}`)
|
||||
const first_tag_start_start = content_.indexOf('<')
|
||||
const first_tag_start_end = content_.indexOf('>')
|
||||
const first_tag_start = content_.slice(first_tag_start_start, first_tag_start_end + 1)
|
||||
const first_tag_name = content_.slice(first_tag_start_start + 1, first_tag_start_end)
|
||||
|
||||
const first_tag_end_start = content_.search(`</${first_tag_name}>`)
|
||||
const first_tag_end_end = first_tag_end_start + first_tag_name.length + 2
|
||||
const first_tag_end = content_.slice(first_tag_end_start, first_tag_end_end + 1)
|
||||
|
||||
console.log(
|
||||
`(${count_})[解析标签] ${first_tag_start} ${first_tag_end} (${first_tag_start_start}/${first_tag_start_end} - ${first_tag_end_start}/${first_tag_end_end})`,
|
||||
)
|
||||
|
||||
const sub_content_ = content_.slice(first_tag_start_end + 1, first_tag_end_start)
|
||||
|
||||
if (sub_content_.indexOf('<') >= 0) {
|
||||
final_xamls.push({
|
||||
name: first_tag_name,
|
||||
message: sub_content_.slice(0, sub_content_.indexOf('<')),
|
||||
subXamls: parseXamlsContent(sub_content_.slice(sub_content_.indexOf('<'))),
|
||||
})
|
||||
} else {
|
||||
final_xamls.push({
|
||||
name: first_tag_name,
|
||||
message: sub_content_,
|
||||
subXamls: [],
|
||||
})
|
||||
}
|
||||
|
||||
content_ = content_.slice(first_tag_end_end + 1)
|
||||
}
|
||||
|
||||
return final_xamls
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<n-modal
|
||||
v-model:show="showModal"
|
||||
title="Xaml 可视化"
|
||||
preset="card"
|
||||
content-scrollable
|
||||
style="height: 60vh; width: 50vw"
|
||||
:z-index="999"
|
||||
draggable
|
||||
>
|
||||
<n-flex vertical>
|
||||
<n-radio-group v-model:value="mode">
|
||||
<n-radio-button value="xaml">Xaml</n-radio-button>
|
||||
<n-radio-button value="visual">可视化</n-radio-button>
|
||||
</n-radio-group>
|
||||
|
||||
<n-alert v-if="mode === 'xaml'" type="info">
|
||||
Xaml 格式的提示词便于简洁地向 AI 提供复杂的设定。你也可以不使用 Xaml 格式。<br />
|
||||
你可以拖动此模态框,但不允许在保持本窗口开启的状态下从遮罩下方复制代码……
|
||||
</n-alert>
|
||||
<n-input v-model:value="xamlContent" v-if="mode === 'xaml'" type="textarea" :rows="10" />
|
||||
|
||||
<component
|
||||
v-if="mode === 'visual'"
|
||||
:is="
|
||||
() => {
|
||||
count_ = 0
|
||||
try {
|
||||
return createXamlBlock(parseXamlsContent(xamlContent))
|
||||
} catch (err) {
|
||||
return createErrorBlock(err!.toString())
|
||||
}
|
||||
}
|
||||
"
|
||||
/>
|
||||
</n-flex>
|
||||
</n-modal>
|
||||
</template>
|
||||
|
||||
<style scoped></style>
|
||||
@@ -0,0 +1,76 @@
|
||||
<script setup lang="ts">
|
||||
import {ref} from 'vue'
|
||||
import {api} from '@/tools/web.ts'
|
||||
import type {ReturnDto} from '@/types/response.ts'
|
||||
import {useMessage} from 'naive-ui'
|
||||
import VerifyCodeModal from '@/components/admin/VerifyCodeModal.vue'
|
||||
import {useNowUser} from "@/stores/now-user.ts";
|
||||
|
||||
const MESSAGE = useMessage()
|
||||
const NOWUSER = useNowUser()
|
||||
|
||||
const showModal = defineModel('showModal', {required: true})
|
||||
|
||||
const showVerifyCodeModal = ref(false)
|
||||
const newEmail = ref("")
|
||||
const verifyCode = ref("")
|
||||
|
||||
function sendEmail() {
|
||||
api
|
||||
.post('/admin/me/email-verify/send/', JSON.stringify({to: newEmail.value}))
|
||||
.then((res) => res.data as ReturnDto)
|
||||
.then((res) => {
|
||||
if (res.success) {
|
||||
MESSAGE.success('验证邮件已发送,请检查收件箱~')
|
||||
showVerifyCodeModal.value = true
|
||||
} else {
|
||||
throw TypeError('未知原因后端错误')
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
MESSAGE.error(`获取验证码失败:${err}`)
|
||||
})
|
||||
}
|
||||
|
||||
function verifyEmail() {
|
||||
api.post('/admin/me/email-verify/', JSON.stringify({
|
||||
to: newEmail.value,
|
||||
verify_code: String(verifyCode.value).split(",").join(""),
|
||||
}))
|
||||
.then((res) => res.data as ReturnDto)
|
||||
.then((res) => {
|
||||
if (res.success) {
|
||||
MESSAGE.success('邮件地址修改成功~')
|
||||
showVerifyCodeModal.value = false
|
||||
showModal.value = false
|
||||
NOWUSER.email = newEmail.value
|
||||
} else {
|
||||
throw TypeError('未知原因后端错误')
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
MESSAGE.error(`验证失败:${err}`)
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<n-modal v-model:show="showModal" preset="card" style="width: 600px" title="修改邮件地址">
|
||||
<n-form label-placement="left">
|
||||
<n-p>你需要使用新的邮件地址接收一个验证码来完成修改。</n-p>
|
||||
<n-form-item path="to" label="新的邮件地址">
|
||||
<n-input v-model:value="newEmail"/>
|
||||
</n-form-item>
|
||||
<n-flex>
|
||||
<n-button type="warning" @click="sendEmail()">获取验证码</n-button>
|
||||
<n-button type="tertiary" @click="showVerifyCodeModal = true">直接输入验证码</n-button>
|
||||
<n-tag type="info">验证码有效期为 5 分钟,且不允许多个同时有效。</n-tag>
|
||||
</n-flex>
|
||||
</n-form>
|
||||
</n-modal>
|
||||
|
||||
<verify-code-modal v-model:show-modal="showVerifyCodeModal" v-model:verify-code="verifyCode"
|
||||
:verify="verifyEmail"/>
|
||||
</template>
|
||||
|
||||
<style scoped></style>
|
||||
@@ -0,0 +1,21 @@
|
||||
<script setup lang="ts">
|
||||
defineProps<{
|
||||
title: string;
|
||||
}>()
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<n-card :title>
|
||||
<template #header-extra>
|
||||
<slot name="extra"/>
|
||||
</template>
|
||||
<slot name="default"/>
|
||||
<template #action>
|
||||
<slot name="action"/>
|
||||
</template>
|
||||
</n-card>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,151 @@
|
||||
<script setup lang="ts">
|
||||
import {ref} from 'vue'
|
||||
import {api} from '@/tools/web.js'
|
||||
import type {ReturnDto} from '@/types/response.js'
|
||||
import {useMessage} from 'naive-ui'
|
||||
import {AxiosError} from 'axios'
|
||||
import {useNowUser} from '@/stores/now-user.js'
|
||||
|
||||
const MESSAGE = useMessage()
|
||||
const NOWUSER = useNowUser()
|
||||
|
||||
const page = ref<'login' | 'register'>('login')
|
||||
|
||||
const loginMethod = ref<'name' | 'email' | 'phone'>('name')
|
||||
|
||||
const loginForm = ref({
|
||||
username: '',
|
||||
password: '',
|
||||
})
|
||||
|
||||
function login() {
|
||||
api
|
||||
.post(`/admin/login/${loginMethod.value}`, {
|
||||
username: loginForm.value.username,
|
||||
password: loginForm.value.password,
|
||||
})
|
||||
.then((res) => res.data as ReturnDto)
|
||||
.then((data) => {
|
||||
if (data.success) {
|
||||
return data.result as { user_id: number; access_token: string }
|
||||
} else {
|
||||
throw TypeError('未知原因,后端登录业务失败。')
|
||||
}
|
||||
})
|
||||
.then((result) => {
|
||||
localStorage.setItem('user-id', String(result.user_id))
|
||||
localStorage.setItem('access-token', result.access_token)
|
||||
MESSAGE.success('登录成功~')
|
||||
NOWUSER.loadUserInfo(result.user_id, result.access_token)
|
||||
})
|
||||
.catch((err) => {
|
||||
let err_msg = '未知的错误'
|
||||
if (err instanceof AxiosError) {
|
||||
if (err.status === 404) {
|
||||
err_msg = '用户名不存在,请检查。'
|
||||
} else if (err.status === 401) {
|
||||
err_msg = '用户名或密码错误,请检查。'
|
||||
}
|
||||
}
|
||||
MESSAGE.error(`登录失败:${err_msg}`)
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<div class="user-action nyahome-card" v-if="NOWUSER.isLogin" style="position: relative">
|
||||
<img :src="NOWUSER.background_url" alt="User Background" class="user-action-background">
|
||||
<div class="card-content" style="margin-top: auto; margin-bottom: 20px;">
|
||||
<n-avatar :size="96" circle :src="NOWUSER.avatar_url"/>
|
||||
<n-h2 style="margin: 0">
|
||||
{{ NOWUSER.display_name ? NOWUSER.display_name : NOWUSER.name }}
|
||||
</n-h2>
|
||||
<n-tag type="primary">{{ NOWUSER.name }}</n-tag>
|
||||
<n-flex class="card-input">
|
||||
<router-link class="card-button" to="/admin">
|
||||
<n-button type="primary" style="width: 100%" secondary>管理</n-button>
|
||||
</router-link>
|
||||
<router-link class="card-button" :to="`/user/${NOWUSER.id}`">
|
||||
<n-button type="info" style="width: 100%" secondary>主页</n-button>
|
||||
</router-link>
|
||||
<router-link class="card-button" to="#">
|
||||
<n-button type="error" style="width: 100%" secondary>注销</n-button>
|
||||
</router-link>
|
||||
</n-flex>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="user-action nyahome-card" v-else>
|
||||
<n-radio-group v-model:value="page">
|
||||
<n-radio-button value="login">登录</n-radio-button>
|
||||
<n-radio-button value="register">注册</n-radio-button>
|
||||
</n-radio-group>
|
||||
<div class="card-content" v-if="page === 'login'">
|
||||
<n-avatar :size="96" circle/>
|
||||
<n-radio-group v-model:value="loginMethod">
|
||||
<n-radio-button value="name">用户名</n-radio-button>
|
||||
<n-radio-button value="email">邮箱</n-radio-button>
|
||||
<n-radio-button value="phone">手机</n-radio-button>
|
||||
</n-radio-group>
|
||||
<n-input v-model:value="loginForm.username" class="card-input" placeholder=""/>
|
||||
<n-input
|
||||
v-model:value="loginForm.password"
|
||||
class="card-input"
|
||||
placeholder="密码"
|
||||
type="password"
|
||||
show-password-toggle
|
||||
/>
|
||||
<n-flex class="card-input">
|
||||
<n-button type="info" class="card-button" @click="login()">登录</n-button>
|
||||
<n-button type="warning" class="card-button">忘记密码</n-button>
|
||||
</n-flex>
|
||||
</div>
|
||||
|
||||
<div class="card-content" v-else>
|
||||
<n-avatar :size="96" circle/>
|
||||
<n-input class="card-input" placeholder="用户名"/>
|
||||
<n-input class="card-input" placeholder="密码" type="password" show-password-toggle/>
|
||||
<n-flex class="card-input">
|
||||
<n-button type="primary" class="card-button">注册</n-button>
|
||||
</n-flex>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped lang="scss">
|
||||
div.user-action {
|
||||
height: 360px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 10px;
|
||||
|
||||
.user-action-background {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
height: 180px;
|
||||
object-fit: cover;
|
||||
border-radius: 6px 6px 0 0;
|
||||
}
|
||||
|
||||
div.card-content {
|
||||
width: 80%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
|
||||
.card-input {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.card-button {
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,56 @@
|
||||
<script setup lang="ts">
|
||||
import {ref} from "vue";
|
||||
import {api} from "@/tools/web.ts";
|
||||
import {useNowUser} from "@/stores/now-user.ts";
|
||||
import {useMessage} from "naive-ui";
|
||||
import {useRouter} from "vue-router";
|
||||
|
||||
const ROUTER = useRouter();
|
||||
const MESSAGE = useMessage()
|
||||
const NOWUSER = useNowUser()
|
||||
|
||||
const showModal = defineModel("showModal", {required: true})
|
||||
|
||||
const changeForm = ref({
|
||||
old_password: '',
|
||||
new_password: '',
|
||||
})
|
||||
|
||||
function change() {
|
||||
api.post("/admin/me/password/", JSON.stringify(changeForm.value))
|
||||
.then(() => {
|
||||
MESSAGE.success("密码修改成功,请重新登录。")
|
||||
NOWUSER.isLogin = false
|
||||
localStorage.removeItem("user-id")
|
||||
localStorage.removeItem("access-token")
|
||||
ROUTER.push("/")
|
||||
})
|
||||
.catch((err) => {
|
||||
MESSAGE.error(`密码修改失败:${err}`)
|
||||
MESSAGE.warning("如果您忘记了原密码,请选择「忘记密码」。")
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<n-modal style="width: 600px;" v-model:show="showModal" title="修改密码" preset="card">
|
||||
<n-form label-align="right" label-placement="left" label-width="auto" :model="changeForm">
|
||||
<n-form-item label="原密码" path="old_password">
|
||||
<n-input v-model:value="changeForm.old_password"/>
|
||||
</n-form-item>
|
||||
<n-form-item label="新密码" path="new_password">
|
||||
<n-input v-model:value="changeForm.new_password" type="password" show-password-toggle/>
|
||||
</n-form-item>
|
||||
<n-form-item label="确认修改">
|
||||
<n-flex>
|
||||
<n-button type="error" @click="change()">确认修改</n-button>
|
||||
<n-tag type="warning" size="large">修改密码会注销所有已登录状态,您将需要重新登录。</n-tag>
|
||||
</n-flex>
|
||||
</n-form-item>
|
||||
</n-form>
|
||||
</n-modal>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,22 @@
|
||||
<script setup lang="ts">
|
||||
const showModal = defineModel('showModal', { required: true })
|
||||
const verifyCode = defineModel('verifyCode', { required: true })
|
||||
const { verify } = defineProps<{
|
||||
verify: () => void
|
||||
}>()
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<n-modal v-model:show="showModal" preset="card" style="width: 600px" title="输入验证码">
|
||||
<n-form inline>
|
||||
<n-form-item label="验证码">
|
||||
<n-input-otp size="large" v-model:value="verifyCode" />
|
||||
</n-form-item>
|
||||
<n-form-item>
|
||||
<n-button size="large" type="primary" secondary @click="verify()">验证</n-button>
|
||||
</n-form-item>
|
||||
</n-form>
|
||||
</n-modal>
|
||||
</template>
|
||||
|
||||
<style scoped></style>
|
||||
@@ -0,0 +1,173 @@
|
||||
<script setup lang="ts">
|
||||
import {computed, onMounted, ref, watch} from 'vue'
|
||||
import AiiProviderAddModal from '@/components/chatroom/AiiProviderAddModal.vue'
|
||||
import {api} from '@/tools/web.js'
|
||||
import type {ReturnDto} from '@/types/response.js'
|
||||
import {type SelectOption, useMessage} from 'naive-ui'
|
||||
import type {AiiProviderPublicWithoutKey} from '@/types/aii.js'
|
||||
|
||||
const MESSAGE = useMessage()
|
||||
|
||||
const showModal = defineModel<boolean>('showModal', {required: true})
|
||||
|
||||
const showAddProviderModal = ref(false)
|
||||
const selectProvider = ref<number | null>(null)
|
||||
const providers = ref<AiiProviderPublicWithoutKey[]>([])
|
||||
const remoteModels = ref<string[]>([])
|
||||
|
||||
const addModelForm = ref({
|
||||
id: 0,
|
||||
model_name: '',
|
||||
max_context_length: 0,
|
||||
aii_provider_id: selectProvider.value,
|
||||
})
|
||||
|
||||
watch(selectProvider, (newValue) => {
|
||||
addModelForm.value.aii_provider_id = newValue
|
||||
})
|
||||
|
||||
function loadProviders() {
|
||||
api
|
||||
.get('/aii/provider/')
|
||||
.then((res) => res.data as ReturnDto)
|
||||
.then((data) => {
|
||||
if (data.success) {
|
||||
return data.result as AiiProviderPublicWithoutKey[]
|
||||
} else {
|
||||
throw TypeError('因未知原因,后端业务失败。')
|
||||
}
|
||||
})
|
||||
.then((result) => {
|
||||
providers.value = result
|
||||
MESSAGE.success(`成功加载了 ${result.length} 个模型提供商。`)
|
||||
})
|
||||
.catch((err) => {
|
||||
MESSAGE.error(`获取模型提供商列表失败:${err}`)
|
||||
})
|
||||
}
|
||||
|
||||
const providerOptions = computed<SelectOption[]>(() => {
|
||||
const options = [] as SelectOption[]
|
||||
for (const ap of providers.value) {
|
||||
options.push({
|
||||
label: `[${ap.id}] [ ${ap.name} ] ( ${ap.base_url} )`,
|
||||
value: ap.id,
|
||||
})
|
||||
}
|
||||
return options
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
loadProviders()
|
||||
})
|
||||
|
||||
function onGetRemoteModels() {
|
||||
api
|
||||
.get(`/aii/provider/${selectProvider.value}/remote/models/`)
|
||||
.then((res) => res.data as ReturnDto)
|
||||
.then((data) => {
|
||||
if (data.success) {
|
||||
return data.result as string[]
|
||||
} else {
|
||||
throw TypeError('由于未知原因,后端业务错误。')
|
||||
}
|
||||
})
|
||||
.then((models) => {
|
||||
remoteModels.value = models
|
||||
MESSAGE.success(`成功获取模型提供商 ${selectProvider.value} 的 ${models.length} 个模型。`)
|
||||
})
|
||||
.catch((err) => {
|
||||
MESSAGE.error(`获取提供商的模型列表失败:${err}`)
|
||||
})
|
||||
}
|
||||
|
||||
function onCheck() {
|
||||
api
|
||||
.get(`/aii/provider/${selectProvider.value}/remote/model/${addModelForm.value.model_name}/`)
|
||||
.then((res) => res.data as ReturnDto)
|
||||
.then((data) => {
|
||||
if (data.success) {
|
||||
MESSAGE.success(`检测成功,模型 ${addModelForm.value.model_name} 可用。`)
|
||||
} else {
|
||||
MESSAGE.warning(`检测完成,模型 ${addModelForm.value.model_name} 不可用。`)
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
MESSAGE.error(`检测过程出现问题:${err}`)
|
||||
})
|
||||
}
|
||||
|
||||
function onConfirm() {
|
||||
api
|
||||
.post('/aii/model/', JSON.stringify(addModelForm.value))
|
||||
.then((res) => res.data as ReturnDto)
|
||||
.then((data) => {
|
||||
if (data.success) {
|
||||
MESSAGE.success(`模型 ${addModelForm.value.model_name} 成功添加。`)
|
||||
showModal.value = false
|
||||
} else {
|
||||
throw TypeError('因未知原因,后端业务失败。')
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
MESSAGE.error(`添加模型失败:${err}`)
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<n-modal v-model:show="showModal" preset="card" title="添加模型">
|
||||
<n-form :model="addModelForm" label-placement="left" label-width="auto" label-align="right">
|
||||
<n-form-item label="模型提供商" path="aii_provider_id">
|
||||
<n-flex style="width: 100%" justify="right" align="center">
|
||||
<n-select v-model:value="selectProvider" :options="providerOptions"/>
|
||||
<n-tag round type="info">修改已添加的提供商?请前往管理中心</n-tag>
|
||||
<n-button secondary type="success" size="small" round @click="loadProviders()"
|
||||
>刷新
|
||||
</n-button
|
||||
>
|
||||
<n-button secondary type="warning" size="small" round @click="showAddProviderModal = true"
|
||||
>添加
|
||||
</n-button
|
||||
>
|
||||
</n-flex>
|
||||
</n-form-item>
|
||||
<n-form-item label="模型名称" path="model_name">
|
||||
<n-flex style="width: 100%" justify="right" align="center">
|
||||
<n-input v-model:value="addModelForm.model_name"/>
|
||||
<n-flex style="overflow: auto">
|
||||
<n-button
|
||||
secondary
|
||||
type="info"
|
||||
size="small"
|
||||
round
|
||||
v-for="m in remoteModels"
|
||||
v-bind:key="m"
|
||||
@click="addModelForm.model_name = m"
|
||||
>{{ m }}
|
||||
</n-button
|
||||
>
|
||||
</n-flex>
|
||||
<n-button secondary type="success" size="small" round @click="onGetRemoteModels()"
|
||||
>获取模型列表
|
||||
</n-button
|
||||
>
|
||||
</n-flex>
|
||||
</n-form-item>
|
||||
<n-form-item label="最大上下文" path="max_context_length">
|
||||
<n-input-number v-model:value="addModelForm.max_context_length">
|
||||
<template #suffix>K</template>
|
||||
</n-input-number>
|
||||
</n-form-item>
|
||||
<n-form-item label="添加完成">
|
||||
<n-flex>
|
||||
<n-button secondary type="info" @click="onCheck()">检测</n-button>
|
||||
<n-button secondary type="primary" @click="onConfirm()">确认</n-button>
|
||||
</n-flex>
|
||||
</n-form-item>
|
||||
</n-form>
|
||||
<aii-provider-add-modal v-model:show-modal="showAddProviderModal"/>
|
||||
</n-modal>
|
||||
</template>
|
||||
|
||||
<style scoped></style>
|
||||
@@ -0,0 +1,74 @@
|
||||
<script setup lang="ts">
|
||||
import {ref} from 'vue'
|
||||
import {api} from '@/tools/web.js'
|
||||
import type {ReturnDto} from '@/types/response.js'
|
||||
import {useMessage} from 'naive-ui'
|
||||
|
||||
const MESSAGE = useMessage()
|
||||
|
||||
const showModal = defineModel('showModal', {required: true})
|
||||
|
||||
const addProviderForm = ref({
|
||||
id: 0,
|
||||
name: '',
|
||||
base_url: '',
|
||||
api_key: '',
|
||||
})
|
||||
|
||||
function onCheck() {
|
||||
api
|
||||
.post('/aii/remote/provider/check/', JSON.stringify(addProviderForm.value))
|
||||
.then((res) => res.data as ReturnDto)
|
||||
.then((data) => {
|
||||
if (data.success) {
|
||||
MESSAGE.success(`模型提供商检测成功,探测到 ${data.result} 个可用模型。`)
|
||||
} else {
|
||||
MESSAGE.warning('模型提供商检测失败,请确认 Base URI 与 API key 是否正确。')
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
MESSAGE.error(`检测模型提供商时遇到未知的异常,请检查后端业务:${err}`)
|
||||
})
|
||||
}
|
||||
|
||||
function onConfirm() {
|
||||
api
|
||||
.post('/aii/provider/', JSON.stringify(addProviderForm.value))
|
||||
.then((res) => res.data as ReturnDto)
|
||||
.then((data) => {
|
||||
if (data.success) {
|
||||
MESSAGE.success(`已添加模型提供商 ${addProviderForm.value.name} 。`)
|
||||
showModal.value = false
|
||||
} else {
|
||||
throw TypeError('后端业务表示添加模型提供商失败,但未提供原因。')
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
MESSAGE.error(`添加模型提供商失败:${err}`)
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<n-modal v-model:show="showModal" preset="card" title="添加模型提供商">
|
||||
<n-form :model="addProviderForm" label-placement="left" label-width="auto" label-align="right">
|
||||
<n-form-item label="名称" path="name">
|
||||
<n-input v-model:value="addProviderForm.name"/>
|
||||
</n-form-item>
|
||||
<n-form-item label="Base URL" path="base_url">
|
||||
<n-input v-model:value="addProviderForm.base_url"/>
|
||||
</n-form-item>
|
||||
<n-form-item label="API Key" path="api_key">
|
||||
<n-input v-model:value="addProviderForm.api_key"/>
|
||||
</n-form-item>
|
||||
<n-form-item label="添加完成">
|
||||
<n-flex>
|
||||
<n-button secondary type="info" @click="onCheck()">检测</n-button>
|
||||
<n-button secondary type="primary" @click="onConfirm()">确认</n-button>
|
||||
</n-flex>
|
||||
</n-form-item>
|
||||
</n-form>
|
||||
</n-modal>
|
||||
</template>
|
||||
|
||||
<style scoped></style>
|
||||
@@ -0,0 +1,98 @@
|
||||
<script setup lang="ts">
|
||||
import {computed, onMounted, ref} from 'vue'
|
||||
import {api} from '@/tools/web.js'
|
||||
import type {ReturnDto} from '@/types/response.js'
|
||||
import {type SelectOption, useMessage} from 'naive-ui'
|
||||
import AiiModelAddModal from '@/components/chatroom/AiiModelAddModal.vue'
|
||||
import type {AiiModelPublic} from '@/types/aii.js'
|
||||
import ChatPromptQuicker from '@/components/chatroom/ChatPromptQuicker.vue'
|
||||
import ScriptDrawer from '@/components/chatroom/ScriptDrawer.vue'
|
||||
|
||||
const MESSAGE = useMessage()
|
||||
|
||||
const selectedModel = defineModel<number | null>('selectModel', {required: true})
|
||||
const quickerPrompt = defineModel<string>('quickerPrompt', {required: true})
|
||||
|
||||
const {script} = defineProps<{
|
||||
script: string
|
||||
}>()
|
||||
|
||||
const showModal = ref(false)
|
||||
const models = ref<AiiModelPublic[]>([])
|
||||
const showScriptDrawer = ref(false)
|
||||
|
||||
const modelOptions = computed(() => {
|
||||
const options = [] as SelectOption[]
|
||||
for (const model of models.value) {
|
||||
options.push({
|
||||
value: model.id,
|
||||
label: `[${model.provider_name}] ${model.model_name}`,
|
||||
})
|
||||
}
|
||||
return options
|
||||
})
|
||||
|
||||
function load() {
|
||||
api
|
||||
.get('/aii/model')
|
||||
.then((res) => res.data as ReturnDto)
|
||||
.then((data) => {
|
||||
if (data.success) {
|
||||
models.value = data.result as AiiModelPublic[]
|
||||
} else {
|
||||
throw TypeError('获取模型列表失败……')
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
MESSAGE.error(`加载模型列表失败:${err}`)
|
||||
})
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
load()
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<n-flex vertical>
|
||||
<n-card title="模型">
|
||||
<template #header-extra>
|
||||
<n-flex>
|
||||
<n-button secondary type="info" size="small" round @click="load()">刷新</n-button>
|
||||
<n-button secondary type="warning" size="small" round @click="showModal = true">
|
||||
添加
|
||||
</n-button>
|
||||
<n-button-group>
|
||||
<n-button secondary type="primary" size="small" round>保存</n-button>
|
||||
<n-button secondary type="tertiary" size="small" round>?</n-button>
|
||||
</n-button-group>
|
||||
</n-flex>
|
||||
</template>
|
||||
<n-select v-model:value="selectedModel" :options="modelOptions"/>
|
||||
<aii-model-add-modal v-model:show-modal="showModal"/>
|
||||
</n-card>
|
||||
|
||||
<chat-prompt-quicker v-model:prompt-prefix="quickerPrompt"/>
|
||||
|
||||
<n-card title="剧本">
|
||||
<template #header-extra>故事设定 · 世界书</template>
|
||||
<n-flex vertical>
|
||||
<n-alert type="info">剧本模板功能仍在开发中,暂不支持分享哦~</n-alert>
|
||||
<n-button secondary type="info" @click="showScriptDrawer = true">
|
||||
故事设定 · 世界书
|
||||
</n-button>
|
||||
</n-flex>
|
||||
<script-drawer :script v-model:show-drawer="showScriptDrawer"/>
|
||||
</n-card>
|
||||
|
||||
<n-card title="设置">
|
||||
<template #header-extra>也许你不需要修改这里</template>
|
||||
<n-flex vertical>
|
||||
<n-button secondary type="primary">聊天室信息</n-button>
|
||||
<n-button secondary type="info">系统设置</n-button>
|
||||
</n-flex>
|
||||
</n-card>
|
||||
</n-flex>
|
||||
</template>
|
||||
|
||||
<style scoped></style>
|
||||
@@ -0,0 +1,107 @@
|
||||
<script setup lang="ts">
|
||||
import {md} from '@/tools/md.js'
|
||||
import {onMounted, ref, useTemplateRef} from 'vue'
|
||||
|
||||
const {role, msg} = defineProps<{
|
||||
role: 'aii' | 'user'
|
||||
msg: string
|
||||
onMessageEdit: (oldMessage: string, newMessage: string, change: 'aii' | 'user') => void
|
||||
onMessageDelete: (message: string, change: 'aii' | 'user') => void
|
||||
}>()
|
||||
|
||||
const showModal = ref(false)
|
||||
|
||||
const showEditor = ref(false)
|
||||
const editorMessage = ref('')
|
||||
|
||||
const self = useTemplateRef('self')
|
||||
const isCollapse = ref(false)
|
||||
|
||||
function enableCollapse() {
|
||||
self.value?.classList.add('collapse')
|
||||
isCollapse.value = true
|
||||
}
|
||||
|
||||
function disableCollapse() {
|
||||
self.value?.classList.remove('collapse')
|
||||
isCollapse.value = false
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
editorMessage.value = msg
|
||||
if (role === 'aii') {
|
||||
enableCollapse()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div :class="[`${role}-message`, 'message']" ref="self">
|
||||
<p v-html="md.render(msg)"/>
|
||||
<n-button class="modify-button" secondary type="info" circle @click="showModal = true">
|
||||
⚙️
|
||||
</n-button>
|
||||
<n-button
|
||||
v-if="role === 'aii'"
|
||||
class="collapse-button"
|
||||
secondary
|
||||
:type="isCollapse ? 'error' : 'info'"
|
||||
circle
|
||||
@click="
|
||||
() => {
|
||||
if (isCollapse) {
|
||||
disableCollapse()
|
||||
} else {
|
||||
enableCollapse()
|
||||
}
|
||||
self!.scrollIntoView({ behavior: 'smooth' })
|
||||
}
|
||||
"
|
||||
>
|
||||
🪟
|
||||
</n-button>
|
||||
|
||||
<n-modal
|
||||
v-model:show="showModal"
|
||||
:title="role === 'aii' ? 'AI 生成的内容' : '你输入的内容'"
|
||||
preset="card"
|
||||
content-scrollable
|
||||
style="max-height: 60vh"
|
||||
>
|
||||
<n-h3 prefix="bar" v-if="showEditor">编辑中</n-h3>
|
||||
<n-input v-if="showEditor" type="textarea" :rows="10" v-model:value="editorMessage"></n-input>
|
||||
<n-code v-else :code="msg" word-wrap/>
|
||||
<!--suppress VueUnrecognizedSlot -->
|
||||
<template #footer>
|
||||
<n-flex align="center" style="padding-top: 10px">
|
||||
<n-button v-if="!showEditor" secondary type="info">复制</n-button>
|
||||
<n-button v-if="!showEditor" secondary type="warning" @click="showEditor = true">
|
||||
编辑
|
||||
</n-button>
|
||||
<n-button v-if="!showEditor" secondary type="error" @click="onMessageDelete(msg, role)">
|
||||
删除
|
||||
</n-button>
|
||||
<n-button v-if="showEditor" secondary type="info" @click="showEditor = false">
|
||||
取消
|
||||
</n-button>
|
||||
<n-button
|
||||
v-if="showEditor"
|
||||
secondary
|
||||
type="primary"
|
||||
@click="
|
||||
() => {
|
||||
onMessageEdit(msg, editorMessage, role)
|
||||
showEditor = false
|
||||
}
|
||||
"
|
||||
>
|
||||
保存
|
||||
</n-button>
|
||||
<n-tag v-if="showEditor" type="warning">保存不会触发 AI 调用。</n-tag>
|
||||
</n-flex>
|
||||
</template>
|
||||
</n-modal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped></style>
|
||||
@@ -0,0 +1,39 @@
|
||||
<script setup lang="ts">
|
||||
import { onMounted, ref } from 'vue'
|
||||
|
||||
const promptPrefix = defineModel<string>('promptPrefix', { required: true })
|
||||
|
||||
const quickerForm = ref({
|
||||
length: 1000,
|
||||
style: '第三人称全知视角,禁止打破第四面墙。',
|
||||
})
|
||||
|
||||
function save() {
|
||||
promptPrefix.value = `<要求><输出字数>${quickerForm.value.length}</输出字数><风格约束>${quickerForm.value.style}</风格约束></要求>`
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
save()
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<n-card title="快速调整">
|
||||
<template #header-extra>
|
||||
<n-button-group>
|
||||
<n-button secondary type="primary" size="small" round @click="save()">保存</n-button>
|
||||
<n-button secondary type="tertiary" size="small" round>?</n-button>
|
||||
</n-button-group>
|
||||
</template>
|
||||
<n-form :model="quickerForm">
|
||||
<n-form-item label="输出字数" path="length">
|
||||
<n-input-number v-model:value="quickerForm.length" />
|
||||
</n-form-item>
|
||||
<n-form-item label="风格约束" path="style">
|
||||
<n-input v-model:value="quickerForm.style" />
|
||||
</n-form-item>
|
||||
</n-form>
|
||||
</n-card>
|
||||
</template>
|
||||
|
||||
<style scoped></style>
|
||||
@@ -0,0 +1,113 @@
|
||||
<script setup lang="ts">
|
||||
import {createChatTableMessages} from '@/components/chatroom/chat-table-messages.js'
|
||||
import {md} from '@/tools/md.js'
|
||||
|
||||
defineProps<{
|
||||
content: string | null
|
||||
aiiThinking: string
|
||||
aiiMessage: string | null
|
||||
aiiTokenInfo: string
|
||||
onSendMessage: () => void
|
||||
onAccept: () => void
|
||||
onRewrite: () => void
|
||||
onCancel: () => void
|
||||
onMessageEdit: (oldMessage: string, newMessage: string, change: 'aii' | 'user') => void
|
||||
onMessageDelete: (message: string, change: 'aii' | 'user') => void
|
||||
}>()
|
||||
|
||||
const message = defineModel<string>('message', {required: true})
|
||||
const mode = defineModel<'continue' | 'expand'>('mode', {required: true})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="chat-table-container">
|
||||
<div class="viewer">
|
||||
<component
|
||||
v-if="content !== null"
|
||||
:is="createChatTableMessages(content, onMessageEdit, onMessageDelete)"
|
||||
/>
|
||||
<div v-if="aiiMessage !== null" class="user-message message" v-html="md.render(message)"/>
|
||||
<div v-if="aiiMessage !== null" class="aii-message-streaming message">
|
||||
<div class="thinking">{{ aiiThinking }}</div>
|
||||
<div v-html="md.render(aiiMessage)"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="aiiMessage === null" class="editor">
|
||||
<n-input v-model:value="message" type="textarea" :resizable="false"/>
|
||||
<n-flex justify="right" align="center">
|
||||
<n-button type="tertiary" size="small" circle>!</n-button>
|
||||
<n-switch
|
||||
v-model:value="mode"
|
||||
size="large"
|
||||
checked-value="expand"
|
||||
unchecked-value="continue"
|
||||
>
|
||||
<template #checked>扩写模式</template>
|
||||
<template #unchecked>推进模式</template>
|
||||
<template #icon>✒️</template>
|
||||
</n-switch>
|
||||
<n-button type="primary" size="small" round @click="onSendMessage">发送 ↩︎</n-button>
|
||||
</n-flex>
|
||||
</div>
|
||||
|
||||
<div v-else class="confirmer">
|
||||
<n-flex justify="center" align="center" size="large">
|
||||
<n-button secondary type="success" size="large" @click="onAccept">接受</n-button>
|
||||
<n-button secondary type="warning" size="large" @click="onRewrite">重写</n-button>
|
||||
<n-button secondary type="error" size="large" @click="onCancel">撤回</n-button>
|
||||
</n-flex>
|
||||
<p v-html="aiiTokenInfo" style="margin: 0; text-align: center"></p>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped lang="scss">
|
||||
div.chat-table-container {
|
||||
border: 1px solid #434343;
|
||||
border-radius: 4px;
|
||||
padding: 3px;
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 3px;
|
||||
|
||||
div.viewer {
|
||||
flex: 1;
|
||||
overflow: auto;
|
||||
padding: 10px;
|
||||
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
div.editor,
|
||||
div.confirmer {
|
||||
flex: 0;
|
||||
min-height: 120px;
|
||||
border-radius: 4px;
|
||||
padding: 3px;
|
||||
}
|
||||
|
||||
div.editor {
|
||||
border: 3px solid rgb(122 255 162 / 0.7);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 3px;
|
||||
}
|
||||
|
||||
div.confirmer {
|
||||
border: 3px solid rgb(255 110 110 / 0.7);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 4px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,71 @@
|
||||
<script setup lang="ts">
|
||||
defineProps<{
|
||||
id: number
|
||||
name: string
|
||||
description: string
|
||||
feature_image: string
|
||||
infoMode?: boolean
|
||||
}>()
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="chatroom-card">
|
||||
<n-image v-if="infoMode" class="image" object-fit="cover" preview-disabled :src="feature_image"
|
||||
width="140"
|
||||
height="100"/>
|
||||
<n-image v-else class="image" object-fit="cover" preview-disabled :src="feature_image"
|
||||
width="84" height="60"/>
|
||||
<div class="card-body">
|
||||
<n-text class="name">{{ name }}</n-text>
|
||||
<n-ellipsis :line-clamp="2" style="max-width: 100%" class="description">
|
||||
{{ description !== '' ? description : '此聊天室没有任何介绍……神秘的喵!' }}
|
||||
</n-ellipsis>
|
||||
</div>
|
||||
<router-link v-if="infoMode" :to="'/chatroom/' + id">
|
||||
<div class="button">前往</div>
|
||||
</router-link>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped lang="scss">
|
||||
div.chatroom-card {
|
||||
background: linear-gradient(80deg, hsl(48 100% 85%), hsl(45 100% 94%));
|
||||
border-radius: 4px;
|
||||
border: solid 1px #252525;
|
||||
padding: 4px;
|
||||
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
gap: 6px;
|
||||
|
||||
.image {
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
div.card-body {
|
||||
flex: 1;
|
||||
padding: 2px;
|
||||
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 3px;
|
||||
|
||||
.name {
|
||||
font-size: 18px;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
|
||||
.button {
|
||||
height: 100px;
|
||||
padding: 0 20px;
|
||||
border-radius: 4px;
|
||||
background-color: rgb(94 255 11 / 0.3);
|
||||
color: #048f01;
|
||||
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,92 @@
|
||||
<script setup lang="ts">
|
||||
import {computed, ref, watch} from 'vue'
|
||||
import type {ChatroomPublic} from '@/types/chatroom.js'
|
||||
import {api} from '@/tools/web.js'
|
||||
import type {ReturnDto} from '@/types/response.js'
|
||||
import {useMessage} from 'naive-ui'
|
||||
import UploadFileModal from "@/components/file/UploadFileModal.vue";
|
||||
import SelectFileModal from "@/components/file/SelectFileModal.vue";
|
||||
import type {UploadFileDto} from "@/types/user.js";
|
||||
|
||||
const MESSAGE = useMessage()
|
||||
|
||||
const showModal = defineModel<boolean>('showModal', {required: true})
|
||||
|
||||
const showSelectModal = ref(false)
|
||||
const showUploadModal = ref(false)
|
||||
const files = ref<UploadFileDto[]>([])
|
||||
const selectFiles = ref<UploadFileDto[]>([])
|
||||
const image_url = computed(() => selectFiles.value.at(0)?.download_url)
|
||||
|
||||
const createChatroomForm = ref<ChatroomPublic>({
|
||||
id: 0,
|
||||
name: '',
|
||||
description: '',
|
||||
feature_image: '',
|
||||
script_template_id: 0,
|
||||
script_template_version: '',
|
||||
})
|
||||
|
||||
watch(image_url, () => {
|
||||
if (image_url.value) {
|
||||
createChatroomForm.value.feature_image = image_url.value
|
||||
}
|
||||
})
|
||||
|
||||
async function loadFiles() {
|
||||
return await api.get("/file/").then(res => files.value = res.data as UploadFileDto[])
|
||||
}
|
||||
|
||||
function onSubmit() {
|
||||
api
|
||||
.post('/chatroom/', JSON.stringify(createChatroomForm.value))
|
||||
.then((res) => res.data as ReturnDto)
|
||||
.then((data) => {
|
||||
if (data.success) {
|
||||
MESSAGE.success('聊天室创建成功 ~')
|
||||
showModal.value = false
|
||||
} else {
|
||||
throw TypeError('未知原因地后端业务失败')
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
MESSAGE.error(`聊天室创建失败:${err}`)
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<n-modal v-model:show="showModal" preset="card" title="创建聊天室" content-scrollable
|
||||
style="width: 800px;">
|
||||
<n-form
|
||||
:model="createChatroomForm"
|
||||
label-placement="left"
|
||||
label-align="right"
|
||||
label-width="auto"
|
||||
>
|
||||
<n-form-item path="name" label="名称">
|
||||
<n-input v-model:value="createChatroomForm.name"/>
|
||||
</n-form-item>
|
||||
<n-form-item path="description" label="简介">
|
||||
<n-input type="textarea" v-model:value="createChatroomForm.description"/>
|
||||
</n-form-item>
|
||||
<n-form-item path="feature_image" label="特色图像">
|
||||
<n-flex style="width: 100%;" :wrap="false">
|
||||
<n-input v-model:value="createChatroomForm.feature_image"
|
||||
placeholder="留空以使用默认图像"/>
|
||||
<n-button secondary type="info" @click="showSelectModal = true;">选择</n-button>
|
||||
<n-button secondary type="warning" @click="showUploadModal = true;">上传</n-button>
|
||||
</n-flex>
|
||||
</n-form-item>
|
||||
<n-form-item label="确认?">
|
||||
<n-button secondary type="primary" @click="onSubmit()">确认!</n-button>
|
||||
</n-form-item>
|
||||
</n-form>
|
||||
|
||||
<select-file-modal :max="1" :extensions="['png', 'jpeg', 'jpg']" :load-files="loadFiles"
|
||||
v-model:show-modal="showSelectModal" v-model:select-files="selectFiles"/>
|
||||
<upload-file-modal v-model:show-modal="showUploadModal" :after-leave="loadFiles"/>
|
||||
</n-modal>
|
||||
</template>
|
||||
|
||||
<style scoped></style>
|
||||
@@ -0,0 +1,134 @@
|
||||
<script setup lang="ts">
|
||||
import {api} from '@/tools/web.js'
|
||||
import {ref, watch} from 'vue'
|
||||
import {useRoute} from 'vue-router'
|
||||
import type {ChatScript} from '@/types/chatroom.js'
|
||||
import type {ReturnDto} from '@/types/response.js'
|
||||
import {useMessage} from 'naive-ui'
|
||||
import XamlModal from '@/components/XamlModal.vue'
|
||||
|
||||
const ROUTE = useRoute()
|
||||
const MESSAGE = useMessage()
|
||||
|
||||
const showDrawer = defineModel('showDrawer', {required: true})
|
||||
|
||||
const showXamlModal = ref(false)
|
||||
|
||||
const {script} = defineProps<{
|
||||
script: string
|
||||
}>()
|
||||
|
||||
const scriptForm = ref<ChatScript>({
|
||||
main_prompt: '',
|
||||
user_prefix: '',
|
||||
user_suffix: '',
|
||||
world_books: [],
|
||||
})
|
||||
|
||||
function save() {
|
||||
const id = Number(ROUTE.params.id)
|
||||
api
|
||||
.post(`/chatroom/${id}/script/`, JSON.stringify(scriptForm.value))
|
||||
.then((res) => res.data as ReturnDto)
|
||||
.then((data) => {
|
||||
if (data.success) {
|
||||
scriptForm.value = data.result as ChatScript
|
||||
MESSAGE.success('保存剧本成功~')
|
||||
} else {
|
||||
throw TypeError('未知原因后端保存剧本失败。')
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
MESSAGE.error(`保存剧本失败:${err}`)
|
||||
})
|
||||
}
|
||||
|
||||
watch(
|
||||
() => script,
|
||||
() => {
|
||||
try {
|
||||
scriptForm.value = JSON.parse(script) as ChatScript
|
||||
} catch {
|
||||
}
|
||||
},
|
||||
{immediate: true},
|
||||
)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<n-drawer
|
||||
v-model:show="showDrawer"
|
||||
placement="left"
|
||||
default-width="50vw"
|
||||
resizable
|
||||
native-scrollbar
|
||||
@after-leave="showDrawer = false"
|
||||
:z-index="20"
|
||||
:on-after-leave="
|
||||
() => {
|
||||
if (showXamlModal) {
|
||||
showXamlModal = false
|
||||
MESSAGE.info('已关闭 Xaml 可视化工具。')
|
||||
}
|
||||
}
|
||||
"
|
||||
>
|
||||
<n-drawer-content>
|
||||
<template #header>
|
||||
<n-h2 prefix="bar" style="margin-bottom: 0">剧本编辑器</n-h2>
|
||||
</template>
|
||||
<n-flex vertical>
|
||||
<n-alert type="info" title="故事设定 · 世界书">
|
||||
以下内容会被拼接在提示词以及用户输入中,在向 LLM 发送请求时携带。
|
||||
</n-alert>
|
||||
|
||||
<n-button secondary type="warning" @click="showXamlModal = true">Xaml 可视化</n-button>
|
||||
|
||||
<n-card title="全局设定">
|
||||
<template #header-extra>
|
||||
<n-tag round type="info">这些内容每一轮请求都会被携带</n-tag>
|
||||
</template>
|
||||
<n-form :model="scriptForm">
|
||||
<n-form-item label="提示词(拼接于 Nya 主提示词后)" path="main_prompt">
|
||||
<n-input
|
||||
type="textarea"
|
||||
:rows="8"
|
||||
v-model:value="scriptForm.main_prompt"
|
||||
show-count
|
||||
/>
|
||||
</n-form-item>
|
||||
<n-form-item label="用户输入前置词(拼接于最新一条用户输入前)" path="user_prefix">
|
||||
<n-input
|
||||
type="textarea"
|
||||
:rows="8"
|
||||
v-model:value="scriptForm.user_prefix"
|
||||
show-count
|
||||
/>
|
||||
</n-form-item>
|
||||
<n-form-item label="用户输入后置词(拼接于最新一条用户输入后)" path="user_suffix">
|
||||
<n-input
|
||||
type="textarea"
|
||||
:rows="8"
|
||||
v-model:value="scriptForm.user_suffix"
|
||||
show-count
|
||||
/>
|
||||
</n-form-item>
|
||||
</n-form>
|
||||
</n-card>
|
||||
|
||||
<n-card title="世界书">
|
||||
<template #header-extra>
|
||||
<n-tag round type="info">仅在被提及时才会被动态拼接并携带的细分设定</n-tag>
|
||||
</template>
|
||||
</n-card>
|
||||
</n-flex>
|
||||
<template #footer>
|
||||
<n-button type="primary" @click="save()">保存</n-button>
|
||||
</template>
|
||||
</n-drawer-content>
|
||||
|
||||
<xaml-modal v-model:show-modal="showXamlModal"/>
|
||||
</n-drawer>
|
||||
</template>
|
||||
|
||||
<style scoped></style>
|
||||
@@ -0,0 +1,38 @@
|
||||
import ChatMessage from '@/components/chatroom/ChatMessage.vue'
|
||||
|
||||
interface UserMessage {
|
||||
role: 'user'
|
||||
message: string
|
||||
mode: 'continue' | 'expand'
|
||||
}
|
||||
|
||||
interface AiiMessage {
|
||||
role: 'assistant'
|
||||
message: string
|
||||
}
|
||||
|
||||
type Message = UserMessage | AiiMessage
|
||||
type MessageList = Message[]
|
||||
|
||||
export function createChatTableMessages(
|
||||
content: string,
|
||||
onMessageEdit: (oldMessage: string, newMessage: string, change: 'aii' | 'user') => void,
|
||||
onMessageDelete: (message: string, change: 'aii' | 'user') => void,
|
||||
) {
|
||||
if (!content) return
|
||||
const content_list: MessageList = JSON.parse(content)
|
||||
return (
|
||||
<>
|
||||
{content_list.map((msg: Message) => {
|
||||
return (
|
||||
<ChatMessage
|
||||
msg={msg.message}
|
||||
role={msg.role === 'assistant' ? 'aii' : 'user'}
|
||||
onMessageEdit={onMessageEdit}
|
||||
onMessageDelete={onMessageDelete}
|
||||
/>
|
||||
)
|
||||
})}
|
||||
</>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
<script setup lang="ts">
|
||||
import type {UploadFileDto} from "@/types/user.js";
|
||||
import {useNowUser} from "@/stores/now-user.js";
|
||||
import {computed} from "vue";
|
||||
|
||||
const NOWUSER = useNowUser()
|
||||
|
||||
const {file} = defineProps<{
|
||||
file: UploadFileDto
|
||||
}>()
|
||||
|
||||
const is_you = computed(() => NOWUSER.id === file.uploader_id)
|
||||
|
||||
const showModal = defineModel("showModal", {required: true})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<n-modal v-model:show="showModal" preset="card" style="width: 1000px;" title="文件信息">
|
||||
<div class="card-content">
|
||||
<n-image :width="500" :height="500" object-fit="contain" :src="file.download_url"/>
|
||||
<div class="side">
|
||||
<n-h3>{{ file.original_name }}</n-h3>
|
||||
<n-p>保存文件名:{{ file.safe_name }}</n-p>
|
||||
<n-p>上传用户ID:{{ file.uploader_id }}
|
||||
<n-tag v-if="is_you" type="primary">你</n-tag>
|
||||
</n-p>
|
||||
|
||||
<n-flex>
|
||||
<a :href="file.download_url" target="_blank">
|
||||
<n-button tertiary type="info">永久链接</n-button>
|
||||
</a>
|
||||
<n-button tertiary type="error" v-if="is_you">删除文件</n-button>
|
||||
</n-flex>
|
||||
</div>
|
||||
</div>
|
||||
</n-modal>
|
||||
</template>
|
||||
|
||||
<style scoped lang="scss">
|
||||
div.card-content {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
gap: 16px;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,74 @@
|
||||
<script setup lang="ts">
|
||||
import type {UploadFileDto} from "@/types/user.js";
|
||||
import {computed, onMounted, ref, useTemplateRef} from "vue";
|
||||
import FileModal from "@/components/file/FileModal.vue";
|
||||
|
||||
const {file, size, enableSelect, onSelect, onRemove} = defineProps<{
|
||||
file: UploadFileDto
|
||||
size: number
|
||||
enableSelect?: boolean
|
||||
onSelect?: (file: UploadFileDto) => boolean
|
||||
onRemove?: (file: UploadFileDto) => boolean
|
||||
}>()
|
||||
|
||||
const th = useTemplateRef("th")
|
||||
|
||||
const showModal = ref(false)
|
||||
const selected = ref(false)
|
||||
|
||||
const ALLOWED_EXTENSIONS = ["jpg", "jpeg", "png"]
|
||||
|
||||
onMounted(() => {
|
||||
if (ALLOWED_EXTENSIONS.includes(file.safe_name.split('.').at(-1)!.toLowerCase())) {
|
||||
th.value?.style.setProperty('background-image', 'url("' + file.download_url + '")')
|
||||
}
|
||||
})
|
||||
|
||||
function onClick() {
|
||||
if (!enableSelect) {
|
||||
showModal.value = true
|
||||
}
|
||||
|
||||
if (selected.value && onRemove) {
|
||||
if (onRemove(file)) {
|
||||
selected.value = false
|
||||
th.value?.classList.remove("selected")
|
||||
console.log(`选中文件:${file.original_name}`)
|
||||
}
|
||||
} else if (!selected.value && onSelect) {
|
||||
if (onSelect(file)) {
|
||||
selected.value = true
|
||||
th.value?.classList.add("selected")
|
||||
console.log(`取消文件:${file.original_name}`)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const size_px = computed(() => `${size}px`)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="file-thumbnail" ref="th" @click="onClick"></div>
|
||||
|
||||
<file-modal :file v-model:show-modal="showModal"/>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
div.file-thumbnail {
|
||||
box-sizing: border-box;
|
||||
width: v-bind(size_px);
|
||||
height: v-bind(size_px);
|
||||
border-radius: 3px;
|
||||
border: 2px solid rgb(0 0 0 / 0.2);
|
||||
background-position: center;
|
||||
background-repeat: no-repeat;
|
||||
background-size: cover;
|
||||
|
||||
transition: border-color 0.3s, box-shadow 0.3s;
|
||||
}
|
||||
|
||||
div.selected {
|
||||
border-color: rgb(74 228 112 / 0.8);
|
||||
box-shadow: 0 0 0 2px rgb(104 104 104 / 0.2);
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,67 @@
|
||||
<script setup lang="ts">
|
||||
import {selectFilesCom} from "@/components/file/upload-files.js";
|
||||
import {computed, ref, watch} from "vue";
|
||||
import type {UploadFileDto} from "@/types/user.js";
|
||||
import {useMessage} from "naive-ui";
|
||||
|
||||
const MESSAGE = useMessage()
|
||||
|
||||
const {max, extensions, loadFiles} = defineProps<{
|
||||
max: number
|
||||
extensions: string[]
|
||||
loadFiles: () => Promise<UploadFileDto[]>
|
||||
}>()
|
||||
|
||||
const showModal = defineModel("showModal", {required: true})
|
||||
|
||||
const files = ref<UploadFileDto[]>([])
|
||||
const tempFiles = ref<UploadFileDto[]>([])
|
||||
const selectFiles = defineModel<UploadFileDto[]>("selectFiles", {required: true})
|
||||
|
||||
function selectFile(file: UploadFileDto) {
|
||||
if (tempFiles.value.length < max) {
|
||||
tempFiles.value.push(file)
|
||||
return true
|
||||
} else {
|
||||
MESSAGE.warning("可选择文件数量达到上限……")
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
function removeFile(file: UploadFileDto) {
|
||||
const i = tempFiles.value.findIndex((item) => item.id === file.id)
|
||||
if (i >= 0) {
|
||||
tempFiles.value.splice(i, 1)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
watch(showModal, async () => {
|
||||
tempFiles.value = [] // 每次打开模态框时都重置已选文件
|
||||
files.value = await loadFiles()
|
||||
})
|
||||
|
||||
const tip_1 = computed(() => max > 1 ? `请选择至少 ${max} 个文件。` : "请选择一个文件。")
|
||||
const tip_2 = computed(() => `允许的文件类型:${extensions.join('、')}。`)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<n-modal preset="card" style="max-width: 600px; max-height: 600px;" title="选择文件"
|
||||
content-scrollable
|
||||
v-model:show="showModal">
|
||||
<n-flex vertical>
|
||||
<n-alert type="info">
|
||||
{{ tip_1 }}
|
||||
{{ tip_2 }}
|
||||
</n-alert>
|
||||
<component :is="selectFilesCom(files, selectFile, removeFile)"/>
|
||||
<n-button type="primary" secondary @click="selectFiles = tempFiles; showModal = false;">
|
||||
确认选择
|
||||
</n-button>
|
||||
</n-flex>
|
||||
</n-modal>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,69 @@
|
||||
<script setup lang="ts">
|
||||
import {type UploadCustomRequestOptions, type UploadFileInfo} from "naive-ui";
|
||||
import {api} from "@/tools/web.js";
|
||||
import type {UploadFileDto} from "@/types/user.js";
|
||||
import {shallowRef, useTemplateRef} from "vue";
|
||||
|
||||
defineProps<{
|
||||
afterLeave?: () => void;
|
||||
}>()
|
||||
|
||||
const showModal = defineModel("showModal", {required: true})
|
||||
|
||||
const upload = useTemplateRef("upload")
|
||||
|
||||
const fileList = shallowRef<UploadFileInfo[]>([])
|
||||
|
||||
async function handle_upload({file, onFinish, onError, onProgress}: UploadCustomRequestOptions) {
|
||||
const formData = new FormData();
|
||||
console.log(file.file)
|
||||
formData.append("file", file.file!)
|
||||
console.log(formData)
|
||||
|
||||
try {
|
||||
const data = await api.post("/file/upload/", formData, {
|
||||
headers: {
|
||||
'Content-Type': undefined // 取消全局默认的 application/json 很重要!!!!!!!!
|
||||
},
|
||||
onUploadProgress: (progressEvent) => {
|
||||
const percent = Math.ceil(
|
||||
(progressEvent.loaded / progressEvent.total!) * 100
|
||||
)
|
||||
onProgress({percent}) // 更新进度条
|
||||
}
|
||||
}).then((res) => res.data as UploadFileDto)
|
||||
|
||||
file.url = data.download_url
|
||||
onFinish()
|
||||
} catch (err) {
|
||||
console.error(`文件上传失败:${err}`)
|
||||
onError()
|
||||
}
|
||||
}
|
||||
|
||||
function onUpload() {
|
||||
upload.value?.submit()
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<n-modal style="width: 600px;" preset="card" v-model:show="showModal"
|
||||
title="上传文件" content-scrollable
|
||||
@after-leave="afterLeave">
|
||||
<n-flex vertical>
|
||||
<n-upload multiple ref="upload" :default-upload="false" list-type="image"
|
||||
:custom-request="handle_upload" v-model:file-list="fileList">
|
||||
<n-upload-dragger>
|
||||
<n-p>拖拽文件到此区域可以快速上传。</n-p>
|
||||
</n-upload-dragger>
|
||||
</n-upload>
|
||||
|
||||
<n-flex>
|
||||
<n-button type="primary" secondary @click="onUpload">上传</n-button>
|
||||
<n-tag size="large" type="info">如有必要,请在上传前在您的本地对文件进行重命名~</n-tag>
|
||||
</n-flex>
|
||||
</n-flex>
|
||||
</n-modal>
|
||||
</template>
|
||||
|
||||
<style scoped></style>
|
||||
@@ -0,0 +1,30 @@
|
||||
import type {UploadFileDto} from "@/types/user.ts";
|
||||
import FileThumbnail from "@/components/file/FileThumbnail.vue";
|
||||
import {NEmpty, NFlex} from "naive-ui";
|
||||
|
||||
export function uploadFilesCom(files: UploadFileDto[]) {
|
||||
if (files.length === 0) {
|
||||
return <NEmpty description="你还没有上传任何文件。" size="large"/>
|
||||
}
|
||||
return <NFlex>
|
||||
{files.map((file: UploadFileDto) => {
|
||||
return <FileThumbnail size={120} file={file}></FileThumbnail>;
|
||||
})}
|
||||
</NFlex>
|
||||
}
|
||||
|
||||
export function selectFilesCom(
|
||||
files: UploadFileDto[],
|
||||
onSelect: (file: UploadFileDto) => boolean,
|
||||
onRemove: (file: UploadFileDto) => boolean
|
||||
) {
|
||||
if (files.length === 0) {
|
||||
return <NEmpty description="你还没有上传任何文件。" size="large"/>
|
||||
}
|
||||
return <NFlex>
|
||||
{files.map((file: UploadFileDto) => {
|
||||
return <FileThumbnail size={82} file={file} enableSelect onSelect={onSelect}
|
||||
onRemove={onRemove}></FileThumbnail>;
|
||||
})}
|
||||
</NFlex>
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
import { NAlert, NH4, NP } from 'naive-ui'
|
||||
|
||||
export interface Xaml {
|
||||
name: string
|
||||
message: string
|
||||
subXamls: Xaml[]
|
||||
}
|
||||
|
||||
export function createXamlBlock(xamls: Xaml[]) {
|
||||
return (
|
||||
<>
|
||||
{xamls.map((xaml) => {
|
||||
return (
|
||||
<div class="xaml-block">
|
||||
<NH4 class="title">{xaml.name}</NH4>
|
||||
<NP class="text">{xaml.message}</NP>
|
||||
{createXamlBlock(xaml.subXamls)}
|
||||
</div>
|
||||
)
|
||||
})}
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
export function createErrorBlock(msg: string) {
|
||||
return (
|
||||
<NAlert type="error" title="可视化失败……">
|
||||
{msg}
|
||||
</NAlert>
|
||||
)
|
||||
}
|
||||
@@ -1,14 +1,19 @@
|
||||
import {createApp} from 'vue'
|
||||
import {createPinia} from 'pinia'
|
||||
import {createHead} from "@unhead/vue/client";
|
||||
|
||||
import '@/assets/main.scss'
|
||||
import '@/assets/beautiful.scss'
|
||||
import '@/assets/chat.scss'
|
||||
|
||||
import App from './App.vue'
|
||||
import router from './router'
|
||||
|
||||
const app = createApp(App)
|
||||
const head = createHead()
|
||||
|
||||
app.use(createPinia())
|
||||
app.use(router)
|
||||
app.use(head)
|
||||
|
||||
app.mount('#app')
|
||||
|
||||
@@ -0,0 +1,124 @@
|
||||
<script setup lang="ts">
|
||||
import UserAction from "@/components/admin/UserAction.vue";
|
||||
import type {MenuOption} from "naive-ui";
|
||||
import {computed, onMounted, ref, useTemplateRef} from "vue";
|
||||
import {useRouter} from "vue-router";
|
||||
import {useNowUser} from "@/stores/now-user.js";
|
||||
import {useHead} from "@unhead/vue";
|
||||
|
||||
useHead({
|
||||
titleTemplate: "%s | 管理面板 | NayHome"
|
||||
})
|
||||
|
||||
const ROUTER = useRouter()
|
||||
const NOWUSER = useNowUser()
|
||||
|
||||
const menu = useTemplateRef("menu")
|
||||
|
||||
const selectOption = ref("")
|
||||
const options = computed<MenuOption[]>(() => [
|
||||
{
|
||||
label: "总览",
|
||||
key: "",
|
||||
},
|
||||
{
|
||||
label: "用户",
|
||||
key: "user-basic",
|
||||
children: [
|
||||
{
|
||||
label: "资料",
|
||||
key: "user-info"
|
||||
},
|
||||
{
|
||||
label: "安全",
|
||||
key: "user-security"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
label: "内容",
|
||||
key: "user-creation",
|
||||
children: [
|
||||
{
|
||||
label: "上传",
|
||||
key: "user-upload"
|
||||
},
|
||||
{
|
||||
label: "剧本",
|
||||
key: "user-script"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
label: "NyaHome 管理后台",
|
||||
key: "nyahome",
|
||||
show: NOWUSER.is_admin,
|
||||
}
|
||||
])
|
||||
|
||||
function handleMenuClick(key: string) {
|
||||
ROUTER.push(`/admin/${key}`)
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
const key = ROUTER.currentRoute.value.fullPath.replace("/admin/", "")
|
||||
if (key) {
|
||||
selectOption.value = key
|
||||
menu.value?.showOption(key)
|
||||
} else {
|
||||
selectOption.value = ""
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div id="user-page">
|
||||
<div id="user-page-sidebar">
|
||||
<user-action/>
|
||||
<div class="nyahome-card">
|
||||
<n-menu ref="menu" v-model:value="selectOption" :options @update:value="handleMenuClick"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<router-view v-slot="{Component}">
|
||||
<div id="user-page-content">
|
||||
<keep-alive>
|
||||
<component :is="Component"/>
|
||||
</keep-alive>
|
||||
</div>
|
||||
</router-view>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped lang="scss">
|
||||
div#user-page {
|
||||
min-width: min(1200px, 90%);
|
||||
width: min(1200px, 90%);
|
||||
min-height: 0;
|
||||
padding: 6px 20px;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
gap: 10px;
|
||||
|
||||
div#user-page-sidebar {
|
||||
flex: 0;
|
||||
flex-basis: 350px;
|
||||
min-height: 0;
|
||||
overflow: auto;
|
||||
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
div#user-page-content {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
overflow: auto;
|
||||
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 10px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,364 @@
|
||||
<script setup lang="ts">
|
||||
import {useRoute} from 'vue-router'
|
||||
import {onMounted, ref, useTemplateRef, watch} from 'vue'
|
||||
import {api} from '@/tools/web.ts'
|
||||
import type {ReturnDto} from '@/types/response.ts'
|
||||
import type {Chatroom} from '@/types/chatroom.ts'
|
||||
import {useMessage} from 'naive-ui'
|
||||
import ChatroomCard from '@/components/chatroom/ChatroomCard.vue'
|
||||
import ChatTable from '@/components/chatroom/ChatTable.vue'
|
||||
import ChatControlPanel from '@/components/chatroom/ChatControlPanel.vue'
|
||||
import {fetchEventSource} from '@microsoft/fetch-event-source'
|
||||
import type {AiiTokenInfo} from '@/types/aii.ts'
|
||||
import {SEE_YOU_TOMORROW} from '@/types/syt.ts'
|
||||
|
||||
const ROUTE = useRoute()
|
||||
const MESSAGE = useMessage()
|
||||
|
||||
const crName = ref('')
|
||||
const crDescription = ref('')
|
||||
const crFeatureImage = ref('')
|
||||
const crContent = ref('')
|
||||
const crScript = ref('')
|
||||
|
||||
const selectedModel = ref<number | null>(null)
|
||||
const quickerPrompt = ref('')
|
||||
const inputMessage = ref<string>('')
|
||||
const inputMode = ref<'continue' | 'expand'>('expand')
|
||||
|
||||
// aiiMessage 是 AI **正在** 输出时的存储 AI 输出的容器。在 AI 完成输出后、开始输出前以及错误被处理后,应该为 null。
|
||||
const aiiMessage = ref<string | null>(null)
|
||||
// aiiThinking 是思维链/思考过程,有的模型不提供
|
||||
const aiiThinking = ref('')
|
||||
const aiiTokenInfo = ref(SEE_YOU_TOMORROW)
|
||||
|
||||
function load() {
|
||||
const id = Number(ROUTE.params.id)
|
||||
api
|
||||
.get(`/chatroom/${id}/`)
|
||||
.then((res) => res.data as ReturnDto)
|
||||
.then((data) => {
|
||||
if (data.success) {
|
||||
return data.result as Chatroom
|
||||
} else {
|
||||
throw TypeError('聊天室不存在,请检查。')
|
||||
}
|
||||
})
|
||||
.then((cr) => {
|
||||
crName.value = cr.name
|
||||
crDescription.value = cr.description
|
||||
crFeatureImage.value = cr.feature_image
|
||||
crContent.value = cr.content
|
||||
crScript.value = cr.script
|
||||
})
|
||||
.catch((e) => {
|
||||
MESSAGE.error(`访问聊天室失败:${e}`)
|
||||
})
|
||||
}
|
||||
|
||||
watch(
|
||||
() => ROUTE.params.id,
|
||||
(newId, oldId) => {
|
||||
console.log(`聊天室跳转,从 ${oldId} 来到 ${newId}。`)
|
||||
load()
|
||||
},
|
||||
)
|
||||
|
||||
function chat() {
|
||||
if (!selectedModel.value) {
|
||||
MESSAGE.warning('未选择模型,无法开始创作喵!')
|
||||
return
|
||||
}
|
||||
if (inputMessage.value === '') {
|
||||
MESSAGE.warning('未输入任何内容,无法开始创作喵!')
|
||||
return
|
||||
}
|
||||
|
||||
const id = Number(ROUTE.params.id)
|
||||
aiiThinking.value = ''
|
||||
aiiMessage.value = ''
|
||||
aiiTokenInfo.value = SEE_YOU_TOMORROW
|
||||
// /chatroom/${id}/chat 接口返回的是 SSE 流式输出
|
||||
fetchEventSource(`/api/chatroom/${id}/chat/`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
body: JSON.stringify({
|
||||
message: inputMessage.value,
|
||||
prefix: quickerPrompt.value,
|
||||
mode: inputMode.value,
|
||||
model_id: selectedModel.value,
|
||||
}),
|
||||
openWhenHidden: true, // 此开关控制在浏览器失去焦点时是否保持连接开启。默认为 false 会导致焦点转移时流式传输中断然后重连,很怪
|
||||
|
||||
onmessage(msg) {
|
||||
if (msg.data === '[DONE]') {
|
||||
MESSAGE.success('AI 似乎已经完成创作,请检查一下喵!')
|
||||
console.log('SSE 流式输出结束。')
|
||||
// aiiMessage.value = null // 即使 AI 完成输出,也等待用户确认后再保存喵!
|
||||
return
|
||||
}
|
||||
|
||||
const data: { type: 'output' | 'thinking' | 'usage'; text?: string } = JSON.parse(msg.data)
|
||||
if (data.type === 'output') {
|
||||
aiiMessage.value += data.text as string
|
||||
} else if (data.type === 'thinking') {
|
||||
aiiThinking.value += data.text as string
|
||||
} else {
|
||||
const usage = data as AiiTokenInfo
|
||||
aiiTokenInfo.value = `总计:${usage.total_tokens} | 输入:${usage.prompt_tokens} | 输出:${usage.completion_tokens}`
|
||||
if (usage.prompt_cache_hit_tokens && usage.prompt_cache_miss_tokens) {
|
||||
aiiTokenInfo.value += `<br />[ 输入(缓存):${usage.prompt_cache_hit_tokens} | 输入(未缓存):${usage.prompt_cache_miss_tokens} ]`
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
onerror(err) {
|
||||
console.error(`SSE 错误:${err}`)
|
||||
// aiiMessage.value = null // 等待用户主动确认 AI 输出错误之后,再主动重置为 null
|
||||
throw err
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
function accept() {
|
||||
const id = Number(ROUTE.params.id)
|
||||
api
|
||||
.post(
|
||||
`/chatroom/${id}/chat/accept/`,
|
||||
JSON.stringify({
|
||||
aii_message: aiiMessage.value,
|
||||
user_message: inputMessage.value,
|
||||
mode: inputMode.value,
|
||||
}),
|
||||
)
|
||||
.then((res) => res.data as ReturnDto)
|
||||
.then((data) => {
|
||||
if (data.success) {
|
||||
MESSAGE.success('保存成功,正在刷新创作视图喵~')
|
||||
aiiMessage.value = null
|
||||
inputMessage.value = ''
|
||||
return data.result as Chatroom
|
||||
} else {
|
||||
throw TypeError('未知原因,后端业务错误')
|
||||
}
|
||||
})
|
||||
.then((result) => {
|
||||
crContent.value = result.content
|
||||
})
|
||||
.catch((err) => {
|
||||
MESSAGE.error(`保存失败:${err}`)
|
||||
})
|
||||
}
|
||||
|
||||
function rewrite() {
|
||||
chat()
|
||||
}
|
||||
|
||||
function cancel() {
|
||||
aiiMessage.value = null
|
||||
}
|
||||
|
||||
function messageEdit(oldMessage: string, newMessage: string, change: 'aii' | 'user') {
|
||||
const id = Number(ROUTE.params.id)
|
||||
api
|
||||
.post(
|
||||
`/chatroom/${id}/chat/edit/`,
|
||||
JSON.stringify({
|
||||
old_message: oldMessage,
|
||||
new_message: newMessage,
|
||||
change,
|
||||
}),
|
||||
)
|
||||
.then((res) => res.data as ReturnDto)
|
||||
.then((data) => {
|
||||
if (data.success) {
|
||||
return data.result as Chatroom
|
||||
} else {
|
||||
throw TypeError('未知原因,后端聊天记录修改失败')
|
||||
}
|
||||
})
|
||||
.then((result) => {
|
||||
crContent.value = result.content
|
||||
MESSAGE.success('聊天记录已删除,页面已更新~')
|
||||
})
|
||||
.catch((err) => {
|
||||
MESSAGE.error(`修改聊天消息失败:${err}`)
|
||||
})
|
||||
}
|
||||
|
||||
function messageDelete(message: string, change: 'aii' | 'user') {
|
||||
const id = Number(ROUTE.params.id)
|
||||
api
|
||||
.post(`/chatroom/${id}/chat/delete/`, JSON.stringify({message, change}))
|
||||
.then((res) => res.data as ReturnDto)
|
||||
.then((data) => {
|
||||
if (data.success) {
|
||||
return data.result as Chatroom
|
||||
} else {
|
||||
throw TypeError('未知原因,后端聊天记录删除失败')
|
||||
}
|
||||
})
|
||||
.then((result) => {
|
||||
crContent.value = result.content
|
||||
MESSAGE.success('聊天记录已删除,页面已更新~')
|
||||
})
|
||||
.catch((err) => {
|
||||
MESSAGE.error(`删除聊天消息失败:${err}`)
|
||||
})
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
enableSidebar()
|
||||
load()
|
||||
})
|
||||
|
||||
const mainToggle = useTemplateRef('main-toggle')
|
||||
const sidebar = useTemplateRef('sidebar')
|
||||
|
||||
function disableSidebar() {
|
||||
mainToggle.value?.style.setProperty('--opacity', '1')
|
||||
sidebar.value?.style.setProperty('--width', '0')
|
||||
sidebar.value?.style.setProperty('--opacity', '0')
|
||||
sidebar.value?.style.setProperty('--transform-x', '100%')
|
||||
}
|
||||
|
||||
function enableSidebar() {
|
||||
mainToggle.value?.style.setProperty('--opacity', '0')
|
||||
sidebar.value?.style.setProperty('--width', '400px')
|
||||
sidebar.value?.style.setProperty('--opacity', '1')
|
||||
sidebar.value?.style.setProperty('--transform-x', '0')
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="page-container">
|
||||
<div class="main-column">
|
||||
<chatroom-card :id="Number(ROUTE.params.id)" :name="crName" :description="crDescription"
|
||||
:feature_image="crFeatureImage"/>
|
||||
<chat-table
|
||||
:content="crContent"
|
||||
:aii-thinking
|
||||
:aii-message
|
||||
:aii-token-info
|
||||
v-model:message="inputMessage"
|
||||
v-model:mode="inputMode"
|
||||
:on-send-message="chat"
|
||||
:on-accept="accept"
|
||||
:on-rewrite="rewrite"
|
||||
:on-cancel="cancel"
|
||||
:on-message-edit="messageEdit"
|
||||
:on-message-delete="messageDelete"
|
||||
/>
|
||||
<div id="main-toggle" ref="main-toggle" @click="enableSidebar"/>
|
||||
</div>
|
||||
<div class="sidebar-column" ref="sidebar">
|
||||
<chat-control-panel
|
||||
:script="crScript"
|
||||
v-model:quicker-prompt="quickerPrompt"
|
||||
v-model:select-model="selectedModel"
|
||||
/>
|
||||
<div id="sidebar-toggle" @click="disableSidebar"/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped lang="scss">
|
||||
div.page-container {
|
||||
width: min(1200px, 90vw);
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
|
||||
div.main-column {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
overflow: hidden;
|
||||
padding: 4px;
|
||||
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 4px;
|
||||
|
||||
position: relative;
|
||||
|
||||
div#main-toggle {
|
||||
--opacity: 1;
|
||||
|
||||
position: absolute;
|
||||
top: 40%;
|
||||
right: 12px;
|
||||
height: 20%;
|
||||
width: 10px;
|
||||
|
||||
background: rgb(0 0 0 / 0.1);
|
||||
border-radius: 5px;
|
||||
opacity: var(--opacity);
|
||||
|
||||
transition: background-color 0.8s,
|
||||
transform 0.5s,
|
||||
opacity 1s,
|
||||
height 0.5s,
|
||||
width 0.5s,
|
||||
top 0.5s,
|
||||
border-radius 0.5s;
|
||||
|
||||
&:hover {
|
||||
background: rgb(0 0 0 / 0.6);
|
||||
transform: translateX(-4px);
|
||||
top: calc(50% - 15px);
|
||||
height: 30px;
|
||||
width: 30px;
|
||||
border-radius: 15px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
div.sidebar-column {
|
||||
--transition-x: 100%;
|
||||
--opacity: 1;
|
||||
--width: 400px;
|
||||
|
||||
flex: 0;
|
||||
overflow: auto;
|
||||
|
||||
position: relative;
|
||||
|
||||
transition: transform 1s,
|
||||
opacity 1s,
|
||||
flex-basis 1s;
|
||||
transform: translateX(var(--transform-x));
|
||||
flex-basis: var(--width);
|
||||
opacity: var(--opacity);
|
||||
|
||||
div#sidebar-toggle {
|
||||
position: absolute;
|
||||
top: 40%;
|
||||
left: 0;
|
||||
height: 20%;
|
||||
width: 10px;
|
||||
|
||||
background: rgb(0 0 0 / 0.1);
|
||||
border-radius: 5px;
|
||||
|
||||
transition: background-color 0.8s,
|
||||
transform 0.5s,
|
||||
height 0.5s,
|
||||
width 0.5s,
|
||||
top 0.5s,
|
||||
border-radius 0.5s;
|
||||
|
||||
&:hover {
|
||||
background: rgb(0 0 0 / 0.6);
|
||||
transform: translateX(4px);
|
||||
top: calc(50% - 15px);
|
||||
height: 30px;
|
||||
width: 30px;
|
||||
border-radius: 15px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,5 +1,65 @@
|
||||
<script setup lang="ts"></script>
|
||||
<script setup lang="ts">
|
||||
import ChatroomCard from '@/components/chatroom/ChatroomCard.vue'
|
||||
import {ref, watch} from 'vue'
|
||||
import {api} from '@/tools/web.ts'
|
||||
import type {ChatroomPublic} from '@/types/chatroom.ts'
|
||||
import type {ReturnDto} from '@/types/response.ts'
|
||||
import ChatroomCreatorModal from '@/components/chatroom/ChatroomCreatorModal.vue'
|
||||
import {useNowUser} from "@/stores/now-user.ts";
|
||||
|
||||
<template></template>
|
||||
const NOWUSER = useNowUser()
|
||||
|
||||
<style scoped></style>
|
||||
const crList = ref<ChatroomPublic[]>([])
|
||||
|
||||
const showModal = ref(false)
|
||||
|
||||
function load() {
|
||||
api
|
||||
.get('/chatroom/')
|
||||
.then((res) => res.data as ReturnDto)
|
||||
.then((data) => data.result as ChatroomPublic[])
|
||||
.then((list) => {
|
||||
crList.value = list
|
||||
})
|
||||
}
|
||||
|
||||
watch(() => NOWUSER.isLogin, () => {
|
||||
load()
|
||||
}, {immediate: true})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<n-card title="聊天室">
|
||||
查看您创建的所有聊天室。
|
||||
<template #footer>
|
||||
<n-flex>
|
||||
<n-button secondary type="primary" style="margin-left: auto" @click="showModal = true">
|
||||
创建聊天室
|
||||
</n-button>
|
||||
</n-flex>
|
||||
</template>
|
||||
</n-card>
|
||||
<div id="chatroom-card-list">
|
||||
<chatroom-card
|
||||
v-for="cr in crList"
|
||||
v-bind:key="cr.id"
|
||||
:id="cr.id"
|
||||
:name="cr.name"
|
||||
:description="cr.description"
|
||||
:feature_image="cr.feature_image"
|
||||
info-mode
|
||||
/>
|
||||
</div>
|
||||
|
||||
<chatroom-creator-modal v-model:show-modal="showModal"/>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
div#chatroom-card-list {
|
||||
width: 800px;
|
||||
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 6px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,7 +1,25 @@
|
||||
<script setup lang="ts"></script>
|
||||
<script setup lang="ts">
|
||||
import UserAction from '@/components/admin/UserAction.vue'
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<n-card title="Welcome to Welcome!"></n-card>
|
||||
<n-flex vertical style="padding: 6px 20px">
|
||||
<n-flex>
|
||||
<n-card class="welcome-card" title="Welcome to Welcome!"></n-card>
|
||||
<div class="user-action-card">
|
||||
<user-action/>
|
||||
</div>
|
||||
</n-flex>
|
||||
</n-flex>
|
||||
</template>
|
||||
|
||||
<style scoped></style>
|
||||
<style scoped>
|
||||
.welcome-card {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
div.user-action-card {
|
||||
flex: 0;
|
||||
flex-basis: 350px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -0,0 +1,197 @@
|
||||
<script setup lang="ts">
|
||||
import ConfigCard from "@/components/admin/ConfigCard.vue";
|
||||
import {useHead} from "@unhead/vue";
|
||||
import {ref} from "vue";
|
||||
import {api} from "@/tools/web.ts";
|
||||
import InDev from "@/components/InDev.vue";
|
||||
import {useMessage} from "naive-ui";
|
||||
import type {ReturnDto} from "@/types/response.ts";
|
||||
|
||||
interface SiteConfig {
|
||||
site_name: string;
|
||||
site_url: string;
|
||||
backend_url: string;
|
||||
|
||||
jwt_secret_key: string;
|
||||
|
||||
smtp_enable: boolean;
|
||||
smtp_sender: string;
|
||||
smtp_hostname: string;
|
||||
smtp_port: number;
|
||||
smtp_username: string;
|
||||
smtp_password: string;
|
||||
smtp_use_tls: boolean;
|
||||
}
|
||||
|
||||
const MESSAGE = useMessage()
|
||||
|
||||
useHead({
|
||||
title: "NyaHome 管理后台"
|
||||
})
|
||||
|
||||
const siteConfig = ref<SiteConfig | null>(null);
|
||||
|
||||
function getConfig() {
|
||||
api.get("/admin/site_config/")
|
||||
.then((res) => {
|
||||
siteConfig.value = res.data as SiteConfig
|
||||
MESSAGE.success("成功获取设置~")
|
||||
})
|
||||
}
|
||||
|
||||
function saveConfig() {
|
||||
api.post("/admin/site_config/", JSON.stringify(siteConfig.value))
|
||||
.then((res) => {
|
||||
siteConfig.value = res.data as SiteConfig
|
||||
MESSAGE.success("保存并刷新设置成功~")
|
||||
})
|
||||
}
|
||||
|
||||
const testMailTo = ref("25565@qq.com")
|
||||
|
||||
function sendTestMail() {
|
||||
api.post("/admin/email-test/", JSON.stringify({to: testMailTo.value}))
|
||||
.then(res => res.data as ReturnDto)
|
||||
.then(data => data.success)
|
||||
.then(success => {
|
||||
if (success) {
|
||||
MESSAGE.success("邮件发送成功,请稍等片刻,然后检查收件箱~")
|
||||
} else {
|
||||
MESSAGE.error("后端表示邮件发送失败,请检查日志输出。")
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<n-card>
|
||||
<template #header>
|
||||
<n-h3 prefix="bar" style="margin: 0;">NyaHome 管理后台</n-h3>
|
||||
</template>
|
||||
<template #header-extra>
|
||||
<n-flex>
|
||||
<n-button type="success" secondary @click="getConfig()">获取设置</n-button>
|
||||
<n-button type="error" secondary @click="saveConfig()">保存设置</n-button>
|
||||
</n-flex>
|
||||
</template>
|
||||
</n-card>
|
||||
|
||||
<n-tabs type="card" v-if="siteConfig !== null">
|
||||
<n-tab-pane name="user" tab="用户" display-directive="show">
|
||||
<config-card title="全部用户">
|
||||
<in-dev/>
|
||||
</config-card>
|
||||
</n-tab-pane>
|
||||
|
||||
<n-tab-pane name="chatroom" tab="聊天室" display-directive="show">
|
||||
<config-card title="全部聊天室">
|
||||
<in-dev/>
|
||||
</config-card>
|
||||
</n-tab-pane>
|
||||
|
||||
<n-tab-pane name="script" tab="剧本" display-directive="show">
|
||||
<config-card title="全部剧本">
|
||||
<in-dev/>
|
||||
</config-card>
|
||||
</n-tab-pane>
|
||||
|
||||
<n-tab-pane name="site_info" tab="站点信息" display-directive="show">
|
||||
<n-flex vertical>
|
||||
<config-card title="基本信息">
|
||||
<n-form>
|
||||
<n-form-item label="站点名称">
|
||||
<n-input v-model:value="siteConfig.site_name"/>
|
||||
</n-form-item>
|
||||
<n-form-item label="站点地址">
|
||||
<n-input v-model:value="siteConfig.site_url"/>
|
||||
</n-form-item>
|
||||
<n-alert type="info" class="in-form-alert">
|
||||
如果您需要将 NyaHome 的前后端分开部署,则需要在此设置后端地址。您需要自行处理跨域问题。
|
||||
</n-alert>
|
||||
<n-form-item label="FastAPI 后端地址">
|
||||
<n-input v-model:value="siteConfig.backend_url"/>
|
||||
</n-form-item>
|
||||
</n-form>
|
||||
</config-card>
|
||||
|
||||
<config-card title="搜索引擎设置与 SEO">
|
||||
<in-dev/>
|
||||
</config-card>
|
||||
</n-flex>
|
||||
</n-tab-pane>
|
||||
|
||||
<n-tab-pane name="permission" tab="权限设置" display-directive="show">
|
||||
<config-card title="用户权限">
|
||||
<in-dev/>
|
||||
</config-card>
|
||||
</n-tab-pane>
|
||||
|
||||
<n-tab-pane name="security" tab="安全设置" display-directive="show">
|
||||
<n-flex vertical>
|
||||
<config-card title="JWT">
|
||||
<n-form>
|
||||
<n-alert type="info" class="in-form-alert">
|
||||
JWT(Json Web Token)签名需要一个密钥,你可以手动提供一个,或者自行生成一个。<br/>
|
||||
修改此密钥会导致所有用户的登录状态丢失(你也会),请一次性设置一个足够安全的。
|
||||
</n-alert>
|
||||
<n-form-item label="JWT 密钥">
|
||||
<n-input v-model:value="siteConfig.jwt_secret_key"/>
|
||||
</n-form-item>
|
||||
</n-form>
|
||||
</config-card>
|
||||
</n-flex>
|
||||
</n-tab-pane>
|
||||
|
||||
<n-tab-pane name="remote_service" tab="外部服务" display-directive="show">
|
||||
<n-flex vertical>
|
||||
<config-card title="邮件 SMTP">
|
||||
<n-form>
|
||||
<n-alert type="info" class="in-form-alert">
|
||||
NayHome 无法自己发送邮件,需要配置 SMTP 服务。<br/>
|
||||
或者你也可以关闭邮件功能,当然芒果还是建议你配置一下的。
|
||||
</n-alert>
|
||||
<n-form-item label="启用邮件功能(SMTP)">
|
||||
<n-switch v-model:value="siteConfig.smtp_enable"/>
|
||||
</n-form-item>
|
||||
<n-form-item label="发件人邮件地址">
|
||||
<n-input v-model:value="siteConfig.smtp_sender"/>
|
||||
</n-form-item>
|
||||
<n-form-item label="SMTP 主机名">
|
||||
<n-input v-model:value="siteConfig.smtp_hostname"/>
|
||||
</n-form-item>
|
||||
<n-form-item label="SMTP 端口">
|
||||
<n-input-number v-model:value="siteConfig.smtp_port"/>
|
||||
</n-form-item>
|
||||
<n-form-item label="SMTP 用户名">
|
||||
<n-input v-model:value="siteConfig.smtp_username"/>
|
||||
</n-form-item>
|
||||
<n-form-item label="SMTP 密码(一般应当是一个独立的应用程序密码)">
|
||||
<n-input v-model:value="siteConfig.smtp_password"/>
|
||||
</n-form-item>
|
||||
<n-form-item label="使用 TLS/SSL 加密">
|
||||
<n-switch v-model:value="siteConfig.smtp_use_tls"/>
|
||||
</n-form-item>
|
||||
</n-form>
|
||||
<template #action>
|
||||
<n-flex vertical>
|
||||
<n-text>你可以在这里测试 NayHome 的邮件系统能否使用上述 SMTP
|
||||
设置工作,这会发送一封测试邮件。
|
||||
</n-text>
|
||||
<n-input v-model:value="testMailTo"/>
|
||||
<n-button secondary type="warning" @click="sendTestMail()">发送测试邮件</n-button>
|
||||
</n-flex>
|
||||
</template>
|
||||
</config-card>
|
||||
</n-flex>
|
||||
</n-tab-pane>
|
||||
</n-tabs>
|
||||
|
||||
<n-empty size="large" v-else description="请尝试手动获取设置..."/>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.in-form-alert {
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,30 @@
|
||||
<script setup lang="ts">
|
||||
import {useNowUser} from "@/stores/now-user.js";
|
||||
import {computed} from "vue";
|
||||
import {useHead} from "@unhead/vue";
|
||||
|
||||
useHead({
|
||||
title: "总览"
|
||||
})
|
||||
|
||||
const NOWUSER = useNowUser()
|
||||
|
||||
const backgroundUrl = computed(() => `url("${NOWUSER.background_url}")`)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="overview"></div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
div.overview {
|
||||
width: 100%;
|
||||
height: 300px;
|
||||
border-radius: 6px;
|
||||
background-color: #ddfbff;
|
||||
background-image: v-bind(backgroundUrl);
|
||||
background-size: cover;
|
||||
background-position: top;
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,187 @@
|
||||
<script setup lang="ts">
|
||||
import { useNowUser } from '@/stores/now-user.js'
|
||||
import { ref, watch } from 'vue'
|
||||
import SelectFileModal from '@/components/file/SelectFileModal.vue'
|
||||
import { api } from '@/tools/web.js'
|
||||
import type { UploadFileDto, UserDto } from '@/types/user.js'
|
||||
import { useHead } from '@unhead/vue'
|
||||
import ChangeEmailModal from '@/components/admin/ChangeEmailModal.vue'
|
||||
|
||||
useHead({
|
||||
title: '用户资料',
|
||||
})
|
||||
|
||||
const NOWUSER = useNowUser()
|
||||
|
||||
const showAvatarModal = ref(false)
|
||||
const showBackgroundModal = ref(false)
|
||||
const files = ref<UploadFileDto[]>([])
|
||||
const avatar_selectFiles = ref<UploadFileDto[]>([])
|
||||
const background_selectFiles = ref<UploadFileDto[]>([])
|
||||
|
||||
const showChangeEmailModal = ref(false)
|
||||
const showChangePhoneModal = ref(false)
|
||||
|
||||
async function loadFiles() {
|
||||
return await api.get('/file/').then((res) => (files.value = res.data as UploadFileDto[]))
|
||||
}
|
||||
|
||||
const infoForm = ref({
|
||||
name: '',
|
||||
display_name: '',
|
||||
avatar_url: '',
|
||||
background_url: '',
|
||||
description: '',
|
||||
})
|
||||
|
||||
function reInitForm() {
|
||||
infoForm.value.name = NOWUSER.name
|
||||
infoForm.value.display_name = NOWUSER.display_name
|
||||
infoForm.value.avatar_url = NOWUSER.avatar_url
|
||||
infoForm.value.background_url = NOWUSER.background_url
|
||||
infoForm.value.description = NOWUSER.description
|
||||
}
|
||||
|
||||
watch(
|
||||
() => avatar_selectFiles.value.at(0)?.download_url,
|
||||
(value) => {
|
||||
if (value) {
|
||||
infoForm.value.avatar_url = value
|
||||
} else {
|
||||
infoForm.value.avatar_url = NOWUSER.avatar_url
|
||||
}
|
||||
},
|
||||
)
|
||||
watch(
|
||||
() => background_selectFiles.value.at(0)?.download_url,
|
||||
(value) => {
|
||||
if (value) {
|
||||
infoForm.value.background_url = value
|
||||
} else {
|
||||
infoForm.value.background_url = NOWUSER.background_url
|
||||
}
|
||||
},
|
||||
)
|
||||
|
||||
watch(
|
||||
() => NOWUSER.isLogin,
|
||||
() => {
|
||||
reInitForm()
|
||||
},
|
||||
{ immediate: true },
|
||||
)
|
||||
|
||||
async function save() {
|
||||
const user = await api
|
||||
.post('/admin/me/', JSON.stringify(infoForm.value))
|
||||
.then((res) => res.data as UserDto)
|
||||
await NOWUSER.loadWithUserInfo(user)
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<n-card>
|
||||
<template #header>
|
||||
<n-h3 prefix="bar" style="margin: 0">用户资料</n-h3>
|
||||
</template>
|
||||
<n-alert type="warning">
|
||||
您需要通过用户名、邮箱和手机号三者之一进行登录,修改之后请牢记新的用户名。
|
||||
</n-alert>
|
||||
<div class="ui-content">
|
||||
<n-form style="width: 450px" label-width="auto" label-placement="left" label-align="right">
|
||||
<n-form-item label="用户名">
|
||||
<n-input v-model:value="infoForm.name" />
|
||||
</n-form-item>
|
||||
<n-form-item label="展示名称">
|
||||
<n-input v-model:value="infoForm.display_name" />
|
||||
</n-form-item>
|
||||
<n-form-item label="头像">
|
||||
<n-flex>
|
||||
<n-avatar v-model:src="infoForm.avatar_url" :size="96" circle />
|
||||
<n-flex vertical>
|
||||
<n-tag type="info">需在「内容-上传」中提前上传图像。</n-tag>
|
||||
<n-tag type="warning">使用方形图像以获得最佳效果。</n-tag>
|
||||
<n-flex>
|
||||
<n-button secondary type="info" @click="showAvatarModal = true">选择</n-button>
|
||||
<n-button
|
||||
secondary
|
||||
type="tertiary"
|
||||
@click="infoForm.avatar_url = NOWUSER.avatar_url"
|
||||
>重置
|
||||
</n-button>
|
||||
</n-flex>
|
||||
</n-flex>
|
||||
</n-flex>
|
||||
</n-form-item>
|
||||
<n-form-item label="个人背景">
|
||||
<n-flex>
|
||||
<n-avatar v-model:src="infoForm.background_url" :size="96" object-fit="cover" />
|
||||
<n-flex vertical>
|
||||
<n-tag type="info">需在「内容-上传」中提前上传图像。</n-tag>
|
||||
<n-flex>
|
||||
<n-button secondary type="info" @click="showBackgroundModal = true">选择</n-button>
|
||||
<n-button
|
||||
secondary
|
||||
type="tertiary"
|
||||
@click="infoForm.background_url = NOWUSER.background_url"
|
||||
>重置
|
||||
</n-button>
|
||||
</n-flex>
|
||||
</n-flex>
|
||||
</n-flex>
|
||||
</n-form-item>
|
||||
<n-form-item label="个人介绍">
|
||||
<n-input
|
||||
v-model:value="infoForm.description"
|
||||
:autosize="{ minRows: 2, maxRows: 5 }"
|
||||
type="textarea"
|
||||
/>
|
||||
</n-form-item>
|
||||
<n-form-item label="邮箱">
|
||||
<n-input v-model:value="NOWUSER.email" disabled />
|
||||
</n-form-item>
|
||||
<n-form-item label="手机号">
|
||||
<n-input v-model:value="NOWUSER.phone" disabled />
|
||||
</n-form-item>
|
||||
</n-form>
|
||||
<n-flex>
|
||||
<n-button class="ui-button" type="primary" @click="save">保存</n-button>
|
||||
<n-button class="ui-button" type="warning" @click="showChangeEmailModal = true"
|
||||
>更改邮箱</n-button
|
||||
>
|
||||
<n-button class="ui-button" type="warning">更改手机号</n-button>
|
||||
<n-button class="ui-button" type="tertiary">重置全部</n-button>
|
||||
</n-flex>
|
||||
</div>
|
||||
|
||||
<select-file-modal
|
||||
:load-files="loadFiles"
|
||||
:max="1"
|
||||
:extensions="['png', 'jpg', 'jpeg']"
|
||||
v-model:show-modal="showAvatarModal"
|
||||
v-model:select-files="avatar_selectFiles"
|
||||
/>
|
||||
<select-file-modal
|
||||
:load-files="loadFiles"
|
||||
:max="1"
|
||||
:extensions="['png', 'jpg', 'jpeg']"
|
||||
v-model:show-modal="showBackgroundModal"
|
||||
v-model:select-files="background_selectFiles"
|
||||
/>
|
||||
<change-email-modal v-model:show-modal="showChangeEmailModal" />
|
||||
</n-card>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
div.ui-content {
|
||||
margin-top: 20px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.ui-button {
|
||||
flex-basis: 100px;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,20 @@
|
||||
<script setup lang="ts">
|
||||
import InDev from "@/components/InDev.vue";
|
||||
import {useHead} from "@unhead/vue";
|
||||
|
||||
useHead({
|
||||
title: "剧本"
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<n-card>
|
||||
<template #header>
|
||||
<n-h3 prefix="bar" style="margin: 0;">个人剧本库</n-h3>
|
||||
</template>
|
||||
|
||||
<in-dev/>
|
||||
</n-card>
|
||||
</template>
|
||||
|
||||
<style scoped></style>
|
||||
@@ -0,0 +1,132 @@
|
||||
<script setup lang="ts">
|
||||
import {useNowUser} from "@/stores/now-user.js";
|
||||
import UserPasswordModal from "@/components/admin/UserPasswordModal.vue";
|
||||
import {h, ref} from "vue";
|
||||
import {api} from "@/tools/web.ts";
|
||||
import {type DataTableColumn, NTag, NText} from "naive-ui";
|
||||
import InDev from "@/components/InDev.vue";
|
||||
import {useHead} from "@unhead/vue";
|
||||
|
||||
useHead({
|
||||
title: "用户安全"
|
||||
})
|
||||
|
||||
const NOWUSER = useNowUser()
|
||||
|
||||
const showPasswordModal = ref(false)
|
||||
|
||||
interface SecureChange {
|
||||
created_at: number;
|
||||
type: "login" | "change_password" | "change_email" | "change_phone"
|
||||
old: string | null
|
||||
new: string | null
|
||||
}
|
||||
|
||||
const secureChanges = ref<SecureChange[]>([])
|
||||
|
||||
const columns = [
|
||||
{
|
||||
title: "记录时间",
|
||||
key: "created_at",
|
||||
render(row) {
|
||||
const date = new Date(row.created_at * 1000)
|
||||
return h(
|
||||
NText,
|
||||
{},
|
||||
{default: () => date.toLocaleString()}
|
||||
)
|
||||
}
|
||||
},
|
||||
{
|
||||
title: "类型",
|
||||
key: "type",
|
||||
render: (row) => {
|
||||
return h(
|
||||
NTag,
|
||||
{
|
||||
type: "info"
|
||||
},
|
||||
{default: () => row.type}
|
||||
)
|
||||
}
|
||||
},
|
||||
{
|
||||
title: "事件之前",
|
||||
key: "old",
|
||||
},
|
||||
{
|
||||
title: "事件之后",
|
||||
key: "new",
|
||||
}
|
||||
] as DataTableColumn<SecureChange>[]
|
||||
|
||||
function loadSecureChanges() {
|
||||
api.get("/admin/me/secure_changes/")
|
||||
.then(res => secureChanges.value = res.data as SecureChange[])
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<n-card>
|
||||
<template #header>
|
||||
<n-h3 prefix="bar" style="margin: 0;">密码</n-h3>
|
||||
</template>
|
||||
|
||||
<n-flex vertical>
|
||||
<n-alert type="warning" v-if="NOWUSER.id === 1">
|
||||
您正在使用 NyaHome 初始化时创建的管理员账号,此账号的默认密码为 admin。
|
||||
<strong>您应该及时修改默认密码。</strong><br/>
|
||||
如果您已修改密码,请忽略。
|
||||
</n-alert>
|
||||
<n-flex>
|
||||
<n-button type="error" @click="showPasswordModal = true">修改密码</n-button>
|
||||
<n-button type="warning">忘记密码</n-button>
|
||||
</n-flex>
|
||||
</n-flex>
|
||||
|
||||
<user-password-modal v-model:show-modal="showPasswordModal"/>
|
||||
</n-card>
|
||||
|
||||
<n-card>
|
||||
<template #header>
|
||||
<n-h3 prefix="bar" style="margin: 0;">其他登录方式</n-h3>
|
||||
</template>
|
||||
|
||||
<n-flex vertical>
|
||||
<n-alert type="info">
|
||||
在这里连接第三方账户之后,可以使用它们进行登录。<br/>
|
||||
<strong>必须先在这里连接后才能使用第三方账户进行登录。</strong>
|
||||
</n-alert>
|
||||
|
||||
<in-dev/>
|
||||
</n-flex>
|
||||
</n-card>
|
||||
|
||||
<n-card>
|
||||
<template #header>
|
||||
<n-h3 prefix="bar" style="margin: 0;">两步验证</n-h3>
|
||||
</template>
|
||||
|
||||
<n-flex vertical>
|
||||
<n-alert type="info">
|
||||
启用两步验证可以更好地保护您的账户,这会强制此账号在登录时进行额外验证。
|
||||
</n-alert>
|
||||
|
||||
<in-dev/>
|
||||
</n-flex>
|
||||
</n-card>
|
||||
|
||||
<n-card>
|
||||
<template #header>
|
||||
<n-h3 prefix="bar" style="margin: 0;">安全事件记录</n-h3>
|
||||
</template>
|
||||
<n-flex vertical>
|
||||
<n-data-table :columns :data="secureChanges"/>
|
||||
<n-button secondary type="warning" @click="loadSecureChanges()">查询(更新)</n-button>
|
||||
</n-flex>
|
||||
</n-card>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,62 @@
|
||||
<script setup lang="ts">
|
||||
import {ref, watch} from "vue";
|
||||
import UploadFileModal from "@/components/file/UploadFileModal.vue";
|
||||
import {api} from "@/tools/web.js";
|
||||
import type {UploadFileDto} from "@/types/user.js";
|
||||
import {useNowUser} from "@/stores/now-user.js";
|
||||
import {uploadFilesCom} from "@/components/file/upload-files.js";
|
||||
import {useHead} from "@unhead/vue";
|
||||
|
||||
useHead({
|
||||
title: "上传"
|
||||
})
|
||||
|
||||
const NOWUSER = useNowUser();
|
||||
|
||||
const showUploadModal = ref(false)
|
||||
|
||||
const files = ref<UploadFileDto[]>([])
|
||||
|
||||
function load() {
|
||||
api.get("/file/")
|
||||
.then(res => {
|
||||
files.value = res.data as UploadFileDto[]
|
||||
})
|
||||
}
|
||||
|
||||
watch(() => NOWUSER.isLogin, () => {
|
||||
load()
|
||||
}, {immediate: true})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<n-card>
|
||||
<template #header>
|
||||
<n-h3 prefix="bar" style="margin: 0;">上传文件</n-h3>
|
||||
</template>
|
||||
|
||||
<n-flex vertical>
|
||||
<n-alert type="info">
|
||||
接受的文件类型:
|
||||
</n-alert>
|
||||
<n-button @click="showUploadModal = true">打开上传向导</n-button>
|
||||
|
||||
<upload-file-modal v-model:show-modal="showUploadModal" :after-leave="() => {load()}"/>
|
||||
</n-flex>
|
||||
</n-card>
|
||||
|
||||
<n-card>
|
||||
<template #header>
|
||||
<n-h3 prefix="bar" style="margin: 0;">个人文件库</n-h3>
|
||||
</template>
|
||||
<template #header-extra>
|
||||
您已经上传的文件都在这里,可以选择性地删除以及重新下载。
|
||||
</template>
|
||||
|
||||
<component :is="uploadFilesCom(files)"/>
|
||||
</n-card>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -1,6 +1,14 @@
|
||||
import {createRouter, createWebHashHistory} from 'vue-router'
|
||||
import ChatroomPage from '@/pages/ChatroomPage.vue'
|
||||
import WelcomePage from '@/pages/WelcomePage.vue'
|
||||
import Chatroom1Page from "@/pages/Chatroom1Page.vue";
|
||||
import AdminPage from "@/pages/AdminPage.vue";
|
||||
import AdminOverview from "@/pages/admin/AdminOverview.vue";
|
||||
import AdminUserInfo from "@/pages/admin/AdminUserInfo.vue";
|
||||
import AdminUserSecurity from "@/pages/admin/AdminUserSecurity.vue";
|
||||
import AdminUserUpload from "@/pages/admin/AdminUserUpload.vue";
|
||||
import AdminNyahome from "@/pages/admin/AdminNyahome.vue";
|
||||
import AdminUserScript from "@/pages/admin/AdminUserScript.vue";
|
||||
|
||||
const router = createRouter({
|
||||
history: createWebHashHistory(import.meta.env.BASE_URL),
|
||||
@@ -10,11 +18,53 @@ const router = createRouter({
|
||||
path: '/',
|
||||
component: WelcomePage,
|
||||
},
|
||||
{
|
||||
name: 'chatroom-1',
|
||||
path: '/chatroom/:id',
|
||||
component: Chatroom1Page,
|
||||
},
|
||||
{
|
||||
name: 'chatroom',
|
||||
path: '/chatroom',
|
||||
component: ChatroomPage,
|
||||
},
|
||||
{
|
||||
name: 'admin',
|
||||
path: '/admin/',
|
||||
component: AdminPage,
|
||||
children: [
|
||||
{
|
||||
name: "admin-overview",
|
||||
path: "",
|
||||
component: AdminOverview,
|
||||
},
|
||||
{
|
||||
name: "admin-user-info",
|
||||
path: "user-info",
|
||||
component: AdminUserInfo,
|
||||
},
|
||||
{
|
||||
name: "admin-user-security",
|
||||
path: "user-security",
|
||||
component: AdminUserSecurity,
|
||||
},
|
||||
{
|
||||
name: "admin-user-upload",
|
||||
path: "user-upload",
|
||||
component: AdminUserUpload,
|
||||
},
|
||||
{
|
||||
name: "admin-user-script",
|
||||
path: "user-script",
|
||||
component: AdminUserScript,
|
||||
},
|
||||
{
|
||||
name: "admin-nyahome",
|
||||
path: "nyahome",
|
||||
component: AdminNyahome,
|
||||
}
|
||||
]
|
||||
},
|
||||
],
|
||||
})
|
||||
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
import { ref, computed } from 'vue'
|
||||
import { defineStore } from 'pinia'
|
||||
|
||||
export const useCounterStore = defineStore('counter', () => {
|
||||
const count = ref(0)
|
||||
const doubleCount = computed(() => count.value * 2)
|
||||
function increment() {
|
||||
count.value++
|
||||
}
|
||||
|
||||
return { count, doubleCount, increment }
|
||||
})
|
||||
@@ -0,0 +1,63 @@
|
||||
import {defineStore} from 'pinia'
|
||||
import {ref} from 'vue'
|
||||
import {api, setApiToken} from '@/tools/web.ts'
|
||||
import type {UserDto} from '@/types/user.ts'
|
||||
|
||||
export const useNowUser = defineStore('now-user', () => {
|
||||
const isLogin = ref(false)
|
||||
|
||||
const id = ref(0)
|
||||
const name = ref('')
|
||||
const display_name = ref('')
|
||||
const email = ref('')
|
||||
const phone = ref('')
|
||||
const avatar_url = ref('')
|
||||
const background_url = ref('')
|
||||
const description = ref('')
|
||||
const is_admin = ref(false)
|
||||
|
||||
async function loadUserInfo(user_id: number, access_token: string) {
|
||||
id.value = user_id
|
||||
setApiToken(access_token)
|
||||
|
||||
let user: UserDto
|
||||
try {
|
||||
user = await api
|
||||
.get('/admin/me/')
|
||||
.then((res) => res.data as UserDto)
|
||||
} catch (err) {
|
||||
console.error(`请求用户信息时失败:${err}`)
|
||||
throw err
|
||||
}
|
||||
|
||||
await loadWithUserInfo(user)
|
||||
}
|
||||
|
||||
async function loadWithUserInfo(user: UserDto) {
|
||||
name.value = user.name
|
||||
display_name.value = user.display_name
|
||||
email.value = user.email
|
||||
phone.value = user.phone
|
||||
avatar_url.value = user.avatar_url
|
||||
background_url.value = user.background_url
|
||||
description.value = user.description
|
||||
is_admin.value = user.is_admin
|
||||
|
||||
isLogin.value = true
|
||||
}
|
||||
|
||||
return {
|
||||
isLogin,
|
||||
id,
|
||||
name,
|
||||
display_name,
|
||||
email,
|
||||
phone,
|
||||
avatar_url,
|
||||
background_url,
|
||||
description,
|
||||
is_admin,
|
||||
loadUserInfo,
|
||||
loadWithUserInfo,
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,3 @@
|
||||
import markdownit from 'markdown-it'
|
||||
|
||||
export const md = markdownit({ html: true, breaks: true })
|
||||
@@ -0,0 +1,21 @@
|
||||
import axios from 'axios'
|
||||
|
||||
export const api = axios.create({
|
||||
baseURL: '/api',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
})
|
||||
|
||||
let authToken: string | null = null
|
||||
|
||||
export function setApiToken(token: string) {
|
||||
authToken = token
|
||||
}
|
||||
|
||||
api.interceptors.request.use((config) => {
|
||||
if (authToken) {
|
||||
config.headers.Authorization = `Bearer ${authToken}`
|
||||
}
|
||||
return config
|
||||
})
|
||||
@@ -0,0 +1,39 @@
|
||||
/**
|
||||
* /api/aii/model 端点返回的模型数据,包含冰冷的 provider id 以及查询得到的温暖的 provider name 和 base url。
|
||||
*
|
||||
* 创建新模型不使用此 interface。
|
||||
*/
|
||||
export interface AiiModelPublic {
|
||||
id: number
|
||||
model_name: string
|
||||
max_context_length: number
|
||||
provider_id: number
|
||||
provider_name: string
|
||||
base_url: string
|
||||
}
|
||||
|
||||
export interface AiiProviderPublic {
|
||||
id: number
|
||||
name: string
|
||||
base_url: string
|
||||
api_key: string
|
||||
}
|
||||
|
||||
export interface AiiProviderPublicWithoutKey {
|
||||
id: number
|
||||
name: string
|
||||
base_url: string
|
||||
}
|
||||
|
||||
export interface AiiTokenInfo {
|
||||
type: 'usage'
|
||||
completion_tokens: number
|
||||
completion_tokens_details: object
|
||||
prompt_tokens: number
|
||||
prompt_tokens_details: object
|
||||
total_tokens: number
|
||||
// DeepSeek
|
||||
prompt_cache_hit_tokens?: number
|
||||
// DeepSeek
|
||||
prompt_cache_miss_tokens?: number
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
export interface ChatroomPublic {
|
||||
id: number
|
||||
name: string
|
||||
description: string
|
||||
feature_image: string
|
||||
|
||||
script_template_id: number
|
||||
script_template_version: string
|
||||
}
|
||||
|
||||
export interface Chatroom extends ChatroomPublic {
|
||||
script: string
|
||||
content: string
|
||||
}
|
||||
|
||||
export interface WordBook {
|
||||
key_word: string
|
||||
message: string
|
||||
}
|
||||
|
||||
export interface ChatScript {
|
||||
main_prompt: string
|
||||
user_prefix: string
|
||||
user_suffix: string
|
||||
world_books: WordBook[]
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
export interface ReturnDto {
|
||||
success: boolean
|
||||
message?: string
|
||||
result?: unknown
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
export const SEE_YOU_TOMORROW = '... . . -.-- --- ..- - --- -- --- .-. .-. --- .--'
|
||||
@@ -0,0 +1,22 @@
|
||||
export interface UserDto {
|
||||
id: number
|
||||
name: string
|
||||
display_name: string
|
||||
avatar_url: string
|
||||
background_url: string
|
||||
description: string
|
||||
|
||||
email: string
|
||||
phone: string
|
||||
|
||||
is_admin: boolean
|
||||
}
|
||||
|
||||
export interface UploadFileDto {
|
||||
id: number
|
||||
original_name: string
|
||||
safe_name: string
|
||||
download_url: string
|
||||
|
||||
uploader_id: number
|
||||
}
|
||||
+13
-3
@@ -9,6 +9,7 @@ import {resolve} from "path";
|
||||
import AutoImport from 'unplugin-auto-import/vite'
|
||||
import {NaiveUiResolver} from 'unplugin-vue-components/resolvers'
|
||||
import Components from 'unplugin-vue-components/vite'
|
||||
import {unheadVueComposablesImports} from "@unhead/vue";
|
||||
|
||||
// 从 package.json 里搞到 WebUI 版本号
|
||||
const pkg = JSON.parse(readFileSync(resolve(__dirname, 'package.json'), 'utf-8'));
|
||||
@@ -29,7 +30,8 @@ export default defineConfig({
|
||||
'useNotification',
|
||||
'useLoadingBar'
|
||||
]
|
||||
}
|
||||
},
|
||||
unheadVueComposablesImports,
|
||||
]
|
||||
}),
|
||||
Components({
|
||||
@@ -55,11 +57,19 @@ export default defineConfig({
|
||||
server: {
|
||||
proxy: {
|
||||
'/api': {
|
||||
target: 'http://localhost:8000',
|
||||
target: 'http://localhost:9000',
|
||||
changeOrigin: true,
|
||||
},
|
||||
'/admin': {
|
||||
target: 'http://localhost:8000',
|
||||
target: 'http://localhost:9000',
|
||||
changeOrigin: true,
|
||||
},
|
||||
'/nyahome': {
|
||||
target: 'http://localhost:9000',
|
||||
changeOrigin: true,
|
||||
},
|
||||
'/download': {
|
||||
target: 'http://localhost:9000',
|
||||
changeOrigin: true,
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user