10 Commits
v1.2.1 ... main

Author SHA1 Message Date
6a327b5d22 [Base] 更新 server.js 输出更详细的信息 2025-06-14 19:50:29 +08:00
a97750a542 更新了项目链接 2025-06-09 17:48:42 +08:00
57bd8409cd [Base] 更新依赖 2025-06-09 17:25:47 +08:00
c4464e1202 增加了一些作品信息展示和更友好的错误界面
All checks were successful
Build / build-and-test (push) Successful in 42s
[BugFix]
增加了错误界面返回链接缺失的换行
修复了不显示作者笔名的陈年老 Bug (我觉得我是不是 SB, 把 pseud 写成 pesud)
2025-06-09 17:20:48 +08:00
eca669d62a [Base] 更新 SSR 机制, 支持流式渲染注入 head 标签
All checks were successful
Build / build-and-test (push) Successful in 28s
损失的 TTFB 可以忽略不计
2025-06-05 18:02:03 +08:00
b1804ae060 [BugFix] 修复章节列表暗色显示问题
All checks were successful
Build / build-and-test (push) Successful in 37s
[Base]
增加 robots.txt
2025-06-03 17:45:33 +08:00
78fe779c93 小优化和 A11Y 调整 2025-05-31 23:50:23 +08:00
3a6d10c2ec 修整了代码, 移除不必要导入, 使代码紧凑
All checks were successful
Build / build-and-test (push) Successful in 29s
[UX]
在路由加载时如果有新的路由请求直接拦截取消 (beforeEach 路由守卫)
2025-05-31 19:11:20 +08:00
7c46970dfe 增加了章节列表的当前章节高亮
All checks were successful
Build / build-and-test (push) Successful in 24s
[BugFix]
修复了搜索页面加载重复的问题
2025-05-28 20:39:22 +08:00
eda629e58d [BugFix] 修复了在非章节化作品时仍判断为章节作品的 BUG
All checks were successful
Build / build-and-test (push) Successful in 26s
2025-05-28 14:39:08 +08:00
30 changed files with 797 additions and 851 deletions

View File

@ -1,9 +1,9 @@
<!doctype html> <!doctype html>
<html> <html lang="zh-CN">
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="icon" type="image/svg" href="/favicon.svg"> <link rel="icon" type="image/svg" href="/favicon.svg" />
<!--app-head--> <!--app-head-->
</head> </head>
<body> <body>

493
package-lock.json generated
View File

@ -8,25 +8,25 @@
"name": "ao3-mirror-ssr", "name": "ao3-mirror-ssr",
"version": "0.0.0", "version": "0.0.0",
"dependencies": { "dependencies": {
"@mdui/icons": "^1.0.2", "@mdui/icons": "^1.0.3",
"@vueuse/core": "^13.3.0", "@vueuse/core": "^13.3.0",
"@vueuse/integrations": "^13.3.0", "@vueuse/integrations": "^13.3.0",
"axios": "^1.9.0", "axios": "^1.9.0",
"compress-json": "^3.1.1", "compress-json": "^3.1.2",
"cookie-parser": "^1.4.7", "cookie-parser": "^1.4.7",
"express": "^5.1.0", "express": "^5.1.0",
"mdui": "^2.1.4", "mdui": "^2.1.4",
"pinia": "^3.0.2", "pinia": "^3.0.3",
"vue": "^3.5.15", "vue": "^3.5.16",
"vue-router": "^4.5.1" "vue-router": "^4.5.1"
}, },
"devDependencies": { "devDependencies": {
"@vitejs/plugin-vue": "^5.2.4", "@vitejs/plugin-vue": "^5.2.4",
"@vitejs/plugin-vue-jsx": "^4.1.2", "@vitejs/plugin-vue-jsx": "^4.2.0",
"cross-env": "^7.0.3", "cross-env": "^7.0.3",
"markdown-it-anchor": "^9.2.0", "markdown-it-anchor": "^9.2.0",
"markdown-it-attrs": "^4.3.1", "markdown-it-attrs": "^4.3.1",
"sass": "^1.89.0", "sass": "^1.89.1",
"vite": "^6.3.5", "vite": "^6.3.5",
"vite-plugin-md": "^0.21.5", "vite-plugin-md": "^0.21.5",
"vite-plugin-vue-devtools": "^7.7.6" "vite-plugin-vue-devtools": "^7.7.6"
@ -55,44 +55,44 @@
} }
}, },
"node_modules/@babel/code-frame": { "node_modules/@babel/code-frame": {
"version": "7.26.2", "version": "7.27.1",
"resolved": "https://registry.npmmirror.com/@babel/code-frame/-/code-frame-7.26.2.tgz", "resolved": "https://registry.npmmirror.com/@babel/code-frame/-/code-frame-7.27.1.tgz",
"integrity": "sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ==", "integrity": "sha512-cjQ7ZlQ0Mv3b47hABuTevyTuYN4i+loJKGeV9flcCgIK37cCXRh+L1bd3iBHlynerhQ7BhCkn2BPbQUL+rGqFg==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@babel/helper-validator-identifier": "^7.25.9", "@babel/helper-validator-identifier": "^7.27.1",
"js-tokens": "^4.0.0", "js-tokens": "^4.0.0",
"picocolors": "^1.0.0" "picocolors": "^1.1.1"
}, },
"engines": { "engines": {
"node": ">=6.9.0" "node": ">=6.9.0"
} }
}, },
"node_modules/@babel/compat-data": { "node_modules/@babel/compat-data": {
"version": "7.26.8", "version": "7.27.5",
"resolved": "https://registry.npmmirror.com/@babel/compat-data/-/compat-data-7.26.8.tgz", "resolved": "https://registry.npmmirror.com/@babel/compat-data/-/compat-data-7.27.5.tgz",
"integrity": "sha512-oH5UPLMWR3L2wEFLnFJ1TZXqHufiTKAiLfqw5zkhS4dKXLJ10yVztfil/twG8EDTA4F/tvVNw9nOl4ZMslB8rQ==", "integrity": "sha512-KiRAp/VoJaWkkte84TvUd9qjdbZAdiqyvMxrGl1N6vzFogKmaLgoM3L1kgtLicp2HP5fBJS8JrZKLVIZGVJAVg==",
"dev": true, "dev": true,
"engines": { "engines": {
"node": ">=6.9.0" "node": ">=6.9.0"
} }
}, },
"node_modules/@babel/core": { "node_modules/@babel/core": {
"version": "7.26.9", "version": "7.27.4",
"resolved": "https://registry.npmmirror.com/@babel/core/-/core-7.26.9.tgz", "resolved": "https://registry.npmmirror.com/@babel/core/-/core-7.27.4.tgz",
"integrity": "sha512-lWBYIrF7qK5+GjY5Uy+/hEgp8OJWOD/rpy74GplYRhEauvbHDeFB8t5hPOZxCZ0Oxf4Cc36tK51/l3ymJysrKw==", "integrity": "sha512-bXYxrXFubeYdvB0NhD/NBB3Qi6aZeV20GOWVI47t2dkecCEoneR4NPVcb7abpXDEvejgrUfFtG6vG/zxAKmg+g==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@ampproject/remapping": "^2.2.0", "@ampproject/remapping": "^2.2.0",
"@babel/code-frame": "^7.26.2", "@babel/code-frame": "^7.27.1",
"@babel/generator": "^7.26.9", "@babel/generator": "^7.27.3",
"@babel/helper-compilation-targets": "^7.26.5", "@babel/helper-compilation-targets": "^7.27.2",
"@babel/helper-module-transforms": "^7.26.0", "@babel/helper-module-transforms": "^7.27.3",
"@babel/helpers": "^7.26.9", "@babel/helpers": "^7.27.4",
"@babel/parser": "^7.26.9", "@babel/parser": "^7.27.4",
"@babel/template": "^7.26.9", "@babel/template": "^7.27.2",
"@babel/traverse": "^7.26.9", "@babel/traverse": "^7.27.4",
"@babel/types": "^7.26.9", "@babel/types": "^7.27.3",
"convert-source-map": "^2.0.0", "convert-source-map": "^2.0.0",
"debug": "^4.1.0", "debug": "^4.1.0",
"gensync": "^1.0.0-beta.2", "gensync": "^1.0.0-beta.2",
@ -131,13 +131,13 @@
"dev": true "dev": true
}, },
"node_modules/@babel/generator": { "node_modules/@babel/generator": {
"version": "7.26.9", "version": "7.27.5",
"resolved": "https://registry.npmmirror.com/@babel/generator/-/generator-7.26.9.tgz", "resolved": "https://registry.npmmirror.com/@babel/generator/-/generator-7.27.5.tgz",
"integrity": "sha512-kEWdzjOAUMW4hAyrzJ0ZaTOu9OmpyDIQicIh0zg0EEcEkYXZb2TjtBhnHi2ViX7PKwZqF4xwqfAm299/QMP3lg==", "integrity": "sha512-ZGhA37l0e/g2s1Cnzdix0O3aLYm66eF8aufiVteOgnwxgnRP8GoyMj7VWsgWnQbVKXyge7hqrFh2K2TQM6t1Hw==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@babel/parser": "^7.26.9", "@babel/parser": "^7.27.5",
"@babel/types": "^7.26.9", "@babel/types": "^7.27.3",
"@jridgewell/gen-mapping": "^0.3.5", "@jridgewell/gen-mapping": "^0.3.5",
"@jridgewell/trace-mapping": "^0.3.25", "@jridgewell/trace-mapping": "^0.3.25",
"jsesc": "^3.0.2" "jsesc": "^3.0.2"
@ -147,25 +147,25 @@
} }
}, },
"node_modules/@babel/helper-annotate-as-pure": { "node_modules/@babel/helper-annotate-as-pure": {
"version": "7.25.9", "version": "7.27.3",
"resolved": "https://registry.npmmirror.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.25.9.tgz", "resolved": "https://registry.npmmirror.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.27.3.tgz",
"integrity": "sha512-gv7320KBUFJz1RnylIg5WWYPRXKZ884AGkYpgpWW02TH66Dl+HaC1t1CKd0z3R4b6hdYEcmrNZHUmfCP+1u3/g==", "integrity": "sha512-fXSwMQqitTGeHLBC08Eq5yXz2m37E4pJX1qAU1+2cNedz/ifv/bVXft90VeSav5nFO61EcNgwr0aJxbyPaWBPg==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@babel/types": "^7.25.9" "@babel/types": "^7.27.3"
}, },
"engines": { "engines": {
"node": ">=6.9.0" "node": ">=6.9.0"
} }
}, },
"node_modules/@babel/helper-compilation-targets": { "node_modules/@babel/helper-compilation-targets": {
"version": "7.26.5", "version": "7.27.2",
"resolved": "https://registry.npmmirror.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.26.5.tgz", "resolved": "https://registry.npmmirror.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.27.2.tgz",
"integrity": "sha512-IXuyn5EkouFJscIDuFF5EsiSolseme1s0CZB+QxVugqJLYmKdxI1VfIBOst0SUu4rnk2Z7kqTwmoO1lp3HIfnA==", "integrity": "sha512-2+1thGUUWWjLTYTHZWK1n8Yga0ijBz1XAhUXcKy81rd5g6yh7hGqMp45v7cadSbEHc9G3OTv45SyneRN3ps4DQ==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@babel/compat-data": "^7.26.5", "@babel/compat-data": "^7.27.2",
"@babel/helper-validator-option": "^7.25.9", "@babel/helper-validator-option": "^7.27.1",
"browserslist": "^4.24.0", "browserslist": "^4.24.0",
"lru-cache": "^5.1.1", "lru-cache": "^5.1.1",
"semver": "^6.3.1" "semver": "^6.3.1"
@ -175,17 +175,17 @@
} }
}, },
"node_modules/@babel/helper-create-class-features-plugin": { "node_modules/@babel/helper-create-class-features-plugin": {
"version": "7.26.9", "version": "7.27.1",
"resolved": "https://registry.npmmirror.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.26.9.tgz", "resolved": "https://registry.npmmirror.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.27.1.tgz",
"integrity": "sha512-ubbUqCofvxPRurw5L8WTsCLSkQiVpov4Qx0WMA+jUN+nXBK8ADPlJO1grkFw5CWKC5+sZSOfuGMdX1aI1iT9Sg==", "integrity": "sha512-QwGAmuvM17btKU5VqXfb+Giw4JcN0hjuufz3DYnpeVDvZLAObloM77bhMXiqry3Iio+Ai4phVRDwl6WU10+r5A==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@babel/helper-annotate-as-pure": "^7.25.9", "@babel/helper-annotate-as-pure": "^7.27.1",
"@babel/helper-member-expression-to-functions": "^7.25.9", "@babel/helper-member-expression-to-functions": "^7.27.1",
"@babel/helper-optimise-call-expression": "^7.25.9", "@babel/helper-optimise-call-expression": "^7.27.1",
"@babel/helper-replace-supers": "^7.26.5", "@babel/helper-replace-supers": "^7.27.1",
"@babel/helper-skip-transparent-expression-wrappers": "^7.25.9", "@babel/helper-skip-transparent-expression-wrappers": "^7.27.1",
"@babel/traverse": "^7.26.9", "@babel/traverse": "^7.27.1",
"semver": "^6.3.1" "semver": "^6.3.1"
}, },
"engines": { "engines": {
@ -196,40 +196,40 @@
} }
}, },
"node_modules/@babel/helper-member-expression-to-functions": { "node_modules/@babel/helper-member-expression-to-functions": {
"version": "7.25.9", "version": "7.27.1",
"resolved": "https://registry.npmmirror.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.25.9.tgz", "resolved": "https://registry.npmmirror.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.27.1.tgz",
"integrity": "sha512-wbfdZ9w5vk0C0oyHqAJbc62+vet5prjj01jjJ8sKn3j9h3MQQlflEdXYvuqRWjHnM12coDEqiC1IRCi0U/EKwQ==", "integrity": "sha512-E5chM8eWjTp/aNoVpcbfM7mLxu9XGLWYise2eBKGQomAk/Mb4XoxyqXTZbuTohbsl8EKqdlMhnDI2CCLfcs9wA==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@babel/traverse": "^7.25.9", "@babel/traverse": "^7.27.1",
"@babel/types": "^7.25.9" "@babel/types": "^7.27.1"
}, },
"engines": { "engines": {
"node": ">=6.9.0" "node": ">=6.9.0"
} }
}, },
"node_modules/@babel/helper-module-imports": { "node_modules/@babel/helper-module-imports": {
"version": "7.25.9", "version": "7.27.1",
"resolved": "https://registry.npmmirror.com/@babel/helper-module-imports/-/helper-module-imports-7.25.9.tgz", "resolved": "https://registry.npmmirror.com/@babel/helper-module-imports/-/helper-module-imports-7.27.1.tgz",
"integrity": "sha512-tnUA4RsrmflIM6W6RFTLFSXITtl0wKjgpnLgXyowocVPrbYrLUXSBXDgTs8BlbmIzIdlBySRQjINYs2BAkiLtw==", "integrity": "sha512-0gSFWUPNXNopqtIPQvlD5WgXYI5GY2kP2cCvoT8kczjbfcfuIljTbcWrulD1CIPIX2gt1wghbDy08yE1p+/r3w==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@babel/traverse": "^7.25.9", "@babel/traverse": "^7.27.1",
"@babel/types": "^7.25.9" "@babel/types": "^7.27.1"
}, },
"engines": { "engines": {
"node": ">=6.9.0" "node": ">=6.9.0"
} }
}, },
"node_modules/@babel/helper-module-transforms": { "node_modules/@babel/helper-module-transforms": {
"version": "7.26.0", "version": "7.27.3",
"resolved": "https://registry.npmmirror.com/@babel/helper-module-transforms/-/helper-module-transforms-7.26.0.tgz", "resolved": "https://registry.npmmirror.com/@babel/helper-module-transforms/-/helper-module-transforms-7.27.3.tgz",
"integrity": "sha512-xO+xu6B5K2czEnQye6BHA7DolFFmS3LB7stHZFaOLb1pAwO1HWLS8fXA+eh0A2yIvltPVmx3eNNDBJA2SLHXFw==", "integrity": "sha512-dSOvYwvyLsWBeIRyOeHXp5vPj5l1I011r52FM1+r1jCERv+aFXYk4whgQccYEGYxK2H3ZAIA8nuPkQ0HaUo3qg==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@babel/helper-module-imports": "^7.25.9", "@babel/helper-module-imports": "^7.27.1",
"@babel/helper-validator-identifier": "^7.25.9", "@babel/helper-validator-identifier": "^7.27.1",
"@babel/traverse": "^7.25.9" "@babel/traverse": "^7.27.3"
}, },
"engines": { "engines": {
"node": ">=6.9.0" "node": ">=6.9.0"
@ -239,35 +239,35 @@
} }
}, },
"node_modules/@babel/helper-optimise-call-expression": { "node_modules/@babel/helper-optimise-call-expression": {
"version": "7.25.9", "version": "7.27.1",
"resolved": "https://registry.npmmirror.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.25.9.tgz", "resolved": "https://registry.npmmirror.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.27.1.tgz",
"integrity": "sha512-FIpuNaz5ow8VyrYcnXQTDRGvV6tTjkNtCK/RYNDXGSLlUD6cBuQTSw43CShGxjvfBTfcUA/r6UhUCbtYqkhcuQ==", "integrity": "sha512-URMGH08NzYFhubNSGJrpUEphGKQwMQYBySzat5cAByY1/YgIRkULnIy3tAMeszlL/so2HbeilYloUmSpd7GdVw==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@babel/types": "^7.25.9" "@babel/types": "^7.27.1"
}, },
"engines": { "engines": {
"node": ">=6.9.0" "node": ">=6.9.0"
} }
}, },
"node_modules/@babel/helper-plugin-utils": { "node_modules/@babel/helper-plugin-utils": {
"version": "7.26.5", "version": "7.27.1",
"resolved": "https://registry.npmmirror.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.26.5.tgz", "resolved": "https://registry.npmmirror.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.27.1.tgz",
"integrity": "sha512-RS+jZcRdZdRFzMyr+wcsaqOmld1/EqTghfaBGQQd/WnRdzdlvSZ//kF7U8VQTxf1ynZ4cjUcYgjVGx13ewNPMg==", "integrity": "sha512-1gn1Up5YXka3YYAHGKpbideQ5Yjf1tDa9qYcgysz+cNCXukyLl6DjPXhD3VRwSb8c0J9tA4b2+rHEZtc6R0tlw==",
"dev": true, "dev": true,
"engines": { "engines": {
"node": ">=6.9.0" "node": ">=6.9.0"
} }
}, },
"node_modules/@babel/helper-replace-supers": { "node_modules/@babel/helper-replace-supers": {
"version": "7.26.5", "version": "7.27.1",
"resolved": "https://registry.npmmirror.com/@babel/helper-replace-supers/-/helper-replace-supers-7.26.5.tgz", "resolved": "https://registry.npmmirror.com/@babel/helper-replace-supers/-/helper-replace-supers-7.27.1.tgz",
"integrity": "sha512-bJ6iIVdYX1YooY2X7w1q6VITt+LnUILtNk7zT78ykuwStx8BauCzxvFqFaHjOpW1bVnSUM1PN1f0p5P21wHxvg==", "integrity": "sha512-7EHz6qDZc8RYS5ElPoShMheWvEgERonFCs7IAonWLLUTXW59DP14bCZt89/GKyreYn8g3S83m21FelHKbeDCKA==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@babel/helper-member-expression-to-functions": "^7.25.9", "@babel/helper-member-expression-to-functions": "^7.27.1",
"@babel/helper-optimise-call-expression": "^7.25.9", "@babel/helper-optimise-call-expression": "^7.27.1",
"@babel/traverse": "^7.26.5" "@babel/traverse": "^7.27.1"
}, },
"engines": { "engines": {
"node": ">=6.9.0" "node": ">=6.9.0"
@ -277,13 +277,13 @@
} }
}, },
"node_modules/@babel/helper-skip-transparent-expression-wrappers": { "node_modules/@babel/helper-skip-transparent-expression-wrappers": {
"version": "7.25.9", "version": "7.27.1",
"resolved": "https://registry.npmmirror.com/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.25.9.tgz", "resolved": "https://registry.npmmirror.com/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.27.1.tgz",
"integrity": "sha512-K4Du3BFa3gvyhzgPcntrkDgZzQaq6uozzcpGbOO1OEJaI+EJdqWIMTLgFgQf6lrfiDFo5FU+BxKepI9RmZqahA==", "integrity": "sha512-Tub4ZKEXqbPjXgWLl2+3JpQAYBJ8+ikpQ2Ocj/q/r0LwE3UhENh7EUabyHjz2kCEsrRY83ew2DQdHluuiDQFzg==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@babel/traverse": "^7.25.9", "@babel/traverse": "^7.27.1",
"@babel/types": "^7.25.9" "@babel/types": "^7.27.1"
}, },
"engines": { "engines": {
"node": ">=6.9.0" "node": ">=6.9.0"
@ -306,31 +306,31 @@
} }
}, },
"node_modules/@babel/helper-validator-option": { "node_modules/@babel/helper-validator-option": {
"version": "7.25.9", "version": "7.27.1",
"resolved": "https://registry.npmmirror.com/@babel/helper-validator-option/-/helper-validator-option-7.25.9.tgz", "resolved": "https://registry.npmmirror.com/@babel/helper-validator-option/-/helper-validator-option-7.27.1.tgz",
"integrity": "sha512-e/zv1co8pp55dNdEcCynfj9X7nyUKUXoUEwfXqaZt0omVOmDe9oOTdKStH4GmAw6zxMFs50ZayuMfHDKlO7Tfw==", "integrity": "sha512-YvjJow9FxbhFFKDSuFnVCe2WxXk1zWc22fFePVNEaWJEu8IrZVlda6N0uHwzZrUM1il7NC9Mlp4MaJYbYd9JSg==",
"dev": true, "dev": true,
"engines": { "engines": {
"node": ">=6.9.0" "node": ">=6.9.0"
} }
}, },
"node_modules/@babel/helpers": { "node_modules/@babel/helpers": {
"version": "7.26.9", "version": "7.27.6",
"resolved": "https://registry.npmmirror.com/@babel/helpers/-/helpers-7.26.9.tgz", "resolved": "https://registry.npmmirror.com/@babel/helpers/-/helpers-7.27.6.tgz",
"integrity": "sha512-Mz/4+y8udxBKdmzt/UjPACs4G3j5SshJJEFFKxlCGPydG4JAHXxjWjAwjd09tf6oINvl1VfMJo+nB7H2YKQ0dA==", "integrity": "sha512-muE8Tt8M22638HU31A3CgfSUciwz1fhATfoVai05aPXGor//CdWDCbnlY1yvBPo07njuVOCNGCSp/GTt12lIug==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@babel/template": "^7.26.9", "@babel/template": "^7.27.2",
"@babel/types": "^7.26.9" "@babel/types": "^7.27.6"
}, },
"engines": { "engines": {
"node": ">=6.9.0" "node": ">=6.9.0"
} }
}, },
"node_modules/@babel/parser": { "node_modules/@babel/parser": {
"version": "7.27.3", "version": "7.27.5",
"resolved": "https://registry.npmmirror.com/@babel/parser/-/parser-7.27.3.tgz", "resolved": "https://registry.npmmirror.com/@babel/parser/-/parser-7.27.5.tgz",
"integrity": "sha512-xyYxRj6+tLNDTWi0KCBcZ9V7yg3/lwL9DWh9Uwh/RIVlIfFidggcgxKX3GCXwCiswwcGRawBKbEg2LG/Y8eJhw==", "integrity": "sha512-OsQd175SxWkGlzbny8J3K8TnnDD0N3lrIUtB92xwyRpzaenGZhxDvxN/JgU00U3CDZNj9tPuDJ5H0WS4Nt3vKg==",
"dependencies": { "dependencies": {
"@babel/types": "^7.27.3" "@babel/types": "^7.27.3"
}, },
@ -416,12 +416,12 @@
} }
}, },
"node_modules/@babel/plugin-syntax-typescript": { "node_modules/@babel/plugin-syntax-typescript": {
"version": "7.25.9", "version": "7.27.1",
"resolved": "https://registry.npmmirror.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.25.9.tgz", "resolved": "https://registry.npmmirror.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.27.1.tgz",
"integrity": "sha512-hjMgRy5hb8uJJjUcdWunWVcoi9bGpJp8p5Ol1229PoN6aytsLwNMgmdftO23wnCLMfVmTwZDWMPNq/D1SY60JQ==", "integrity": "sha512-xfYCBMxveHrRMnAWl1ZlPXOZjzkN82THFvLhQhFXFt81Z5HnN+EtUkZhv/zcKpmT3fzmWZB0ywiBrbC3vogbwQ==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@babel/helper-plugin-utils": "^7.25.9" "@babel/helper-plugin-utils": "^7.27.1"
}, },
"engines": { "engines": {
"node": ">=6.9.0" "node": ">=6.9.0"
@ -431,16 +431,16 @@
} }
}, },
"node_modules/@babel/plugin-transform-typescript": { "node_modules/@babel/plugin-transform-typescript": {
"version": "7.26.8", "version": "7.27.1",
"resolved": "https://registry.npmmirror.com/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.26.8.tgz", "resolved": "https://registry.npmmirror.com/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.27.1.tgz",
"integrity": "sha512-bME5J9AC8ChwA7aEPJ6zym3w7aObZULHhbNLU0bKUhKsAkylkzUdq+0kdymh9rzi8nlNFl2bmldFBCKNJBUpuw==", "integrity": "sha512-Q5sT5+O4QUebHdbwKedFBEwRLb02zJ7r4A5Gg2hUoLuU3FjdMcyqcywqUrLCaDsFCxzokf7u9kuy7qz51YUuAg==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@babel/helper-annotate-as-pure": "^7.25.9", "@babel/helper-annotate-as-pure": "^7.27.1",
"@babel/helper-create-class-features-plugin": "^7.25.9", "@babel/helper-create-class-features-plugin": "^7.27.1",
"@babel/helper-plugin-utils": "^7.26.5", "@babel/helper-plugin-utils": "^7.27.1",
"@babel/helper-skip-transparent-expression-wrappers": "^7.25.9", "@babel/helper-skip-transparent-expression-wrappers": "^7.27.1",
"@babel/plugin-syntax-typescript": "^7.25.9" "@babel/plugin-syntax-typescript": "^7.27.1"
}, },
"engines": { "engines": {
"node": ">=6.9.0" "node": ">=6.9.0"
@ -450,30 +450,30 @@
} }
}, },
"node_modules/@babel/template": { "node_modules/@babel/template": {
"version": "7.26.9", "version": "7.27.2",
"resolved": "https://registry.npmmirror.com/@babel/template/-/template-7.26.9.tgz", "resolved": "https://registry.npmmirror.com/@babel/template/-/template-7.27.2.tgz",
"integrity": "sha512-qyRplbeIpNZhmzOysF/wFMuP9sctmh2cFzRAZOn1YapxBsE1i9bJIY586R/WBLfLcmcBlM8ROBiQURnnNy+zfA==", "integrity": "sha512-LPDZ85aEJyYSd18/DkjNh4/y1ntkE5KwUHWTiqgRxruuZL2F1yuHligVHLvcHY2vMHXttKFpJn6LwfI7cw7ODw==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@babel/code-frame": "^7.26.2", "@babel/code-frame": "^7.27.1",
"@babel/parser": "^7.26.9", "@babel/parser": "^7.27.2",
"@babel/types": "^7.26.9" "@babel/types": "^7.27.1"
}, },
"engines": { "engines": {
"node": ">=6.9.0" "node": ">=6.9.0"
} }
}, },
"node_modules/@babel/traverse": { "node_modules/@babel/traverse": {
"version": "7.26.9", "version": "7.27.4",
"resolved": "https://registry.npmmirror.com/@babel/traverse/-/traverse-7.26.9.tgz", "resolved": "https://registry.npmmirror.com/@babel/traverse/-/traverse-7.27.4.tgz",
"integrity": "sha512-ZYW7L+pL8ahU5fXmNbPF+iZFHCv5scFak7MZ9bwaRPLUhHh7QQEMjZUg0HevihoqCM5iSYHN61EyCoZvqC+bxg==", "integrity": "sha512-oNcu2QbHqts9BtOWJosOVJapWjBDSxGCpFvikNR5TGDYDQf3JwpIoMzIKrvfoti93cLfPJEG4tH9SPVeyCGgdA==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@babel/code-frame": "^7.26.2", "@babel/code-frame": "^7.27.1",
"@babel/generator": "^7.26.9", "@babel/generator": "^7.27.3",
"@babel/parser": "^7.26.9", "@babel/parser": "^7.27.4",
"@babel/template": "^7.26.9", "@babel/template": "^7.27.2",
"@babel/types": "^7.26.9", "@babel/types": "^7.27.3",
"debug": "^4.3.1", "debug": "^4.3.1",
"globals": "^11.1.0" "globals": "^11.1.0"
}, },
@ -505,9 +505,9 @@
"dev": true "dev": true
}, },
"node_modules/@babel/types": { "node_modules/@babel/types": {
"version": "7.27.3", "version": "7.27.6",
"resolved": "https://registry.npmmirror.com/@babel/types/-/types-7.27.3.tgz", "resolved": "https://registry.npmmirror.com/@babel/types/-/types-7.27.6.tgz",
"integrity": "sha512-Y1GkI4ktrtvmawoSq+4FCVHNryea6uR+qUQy0AGxLSsjCX0nVmkYQMBLHDkXZuo5hGx7eYdnIaslsdBFm7zbUw==", "integrity": "sha512-ETyHEk2VHHvl9b9jZP5IHPavHYk57EhanlRRuae9XCpb/j5bDCbPPMOBfCWhnl/7EDJz0jEMCi/RhccCE8r1+Q==",
"dependencies": { "dependencies": {
"@babel/helper-string-parser": "^7.27.1", "@babel/helper-string-parser": "^7.27.1",
"@babel/helper-validator-identifier": "^7.27.1" "@babel/helper-validator-identifier": "^7.27.1"
@ -1022,13 +1022,13 @@
"integrity": "sha512-ztmtTd6xwnuh2/xu+Vb01btgV8SQWYCaK56CkRK8gEkWe5TuDyBcYJ0wgkMRn+2VcE9KUmhvkz+N9GHrqw/C0g==" "integrity": "sha512-ztmtTd6xwnuh2/xu+Vb01btgV8SQWYCaK56CkRK8gEkWe5TuDyBcYJ0wgkMRn+2VcE9KUmhvkz+N9GHrqw/C0g=="
}, },
"node_modules/@mdui/icons": { "node_modules/@mdui/icons": {
"version": "1.0.2", "version": "1.0.3",
"resolved": "https://registry.npmmirror.com/@mdui/icons/-/icons-1.0.2.tgz", "resolved": "https://registry.npmmirror.com/@mdui/icons/-/icons-1.0.3.tgz",
"integrity": "sha512-2Ffhka9dbJIq0wQo+daUjG2CGLRStRE4ngf3Me8PVurQCQEd4QI2Qb9nblACOFoK0/ZYy+u77uYM9yuoDSvxXA==", "integrity": "sha512-Jq9juUqIJMBvIRSTr0qBKiqnlbY5pVUzUP20EHSN8dT7GcqN7bq0AL8MASL5DxKs09kgcERq+z5bHJOkz/VDlA==",
"dependencies": { "dependencies": {
"@mdui/shared": "^1.0.2", "@mdui/shared": "^1.0.8",
"lit": "^3.0.0", "lit": "^3.3.0",
"tslib": "^2.6.2" "tslib": "^2.8.1"
} }
}, },
"node_modules/@mdui/jq": { "node_modules/@mdui/jq": {
@ -1389,6 +1389,12 @@
"integrity": "sha512-8LduaNlMZGwdZ6qWrKlfa+2M4gahzFkprZiAt2TF8uS0qQgBizKXpXURqvTJ4WtmupWxaLqjRb2UCTe72mu+Aw==", "integrity": "sha512-8LduaNlMZGwdZ6qWrKlfa+2M4gahzFkprZiAt2TF8uS0qQgBizKXpXURqvTJ4WtmupWxaLqjRb2UCTe72mu+Aw==",
"dev": true "dev": true
}, },
"node_modules/@rolldown/pluginutils": {
"version": "1.0.0-beta.13",
"resolved": "https://registry.npmmirror.com/@rolldown/pluginutils/-/pluginutils-1.0.0-beta.13.tgz",
"integrity": "sha512-/9TBv7Ir9ojO1mDlTy35X0GSGqvP+aRa44i2fciAK/EEJeimvJyL6eN2Ug2RwXEGFVumgZh231PeykYjo2WBtw==",
"dev": true
},
"node_modules/@rollup/pluginutils": { "node_modules/@rollup/pluginutils": {
"version": "5.1.4", "version": "5.1.4",
"resolved": "https://registry.npmmirror.com/@rollup/pluginutils/-/pluginutils-5.1.4.tgz", "resolved": "https://registry.npmmirror.com/@rollup/pluginutils/-/pluginutils-5.1.4.tgz",
@ -1752,14 +1758,15 @@
} }
}, },
"node_modules/@vitejs/plugin-vue-jsx": { "node_modules/@vitejs/plugin-vue-jsx": {
"version": "4.1.2", "version": "4.2.0",
"resolved": "https://registry.npmmirror.com/@vitejs/plugin-vue-jsx/-/plugin-vue-jsx-4.1.2.tgz", "resolved": "https://registry.npmmirror.com/@vitejs/plugin-vue-jsx/-/plugin-vue-jsx-4.2.0.tgz",
"integrity": "sha512-4Rk0GdE0QCdsIkuMmWeg11gmM4x8UmTnZR/LWPm7QJ7+BsK4tq08udrN0isrrWqz5heFy9HLV/7bOLgFS8hUjA==", "integrity": "sha512-DSTrmrdLp+0LDNF77fqrKfx7X0ErRbOcUAgJL/HbSesqQwoUvUQ4uYQqaex+rovqgGcoPqVk+AwUh3v9CuiYIw==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@babel/core": "^7.26.7", "@babel/core": "^7.27.1",
"@babel/plugin-transform-typescript": "^7.26.7", "@babel/plugin-transform-typescript": "^7.27.1",
"@vue/babel-plugin-jsx": "^1.2.5" "@rolldown/pluginutils": "^1.0.0-beta.9",
"@vue/babel-plugin-jsx": "^1.4.0"
}, },
"engines": { "engines": {
"node": "^18.0.0 || >=20.0.0" "node": "^18.0.0 || >=20.0.0"
@ -1770,27 +1777,26 @@
} }
}, },
"node_modules/@vue/babel-helper-vue-transform-on": { "node_modules/@vue/babel-helper-vue-transform-on": {
"version": "1.2.5", "version": "1.4.0",
"resolved": "https://registry.npmmirror.com/@vue/babel-helper-vue-transform-on/-/babel-helper-vue-transform-on-1.2.5.tgz", "resolved": "https://registry.npmmirror.com/@vue/babel-helper-vue-transform-on/-/babel-helper-vue-transform-on-1.4.0.tgz",
"integrity": "sha512-lOz4t39ZdmU4DJAa2hwPYmKc8EsuGa2U0L9KaZaOJUt0UwQNjNA3AZTq6uEivhOKhhG1Wvy96SvYBoFmCg3uuw==", "integrity": "sha512-mCokbouEQ/ocRce/FpKCRItGo+013tHg7tixg3DUNS+6bmIchPt66012kBMm476vyEIJPafrvOf4E5OYj3shSw==",
"dev": true "dev": true
}, },
"node_modules/@vue/babel-plugin-jsx": { "node_modules/@vue/babel-plugin-jsx": {
"version": "1.2.5", "version": "1.4.0",
"resolved": "https://registry.npmmirror.com/@vue/babel-plugin-jsx/-/babel-plugin-jsx-1.2.5.tgz", "resolved": "https://registry.npmmirror.com/@vue/babel-plugin-jsx/-/babel-plugin-jsx-1.4.0.tgz",
"integrity": "sha512-zTrNmOd4939H9KsRIGmmzn3q2zvv1mjxkYZHgqHZgDrXz5B1Q3WyGEjO2f+JrmKghvl1JIRcvo63LgM1kH5zFg==", "integrity": "sha512-9zAHmwgMWlaN6qRKdrg1uKsBKHvnUU+Py+MOCTuYZBoZsopa90Di10QRjB+YPnVss0BZbG/H5XFwJY1fTxJWhA==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@babel/helper-module-imports": "^7.24.7", "@babel/helper-module-imports": "^7.25.9",
"@babel/helper-plugin-utils": "^7.24.8", "@babel/helper-plugin-utils": "^7.26.5",
"@babel/plugin-syntax-jsx": "^7.24.7", "@babel/plugin-syntax-jsx": "^7.25.9",
"@babel/template": "^7.25.0", "@babel/template": "^7.26.9",
"@babel/traverse": "^7.25.6", "@babel/traverse": "^7.26.9",
"@babel/types": "^7.25.6", "@babel/types": "^7.26.9",
"@vue/babel-helper-vue-transform-on": "1.2.5", "@vue/babel-helper-vue-transform-on": "1.4.0",
"@vue/babel-plugin-resolve-type": "1.2.5", "@vue/babel-plugin-resolve-type": "1.4.0",
"html-tags": "^3.3.1", "@vue/shared": "^3.5.13"
"svg-tags": "^1.0.0"
}, },
"peerDependencies": { "peerDependencies": {
"@babel/core": "^7.0.0-0" "@babel/core": "^7.0.0-0"
@ -1802,52 +1808,55 @@
} }
}, },
"node_modules/@vue/babel-plugin-resolve-type": { "node_modules/@vue/babel-plugin-resolve-type": {
"version": "1.2.5", "version": "1.4.0",
"resolved": "https://registry.npmmirror.com/@vue/babel-plugin-resolve-type/-/babel-plugin-resolve-type-1.2.5.tgz", "resolved": "https://registry.npmmirror.com/@vue/babel-plugin-resolve-type/-/babel-plugin-resolve-type-1.4.0.tgz",
"integrity": "sha512-U/ibkQrf5sx0XXRnUZD1mo5F7PkpKyTbfXM3a3rC4YnUz6crHEz9Jg09jzzL6QYlXNto/9CePdOg/c87O4Nlfg==", "integrity": "sha512-4xqDRRbQQEWHQyjlYSgZsWj44KfiF6D+ktCuXyZ8EnVDYV3pztmXJDf1HveAjUAXxAnR8daCQT51RneWWxtTyQ==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@babel/code-frame": "^7.24.7", "@babel/code-frame": "^7.26.2",
"@babel/helper-module-imports": "^7.24.7", "@babel/helper-module-imports": "^7.25.9",
"@babel/helper-plugin-utils": "^7.24.8", "@babel/helper-plugin-utils": "^7.26.5",
"@babel/parser": "^7.25.6", "@babel/parser": "^7.26.9",
"@vue/compiler-sfc": "^3.5.3" "@vue/compiler-sfc": "^3.5.13"
},
"funding": {
"url": "https://github.com/sponsors/sxzz"
}, },
"peerDependencies": { "peerDependencies": {
"@babel/core": "^7.0.0-0" "@babel/core": "^7.0.0-0"
} }
}, },
"node_modules/@vue/compiler-core": { "node_modules/@vue/compiler-core": {
"version": "3.5.15", "version": "3.5.16",
"resolved": "https://registry.npmmirror.com/@vue/compiler-core/-/compiler-core-3.5.15.tgz", "resolved": "https://registry.npmmirror.com/@vue/compiler-core/-/compiler-core-3.5.16.tgz",
"integrity": "sha512-nGRc6YJg/kxNqbv/7Tg4juirPnjHvuVdhcmDvQWVZXlLHjouq7VsKmV1hIxM/8yKM0VUfwT/Uzc0lO510ltZqw==", "integrity": "sha512-AOQS2eaQOaaZQoL1u+2rCJIKDruNXVBZSiUD3chnUrsoX5ZTQMaCvXlWNIfxBJuU15r1o7+mpo5223KVtIhAgQ==",
"dependencies": { "dependencies": {
"@babel/parser": "^7.27.2", "@babel/parser": "^7.27.2",
"@vue/shared": "3.5.15", "@vue/shared": "3.5.16",
"entities": "^4.5.0", "entities": "^4.5.0",
"estree-walker": "^2.0.2", "estree-walker": "^2.0.2",
"source-map-js": "^1.2.1" "source-map-js": "^1.2.1"
} }
}, },
"node_modules/@vue/compiler-dom": { "node_modules/@vue/compiler-dom": {
"version": "3.5.15", "version": "3.5.16",
"resolved": "https://registry.npmmirror.com/@vue/compiler-dom/-/compiler-dom-3.5.15.tgz", "resolved": "https://registry.npmmirror.com/@vue/compiler-dom/-/compiler-dom-3.5.16.tgz",
"integrity": "sha512-ZelQd9n+O/UCBdL00rlwCrsArSak+YLZpBVuNDio1hN3+wrCshYZEDUO3khSLAzPbF1oQS2duEoMDUHScUlYjA==", "integrity": "sha512-SSJIhBr/teipXiXjmWOVWLnxjNGo65Oj/8wTEQz0nqwQeP75jWZ0n4sF24Zxoht1cuJoWopwj0J0exYwCJ0dCQ==",
"dependencies": { "dependencies": {
"@vue/compiler-core": "3.5.15", "@vue/compiler-core": "3.5.16",
"@vue/shared": "3.5.15" "@vue/shared": "3.5.16"
} }
}, },
"node_modules/@vue/compiler-sfc": { "node_modules/@vue/compiler-sfc": {
"version": "3.5.15", "version": "3.5.16",
"resolved": "https://registry.npmmirror.com/@vue/compiler-sfc/-/compiler-sfc-3.5.15.tgz", "resolved": "https://registry.npmmirror.com/@vue/compiler-sfc/-/compiler-sfc-3.5.16.tgz",
"integrity": "sha512-3zndKbxMsOU6afQWer75Zot/aydjtxNj0T2KLg033rAFaQUn2PGuE32ZRe4iMhflbTcAxL0yEYsRWFxtPro8RQ==", "integrity": "sha512-rQR6VSFNpiinDy/DVUE0vHoIDUF++6p910cgcZoaAUm3POxgNOOdS/xgoll3rNdKYTYPnnbARDCZOyZ+QSe6Pw==",
"dependencies": { "dependencies": {
"@babel/parser": "^7.27.2", "@babel/parser": "^7.27.2",
"@vue/compiler-core": "3.5.15", "@vue/compiler-core": "3.5.16",
"@vue/compiler-dom": "3.5.15", "@vue/compiler-dom": "3.5.16",
"@vue/compiler-ssr": "3.5.15", "@vue/compiler-ssr": "3.5.16",
"@vue/shared": "3.5.15", "@vue/shared": "3.5.16",
"estree-walker": "^2.0.2", "estree-walker": "^2.0.2",
"magic-string": "^0.30.17", "magic-string": "^0.30.17",
"postcss": "^8.5.3", "postcss": "^8.5.3",
@ -1855,12 +1864,12 @@
} }
}, },
"node_modules/@vue/compiler-ssr": { "node_modules/@vue/compiler-ssr": {
"version": "3.5.15", "version": "3.5.16",
"resolved": "https://registry.npmmirror.com/@vue/compiler-ssr/-/compiler-ssr-3.5.15.tgz", "resolved": "https://registry.npmmirror.com/@vue/compiler-ssr/-/compiler-ssr-3.5.16.tgz",
"integrity": "sha512-gShn8zRREZbrXqTtmLSCffgZXDWv8nHc/GhsW+mbwBfNZL5pI96e7IWcIq8XGQe1TLtVbu7EV9gFIVSmfyarPg==", "integrity": "sha512-d2V7kfxbdsjrDSGlJE7my1ZzCXViEcqN6w14DOsDrUCHEA6vbnVCpRFfrc4ryCP/lCKzX2eS1YtnLE/BuC9f/A==",
"dependencies": { "dependencies": {
"@vue/compiler-dom": "3.5.15", "@vue/compiler-dom": "3.5.16",
"@vue/shared": "3.5.15" "@vue/shared": "3.5.16"
} }
}, },
"node_modules/@vue/devtools-api": { "node_modules/@vue/devtools-api": {
@ -1926,49 +1935,49 @@
} }
}, },
"node_modules/@vue/reactivity": { "node_modules/@vue/reactivity": {
"version": "3.5.15", "version": "3.5.16",
"resolved": "https://registry.npmmirror.com/@vue/reactivity/-/reactivity-3.5.15.tgz", "resolved": "https://registry.npmmirror.com/@vue/reactivity/-/reactivity-3.5.16.tgz",
"integrity": "sha512-GaA5VUm30YWobCwpvcs9nvFKf27EdSLKDo2jA0IXzGS344oNpFNbEQ9z+Pp5ESDaxyS8FcH0vFN/XSe95BZtHQ==", "integrity": "sha512-FG5Q5ee/kxhIm1p2bykPpPwqiUBV3kFySsHEQha5BJvjXdZTUfmya7wP7zC39dFuZAcf/PD5S4Lni55vGLMhvA==",
"dependencies": { "dependencies": {
"@vue/shared": "3.5.15" "@vue/shared": "3.5.16"
} }
}, },
"node_modules/@vue/runtime-core": { "node_modules/@vue/runtime-core": {
"version": "3.5.15", "version": "3.5.16",
"resolved": "https://registry.npmmirror.com/@vue/runtime-core/-/runtime-core-3.5.15.tgz", "resolved": "https://registry.npmmirror.com/@vue/runtime-core/-/runtime-core-3.5.16.tgz",
"integrity": "sha512-CZAlIOQ93nj0OPpWWOx4+QDLCMzBNY85IQR4Voe6vIID149yF8g9WQaWnw042f/6JfvLttK7dnyWlC1EVCRK8Q==", "integrity": "sha512-bw5Ykq6+JFHYxrQa7Tjr+VSzw7Dj4ldR/udyBZbq73fCdJmyy5MPIFR9IX/M5Qs+TtTjuyUTCnmK3lWWwpAcFQ==",
"dependencies": { "dependencies": {
"@vue/reactivity": "3.5.15", "@vue/reactivity": "3.5.16",
"@vue/shared": "3.5.15" "@vue/shared": "3.5.16"
} }
}, },
"node_modules/@vue/runtime-dom": { "node_modules/@vue/runtime-dom": {
"version": "3.5.15", "version": "3.5.16",
"resolved": "https://registry.npmmirror.com/@vue/runtime-dom/-/runtime-dom-3.5.15.tgz", "resolved": "https://registry.npmmirror.com/@vue/runtime-dom/-/runtime-dom-3.5.16.tgz",
"integrity": "sha512-wFplHKzKO/v998up2iCW3RN9TNUeDMhdBcNYZgs5LOokHntrB48dyuZHspcahKZczKKh3v6i164gapMPxBTKNw==", "integrity": "sha512-T1qqYJsG2xMGhImRUV9y/RseB9d0eCYZQ4CWca9ztCuiPj/XWNNN+lkNBuzVbia5z4/cgxdL28NoQCvC0Xcfww==",
"dependencies": { "dependencies": {
"@vue/reactivity": "3.5.15", "@vue/reactivity": "3.5.16",
"@vue/runtime-core": "3.5.15", "@vue/runtime-core": "3.5.16",
"@vue/shared": "3.5.15", "@vue/shared": "3.5.16",
"csstype": "^3.1.3" "csstype": "^3.1.3"
} }
}, },
"node_modules/@vue/server-renderer": { "node_modules/@vue/server-renderer": {
"version": "3.5.15", "version": "3.5.16",
"resolved": "https://registry.npmmirror.com/@vue/server-renderer/-/server-renderer-3.5.15.tgz", "resolved": "https://registry.npmmirror.com/@vue/server-renderer/-/server-renderer-3.5.16.tgz",
"integrity": "sha512-Gehc693kVTYkLt6QSYEjGvqvdK2zZ/gf/D5zkgmvBdeB30dNnVZS8yY7+IlBmHRd1rR/zwaqeu06Ij04ZxBscg==", "integrity": "sha512-BrX0qLiv/WugguGsnQUJiYOE0Fe5mZTwi6b7X/ybGB0vfrPH9z0gD/Y6WOR1sGCgX4gc25L1RYS5eYQKDMoNIg==",
"dependencies": { "dependencies": {
"@vue/compiler-ssr": "3.5.15", "@vue/compiler-ssr": "3.5.16",
"@vue/shared": "3.5.15" "@vue/shared": "3.5.16"
}, },
"peerDependencies": { "peerDependencies": {
"vue": "3.5.15" "vue": "3.5.16"
} }
}, },
"node_modules/@vue/shared": { "node_modules/@vue/shared": {
"version": "3.5.15", "version": "3.5.16",
"resolved": "https://registry.npmmirror.com/@vue/shared/-/shared-3.5.15.tgz", "resolved": "https://registry.npmmirror.com/@vue/shared/-/shared-3.5.16.tgz",
"integrity": "sha512-bKvgFJJL1ZX9KxMCTQY6xD9Dhe3nusd1OhyOb1cJYGqvAr0Vg8FIjHPMOEVbJ9GDT9HG+Bjdn4oS8ohKP8EvoA==" "integrity": "sha512-c/0fWy3Jw6Z8L9FmTyYfkpM5zklnqqa9+a6dz3DvONRKW2NEbh46BP0FHuLFSWi2TnQEtp91Z6zOWNrU6QiyPg=="
}, },
"node_modules/@vueuse/core": { "node_modules/@vueuse/core": {
"version": "13.3.0", "version": "13.3.0",
@ -2766,9 +2775,9 @@
} }
}, },
"node_modules/browserslist": { "node_modules/browserslist": {
"version": "4.24.4", "version": "4.25.0",
"resolved": "https://registry.npmmirror.com/browserslist/-/browserslist-4.24.4.tgz", "resolved": "https://registry.npmmirror.com/browserslist/-/browserslist-4.25.0.tgz",
"integrity": "sha512-KDi1Ny1gSePi1vm0q4oxSF8b4DR44GF4BbmS2YdhPLOEqd8pDviZOGH/GsmRwoWJ2+5Lr085X7naowMwKHDG1A==", "integrity": "sha512-PJ8gYKeS5e/whHBh8xrwYK+dAvEj7JXtz6uTucnMRB8OiGTsKccFekoRrjajPBHV8oOY+2tI4uxeceSimKwMFA==",
"dev": true, "dev": true,
"funding": [ "funding": [
{ {
@ -2785,10 +2794,10 @@
} }
], ],
"dependencies": { "dependencies": {
"caniuse-lite": "^1.0.30001688", "caniuse-lite": "^1.0.30001718",
"electron-to-chromium": "^1.5.73", "electron-to-chromium": "^1.5.160",
"node-releases": "^2.0.19", "node-releases": "^2.0.19",
"update-browserslist-db": "^1.1.1" "update-browserslist-db": "^1.1.3"
}, },
"bin": { "bin": {
"browserslist": "cli.js" "browserslist": "cli.js"
@ -2915,9 +2924,9 @@
} }
}, },
"node_modules/caniuse-lite": { "node_modules/caniuse-lite": {
"version": "1.0.30001701", "version": "1.0.30001721",
"resolved": "https://registry.npmmirror.com/caniuse-lite/-/caniuse-lite-1.0.30001701.tgz", "resolved": "https://registry.npmmirror.com/caniuse-lite/-/caniuse-lite-1.0.30001721.tgz",
"integrity": "sha512-faRs/AW3jA9nTwmJBSO1PQ6L/EOgsB5HMQQq4iCu5zhPgVVgO/pZRHlmatwijZKetFw8/Pr4q6dEN8sJuq8qTw==", "integrity": "sha512-cOuvmUVtKrtEaoKiO0rSc29jcjwMwX5tOHDy4MgVFEWiUXj4uBMJkwI8MDySkgXidpMiHUcviogAvFi4pA2hDQ==",
"dev": true, "dev": true,
"funding": [ "funding": [
{ {
@ -3004,9 +3013,9 @@
"peer": true "peer": true
}, },
"node_modules/compress-json": { "node_modules/compress-json": {
"version": "3.1.1", "version": "3.1.2",
"resolved": "https://registry.npmmirror.com/compress-json/-/compress-json-3.1.1.tgz", "resolved": "https://registry.npmmirror.com/compress-json/-/compress-json-3.1.2.tgz",
"integrity": "sha512-PfW4WPGnWXXfcT0mvT9Y92Jsw95aK+eIb+XWXJC45DX2KNYRXeq5kw/FRkkFTHinXm4IwleABsjS5LNHLaxk0Q==" "integrity": "sha512-wj8WsM4qAMdGeNDvtqhm8Npk4JseNi+qx3oV8ez6+J66IaUQgrxC+3Ci59bUDR3hWsW9VA3tHtC2Abid8HigIw=="
}, },
"node_modules/content-disposition": { "node_modules/content-disposition": {
"version": "1.0.0", "version": "1.0.0",
@ -3223,9 +3232,9 @@
"integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow=="
}, },
"node_modules/electron-to-chromium": { "node_modules/electron-to-chromium": {
"version": "1.5.109", "version": "1.5.165",
"resolved": "https://registry.npmmirror.com/electron-to-chromium/-/electron-to-chromium-1.5.109.tgz", "resolved": "https://registry.npmmirror.com/electron-to-chromium/-/electron-to-chromium-1.5.165.tgz",
"integrity": "sha512-AidaH9JETVRr9DIPGfp1kAarm/W6hRJTPuCnkF+2MqhF4KaAgRIcBc8nvjk+YMXZhwfISof/7WG29eS4iGxQLQ==", "integrity": "sha512-naiMx1Z6Nb2TxPU6fiFrUrDTjyPMLdTtaOd2oLmG8zVSg2hCWGkhPyxwk+qRmZ1ytwVqUv0u7ZcDA5+ALhaUtw==",
"dev": true "dev": true
}, },
"node_modules/encodeurl": { "node_modules/encodeurl": {
@ -3858,18 +3867,6 @@
"resolved": "https://registry.npmmirror.com/hookable/-/hookable-5.5.3.tgz", "resolved": "https://registry.npmmirror.com/hookable/-/hookable-5.5.3.tgz",
"integrity": "sha512-Yc+BQe8SvoXH1643Qez1zqLRmbA5rCL+sSmk6TVos0LWVfNIB7PGncdlId77WzLGSIB5KaWgTaNTs2lNVEI6VQ==" "integrity": "sha512-Yc+BQe8SvoXH1643Qez1zqLRmbA5rCL+sSmk6TVos0LWVfNIB7PGncdlId77WzLGSIB5KaWgTaNTs2lNVEI6VQ=="
}, },
"node_modules/html-tags": {
"version": "3.3.1",
"resolved": "https://registry.npmmirror.com/html-tags/-/html-tags-3.3.1.tgz",
"integrity": "sha512-ztqyC3kLto0e9WbNp0aeP+M3kTt+nbaIveGmUxAtZa+8iFgKLUOD4YKM5j+f3QD89bra7UeumolZHKuOXnTmeQ==",
"dev": true,
"engines": {
"node": ">=8"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/http-errors": { "node_modules/http-errors": {
"version": "2.0.0", "version": "2.0.0",
"resolved": "https://registry.npmmirror.com/http-errors/-/http-errors-2.0.0.tgz", "resolved": "https://registry.npmmirror.com/http-errors/-/http-errors-2.0.0.tgz",
@ -4632,9 +4629,9 @@
} }
}, },
"node_modules/pinia": { "node_modules/pinia": {
"version": "3.0.2", "version": "3.0.3",
"resolved": "https://registry.npmmirror.com/pinia/-/pinia-3.0.2.tgz", "resolved": "https://registry.npmmirror.com/pinia/-/pinia-3.0.3.tgz",
"integrity": "sha512-sH2JK3wNY809JOeiiURUR0wehJ9/gd9qFN2Y828jCbxEzKEmEt0pzCXwqiSTfuRsK9vQsOflSdnbdBOGrhtn+g==", "integrity": "sha512-ttXO/InUULUXkMHpTdp9Fj4hLpD/2AoJdmAbAeW2yu1iy1k+pkFekQXw5VpC0/5p51IOR/jDaDRfRWRnMMsGOA==",
"dependencies": { "dependencies": {
"@vue/devtools-api": "^7.7.2" "@vue/devtools-api": "^7.7.2"
}, },
@ -4958,9 +4955,9 @@
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
}, },
"node_modules/sass": { "node_modules/sass": {
"version": "1.89.0", "version": "1.89.1",
"resolved": "https://registry.npmmirror.com/sass/-/sass-1.89.0.tgz", "resolved": "https://registry.npmmirror.com/sass/-/sass-1.89.1.tgz",
"integrity": "sha512-ld+kQU8YTdGNjOLfRWBzewJpU5cwEv/h5yyqlSeJcj6Yh8U4TDA9UA5FPicqDz/xgRPWRSYIQNiFks21TbA9KQ==", "integrity": "sha512-eMLLkl+qz7tx/0cJ9wI+w09GQ2zodTkcE/aVfywwdlRcI3EO19xGnbmJwg/JMIm+5MxVJ6outddLZ4Von4E++Q==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"chokidar": "^4.0.0", "chokidar": "^4.0.0",
@ -5286,12 +5283,6 @@
"node": ">=16" "node": ">=16"
} }
}, },
"node_modules/svg-tags": {
"version": "1.0.0",
"resolved": "https://registry.npmmirror.com/svg-tags/-/svg-tags-1.0.0.tgz",
"integrity": "sha512-ovssysQTa+luh7A5Weu3Rta6FJlFBBbInjOh722LIt6klpU2/HtdUbszju/G4devcvk8PGt7FCLv5wftu3THUA==",
"dev": true
},
"node_modules/terser": { "node_modules/terser": {
"version": "5.39.0", "version": "5.39.0",
"resolved": "https://registry.npmmirror.com/terser/-/terser-5.39.0.tgz", "resolved": "https://registry.npmmirror.com/terser/-/terser-5.39.0.tgz",
@ -6235,15 +6226,15 @@
} }
}, },
"node_modules/vue": { "node_modules/vue": {
"version": "3.5.15", "version": "3.5.16",
"resolved": "https://registry.npmmirror.com/vue/-/vue-3.5.15.tgz", "resolved": "https://registry.npmmirror.com/vue/-/vue-3.5.16.tgz",
"integrity": "sha512-aD9zK4rB43JAMK/5BmS4LdPiEp8Fdh8P1Ve/XNuMF5YRf78fCyPE6FUbQwcaWQ5oZ1R2CD9NKE0FFOVpMR7gEQ==", "integrity": "sha512-rjOV2ecxMd5SiAmof2xzh2WxntRcigkX/He4YFJ6WdRvVUrbt6DxC1Iujh10XLl8xCDRDtGKMeO3D+pRQ1PP9w==",
"dependencies": { "dependencies": {
"@vue/compiler-dom": "3.5.15", "@vue/compiler-dom": "3.5.16",
"@vue/compiler-sfc": "3.5.15", "@vue/compiler-sfc": "3.5.16",
"@vue/runtime-dom": "3.5.15", "@vue/runtime-dom": "3.5.16",
"@vue/server-renderer": "3.5.15", "@vue/server-renderer": "3.5.16",
"@vue/shared": "3.5.15" "@vue/shared": "3.5.16"
}, },
"peerDependencies": { "peerDependencies": {
"typescript": "*" "typescript": "*"

View File

@ -11,25 +11,25 @@
"preview": "cross-env NODE_ENV=production PORT=5174 HOST=:: node server" "preview": "cross-env NODE_ENV=production PORT=5174 HOST=:: node server"
}, },
"dependencies": { "dependencies": {
"@mdui/icons": "^1.0.2", "@mdui/icons": "^1.0.3",
"@vueuse/core": "^13.3.0", "@vueuse/core": "^13.3.0",
"@vueuse/integrations": "^13.3.0", "@vueuse/integrations": "^13.3.0",
"axios": "^1.9.0", "axios": "^1.9.0",
"compress-json": "^3.1.1", "compress-json": "^3.1.2",
"cookie-parser": "^1.4.7", "cookie-parser": "^1.4.7",
"express": "^5.1.0", "express": "^5.1.0",
"mdui": "^2.1.4", "mdui": "^2.1.4",
"pinia": "^3.0.2", "pinia": "^3.0.3",
"vue": "^3.5.15", "vue": "^3.5.16",
"vue-router": "^4.5.1" "vue-router": "^4.5.1"
}, },
"devDependencies": { "devDependencies": {
"@vitejs/plugin-vue": "^5.2.4", "@vitejs/plugin-vue": "^5.2.4",
"@vitejs/plugin-vue-jsx": "^4.1.2", "@vitejs/plugin-vue-jsx": "^4.2.0",
"cross-env": "^7.0.3", "cross-env": "^7.0.3",
"markdown-it-anchor": "^9.2.0", "markdown-it-anchor": "^9.2.0",
"markdown-it-attrs": "^4.3.1", "markdown-it-attrs": "^4.3.1",
"sass": "^1.89.0", "sass": "^1.89.1",
"vite": "^6.3.5", "vite": "^6.3.5",
"vite-plugin-md": "^0.21.5", "vite-plugin-md": "^0.21.5",
"vite-plugin-vue-devtools": "^7.7.6" "vite-plugin-vue-devtools": "^7.7.6"

3
public/robots.txt Normal file
View File

@ -0,0 +1,3 @@
Sitemap: https://ao3.unknownmp.top/sitemap.xml
User-agent: *
Disallow: /assets/

167
server.js
View File

@ -2,17 +2,15 @@ import fs from 'node:fs/promises'
import express from 'express' import express from 'express'
import cookieParser from 'cookie-parser' import cookieParser from 'cookie-parser'
import { compress } from 'compress-json' import { compress } from 'compress-json'
// Constants
const isProduction = process.env.NODE_ENV === 'production' const isProduction = process.env.NODE_ENV === 'production'
const port = process.env.PORT || 5173 const port = process.env.PORT || 5173
const base = process.env.BASE || '/' const base = process.env.BASE || '/'
// Cached production assets
const templateHtml = isProduction const templateHtml = isProduction
? await fs.readFile('./dist/client/index.html', 'utf-8') ? await fs.readFile('./dist/client/index.html', 'utf-8')
: '' : ''
// Create http server
const app = express() const app = express()
app.use(cookieParser()); app.use(cookieParser());
@ -21,73 +19,112 @@ const MESSAGE = {
0: 'Unknown' 0: 'Unknown'
} }
// Add Vite or respective production middlewares
/** @type {import('vite').ViteDevServer | undefined} */
let vite let vite
if (!isProduction) { if (!isProduction) {
const { createServer } = await import('vite') const { createServer } = await import('vite')
vite = await createServer({ vite = await createServer({
server: { middlewareMode: true }, server: { middlewareMode: true },
appType: 'custom', appType: 'custom',
base, base,
}) })
app.use(vite.middlewares) app.use(vite.middlewares)
} else { } else {
//const compression = (await import('compression')).default const sirv = (await import('sirv')).default
const sirv = (await import('sirv')).default app.use(base, sirv('./dist/client', { extensions: [] }))
//app.use(compression())
app.use(base, sirv('./dist/client', { extensions: [] }))
} }
// Serve HTML app.set('trust proxy', true);
app.use('*all', async (req, res) => { app.use('*all', async (req, res) => {
try { try {
const url = req.originalUrl.replace(base, '') const url = req.originalUrl.replace(base, '')
console.log(`Request ${url}`) const ua = req.get('User-Agent');
/** @type {string} */ console.log(`${req.ip} /${url} "${ua}"`)
let template let template
/** @type {import('./src/entry-server.js').render} */ let render, getRoute
let render, getRoute if (!isProduction) {
if (!isProduction) { // Always read fresh template in development
// Always read fresh template in development template = await fs.readFile('./index.html', 'utf-8')
template = await fs.readFile('./index.html', 'utf-8') template = await vite.transformIndexHtml(url, template)
template = await vite.transformIndexHtml(url, template) const module = await vite.ssrLoadModule('/src/entry-server.js')
const module = await vite.ssrLoadModule('/src/entry-server.js') render = module.render
render = module.render getRoute = module.getRoute
getRoute = module.getRoute } else {
} else { template = templateHtml
template = templateHtml const module = await import('./dist/server/entry-server.js')
const module = await import('./dist/server/entry-server.js') render = module.render
render = module.render getRoute = module.getRoute
getRoute = module.getRoute }
} const { router, code, title, metas, meta } = await getRoute(url)
const { router, code } = await getRoute(url) if (code != 200 && !req.accepts('html')) {
if (code != 200 && !req.accepts('html')) { res.status(code).set({ 'Content-Type': 'text/plain' })
res.status(code).set({ 'Content-Type': 'text/plain' }) res.write(MESSAGE[code] || MESSAGE[0])
res.write(MESSAGE[code] || MESSAGE[0]) res.end()
res.end() return
return }
} const { stream, piniaState, headState } = await render(router, req.cookies, req.headers.host)
const { stream, piniaState } = await render(router, req.cookies, req.headers.host) const [htmlStart, htmlEnd] = template.split('<!--app-html-->')
const [htmlStart, htmlEnd] = template.split('<!--app-html-->') if (meta) {
res.status(code).set({ 'Content-Type': 'text/html' }) const buffer = []
res.write(htmlStart) let headReady = false
for await (const chunk of stream) { for await (const chunk of stream) {
if (res.closed) break if (res.closed) break
res.write(chunk) if (headReady) res.write(chunk)
} else {
const piniaStateContent = JSON.stringify(compress(piniaState)) if (headState.ready) {
const stateScript = `<script>window.__PINIA_STATE__=${piniaStateContent}</script>` res.status(headState.code || code).set({ 'Content-Type': 'text/html' })
res.write(htmlEnd.replace('<!--app-state-->', stateScript)) const heads = [`<title>${ headState.title || title }</title>`]
res.end() for (const item of [ ...metas, ...headState.meta ]) {
} catch (e) { const properties = []
vite?.ssrFixStacktrace(e) for (const [key, value] of Object.entries(item)) properties.push(`${key}="${value}"`)
console.log(e.stack) heads.push(`<meta ${properties.join(' ')}>`)
res.status(500).end(e.stack) }
} res.write(htmlStart.replace('<!--app-head-->',heads.join('')))
for (const item of buffer) res.write(item)
res.write(chunk)
headReady = true
} else buffer.push(chunk)
}
}
if (!headState.ready) {
console.warn('Page not set meta ready! No stream render at all!')
const heads = [`<title>${ title }</title>`]
for (const item of metas) {
const properties = []
for (const [key, value] of Object.entries(item)) properties.push(`${key}="${value}"`)
heads.push(`<meta ${properties.join(' ')}>`)
}
res.write(htmlStart.replace('<!--app-head-->',heads.join('')))
for await (const chunk of buffer) {
if (res.closed) break
res.write(chunk)
}
}
} else {
res.status(code).set({ 'Content-Type': 'text/html' })
const heads = [`<title>${ title }</title>`]
for (const item of metas) {
const properties = []
for (const [key, value] of Object.entries(item)) properties.push(`${key}="${value}"`)
heads.push(`<meta ${properties.join(' ')}>`)
}
res.write(htmlStart.replace('<!--app-head-->',heads.join('')))
for await (const chunk of stream) {
if (res.closed) break
res.write(chunk)
}
}
const piniaStateContent = JSON.stringify(compress(piniaState))
const stateScript = `<script>window.__PINIA_STATE__=${piniaStateContent}</script>`
res.write(htmlEnd.replace('<!--app-state-->', stateScript))
res.end()
} catch (e) {
vite?.ssrFixStacktrace(e)
console.log(e.stack)
res.status(500).end(e.stack)
}
}) })
// Start http server
app.listen(port, () => { app.listen(port, () => {
console.log(`Server started at http://localhost:${port}`) console.log(`Server started at port ${port}`)
}) })

View File

@ -1,6 +1,8 @@
<script setup> <script setup>
import { onMounted, onBeforeMount, onServerPrefetch, nextTick, ref, watch } from 'vue' import 'mdui/mdui.css'
import { useRouter, useRoute, RouterView } from 'vue-router' import './main.scss'
import { onMounted, onBeforeMount, nextTick, ref, watch } from 'vue'
import { useApiStore } from '@/stores/api.js' import { useApiStore } from '@/stores/api.js'
@ -22,39 +24,27 @@ import '@mdui/icons/arrow-back.js'
import '@mdui/icons/light-mode.js' import '@mdui/icons/light-mode.js'
import '@mdui/icons/menu.js' import '@mdui/icons/menu.js'
const router = useRouter()
const route = useRoute()
const clientOnlyStore = useClientOnlyStore() const clientOnlyStore = useClientOnlyStore()
const api = useApiStore()
let themeScheme = null
const mobileScreen = useMobileScreen()
const routeStore = useRouteStore() const routeStore = useRouteStore()
const api = useApiStore()
const mobileScreen = useMobileScreen()
let themeScheme = null
const drawerOpen = ref(false) const drawerOpen = ref(false)
const drawer = ref(null) const drawer = ref(null)
const closeDrawer = ref(true) const closeDrawer = ref(true)
let progressTimer = null
onServerPrefetch(async () => {
})
onBeforeMount(() => { onBeforeMount(() => {
themeScheme = useThemeStore()
mobileScreen.reCal() mobileScreen.reCal()
if(!mobileScreen.isMobile) drawerOpen.value = true if(!mobileScreen.isMobile) drawerOpen.value = true
}) })
onMounted(async () => { onMounted(async () => {
themeScheme = useThemeStore()
themeScheme.applyTheme() themeScheme.applyTheme()
clientOnlyStore.setClient() clientOnlyStore.setClient()
new MutationObserver(() => { new MutationObserver(() => { if (document.documentElement.style.width.includes('calc')) document.documentElement.style.width = '' })
if (document.documentElement.style.width.includes('calc')) { .observe(document.documentElement, { attributes: true, attributeFilter: ['style'] });
document.documentElement.style.width = '';
}
}).observe(document.documentElement, { attributes: true, attributeFilter: ['style'] });
watch(() => mobileScreen.isMobile, (newV, oldV) => { watch(() => mobileScreen.isMobile, (newV, oldV) => {
if( oldV && !newV ) nextTick(() => drawer.value.open = true) if( oldV && !newV ) nextTick(() => drawer.value.open = true)
if( !oldV && newV ) nextTick(() => drawer.value.open = false) if( !oldV && newV ) nextTick(() => drawer.value.open = false)
@ -65,12 +55,7 @@ onMounted(async () => {
<template> <template>
<header><ClientOnly> <header><ClientOnly>
<mdui-top-app-bar style="background-color: rgb(var(--mdui-color-primary-container));" scroll-behavior="shrink elevate"> <mdui-top-app-bar style="background-color: rgb(var(--mdui-color-primary-container));" scroll-behavior="shrink elevate">
<mdui-button-icon @click="drawer.open = !drawer.open"> <mdui-button-icon @click="drawer.open = !drawer.open"><mdui-icon-menu></mdui-icon-menu></mdui-button-icon>
<mdui-icon-menu></mdui-icon-menu>
</mdui-button-icon>
<!--<mdui-button-icon @click="$router.back()" v-if="$route.path != '/'">
<mdui-icon-arrow-back></mdui-icon-arrow-back>
</mdui-button-icon>-->
<mdui-top-app-bar-title style="color: rgb(var(--mdui-color-on-surface-variant))">{{ routeStore.title }}</mdui-top-app-bar-title> <mdui-top-app-bar-title style="color: rgb(var(--mdui-color-on-surface-variant))">{{ routeStore.title }}</mdui-top-app-bar-title>
<mdui-circular-progress v-if="routeStore.showProgress" :value='routeStore.progress' :max='routeStore.progressMax'></mdui-circular-progress> <mdui-circular-progress v-if="routeStore.showProgress" :value='routeStore.progress' :max='routeStore.progressMax'></mdui-circular-progress>
<div style="flex-grow: 1"></div> <div style="flex-grow: 1"></div>
@ -98,10 +83,8 @@ onMounted(async () => {
:class="{ 'active-item' : item.path == $route.path }" :class="{ 'active-item' : item.path == $route.path }"
><a :href="item.path">{{ item.name }}</a></li></ul> ><a :href="item.path">{{ item.name }}</a></li></ul>
</template></ClientOnly></nav> </template></ClientOnly></nav>
<main :class="{ 'mdui-prose' : clientOnlyStore.isClient , 'content' : clientOnlyStore.isClient}"> <main :class="{ 'mdui-prose' : clientOnlyStore.isClient , 'content' : clientOnlyStore.isClient }">
<RouterView v-slot="{ Component }"> <RouterView />
<component :is="Component" />
</RouterView>
</main><footer></footer> </main><footer></footer>
</template> </template>

View File

@ -1,42 +0,0 @@
.typescale-body-large {
line-height: var(--mdui-typescale-body-large-line-height);
font-size: var(--mdui-typescale-body-large-size);
letter-spacing: var(--mdui-typescale-body-large-tracking);
font-weight: var(--mdui-typescale-body-large-weight);
}
.typescale-body-small {
line-height: var(--mdui-typescale-body-small-line-height);
font-size: var(--mdui-typescale-body-small-size);
letter-spacing: var(--mdui-typescale-body-small-tracking);
font-weight: var(--mdui-typescale-body-small-weight);
}
.typescale-label-small {
line-height: var(--mdui-typescale-label-small-line-height);
font-size: var(--mdui-typescale-label-small-size);
letter-spacing: var(--mdui-typescale-label-small-tracking);
font-weight: var(--mdui-typescale-label-small-weight);
}
.typescale-headline-small {
line-height: var(--mdui-typescale-headline-small-line-height);
font-size: var(--mdui-typescale-headline-small-size);
letter-spacing: var(--mdui-typescale-headline-small-tracking);
font-weight: var(--mdui-typescale-headline-small-weight);
}
.typescale-headline-large {
line-height: var(--mdui-typescale-headline-large-line-height);
font-size: var(--mdui-typescale-headline-large-size);
letter-spacing: var(--mdui-typescale-headline-large-tracking);
font-weight: var(--mdui-typescale-headline-large-weight);
}
.typescale-headline-medium {
line-height: var(--mdui-typescale-headline-medium-line-height);
font-size: var(--mdui-typescale-headline-medium-size);
letter-spacing: var(--mdui-typescale-headline-medium-tracking);
font-weight: var(--mdui-typescale-headline-medium-weight);
}

View File

@ -20,9 +20,7 @@ function replaceUrl(url) {
} }
export function useApiRequest(method, url, data, config = {}) { export function useApiRequest(method, url, data, config = {}) {
const start = Date.now()
const baseURL = getEndpoint() const baseURL = getEndpoint()
// 若为 GET 请求,将 data 转为查询参数拼接到 URL 上
const fullURL = method === 'GET' && data const fullURL = method === 'GET' && data
? `${baseURL}${url}?${objectToQueryString(data)}` ? `${baseURL}${url}?${objectToQueryString(data)}`
: `${baseURL}${url}` : `${baseURL}${url}`
@ -45,14 +43,14 @@ export function useApiRequest(method, url, data, config = {}) {
} }
) )
const exec = async () => { const exec = async () => {
await execute() const start = Date.now()
try { await execute() }
catch (e) {}
const stop = Date.now() const stop = Date.now()
return { return {
status: response.value?.status || (error.value?.response?.status ?? -1), status: response.value?.status || (error.value?.response?.status ?? -1),
data: response.value?.data || error.value?.response?.data || null, data: response.value?.data || error.value?.response?.data || null,
duration: stop - start, duration: stop - start,
start,
stop,
error: error.value, error: error.value,
isSSR: import.meta.env.SSR, isSSR: import.meta.env.SSR,
} }

View File

@ -1,5 +1,4 @@
import { decompress } from 'compress-json' import { decompress } from 'compress-json'
import './main.scss'
import { createApp } from './main' import { createApp } from './main'
import { createSSRRouter } from './router.js' import { createSSRRouter } from './router.js'
@ -9,15 +8,7 @@ const router = createSSRRouter()
app.use(router) app.use(router)
if (window.__PINIA_STATE__) { if (window.__PINIA_STATE__) pinia.state.value = decompress(window.__PINIA_STATE__)
pinia.state.value = decompress(window.__PINIA_STATE__)
}
if (window.__INITIAL_STATE__) { router.isReady().then(() => app.mount('#app'))
window.__INITIAL_STATE__ = decompress(window.__INITIAL_STATE__)
}
router.isReady().then(() => {
app.mount('#app')
})

View File

@ -1,28 +1,32 @@
import { renderToWebStream } from 'vue/server-renderer' import { renderToWebStream } from 'vue/server-renderer'
import { createApp } from './main' import { createApp } from './main'
import { createSSRRouter } from './router.js' import { createSSRRouter, defaultHead } from './router.js'
export async function getRoute(_url) { export async function getRoute(_url) {
const router = createSSRRouter() const router = createSSRRouter()
await router.push(_url) await router.push(_url)
await router.isReady() await router.isReady()
const route = router.currentRoute.value.matched[0] const route = router.currentRoute.value.matched[0]
const code = route.meta.code || 200 const code = route.meta.code || 200
return { router, code } return { router, code, meta: route.meta.meta || false,
title: route.meta.title || route.meta.name || defaultHead.title,
metas: [...defaultHead.meta, ...route.meta.metas || []]
}
} }
export async function render(router, cookies, host) { export async function render(router, cookies, host) {
const { app, pinia } = createApp() const { app, pinia } = createApp()
app.use(router)
app.use(router) const headState = {
const ctx = { ready: false,
cookies, code: null,
host, title: null,
initialState: {} meta: []
} }
const stream = renderToWebStream(app, ctx) const ctx = { cookies, host, headState }
const piniaState = pinia.state.value const stream = renderToWebStream(app, ctx)
return { stream, piniaState } const piniaState = pinia.state.value
return { stream, piniaState, headState }
} }

View File

@ -1,33 +1,25 @@
@import 'mdui/mdui.css';
// @import './assets/typescale.css';
// 字体配置
$font-family: Roboto, Noto Sans SC, PingFang SC, Lantinghei SC, $font-family: Roboto, Noto Sans SC, PingFang SC, Lantinghei SC,
Microsoft Yahei, Hiragino Sans GB, "Microsoft Sans Serif", Microsoft Yahei, Hiragino Sans GB, "Microsoft Sans Serif",
WenQuanYi Micro Hei, sans-serif; WenQuanYi Micro Hei, sans-serif;
// MDUI 变量简写
$bg-color: rgb(var(--mdui-color-background)); $bg-color: rgb(var(--mdui-color-background));
$error-color: rgb(var(--mdui-color-error)); $error-color: rgb(var(--mdui-color-error));
$on-error-color: rgb(var(--mdui-color-on-error)); $on-error-color: rgb(var(--mdui-color-on-error));
$transition-duration: var(--mdui-motion-duration-short2);
$transition-easing: var(--mdui-motion-easing-linear);
html { html {
scroll-padding-top: 64px; /* 等于顶栏高度 */ scroll-padding-top: 64px;
} }
body { body {
font-family: $font-family; font-family: $font-family;
background-color: $bg-color; background-color: $bg-color;
transition: opacity $transition-duration $transition-easing;
} }
pre { pre {
overflow-x: auto; overflow-x: auto;
overflow-y: hidden; overflow-y: hidden;
} }
// MDUI 组件样式
mdui-card { mdui-card {
width: 100%; width: 100%;
padding: 8px; padding: 8px;
@ -37,7 +29,6 @@ mdui-text-field {
margin: 8px 0; margin: 8px 0;
} }
// 警告样式
.warn { .warn {
background-color: $error-color; background-color: $error-color;
color: $on-error-color; color: $on-error-color;
@ -47,7 +38,6 @@ mdui-text-field {
color: $error-color; color: $error-color;
} }
// 通用工具类
.pre-break { .pre-break {
white-space: pre-line; white-space: pre-line;
} }
@ -55,4 +45,3 @@ mdui-text-field {
.no-select { .no-select {
user-select: none; user-select: none;
} }

View File

@ -1,86 +1,99 @@
import { createMemoryHistory, createWebHistory, createRouter } from 'vue-router' import { createMemoryHistory, createWebHistory, createRouter } from 'vue-router'
export function createSSRRouter() { export const defaultHead = {
const router = createRouter({ title: 'AO3 Mirror',
history: import.meta.env.SSR ? createMemoryHistory() : createWebHistory(), meta: [
scrollBehavior(to, from, savedPosition) { { name: 'description',
if (savedPosition) { content: 'ArchiveOfOurOwn 镜像站, 使用 Vue 3 与 MDUI 2 重写界面, 优化 UI/UX' },
return savedPosition { name: 'author',
} else if (to.hash) { content: 'UnknownMp' },
return { { property: 'og:title',
el: to.hash, content: 'AO3 Mirror' },
behavior: 'smooth', { property: 'og:description',
} content: 'ArchiveOfOurOwn 重构镜像' },
} else { { property: 'og:image',
return { top: 0 } content: 'https://cdn.unknownmp.top/website/ao3mirror.svg' },
} { property: 'og:url',
}, content: 'https://ao3.unknownmp.top' },
routes: [{ { property: 'og:type',
path: '/', content: 'website' },
name: '前言', ]
component: () => import('./views/Root.vue'),
meta: {
title: '首页',
order: 1
},
},{
path: '/work/:id',
name: 'work',
component: () => import('./views/Work.vue'),
meta: {
title: '阅读',
hidden: true
}
},{
path: '/work/:id/:cid',
name: 'workChapter',
component: () => import('./views/Work.vue'),
meta: {
title: '阅读',
hidden: true
}
},{
path: '/search/simple',
name: '搜索',
component: () => import('./views/SimpleSearch.vue'),
meta: {
title: '搜索',
order: 2
}
},{
path: '/settings',
name: '设置',
component: () => import('./views/Settings.vue'),
meta: {
title: '设置',
order: 90
},
},{
path: '/about',
name: '关于',
component: () => import('./views/About.md'),
meta: {
title: '',
order: 100
},
},{
path: '/developer',
name: '开发人员选项',
component: () => import('./views/Developer.vue'),
meta: {
title: '',
hidden: true
},
},{
path: '/:catchAll(.*)',
name: 'NotFound',
component: () => import('./views/fallback/NotFound.vue'),
meta: {
title: '页面未找到',
hidden: true,
code: 404
}
}
]})
return router
} }
export const createSSRRouter = () => createRouter({
history: import.meta.env.SSR ? createMemoryHistory() : createWebHistory(),
scrollBehavior(to, from, savedPosition) {
if (savedPosition) return savedPosition
else if (to.hash) {
return {
el: to.hash,
behavior: 'smooth',
}
} else return { top: 0 }
},
routes: [{
path: '/',
name: '前言',
component: () => import('./views/Root.vue'),
meta: {
title: '首页',
order: 1
},
},{
path: '/work/:id',
name: 'work',
component: () => import('./views/Work.vue'),
meta: {
title: '阅读',
hidden: true,
meta: true
}
},{
path: '/work/:id/:cid',
name: 'workChapter',
component: () => import('./views/Work.vue'),
meta: {
title: '阅读',
hidden: true,
meta: true
}
},{
path: '/search/simple',
name: '搜索',
component: () => import('./views/SimpleSearch.vue'),
meta: {
title: '搜索',
order: 2
}
},{
path: '/settings',
name: '设置',
component: () => import('./views/Settings.vue'),
meta: {
order: 90
},
},{
path: '/about',
name: '关于',
component: () => import('./views/About.md'),
meta: {
order: 100
},
},{
path: '/developer',
name: '开发人员选项',
component: () => import('./views/Developer.vue'),
meta: {
hidden: true
},
},{
path: '/:catchAll(.*)',
name: 'NotFound',
component: () => import('./views/fallback/NotFound.vue'),
meta: {
title: '页面未找到',
hidden: true,
code: 404
}
}
]})

View File

@ -2,11 +2,11 @@
import { useClientOnlyStore } from './clientOnlyStore.js' import { useClientOnlyStore } from './clientOnlyStore.js'
const clientOnlyStore = useClientOnlyStore() const clientOnlyStore = useClientOnlyStore()
</script> </script>
<template data-allow-mismatch> <template>
<template v-if="clientOnlyStore.isClient" data-allow-mismatch> <template v-if="clientOnlyStore.isClient">
<slot></slot> <slot></slot>
</template><template v-else> </template><template v-else>
<slot name="ssr" data-allow-mismatch></slot> <slot name="ssr"></slot>
</template> </template>
</template> </template>

View File

@ -1,25 +0,0 @@
<script setup>
import { ref, onMounted, useSlots } from 'vue'
const isClient = ref(false)
const slots = useSlots()
onMounted(() => {
isClient.value = true
})
/*
USe:
<ClientOnly>
<template #ssr>
SSR Content
</template>
Real Content
</ClientOnly>
*/
</script>
<template data-allow-mismatch>
<template v-if="isClient" data-allow-mismatch><slot></slot></template>
<template v-else><slot name="ssr" data-allow-mismatch></slot></template>
</template>

47
src/ssr/headHelper.js Normal file
View File

@ -0,0 +1,47 @@
import { useSSRContext } from 'vue'
export function useHeadHelper() {
if (!import.meta.env.SSR) {
return {
headReady: () => {},
setMeta: () => {},
addMeta: () => {},
setTitle: () => {},
setCode: () => {},
}
}
const ssrContext = useSSRContext()
if (!ssrContext || !ssrContext.headState) {
return {
headReady: () => {},
setMeta: () => {},
addMeta: () => {},
setTitle: () => {},
setCode: () => {},
}
}
return {
headReady: () => {
ssrContext.headState.ready = true
},
setMeta: (metas = []) => {
ssrContext.headState.meta = [
...ssrContext.headState.meta,
...metas
]
},
addMeta: (meta) => {
ssrContext.headState.meta.push(meta)
},
setTitle: (title) => {
ssrContext.headState.title = title
},
setCode: (code) => {
ssrContext.headState.code = code
}
}
}

View File

@ -1,9 +0,0 @@
export function getInitialState(key) {
if (typeof window !== 'undefined' && window.__INITIAL_STATE__) {
if (window.__INITIAL_STATE__[key] !== undefined) {
let value = window.__INITIAL_STATE__[key]
delete window.__INITIAL_STATE__[key]
return value
}
}
}

View File

@ -1,5 +1,5 @@
import { defineStore } from 'pinia' import { defineStore } from 'pinia'
import { useApiRequest } from '../composables/apiRequest' import { useApiRequest } from '../composables/apiRequest.js'
export const useApiStore = defineStore('api', () => { export const useApiStore = defineStore('api', () => {
async function getWork(workId, chapterId) { async function getWork(workId, chapterId) {

View File

@ -1,6 +1,5 @@
import { defineStore } from 'pinia' import { defineStore } from 'pinia'
import { reactive } from 'vue' import { useStorage } from '@vueuse/core'
import { useStorage, watchWithFilter, debounceFilter } from '@vueuse/core'
const CURRENT_VERSION = 1 const CURRENT_VERSION = 1

View File

@ -2,6 +2,8 @@ import { ref, computed, watch } from 'vue'
import { defineStore } from 'pinia' import { defineStore } from 'pinia'
import { useRouter, useRoute } from 'vue-router' import { useRouter, useRoute } from 'vue-router'
import { useHeadHelper } from '../ssr/headHelper.js'
export const useRouteStore = defineStore('route', () => { export const useRouteStore = defineStore('route', () => {
const router = useRouter() const router = useRouter()
const route = useRoute() const route = useRoute()
@ -16,14 +18,14 @@ export const useRouteStore = defineStore('route', () => {
) )
const lastFromDrawer = ref(0) const lastFromDrawer = ref(0)
const customTitle = ref(null) const customTitle = ref(null)
const title = computed(() => customTitle.value || route.meta.title || route.name) const title = import.meta.env.SSR ?
computed(() => route.meta.title || route.name) :
computed(() => customTitle.value || route.meta.title || route.name)
function drawerPress(target) { function drawerPress(target) {
if (lastFromDrawer.value == 0) { if (lastFromDrawer.value == 0) {
lastFromDrawer.value = 1 lastFromDrawer.value = 1
router.push(target) router.push(target)
} else { } else router.replace(target)
router.replace(target)
}
} }
const progress = ref(0) const progress = ref(0)
const progressMax = ref(1) const progressMax = ref(1)
@ -32,11 +34,9 @@ export const useRouteStore = defineStore('route', () => {
watch(title, title => document.title = title) watch(title, title => document.title = title)
let progressTimer = null let progressTimer = null
router.beforeEach((to, from) => { router.beforeEach((to, from) => {
if (lastFromDrawer.value == 2) { if (showProgress.value) return false
lastFromDrawer.value = 0 if (lastFromDrawer.value == 2) lastFromDrawer.value = 0
} else if (lastFromDrawer.value == 1) { else if (lastFromDrawer.value == 1) lastFromDrawer.value = 2
lastFromDrawer.value = 2
}
progress.value = 0 progress.value = 0
progressMax.value = 1 progressMax.value = 1
showProgress.value = true showProgress.value = true

View File

@ -13,16 +13,15 @@ export const useSimpleSearchState = defineStore('simpleSearch', () => {
const state = ref(null) const state = ref(null)
async function load() { async function load() {
if (pageCount.value && currentPage.value >= pageCount.value){ state.value = 'finish'; return } if (pageCount.value && currentPage.value >= pageCount.value){ state.value = 'finish'; return }
state.value = 'loading'
let res = await api.workSimpleSearch(keyword.value, currentPage.value) let res = await api.workSimpleSearch(keyword.value, currentPage.value)
res = res.data res = res.data
if( pageCount.value ) {
currentPage.value++
if (currentPage.value > pageCount.value) currentPage.value = pageCount.value
}
if (res.code == 0) { if (res.code == 0) {
if ( !pageCount.value ) { currentPage.value++
if( pageCount.value ) {
if (currentPage.value > pageCount.value) currentPage.value = pageCount.value
} else {
pageCount.value = res.pageCount pageCount.value = res.pageCount
currentPage.value = res.page
} }
count.value = res.count count.value = res.count
state.value = import.meta.env.SSR ? 'ssrready' : 'ready' state.value = import.meta.env.SSR ? 'ssrready' : 'ready'

View File

@ -15,6 +15,8 @@ export const useWorkReadState = defineStore('workRead', () => {
const text = ref(null) const text = ref(null)
const state = ref('') const state = ref('')
const publishedTime = ref(null) const publishedTime = ref(null)
const completedTime = ref(null)
const updatedTime = ref(null)
const wordCount = ref(0) const wordCount = ref(0)
const kudoCount = ref(0) const kudoCount = ref(0)
const hitCount = ref(0) const hitCount = ref(0)
@ -32,6 +34,8 @@ export const useWorkReadState = defineStore('workRead', () => {
pseud.value = data.pseud pseud.value = data.pseud
text.value = data.text text.value = data.text
publishedTime.value = data.stats.publishedTime publishedTime.value = data.stats.publishedTime
completedTime.value = data.stats.completedTime
updatedTime.value = data.stats.updatedTime
wordCount.value = data.stats.wordCount wordCount.value = data.stats.wordCount
kudoCount.value = data.stats.kudoCount kudoCount.value = data.stats.kudoCount
hitCount.value = data.stats.hitCount hitCount.value = data.stats.hitCount
@ -62,29 +66,24 @@ export const useWorkReadState = defineStore('workRead', () => {
if (result.status == 200) { if (result.status == 200) {
setData(result.data) setData(result.data)
state.value = 'ready' state.value = 'ready'
} else { } else if (result.status == 404) {
id.value = target
state.value = import.meta.env.SSR ? 'ssrnotfound' : 'notfound' state.value = import.meta.env.SSR ? 'ssrnotfound' : 'notfound'
} else if (result.status == 401) {
state.value = 'unauth'
} else if (result.status == 500) {
state.value = 'error'
} }
} }
return { return {
id, cid, id, cid,
title, title, summary,
summary, pseud, text, state,
pseud,
text,
state,
publishedTime, publishedTime,
wordCount, completedTime,
kudoCount, updatedTime,
hitCount, wordCount, kudoCount, hitCount,
category, category, fandom, lang,
fandom, chapters, chapterIndex, chapterStat,
lang, setData, loadWork
chapters,
chapterIndex,
chapterStat,
setData,
loadWork
} }
}) })

View File

@ -1,9 +1,3 @@
<template>
<form @submit="handleSubmit">
<slot></slot>
</form>
</template>
<script setup> <script setup>
import { ref } from 'vue' import { ref } from 'vue'
@ -18,3 +12,9 @@ function handleSubmit(event) {
} }
</script> </script>
<template>
<form @submit="handleSubmit">
<slot></slot>
</form>
</template>

View File

@ -1,11 +1,7 @@
import { snackbar } from 'mdui/functions/snackbar.js' import { snackbar } from 'mdui/functions/snackbar.js'
import { alert } from 'mdui/functions/alert.js' import { alert } from 'mdui/functions/alert.js'
export function mduiSnackbar(message) { export const mduiSnackbar = (message) => snackbar({ message })
snackbar({
message: message,
})
}
export function mduiAlert(title,desc,callback = null,confirmText = "OK") { export function mduiAlert(title,desc,callback = null,confirmText = "OK") {
alert({ alert({
@ -19,50 +15,44 @@ export function mduiAlert(title,desc,callback = null,confirmText = "OK") {
} }
export function getQueryVariable(variable) { export function getQueryVariable(variable) {
var query = window.location.search.substring(1); var query = window.location.search.substring(1)
var vars = query.split("&") var vars = query.split("&")
for (var i=0;i<vars.length;i++) { for (var i=0;i<vars.length;i++) {
var pair = vars[i].split("=") var pair = vars[i].split("=")
if(pair[0] == variable){return pair[1]} if(pair[0] == variable){return pair[1]}
} }
return(null); return null
} }
export const escapeHtml = (text) => export const escapeHtml = (text) => text
text .replace(/&/g, "&amp;") // 转义 &
.replace(/&/g, "&amp;") // 转义 & .replace(/</g, "&lt;") // 转义 <
.replace(/</g, "&lt;") // 转义 < .replace(/>/g, "&gt;") // 转义 >
.replace(/>/g, "&gt;") // 转义 > .replace(/"/g, "&quot;") // 转义 "
.replace(/"/g, "&quot;") // 转义 " .replace(/'/g, "&#39;"); // 转义 '
.replace(/'/g, "&#39;"); // 转义 '
export function escapeAndFormatText(input) { export const escapeAndFormatText = (text) => escapeHtml(text)
let escapedText = escapeHtml(input); .replace(/ /g, "&nbsp;")
escapedText = escapedText.replace(/ /g, "&nbsp;"); .replace(/\t/g, "&emsp;&emsp;")
escapedText = escapedText.replace(/\t/g, "&emsp;&emsp;"); .replace(/\n/g, "<br/>")
escapedText = escapedText.replace(/\n/g, "<br/>");
return escapedText;
}
export function getCookie(name) { export function getCookie(name) {
const cookieArr = document.cookie.split(";") const cookieArr = document.cookie.split(";")
for (let i = 0; i < cookieArr.length; i++) { for (let i = 0; i < cookieArr.length; i++) {
const cookiePair = cookieArr[i].trim() const cookiePair = cookieArr[i].trim()
if (cookiePair.startsWith(name + "=")) { if (cookiePair.startsWith(name + "=")) return cookiePair.substring(name.length + 1)
return cookiePair.substring(name.length + 1); }
} return null
}
return null;
} }
export function setCookie(name, value, days = 3650) { export function setCookie(name, value, days = 3650) {
var expires = "" var expires = ""
if (days) { if (days) {
var date = new Date() var date = new Date()
date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000)); date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000))
expires = "; expires=" + date.toUTCString() expires = "; expires=" + date.toUTCString()
} }
document.cookie = name + "=" + value + expires + "; path=/"; document.cookie = name + "=" + value + expires + "; path=/"
} }
export function objectToQueryString(obj, parentKey = '') { export function objectToQueryString(obj, parentKey = '') {
@ -71,42 +61,37 @@ export function objectToQueryString(obj, parentKey = '') {
if (!Object.prototype.hasOwnProperty.call(obj, key)) continue if (!Object.prototype.hasOwnProperty.call(obj, key)) continue
let value = obj[key] let value = obj[key]
let newKey = parentKey ? `${parentKey}[${key}]` : key let newKey = parentKey ? `${parentKey}[${key}]` : key
if (typeof value === 'object' && value !== null) { if (typeof value === 'object' && value !== null) parts.push(objectToQueryString(value, newKey))
parts.push(objectToQueryString(value, newKey)) else parts.push(encodeURIComponent(newKey) + '=' + encodeURIComponent(value))
} else {
parts.push(encodeURIComponent(newKey) + '=' + encodeURIComponent(value))
}
} }
return parts.join('&') return parts.join('&')
} }
export function formatUnixTimestamp(unixTimestamp, timeZone) { export function formatUnixTimestamp(unixTimestamp, timeZone) {
const date = new Date(unixTimestamp * 1000); // 将 UNIX 时间戳转换为毫秒 const date = new Date(unixTimestamp * 1000)
const options = { const options = {
timeZone: timeZone || Intl.DateTimeFormat().resolvedOptions().timeZone, // 使用指定时区或浏览器本地时区 timeZone: timeZone || Intl.DateTimeFormat().resolvedOptions().timeZone,
year: 'numeric', year: 'numeric',
month: '2-digit', month: '2-digit',
day: '2-digit', day: '2-digit',
hour: '2-digit', hour: '2-digit',
minute: '2-digit', minute: '2-digit',
second: '2-digit', second: '2-digit',
hour12: false, // 24小时制 hour12: false,
}; }
const formatter = new Intl.DateTimeFormat('en-US', options); const formatter = new Intl.DateTimeFormat('en-US', options)
const parts = formatter.formatToParts(date); const parts = formatter.formatToParts(date)
const formatMap = {}; const formatMap = {}
parts.forEach(({ type, value }) => { parts.forEach(({ type, value }) => { formatMap[type] = value })
formatMap[type] = value; return `${formatMap.year}-${formatMap.month}-${formatMap.day} ${formatMap.hour}:${formatMap.minute}:${formatMap.second}`
});
return `${formatMap.year}-${formatMap.month}-${formatMap.day} ${formatMap.hour}:${formatMap.minute}:${formatMap.second}`;
} }
export function isMobileDeviceByUA() { export function isMobileDeviceByUA() {
const ua = navigator.userAgent || navigator.vendor || window.opera; const ua = navigator.userAgent || navigator.vendor || window.opera
return /android/i.test(ua) || return /android/i.test(ua) ||
/iphone/i.test(ua) || /iphone/i.test(ua) ||
/ipod/i.test(ua) || /ipod/i.test(ua) ||
/ipad/i.test(ua) || /ipad/i.test(ua) ||
/blackberry/i.test(ua) || /blackberry/i.test(ua) ||
/windows phone/i.test(ua); /windows phone/i.test(ua)
} }

View File

@ -21,17 +21,18 @@ onUnmounted(() => console.log('Unmounted'))*/
--- ---
一个 AO3 镜像站, 优化了 UI/UX 一个 AO3 镜像站, 优化了 UI/UX
作者 (1) 作者 {#contact}
--- ---
- [UnknownMp](https://www.unknownmp.top) - [UnknownMp](https://www.unknownmp.top)
邮件: unknownmp@unknownmp.top
<mdui-avatar src="https://cdn.unknownmp.top/website/logo.jpg"></mdui-avatar> <mdui-avatar src="https://cdn.unknownmp.top/website/logo.jpg"></mdui-avatar>
--- ---
源代码 源代码
--- ---
- 前端 Vue3 + Vite 6 (SSR) + MDUI 2 [Gitea](https://git.unknownmp.top/default/ao3-mirror-ssr) - 前端 Vue3 + Vite 6 (SSR) + MDUI 2 [Gitea](https://git.unknownmp.top/AO3-Mirror/ao3-mirror-ssr)
- 后端 FastAPI + HttpX + LXML *(暂无仓库)* - 后端 FastAPI + HttpX + LXML [Gitea](https://git.unknownmp.top/AO3-Mirror/ao3-mirror-api)
组件库与工具链 组件库与工具链
--- ---
@ -49,7 +50,7 @@ onUnmounted(() => console.log('Unmounted'))*/
### 书签 {#deprecated-feature-bookmark} ### 书签 {#deprecated-feature-bookmark}
因为底层 IndexedDB 更新困难和作品段落解析困难问题, 所以在 [**v1.0.7**](https://git.unknownmp.top/default/ao3-mirror-ssr/releases/tag/v1.0.7) 以后的版本废弃了书签机制 因为底层 IndexedDB 更新困难和作品段落解析困难问题, 所以在 [**v1.0.7**](https://git.unknownmp.top/AO3-Mirror/ao3-mirror-ssr/releases/tag/v1.0.7) 以后的版本废弃了书签机制
--- ---

View File

@ -1,11 +1,9 @@
<script setup> <script setup>
import { ref, onMounted } from 'vue' import { ref, onMounted } from 'vue'
import { useRouter } from 'vue-router'
import { useApiStore } from '@/stores/api.js' import { useApiStore } from '@/stores/api.js'
import { useRouteStore } from '../stores/route.js' import { useRouteStore } from '../stores/route.js'
const router = useRouter()
const api = useApiStore() const api = useApiStore()
const routeStore = useRouteStore() const routeStore = useRouteStore()
@ -30,45 +28,33 @@ onMounted(() => {
}) })
</script> </script>
<template> <template>
<h1 class="warn-text">注意本页面仅为测试用!</h1> <h1 class="warn-text">注意本页面仅为测试用!</h1>
<blockquote> <blockquote>
当然如果你是乱点那个唐鬼小人进来的, 这就是个彩蛋? (神金 当然如果你是乱点那个唐鬼小人进来的, 这就是个彩蛋? (神金
</blockquote> </blockquote><Hr />
<Hr />
<section> <section>
<h2>页面信息</h2> <h2>页面信息</h2>
<h3>可见路由信息:</h3> <h3>可见路由信息:</h3>
<pre>{{ routeStore.allRoutes }}</pre> <pre>{{ routeStore.allRoutes }}</pre>
</section> </section><Hr />
<Hr /> <ClientOnly><section>
<ClientOnly> <h2>浏览器信息</h2><dl>
<section> <dt>User-Agent:</dt>
<h2>浏览器信息</h2> <dd>{{ ua }}</dd>
<dl> <dt>语言:</dt>
<dt>User-Agent:</dt> <dd>{{ language }}</dd>
<dd>{{ ua }}</dd> <dt>平台:</dt>
<dt>语言:</dt> <dd>{{ platform }}</dd>
<dd>{{ language }}</dd> <dt>屏幕尺寸:</dt>
<dt>平台:</dt> <dd>{{ screenSize }}</dd>
<dd>{{ platform }}</dd> <dt>视口尺寸:</dt>
<dt>屏幕尺寸:</dt> <dd>{{ viewportSize }}</dd>
<dd>{{ screenSize }}</dd> <dt>像素比:</dt>
<dt>视口尺寸:</dt> <dd>{{ pixelRatio }}</dd>
<dd>{{ viewportSize }}</dd> <dt>是否触屏设备:</dt>
<dt>像素比:</dt> <dd>{{ touchSupport ? '是' : '否' }}</dd>
<dd>{{ pixelRatio }}</dd> <dt>页面可见性状态:</dt>
<dt>是否触屏设备:</dt> <dd>{{ visibility }}</dd>
<dd>{{ touchSupport ? '是' : '否' }}</dd> </dl></section><Hr /></ClientOnly>
<dt>页面可见性状态:</dt>
<dd>{{ visibility }}</dd>
</dl>
</section>
<Hr />
</ClientOnly>
</template> </template>
<style scoped>
</style>

View File

@ -1,24 +0,0 @@
<script setup>
import { ref, onMounted, onServerPrefetch, onBeforeMount} from 'vue'
import { useRouter, useRoute, RouterView } from 'vue-router'
const router = useRouter()
import { useApiStore } from '@/stores/api.js'
const api = useApiStore()
onServerPrefetch(async () => {
// Load data
})
onBeforeMount(() => {
// Re apply data
})
onMounted(() => {
// Render other
})
</script>
<template>
Padding! No content cause hydration mismatch!
</template>
<style scoped>
</style>

View File

@ -10,29 +10,23 @@ import Intro from '../texts/intro.md'
const router = useRouter() const router = useRouter()
function convert(from) { function convert(from) {
if( Number(from) ) { if( Number(from) ) {return {
return { type: 's',
type: 's', id: Number(from)
id: Number(from) }} else if (from.includes('https://archiveofourown.org/works/')) {
}
} else if (from.includes('https://archiveofourown.org/works/')) {
const sid = from.split('https://archiveofourown.org/works/')[1]; const sid = from.split('https://archiveofourown.org/works/')[1];
if ( sid ) { if ( sid ) {
const id = Number(sid) const id = Number(sid)
if (id) { if (id) { return {
return { type: 's',
type: 's', id
id }} else {
}
} else {
const splited = sid.split('/chapters/') const splited = sid.split('/chapters/')
const id = Number(splited[0]) const id = Number(splited[0])
const cid = Number(splited[1]) const cid = Number(splited[1])
if (id && cid) { if (id && cid) return {
return { type: 'c',
type: 'c', id, cid
id, cid
}
} }
} }
} }
@ -42,22 +36,19 @@ function convert(from) {
function onConvert(data) { function onConvert(data) {
const { type, id, cid, key } = convert(data.src) const { type, id, cid, key } = convert(data.src)
if (type == null) { if (type == null) return
} else if ( type == 'f') { else if ( type == 'f') router.push(`/search/simple?keyword=${encodeURIComponent(key)}`)
router.push(`/search/simple?keyword=${encodeURIComponent(key)}`) else {
} else {
if (cid) router.push(`/work/${id}/${cid}`) if (cid) router.push(`/work/${id}/${cid}`)
else router.push(`/work/${id}`) else router.push(`/work/${id}`)
} }
} }
</script> </script>
<template> <template>
<img style="display: block; margin: 0px auto 10px;" height="200px" alt="logo" src="/favicon.svg" /> <img style="display: block; margin: 0px auto 10px;" height="200px" width="200px" alt="logo" src="/favicon.svg" />
<h1>欢迎来到 AO3 Mirror! 👋👋</h1> <h1>欢迎来到 AO3 Mirror! 👋👋</h1>
<p>一个基于重构渲染的 AO3 镜像站</p> <p>一个基于重构渲染的 AO3 镜像站</p><Hr />
<Hr />
<section id="converter"> <section id="converter">
<h2>链接转换</h2> <h2>链接转换</h2>
<p>AO3 链接 关键词搜索</p> <p>AO3 链接 关键词搜索</p>
@ -67,13 +58,11 @@ function onConvert(data) {
<div style="display: flex"> <div style="display: flex">
<div style="flex-grow: 1"></div> <div style="flex-grow: 1"></div>
<mdui-button type="submit">-></mdui-button> <mdui-button type="submit">-></mdui-button>
</div> </div><template #ssr>
<template #ssr> <input type="text" id="src" name="src" />
<input type="text" id="src" name="src" /> <input type="submit" />
<input type="submit" />
</template></ClientOnly></Form> </template></ClientOnly></Form>
</section> </section><Hr/>
<Hr/>
<Intro /> <Intro />
</template> </template>

View File

@ -11,25 +11,21 @@ let appSetting = null
onBeforeMount(() => { onBeforeMount(() => {
appSetting = useAppSettingStore() appSetting = useAppSettingStore()
}) })
</script> </script>
<template> <template>
<h1>设置</h1> <h1>设置</h1><Hr />
<Hr /> <ClientOnly><div class="settings"><section><mdui-card>
<ClientOnly><div class="settings"> <h2>界面</h2><Hr />
<section><mdui-card> <div>自动黑暗模式<div style="flex: 1;"/>
<h2>界面</h2><Hr /> <mdui-switch :checked="appSetting.value.autoTheme"
<div>自动黑暗模式<div style="flex: 1;"/> @change="e => appSetting.value.autoTheme = e.target.checked">
<mdui-switch :checked="appSetting.value.autoTheme" </mdui-switch></div>
@change="e => appSetting.value.autoTheme = e.target.checked"> <div v-if="!appSetting.value.autoTheme">默认黑暗模式<div style="flex: 1;"/>
</mdui-switch></div> <mdui-switch :checked="appSetting.value.darkTheme"
<div v-if="!appSetting.value.autoTheme">默认黑暗模式<div style="flex: 1;"/> @change="e => appSetting.value.darkTheme = e.target.checked">
<mdui-switch :checked="appSetting.value.darkTheme" </mdui-switch></div>
@change="e => appSetting.value.darkTheme = e.target.checked"> </mdui-card></section></div></ClientOnly>
</mdui-switch></div>
</mdui-card></section>
</div></ClientOnly>
</template> </template>
<style scoped> <style scoped>

View File

@ -1,5 +1,5 @@
<script setup> <script setup>
import { ref, watch, onMounted, nextTick, onServerPrefetch, onBeforeUnmount } from 'vue' import { ref, watch, onMounted, nextTick, onServerPrefetch, onBeforeUnmount } from 'vue'
import { useRoute, useRouter } from 'vue-router' import { useRoute, useRouter } from 'vue-router'
import 'mdui/components/text-field.js' import 'mdui/components/text-field.js'
@ -26,11 +26,7 @@ const stateLabel = {
let isObserver = null let isObserver = null
onServerPrefetch(async () => { onServerPrefetch(async () => { if (route.query.keyword) await simpleSearchState.start(route.query.keyword) })
if (route.query.keyword) {
await simpleSearchState.start(route.query.keyword)
}
})
onMounted(async () => { onMounted(async () => {
watch(() => simpleSearchState.keyword, () => document.title = simpleSearchState.keyword) watch(() => simpleSearchState.keyword, () => document.title = simpleSearchState.keyword)
@ -38,18 +34,14 @@ onMounted(async () => {
if (inputField.value && simpleSearchState != 'ssrready') simpleSearchState.start(inputField.value) if (inputField.value && simpleSearchState != 'ssrready') simpleSearchState.start(inputField.value)
isObserver = new IntersectionObserver((entries) => { isObserver = new IntersectionObserver((entries) => {
entries.forEach((entry) => { entries.forEach((entry) => {
if (entry.isIntersecting) { if (entry.isIntersecting) if (simpleSearchState.state == 'ready' || simpleSearchState.state == 'ssrready') setTimeout(simpleSearchState.load,400)
if (simpleSearchState.state == 'ready') simpleSearchState.load()
}
}) })
}, { threshold: 1 }) }, { threshold: 1 })
await nextTick() await nextTick()
isObserver.observe(label.value) isObserver.observe(label.value)
}) })
onBeforeUnmount(() => { onBeforeUnmount(() => isObserver.disconnect())
isObserver.disconnect();
})
function onSubmit(data) { function onSubmit(data) {
if (simpleSearchState) { if (simpleSearchState) {
@ -57,7 +49,6 @@ function onSubmit(data) {
router.replace(`/search/simple?keyword=${encodeURIComponent(data.src)}`) router.replace(`/search/simple?keyword=${encodeURIComponent(data.src)}`)
} }
} }
</script> </script>
<template> <template>
@ -79,14 +70,12 @@ function onSubmit(data) {
<template v-if="simpleSearchState.result" v-for="work in simpleSearchState.result" :key="work.workId"> <template v-if="simpleSearchState.result" v-for="work in simpleSearchState.result" :key="work.workId">
<ClientOnly><mdui-card style="margin: 8px 0px;"><article> <ClientOnly><mdui-card style="margin: 8px 0px;"><article>
<router-link :to="`/work/${work.workId}`"><h3>{{ work.title }}</h3></router-link> <router-link :to="`/work/${work.workId}`"><h3>{{ work.title }}</h3></router-link>
<h4>{{ work.pseud }}</h4> <h4>{{ work.pseud }}</h4><Hr />
<Hr />
<p v-html="escapeAndFormatText(work.summary)"></p> <p v-html="escapeAndFormatText(work.summary)"></p>
</article></mdui-card><template #ssr> </article></mdui-card><template #ssr>
<router-link :to="`/work/${work.workId}`"><h3>{{ work.title }}</h3></router-link> <router-link :to="`/work/${work.workId}`"><h3>{{ work.title }}</h3></router-link>
<h4>{{ work.pseud }}</h4> <h4>{{ work.pseud }}</h4>
<p>{{ work.summary }}</p> <p>{{ work.summary }}</p><Hr />
<Hr />
</template></ClientOnly> </template></ClientOnly>
</template> </template>
<p style="display: flex;" ref='label'> <p style="display: flex;" ref='label'>

View File

@ -1,14 +1,16 @@
<script setup> <script setup>
import { ref, onMounted, onServerPrefetch, onBeforeUnmount, watch, nextTick } from 'vue' import { ref, onMounted, onBeforeUnmount, onServerPrefetch, watch, nextTick } from 'vue'
import { useRouter, useRoute, RouterView } from 'vue-router' import { useRouter, useRoute } from 'vue-router'
const router = useRouter() const router = useRouter()
const route = useRoute() const route = useRoute()
import { useWorkReadState } from '@/stores/workRead.js' import { useHeadHelper } from '../ssr/headHelper.js'
const workReadState = useWorkReadState()
import { useWorkReadState } from '@/stores/workRead.js'
import { useRouteStore } from '@/stores/route.js' import { useRouteStore } from '@/stores/route.js'
const routeState = useRouteStore() const routeState = useRouteStore()
const workReadState = useWorkReadState()
import 'mdui/components/list.js' import 'mdui/components/list.js'
import 'mdui/components/list-item.js' import 'mdui/components/list-item.js'
@ -23,10 +25,6 @@ import 'mdui/components/card.js'
import '@mdui/icons/bookmark.js' import '@mdui/icons/bookmark.js'
import { confirm } from 'mdui/functions/confirm.js'
import { snackbar } from 'mdui/functions/snackbar.js'
import { prompt } from 'mdui/functions/prompt.js'
import { mduiSnackbar } from '../utils.js' import { mduiSnackbar } from '../utils.js'
const fabExtended = ref(false) const fabExtended = ref(false)
@ -48,17 +46,27 @@ const categoryName = {
} }
onServerPrefetch(async () => { onServerPrefetch(async () => {
const headHelper = useHeadHelper()
await workReadState.loadWork(route.params.id, route.params.cid) await workReadState.loadWork(route.params.id, route.params.cid)
if (workReadState.state == 'ready') headHelper.setTitle(workReadState.title)
else if (workReadState.state == 'ssrnotfound') {
headHelper.setTitle('文章未找到')
headHelper.setCode(404)
} else if (workReadState.state == 'unauth') {
headHelper.setTitle('访问被阻止')
headHelper.setCode(401)
}
headHelper.headReady()
}) })
onMounted(async () => { onMounted(async () => {
watch(() => workReadState.state, (value) => { if (value == 'ready') routeState.customTitle = workReadState.title }) watch(() => workReadState.state, (value) => { if (value == 'ready') routeState.customTitle = workReadState.title })
if (workReadState.state != 'ssrnotfound') await workReadState.loadWork(route.params.id, route.params.cid) if (workReadState.state != 'ssrnotfound' && workReadState.state != 'ready') await workReadState.loadWork(route.params.id, route.params.cid)
if (workReadState.state == 'ready') { if (workReadState.state == 'ready') {
routeState.customTitle = workReadState.title routeState.customTitle = workReadState.title
if (parseInt(route.params.cid) != workReadState.cid) { if (workReadState.cid !== null && parseInt(route.params.cid) != workReadState.cid) {
router.replace(`/work/${workReadState.id}/${workReadState.cid}`) router.replace(`/work/${workReadState.id}/${workReadState.cid}`)
return; return
} }
const paraCount = workReadState.text.length - 1 const paraCount = workReadState.text.length - 1
isObserver = new IntersectionObserver((entries) => { isObserver = new IntersectionObserver((entries) => {
@ -86,50 +94,63 @@ onMounted(async () => {
threshold: 0.5 threshold: 0.5
}) })
await nextTick() await nextTick()
paragraphs = content.value?.querySelectorAll('p'); paragraphs = content.value?.querySelectorAll('p')
paragraphs?.forEach(p => isObserver.observe(p)); paragraphs?.forEach(p => isObserver.observe(p))
} }
console.log(workReadState.chapterStat)
}) })
onBeforeUnmount(() => { onBeforeUnmount(() => { if(isObserver) isObserver.disconnect() })
if(isObserver) isObserver.disconnect();
})
async function switchWorkWithIndex(target) { async function switchWorkWithIndex(target) {
workReadState.loadWork(workReadState.id,workReadState.chapters[target].chapterId); workReadState.loadWork(workReadState.id,workReadState.chapters[target].chapterId)
router.replace(`/work/${workReadState.id}/${workReadState.cid}`) router.replace(`/work/${workReadState.id}/${workReadState.cid}`)
} }
</script> </script>
<template> <template>
<ClientOnly> <template v-if="workReadState.state == 'notfound' || workReadState.state == 'ssrnotfound'">
<h2>文章不存在...</h2>
是不是链接没有复制完全?<br/>
ID: {{ workReadState.id }}<br/>
<template v-if="workReadState.cid">
CID: {{ workReadState.cid }}
</template>
<a @click="$router.back()">返回</a>
</template><template v-if="workReadState.state == 'unauth'">
<h2>访问被阻止!</h2>
上游 AO3 不允许匿名用户访问该作品<br/>
ID: {{workReadState.id}}<br/>
<template v-if="workReadState.cid">
CID: {{ workReadState.cid }}
</template><br/>
<a @click="$router.back()">返回</a>
</template><template v-if="workReadState.state == 'error'">
<h2>内部服务器错误</h2>
这种情况不是你的问题, 而是我给网站写的屎山代码发力了, <a href="/about#contact">这里</a> 联系我修复此问题<br/>
并提供以下信息:<br/>
ID: {{workReadState.id}}<br/>
<template v-if="workReadState.cid">
CID: {{ workReadState.cid }}
</template><br/>
<a @click="$router.back()">返回</a>
</template><template v-if="workReadState.state == 'errformat'">
<h2>路径格式错误</h2>
ID: {{ $route.params.id }}<br/>
<template v-if="$route.params.id">
CID: {{ $route.params.id }}
</template><br/>
<a @click="$router.back()">返回</a>
</template><ClientOnly>
<template v-if="workReadState.state == 'loading'"> <template v-if="workReadState.state == 'loading'">
加载中...<br/> 加载中...<br/>
<mdui-linear-progress></mdui-linear-progress> <mdui-linear-progress></mdui-linear-progress>
</template> </template>
<template v-if="workReadState.state == 'notfound' || workReadState.state == 'ssrnotfound'">
<h2>文章不存在...</h2>
是不是链接没有复制完全?<br/>
ID: {{ workReadState.id }}<br/>
<template v-if="workReadState.cid">
CID: {{ workReadState.cid }}
</template>
<a @click="$router.back()">返回</a>
</template>
<template v-if="workReadState.state == 'errformat'">
<h2>路径格式错误</h2>
ID: {{ $route.params.id }}<br/>
<template v-if="$route.params.id">
CID: {{ $route.params.id }}
</template><br/>
<a @click="$router.back()">返回</a>
</template>
<template v-if="workReadState.state == 'ready'"> <template v-if="workReadState.state == 'ready'">
<article> <article>
<h1 style="margin: auto">{{ workReadState.title }}</h1> <h1>{{ workReadState.title }}</h1>
<h4>{{ workReadState.pesud }}</h4> <h4>{{ workReadState.pseud }}</h4>
<mdui-card style="margin: 8px; padding: 16px;"> <a target="_blank" :href="workReadState.cid ? `https://archiveofourown.org/works/${workReadState.id}/chapters/${workReadState.cid}` : `https://archiveofourown.org/works/${workReadState.id}`"> AO3 链接</a>
<mdui-card style="margin: 8px 0px; padding: 16px;">
<strong>作品信息</strong><dl> <strong>作品信息</strong><dl>
<template v-if="workReadState.category"><dt>分类</dt><ul> <template v-if="workReadState.category"><dt>分类</dt><ul>
<li v-for="item in workReadState.category" :key="item"> <li v-for="item in workReadState.category" :key="item">
@ -139,16 +160,30 @@ async function switchWorkWithIndex(target) {
<li v-for="item in workReadState.fandom" :key="item"> <li v-for="item in workReadState.fandom" :key="item">
{{ item }}</li> {{ item }}</li>
</ul></template> </ul></template>
<template v-if="workReadState.additionalTags"><dt>附加 Tag</dt><ul>
<li v-for="item in workReadState.additionalTags" :key="item">
{{ item }}</li>
</ul></template>
<dt>语言</dt><dd> <dt>语言</dt><dd>
{{ workReadState.lang }} {{ workReadState.lang }}
</dd> </dd>
</dl><Hr/> </dl><Hr/>
<strong>作品状态</strong><dl> <strong>作品状态</strong><dl>
<dt>发布时间</dt><dd> <dt>发布</dt><dd>
{{ workReadState.publishedTime.year }} - {{ workReadState.publishedTime.year }} -
{{ workReadState.publishedTime.month }} - {{ workReadState.publishedTime.month }} -
{{ workReadState.publishedTime.date }} {{ workReadState.publishedTime.date }}
</dd> </dd>
<template v-if="workReadState.completedTime"><dt>完成</dt><dd>
{{ workReadState.completedTime.year }} -
{{ workReadState.completedTime.month }} -
{{ workReadState.completedTime.date }}
</dd></template>
<template v-if="workReadState.updatedTime"><dt>更新</dt><dd>
{{ workReadState.updatedTime.year }} -
{{ workReadState.updatedTime.month }} -
{{ workReadState.updatedTime.date }}
</dd></template>
<dt>字数</dt><dd> <dt>字数</dt><dd>
{{ workReadState.wordCount }} {{ workReadState.wordCount }}
</dd> </dd>
@ -163,9 +198,13 @@ async function switchWorkWithIndex(target) {
</dd></template> </dd></template>
</dl> </dl>
</mdui-card> </mdui-card>
<template v-if="workReadState.chapters"> <template v-if="workReadState.cid">
<p> {{ workReadState.chapterIndex + 1 }} / {{ workReadState.chapters.length }} : {{ workReadState.chapters[workReadState.chapterIndex].title }}</p> <h4> {{ workReadState.chapterIndex + 1 }} / {{ workReadState.chapters.length }} : {{ workReadState.chapters[workReadState.chapterIndex].title }}</h4>
<mdui-button variant='filled' @click="chapterDialog.open = true">章节列表</mdui-button> <div style="display: flex;">
<mdui-button variant="filled" v-if="workReadState.chapterIndex != 0" @click="switchWorkWithIndex(workReadState.chapterIndex - 1)">上一章</mdui-button>
<mdui-button variant='elevated' @click="chapterDialog.open = true" style="margin: 0px 16px;">章节列表</mdui-button>
<mdui-button variant="filled" v-if="workReadState.chapterIndex != workReadState.chapters.length - 1" @click="switchWorkWithIndex(workReadState.chapterIndex + 1)">下一章</mdui-button>
</div><br/>
</template> </template>
<blockquote v-if="workReadState.summary"> <blockquote v-if="workReadState.summary">
<p v-html='workReadState.summary'></p> <p v-html='workReadState.summary'></p>
@ -174,7 +213,7 @@ async function switchWorkWithIndex(target) {
<p v-for="(para, index) in workReadState.text" :key="para" :data-index="index">{{ para }}</p> <p v-for="(para, index) in workReadState.text" :key="para" :data-index="index">{{ para }}</p>
</article> </article>
</article><Hr/> </article><Hr/>
<p style="display: flex;" v-if="workReadState.chapters"> <p style="display: flex;" v-if="workReadState.cid">
<mdui-button variant="filled" v-if="workReadState.chapterIndex != 0" @click="switchWorkWithIndex(workReadState.chapterIndex - 1)">上一章</mdui-button> <mdui-button variant="filled" v-if="workReadState.chapterIndex != 0" @click="switchWorkWithIndex(workReadState.chapterIndex - 1)">上一章</mdui-button>
<span style="flex: 1;"/> <span style="flex: 1;"/>
{{ workReadState.chapterIndex + 1 }} / {{ workReadState.chapters.length }} {{ workReadState.chapterIndex + 1 }} / {{ workReadState.chapters.length }}
@ -193,24 +232,19 @@ async function switchWorkWithIndex(target) {
<br/> <br/>
点击跳转 点击跳转
</span> </span>
<mdui-list><mdui-list-item v-for="(chapter,index) in workReadState.chapters" :key="chapter.chapterId" @click="switchWorkWithIndex(index)"> <mdui-list><mdui-list-item
v-for="(chapter,index) in workReadState.chapters"
:key="chapter.chapterId" @click="switchWorkWithIndex(index)"
:class="{ 'active-item' : index === workReadState.chapterIndex }"
>
{{index + 1}}. {{ chapter.title }} {{index + 1}}. {{ chapter.title }}
</mdui-list-item></mdui-list> </mdui-list-item></mdui-list>
</mdui-dialog> </mdui-dialog>
</template> </template>
<template #ssr> <template #ssr>
<template v-if="workReadState.state == 'notfound' || workReadState.state == 'ssrnotfound'">
<h2>文章不存在...</h2>
是不是链接没有复制完全?<br/>
ID: {{workReadState.id}}<br/>
<template v-if="workReadState.cid">
CID: {{ workReadState.cid }}
</template>
<a @click="$router.back()">返回</a>
</template>
<template v-if="workReadState.state == 'ready'"> <template v-if="workReadState.state == 'ready'">
<h2>{{ workReadState.title }}</h2> <h2>{{ workReadState.title }}</h2>
<h4>{{ workReadState.pesud }}</h4> <h4>{{ workReadState.pseud }}</h4>
<dl> <dl>
<template v-if="workReadState.category"><dt>分类</dt><ul> <template v-if="workReadState.category"><dt>分类</dt><ul>
<li v-for="item in workReadState.category" :key="item"> <li v-for="item in workReadState.category" :key="item">
@ -223,11 +257,21 @@ async function switchWorkWithIndex(target) {
<dt>语言</dt><dd> <dt>语言</dt><dd>
{{ workReadState.lang }} {{ workReadState.lang }}
</dd> </dd>
<dt>发布时间</dt><dd> <dt>发布</dt><dd>
{{ workReadState.publishedTime.year }} - {{ workReadState.publishedTime.year }} -
{{ workReadState.publishedTime.month }} - {{ workReadState.publishedTime.month }} -
{{ workReadState.publishedTime.date }} {{ workReadState.publishedTime.date }}
</dd> </dd>
<template v-if="workReadState.completedTime"><dt>完成</dt><dd>
{{ workReadState.completedTime.year }} -
{{ workReadState.completedTime.month }} -
{{ workReadState.completedTime.date }}
</dd></template>
<template v-if="workReadState.updatedTime"><dt>更新</dt><dd>
{{ workReadState.updatedTime.year }} -
{{ workReadState.updatedTime.month }} -
{{ workReadState.updatedTime.date }}
</dd></template>
<dt>字数</dt><dd> <dt>字数</dt><dd>
{{ workReadState.wordCount }} {{ workReadState.wordCount }}
</dd> </dd>
@ -250,6 +294,9 @@ async function switchWorkWithIndex(target) {
</template> </template>
<style scoped> <style scoped>
.active-item {
background-color: rgb(var(--mdui-color-secondary-container));
}
.mdui-fab { .mdui-fab {
position: fixed; position: fixed;
bottom: 16px; /* 调整垂直位置 */ bottom: 16px; /* 调整垂直位置 */