diff --git a/package.json b/package.json index e20a4a723606fa113a1b5d621e4f088757b7f2af..01ef828d991fdcd83ff2d9ef176f085572a530b0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "openeuler-intelligence", - "version": "0.9.6", + "version": "0.10.1", "description": "openEuler 智能化解决方案", "author": { "name": "openEuler", @@ -17,6 +17,8 @@ "dev": "vite", "dev:micro": "vite --mode micro", "build": "vite build", + "sync-witchaind-assets": "./scripts/sync-witchaind-assets.sh", + "watch-sync-assets": "./scripts/watch-sync-assets.sh", "build:micro": "vite build --mode micro", "preview": "vite preview", "lint": "eslint . --fix", diff --git a/public/debug-module-loading.html b/public/debug-module-loading.html new file mode 100644 index 0000000000000000000000000000000000000000..0ade2f0f288c4b128786ca7e0e3618fff9f5d73b --- /dev/null +++ b/public/debug-module-loading.html @@ -0,0 +1,71 @@ + + + + 模块加载调试 + + +

WitChainD 模块加载调试

+
+
+ + + + diff --git a/public/witchaind/assets/base.css b/public/witchaind/assets/base.css new file mode 100644 index 0000000000000000000000000000000000000000..11b6ac76de0d3ae9e15f5a1f1e0983ab5a606985 --- /dev/null +++ b/public/witchaind/assets/base.css @@ -0,0 +1,47 @@ +*, +*::before, +*::after { + box-sizing: border-box; + margin: 0; + padding: 0; +} +li { + list-style-type: none; + cursor: pointer; +} +textarea { + resize: none; +} + +body { + /* min-height: 100vh; */ + transition: + color 0.5s, + background-color 0.5s; + font-family: + Inter, + -apple-system, + BlinkMacSystemFont, + 'Segoe UI', + Roboto, + Oxygen, + Ubuntu, + Cantarell, + 'Fira Sans', + 'Droid Sans', + 'Helvetica Neue', + sans-serif; + font-size: 15px; + text-rendering: optimizeLegibility; + background-color: #ebeff6; +} +:deep(.dialog) { + padding: 0px; + height: 50%; + display: flex; + flex-direction: column; +} + +:deep(.el-dialog) { + --el-dialog-padding-primary: 0px; +} diff --git a/public/witchaind/assets/fonts/HarmonyOS/HarmonyOS_font.css b/public/witchaind/assets/fonts/HarmonyOS/HarmonyOS_font.css new file mode 100644 index 0000000000000000000000000000000000000000..33dc6afe2667e85ff77391cf07a42ea6f62626b9 --- /dev/null +++ b/public/witchaind/assets/fonts/HarmonyOS/HarmonyOS_font.css @@ -0,0 +1,21 @@ +/* + 100 Thin (Hairline) + 200 Extra Light (Ultra Light) + 300 Light + 400 Normal + 500 Medium + 600 Semi Bold (Demi Bold) + 700 Bold + 800 Extra Bold (Ultra Bold) + 900 Black (Heavy) +*/ + +/* 鸿蒙中文 */ +@font-face { + font-family: 'HarmonyOS Sans SC Regular'; + src: + var(--font-harmony-woff2, url(./HarmonyOS_Sans_SC/HarmonyOS_Sans_SC_Regular.woff2)) format('woff2'), + var(--font-harmony-woff, url(./HarmonyOS_Sans_SC/HarmonyOS_Sans_SC_Regular.woff)) format('woff'); + font-weight: 400; + font-style: normal; +} diff --git a/public/witchaind/assets/icons/fileIcon.png b/public/witchaind/assets/icons/fileIcon.png new file mode 100644 index 0000000000000000000000000000000000000000..0101e81d6a70387f165e5dee4afe574a1996dcc5 Binary files /dev/null and b/public/witchaind/assets/icons/fileIcon.png differ diff --git a/public/witchaind/assets/icons/taskLoading.png b/public/witchaind/assets/icons/taskLoading.png new file mode 100644 index 0000000000000000000000000000000000000000..246938fc748910e389f3570fd8f826325c686a18 Binary files /dev/null and b/public/witchaind/assets/icons/taskLoading.png differ diff --git a/public/witchaind/assets/icons/taskWait.png b/public/witchaind/assets/icons/taskWait.png new file mode 100644 index 0000000000000000000000000000000000000000..32df8404c38af3993e28a9e7aa1adb9bebd943a7 Binary files /dev/null and b/public/witchaind/assets/icons/taskWait.png differ diff --git a/public/witchaind/assets/images/401.gif b/public/witchaind/assets/images/401.gif new file mode 100644 index 0000000000000000000000000000000000000000..4c930e72a698889a0f5666d8599652c5808cfc70 Binary files /dev/null and b/public/witchaind/assets/images/401.gif differ diff --git a/public/witchaind/assets/images/404.png b/public/witchaind/assets/images/404.png new file mode 100644 index 0000000000000000000000000000000000000000..4e098298787749e55a6dc0321642690b882d130e Binary files /dev/null and b/public/witchaind/assets/images/404.png differ diff --git a/public/witchaind/assets/images/404_cloud.png b/public/witchaind/assets/images/404_cloud.png new file mode 100644 index 0000000000000000000000000000000000000000..a81d8daa2c5a025f0137a27d81ed61ce7064039f Binary files /dev/null and b/public/witchaind/assets/images/404_cloud.png differ diff --git a/public/witchaind/assets/images/Qwen.png b/public/witchaind/assets/images/Qwen.png new file mode 100644 index 0000000000000000000000000000000000000000..f13d471bb56a1800b671b5f21f0740f30b4a204c Binary files /dev/null and b/public/witchaind/assets/images/Qwen.png differ diff --git a/public/witchaind/assets/images/dark_bg.webp b/public/witchaind/assets/images/dark_bg.webp new file mode 100644 index 0000000000000000000000000000000000000000..1bba03b8929292ccaf97652a7cddff55e429d2bb Binary files /dev/null and b/public/witchaind/assets/images/dark_bg.webp differ diff --git a/public/witchaind/assets/images/dark_bg_1.webp b/public/witchaind/assets/images/dark_bg_1.webp new file mode 100644 index 0000000000000000000000000000000000000000..671c9df36fd79cf4f2ea99be5288420af253045e Binary files /dev/null and b/public/witchaind/assets/images/dark_bg_1.webp differ diff --git a/public/witchaind/assets/images/date_time.svg b/public/witchaind/assets/images/date_time.svg new file mode 100644 index 0000000000000000000000000000000000000000..90b2f93e9a6244da2d053e85847dea531f2cb301 --- /dev/null +++ b/public/witchaind/assets/images/date_time.svg @@ -0,0 +1,13 @@ + + + Created with Pixso. + + + + + + + + + + diff --git a/public/witchaind/assets/images/deepseek.png b/public/witchaind/assets/images/deepseek.png new file mode 100644 index 0000000000000000000000000000000000000000..fe1d7f5bd0f78c32e581ae9ac4cc772da13ace27 Binary files /dev/null and b/public/witchaind/assets/images/deepseek.png differ diff --git a/public/witchaind/assets/images/empty_failed.svg b/public/witchaind/assets/images/empty_failed.svg new file mode 100644 index 0000000000000000000000000000000000000000..374225ec44fa650a8c9149a3024a6381e5a91258 --- /dev/null +++ b/public/witchaind/assets/images/empty_failed.svg @@ -0,0 +1,46 @@ + + + Created with Pixso. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/witchaind/assets/images/empty_failed_dark.svg b/public/witchaind/assets/images/empty_failed_dark.svg new file mode 100644 index 0000000000000000000000000000000000000000..67bd878fdb9170f24efd786ec76090102eac50e1 --- /dev/null +++ b/public/witchaind/assets/images/empty_failed_dark.svg @@ -0,0 +1,48 @@ + + + Created with Pixso. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/witchaind/assets/images/empty_pending.svg b/public/witchaind/assets/images/empty_pending.svg new file mode 100644 index 0000000000000000000000000000000000000000..32b734e14ef3adde93f4388128617c7bb6990444 --- /dev/null +++ b/public/witchaind/assets/images/empty_pending.svg @@ -0,0 +1,62 @@ + + + Created with Pixso. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/witchaind/assets/images/empty_pending_dark.svg b/public/witchaind/assets/images/empty_pending_dark.svg new file mode 100644 index 0000000000000000000000000000000000000000..26c979ec5c07620e0753002fe94cc8be46c21bed --- /dev/null +++ b/public/witchaind/assets/images/empty_pending_dark.svg @@ -0,0 +1,61 @@ + + + Created with Pixso. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/witchaind/assets/images/empty_running.svg b/public/witchaind/assets/images/empty_running.svg new file mode 100644 index 0000000000000000000000000000000000000000..02d0c7e754e07eabdd22c4e22861aa1f840ddf30 --- /dev/null +++ b/public/witchaind/assets/images/empty_running.svg @@ -0,0 +1,49 @@ + + + Created with Pixso. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/witchaind/assets/images/empty_running_dark.svg b/public/witchaind/assets/images/empty_running_dark.svg new file mode 100644 index 0000000000000000000000000000000000000000..603291ce98af0a6f6dd5e1d7a91a7c41f6dcfece --- /dev/null +++ b/public/witchaind/assets/images/empty_running_dark.svg @@ -0,0 +1,47 @@ + + + Created with Pixso. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/witchaind/assets/images/file.png b/public/witchaind/assets/images/file.png new file mode 100644 index 0000000000000000000000000000000000000000..08dff66d5eb57952eea420b29bf734ac053b98df Binary files /dev/null and b/public/witchaind/assets/images/file.png differ diff --git a/public/witchaind/assets/images/file_count.svg b/public/witchaind/assets/images/file_count.svg new file mode 100644 index 0000000000000000000000000000000000000000..f12f3b47a139f36ad69a4a76f0c0e32500754de0 --- /dev/null +++ b/public/witchaind/assets/images/file_count.svg @@ -0,0 +1,13 @@ + + + Created with Pixso. + + + + + + + + + + diff --git a/public/witchaind/assets/images/file_size.svg b/public/witchaind/assets/images/file_size.svg new file mode 100644 index 0000000000000000000000000000000000000000..bab846b3b2704cabc72199bb904ada823213e03b --- /dev/null +++ b/public/witchaind/assets/images/file_size.svg @@ -0,0 +1,13 @@ + + + Created with Pixso. + + + + + + + + + + diff --git a/public/witchaind/assets/images/helpCircle.svg b/public/witchaind/assets/images/helpCircle.svg new file mode 100644 index 0000000000000000000000000000000000000000..e4b0717b38ea8dcc15d8192861ca4f375faef305 --- /dev/null +++ b/public/witchaind/assets/images/helpCircle.svg @@ -0,0 +1,16 @@ + + + Created with Pixso. + + + + + + + + + + + + + diff --git a/public/witchaind/assets/images/language-en.svg b/public/witchaind/assets/images/language-en.svg new file mode 100644 index 0000000000000000000000000000000000000000..306a6df7be65c77c3d0c4020e44355595955912b --- /dev/null +++ b/public/witchaind/assets/images/language-en.svg @@ -0,0 +1,12 @@ + + + Created with Pixso. + + + + + + + + + diff --git a/public/witchaind/assets/images/language-zh.svg b/public/witchaind/assets/images/language-zh.svg new file mode 100644 index 0000000000000000000000000000000000000000..6e7b694b76715c439487d912ef229243a77b9e58 --- /dev/null +++ b/public/witchaind/assets/images/language-zh.svg @@ -0,0 +1,13 @@ + + + Created with Pixso. + + + + + + + + + + diff --git a/public/witchaind/assets/images/light_bg.webp b/public/witchaind/assets/images/light_bg.webp new file mode 100644 index 0000000000000000000000000000000000000000..dee0bfc15aeac0d6b61d425ddc65e30bebaf6a24 Binary files /dev/null and b/public/witchaind/assets/images/light_bg.webp differ diff --git a/public/witchaind/assets/images/light_bg_1.webp b/public/witchaind/assets/images/light_bg_1.webp new file mode 100644 index 0000000000000000000000000000000000000000..c0f0983f820c9ef4b99f92d0181da3864ec19daa Binary files /dev/null and b/public/witchaind/assets/images/light_bg_1.webp differ diff --git a/public/witchaind/assets/images/login-background-dark.jpg b/public/witchaind/assets/images/login-background-dark.jpg new file mode 100644 index 0000000000000000000000000000000000000000..50dc817e8fca2d229f91de8f9ee4a395572ee00a Binary files /dev/null and b/public/witchaind/assets/images/login-background-dark.jpg differ diff --git a/public/witchaind/assets/images/login-background-light.jpg b/public/witchaind/assets/images/login-background-light.jpg new file mode 100644 index 0000000000000000000000000000000000000000..993b958e243926e4dd5b1a415c879965117a3419 Binary files /dev/null and b/public/witchaind/assets/images/login-background-light.jpg differ diff --git a/public/witchaind/assets/images/member_count.svg b/public/witchaind/assets/images/member_count.svg new file mode 100644 index 0000000000000000000000000000000000000000..60878dc542f308cfcc0d6cbaf80e5c7a0734da0e --- /dev/null +++ b/public/witchaind/assets/images/member_count.svg @@ -0,0 +1,13 @@ + + + Created with Pixso. + + + + + + + + + + diff --git a/public/witchaind/assets/images/timer.png b/public/witchaind/assets/images/timer.png new file mode 100644 index 0000000000000000000000000000000000000000..a7e7b35c0dd2b798dfe86f26f33746c20f34b066 Binary files /dev/null and b/public/witchaind/assets/images/timer.png differ diff --git a/public/witchaind/assets/images/userHeader.jpeg b/public/witchaind/assets/images/userHeader.jpeg new file mode 100644 index 0000000000000000000000000000000000000000..ac2045019ee4e224f1f595a86f2327be6a8d98ac Binary files /dev/null and b/public/witchaind/assets/images/userHeader.jpeg differ diff --git a/public/witchaind/assets/logo.png b/public/witchaind/assets/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..ffa62f3c600e6bc07573320d20c6db8557a1071f Binary files /dev/null and b/public/witchaind/assets/logo.png differ diff --git a/public/witchaind/assets/svg/alarm.svg b/public/witchaind/assets/svg/alarm.svg new file mode 100644 index 0000000000000000000000000000000000000000..df7271a06290438787905774d58bed1b27551e5b --- /dev/null +++ b/public/witchaind/assets/svg/alarm.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/witchaind/assets/svg/dark_taskList.svg b/public/witchaind/assets/svg/dark_taskList.svg new file mode 100644 index 0000000000000000000000000000000000000000..132f9c5d9afd44779af810af86722ef52a1a9132 --- /dev/null +++ b/public/witchaind/assets/svg/dark_taskList.svg @@ -0,0 +1,13 @@ + + + Created with Pixso. + + + + + + + + + + diff --git a/public/witchaind/assets/svg/dark_taskScore.svg b/public/witchaind/assets/svg/dark_taskScore.svg new file mode 100644 index 0000000000000000000000000000000000000000..4db57cc45785bfe95629d4765e0d2b6882f5e5c5 --- /dev/null +++ b/public/witchaind/assets/svg/dark_taskScore.svg @@ -0,0 +1,13 @@ + + + Created with Pixso. + + + + + + + + + + diff --git a/public/witchaind/assets/svg/euler_copilot_logo.svg b/public/witchaind/assets/svg/euler_copilot_logo.svg new file mode 100644 index 0000000000000000000000000000000000000000..2ac4fced1382e233d40e6f566e68bc4570c96dd4 --- /dev/null +++ b/public/witchaind/assets/svg/euler_copilot_logo.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/witchaind/assets/svg/fail.svg b/public/witchaind/assets/svg/fail.svg new file mode 100644 index 0000000000000000000000000000000000000000..483ea68b87f8575c0b173cbd898e8afc20f0d888 --- /dev/null +++ b/public/witchaind/assets/svg/fail.svg @@ -0,0 +1,9 @@ + + + Created with Pixso. + + + + + + diff --git a/public/witchaind/assets/svg/icon_info.svg b/public/witchaind/assets/svg/icon_info.svg new file mode 100644 index 0000000000000000000000000000000000000000..e844652c28e5c65ebf9307fa4c902008615092e6 --- /dev/null +++ b/public/witchaind/assets/svg/icon_info.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/public/witchaind/assets/svg/light_taskList.svg b/public/witchaind/assets/svg/light_taskList.svg new file mode 100644 index 0000000000000000000000000000000000000000..ff887a1f7b793bec0d17e19dbb0b2e569f00d006 --- /dev/null +++ b/public/witchaind/assets/svg/light_taskList.svg @@ -0,0 +1,13 @@ + + + Created with Pixso. + + + + + + + + + + diff --git a/public/witchaind/assets/svg/light_taskScore.svg b/public/witchaind/assets/svg/light_taskScore.svg new file mode 100644 index 0000000000000000000000000000000000000000..0c4e3246710b9daa1634f64f662acc10baa0eb21 --- /dev/null +++ b/public/witchaind/assets/svg/light_taskScore.svg @@ -0,0 +1,13 @@ + + + Created with Pixso. + + + + + + + + + + diff --git a/public/witchaind/assets/svg/login.jpg b/public/witchaind/assets/svg/login.jpg new file mode 100644 index 0000000000000000000000000000000000000000..50dc817e8fca2d229f91de8f9ee4a395572ee00a Binary files /dev/null and b/public/witchaind/assets/svg/login.jpg differ diff --git a/public/witchaind/assets/svg/more.svg b/public/witchaind/assets/svg/more.svg new file mode 100644 index 0000000000000000000000000000000000000000..69e80d3ccf78421b48d0a44d9317a1af8c67788d --- /dev/null +++ b/public/witchaind/assets/svg/more.svg @@ -0,0 +1,13 @@ + + + Created with Pixso. + + + + + + + + + + diff --git a/public/witchaind/assets/svg/more_active.svg b/public/witchaind/assets/svg/more_active.svg new file mode 100644 index 0000000000000000000000000000000000000000..4158d0bf3994ca35cedd0d8f594dc6636784344a --- /dev/null +++ b/public/witchaind/assets/svg/more_active.svg @@ -0,0 +1,13 @@ + + + Created with Pixso. + + + + + + + + + + diff --git a/public/witchaind/assets/svg/more_hover.svg b/public/witchaind/assets/svg/more_hover.svg new file mode 100644 index 0000000000000000000000000000000000000000..46cc8e87d64f938caaf0bd77212e6e6d75c2b9e0 --- /dev/null +++ b/public/witchaind/assets/svg/more_hover.svg @@ -0,0 +1,13 @@ + + + Created with Pixso. + + + + + + + + + + diff --git a/public/witchaind/assets/svg/succes.svg b/public/witchaind/assets/svg/succes.svg new file mode 100644 index 0000000000000000000000000000000000000000..c2d95a2ee35a3ccdc89d4377b4c1247747edeafa --- /dev/null +++ b/public/witchaind/assets/svg/succes.svg @@ -0,0 +1,10 @@ + + + Created with Pixso. + + + + + + + diff --git a/public/witchaind/assets/svg/taskEmpty.svg b/public/witchaind/assets/svg/taskEmpty.svg new file mode 100644 index 0000000000000000000000000000000000000000..5fc27046e095beafcacb3a880403b4b0417e202f --- /dev/null +++ b/public/witchaind/assets/svg/taskEmpty.svg @@ -0,0 +1,61 @@ + + + Created with Pixso. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/witchaind/assets/svg/taskFailed.svg b/public/witchaind/assets/svg/taskFailed.svg new file mode 100644 index 0000000000000000000000000000000000000000..d604e8828d034041fab95e43a16a8666158ac0a5 --- /dev/null +++ b/public/witchaind/assets/svg/taskFailed.svg @@ -0,0 +1,46 @@ + + + Created with Pixso. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/witchaind/assets/svg/taskList.svg b/public/witchaind/assets/svg/taskList.svg new file mode 100644 index 0000000000000000000000000000000000000000..7246b5e576c180ae0765264fda8e871e3b4c16cd --- /dev/null +++ b/public/witchaind/assets/svg/taskList.svg @@ -0,0 +1,13 @@ + + + Created with Pixso. + + + + + + + + + + diff --git a/public/witchaind/assets/svg/taskLoading.svg b/public/witchaind/assets/svg/taskLoading.svg new file mode 100644 index 0000000000000000000000000000000000000000..183bad2d2e9be87dfbb3b486b1d665cb44bdefec --- /dev/null +++ b/public/witchaind/assets/svg/taskLoading.svg @@ -0,0 +1,49 @@ + + + Created with Pixso. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/witchaind/assets/svg/taskScore.svg b/public/witchaind/assets/svg/taskScore.svg new file mode 100644 index 0000000000000000000000000000000000000000..07964681f5d76ec8565a38c2081ac1771308170b --- /dev/null +++ b/public/witchaind/assets/svg/taskScore.svg @@ -0,0 +1,7 @@ + + + Created with Pixso. + + + + diff --git a/public/witchaind/assets/svg/user_icon.png b/public/witchaind/assets/svg/user_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..f2a462180ad60b1f34e68b25b5a1436f2e225211 Binary files /dev/null and b/public/witchaind/assets/svg/user_icon.png differ diff --git a/public/witchaind/euler_copilot_logo.svg b/public/witchaind/euler_copilot_logo.svg new file mode 100644 index 0000000000000000000000000000000000000000..2ac4fced1382e233d40e6f566e68bc4570c96dd4 --- /dev/null +++ b/public/witchaind/euler_copilot_logo.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/witchaind/favicon.ico b/public/witchaind/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..8ed8d998756a7a0dedfb37ee153ce305d9f35f10 Binary files /dev/null and b/public/witchaind/favicon.ico differ diff --git a/scripts/sync-witchaind-assets.sh b/scripts/sync-witchaind-assets.sh new file mode 100755 index 0000000000000000000000000000000000000000..ae42daa039fa647f89471d071228e3c9042a2be9 --- /dev/null +++ b/scripts/sync-witchaind-assets.sh @@ -0,0 +1,83 @@ +#!/bin/bash + +# 同步 witchaind-web 静态资源到主应用 +# 用于解决 iframe 跨域静态资源访问问题 + +set -e + +# 颜色定义 +RED='\033[0;31m' +GREEN='\033[0;32m' +YELLOW='\033[1;33m' +BLUE='\033[0;34m' +NC='\033[0m' # No Color + +# 路径定义 +WITCHAIND_ASSETS_SOURCE="/opt/euler-copilot-witchaind-web/src/assets" +WITCHAIND_PUBLIC_SOURCE="/opt/euler-copilot-witchaind-web/public" +WEB_PUBLIC_TARGET="/opt/euler-copilot-web/public" +WEB_WITCHAIND_ASSETS_TARGET="$WEB_PUBLIC_TARGET/witchaind/assets" + +echo -e "${BLUE}🔄 开始同步 witchaind-web 静态资源...${NC}" + +# 检查源目录是否存在 +if [ ! -d "$WITCHAIND_ASSETS_SOURCE" ]; then + echo -e "${RED}❌ 错误: witchaind-web assets 源目录不存在: $WITCHAIND_ASSETS_SOURCE${NC}" + exit 1 +fi + +# 创建目标目录 +echo -e "${YELLOW}📁 创建目标目录结构...${NC}" +mkdir -p "$WEB_WITCHAIND_ASSETS_TARGET" +mkdir -p "$WEB_PUBLIC_TARGET/witchaind" + +# 清理目标目录 +echo -e "${YELLOW}🗑️ 清理目标目录...${NC}" +rm -rf "$WEB_WITCHAIND_ASSETS_TARGET" +mkdir -p "$WEB_WITCHAIND_ASSETS_TARGET" + +# 同步 assets 目录 +echo -e "${YELLOW}📋 同步 assets 目录...${NC}" +cp -r "$WITCHAIND_ASSETS_SOURCE"/* "$WEB_WITCHAIND_ASSETS_TARGET"/ + +# 同步 public 目录中的静态资源(如果存在) +if [ -d "$WITCHAIND_PUBLIC_SOURCE" ]; then + echo -e "${YELLOW}📋 同步 public 目录...${NC}" + find "$WITCHAIND_PUBLIC_SOURCE" -type f ! -name "index.html" ! -name "*.map" -exec cp {} "$WEB_PUBLIC_TARGET/witchaind/" \; +fi + +# 检查同步结果 +if [ -d "$WEB_WITCHAIND_ASSETS_TARGET" ]; then + SYNC_COUNT=$(find "$WEB_WITCHAIND_ASSETS_TARGET" -type f | wc -l) + echo -e "${GREEN}✅ 同步完成!${NC}" + echo -e "${GREEN}📊 已同步 $SYNC_COUNT 个文件${NC}" + echo -e "${GREEN}📂 目标目录: $WEB_WITCHAIND_ASSETS_TARGET${NC}" + + # 显示同步的文件类型统计 + echo -e "${BLUE}📈 文件类型统计:${NC}" + find "$WEB_WITCHAIND_ASSETS_TARGET" -type f | sed 's/.*\.//' | sort | uniq -c | sort -nr + +else + echo -e "${RED}❌ 同步失败!${NC}" + exit 1 +fi + +# 生成同步报告 +REPORT_FILE="/opt/euler-copilot-web/witchaind-assets-sync.log" +echo "Witchaind Assets Sync Report - $(date)" > "$REPORT_FILE" +echo "Source: $WITCHAIND_ASSETS_SOURCE" >> "$REPORT_FILE" +echo "Target: $WEB_WITCHAIND_ASSETS_TARGET" >> "$REPORT_FILE" +echo "Files synced: $SYNC_COUNT" >> "$REPORT_FILE" +echo "" >> "$REPORT_FILE" +echo "File list:" >> "$REPORT_FILE" +find "$WEB_WITCHAIND_ASSETS_TARGET" -type f -exec ls -la {} \; >> "$REPORT_FILE" + +echo -e "${BLUE}📄 同步报告已生成: $REPORT_FILE${NC}" + +# 提示下一步操作 +echo -e "${YELLOW}💡 提示:${NC}" +echo -e " 1. 静态资源已同步到: ${BLUE}$WEB_WITCHAIND_ASSETS_TARGET${NC}" +echo -e " 2. 现在可以通过以下URL访问: ${BLUE}http://10.211.55.10:8080/witchaind/assets/${NC}" +echo -e " 3. 如果 witchaind-web 的静态资源有更新,请重新运行此脚本" + +echo -e "${GREEN}🎉 静态资源同步完成!${NC}" diff --git a/scripts/watch-sync-assets.sh b/scripts/watch-sync-assets.sh new file mode 100755 index 0000000000000000000000000000000000000000..b340559230533c4c6c8db59fdd0bd0d76dc6736e --- /dev/null +++ b/scripts/watch-sync-assets.sh @@ -0,0 +1,54 @@ +#!/bin/bash + +# 监控 witchaind-web 静态资源变化并自动同步 +# 用于开发环境的实时同步 + +set -e + +# 颜色定义 +RED='\033[0;31m' +GREEN='\033[0;32m' +YELLOW='\033[1;33m' +BLUE='\033[0;34m' +NC='\033[0m' # No Color + +WITCHAIND_ASSETS_SOURCE="/opt/euler-copilot-witchaind-web/src/assets" +SYNC_SCRIPT="/opt/euler-copilot-web/scripts/sync-witchaind-assets.sh" + +echo -e "${BLUE}👀 启动静态资源监控同步...${NC}" +echo -e "${YELLOW}📂 监控目录: $WITCHAIND_ASSETS_SOURCE${NC}" +echo -e "${YELLOW}🔄 同步脚本: $SYNC_SCRIPT${NC}" + +# 检查 inotifywait 是否可用 +if ! command -v inotifywait &> /dev/null; then + echo -e "${YELLOW}⚠️ inotifywait 不可用,使用简单的循环监控${NC}" + + # 获取初始状态 + LAST_MODIFIED=$(find "$WITCHAIND_ASSETS_SOURCE" -type f -exec stat -c %Y {} \; | sort -n | tail -1) + + echo -e "${GREEN}✅ 开始监控... (按 Ctrl+C 停止)${NC}" + + while true; do + sleep 5 + CURRENT_MODIFIED=$(find "$WITCHAIND_ASSETS_SOURCE" -type f -exec stat -c %Y {} \; | sort -n | tail -1) + + if [ "$CURRENT_MODIFIED" != "$LAST_MODIFIED" ]; then + echo -e "${YELLOW}🔄 检测到文件变化,开始同步...${NC}" + $SYNC_SCRIPT + LAST_MODIFIED=$CURRENT_MODIFIED + echo -e "${GREEN}✅ 同步完成,继续监控...${NC}" + fi + done +else + echo -e "${GREEN}✅ 使用 inotifywait 进行实时监控...${NC}" + + # 使用 inotifywait 进行实时监控 + inotifywait -m -r -e modify,create,delete,move "$WITCHAIND_ASSETS_SOURCE" | + while read path action file; do + echo -e "${YELLOW}🔄 文件变化: $action $path$file${NC}" + echo -e "${BLUE}📋 开始同步...${NC}" + $SYNC_SCRIPT + echo -e "${GREEN}✅ 同步完成,继续监控...${NC}" + sleep 1 # 防止频繁触发 + done +fi diff --git a/src/apis/paths/document.ts b/src/apis/paths/document.ts index 368f28f48a683187fed746f0921179c875da56b8..1bfeced03ceca2712c8065dbe8afb3b46253fad1 100644 --- a/src/apis/paths/document.ts +++ b/src/apis/paths/document.ts @@ -9,13 +9,15 @@ // See the Mulan PSL v2 for more details. import { witchainDGet } from 'src/apis/server'; import type { FcResponse } from 'src/apis/server'; +import { getWitchainDAPIPrefix } from 'src/utils/tools'; /** * 获取文档解析方法列表 * @returns Promise<[any, FcResponse | undefined]> */ export const getParseMethodList = (): Promise<[any, FcResponse | undefined]> => { - return witchainDGet('/witchainD/other/parse_method'); + const apiPrefix = getWitchainDAPIPrefix(); + return witchainDGet(`${apiPrefix}/other/parse_method`); }; /** diff --git a/src/router/index.ts b/src/router/index.ts index 4d775945093349d548540bc5be15b0ae36fe3667..1fa0a405354ae3d9e758ec0db27798d40963ffe1 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -43,9 +43,9 @@ const staticRoutes: Array = [ > => import('src/views/createapp/index.vue'), }, { - path: '/witchainD', - name: 'witchainD', - children: [], // 这里不要添加component内容,否则会导致iframe重复渲染 + path: '/witchaind', + name: 'witchaind', + component: () => import('src/views/tools/index.vue'), }, { path: '/settings', diff --git a/src/utils/tools.ts b/src/utils/tools.ts index 063cfc43e18a0b7a2ccaea9954df126adc1fb5d0..d27aa9926dc7d036611f0e2f2e7cc57ebba435bb 100644 --- a/src/utils/tools.ts +++ b/src/utils/tools.ts @@ -155,3 +155,16 @@ export async function getWitchainDProxyUrl(): Promise { const witchainDUrl = import.meta.env.WITCHAIND_PROXY_URL; return typeof witchainDUrl === 'string' && witchainDUrl ? witchainDUrl : ''; } + +/** + * 获取 WitchainD API 路径前缀 + * 根据环境返回正确的API路径前缀 + * - 开发环境:/witchaind/api + * - 生产环境:/wtd/api + */ +export function getWitchainDAPIPrefix(): string { + // 开发环境使用 /witchaind/api,生产环境使用 /wtd/api + const isDevelopment = window.location.hostname === 'localhost' || + import.meta.env.MODE === 'development'; + return isDevelopment ? '/witchaind/api' : '/wtd/api'; +} diff --git a/src/views/dialogue/components/DialogueSession.vue b/src/views/dialogue/components/DialogueSession.vue index 6014d7305580ae1bf105459cebabd2edd094c77f..ae007a0162b4dd1fec634a7e76f15b46af18c971 100644 --- a/src/views/dialogue/components/DialogueSession.vue +++ b/src/views/dialogue/components/DialogueSession.vue @@ -899,7 +899,11 @@ function downloadFun(url: string) { } const downLoadSourceFile = (file: any) => { if (!file) return; - const url = `${window.origin}/witchaind/api/doc/download?docId=${file.documentId}`; + // 根据环境动态获取API前缀 + const isDevelopment = window.location.hostname === 'localhost' || + import.meta.env.MODE === 'development'; + const apiPrefix = isDevelopment ? '/witchaind/api' : '/wtd/api'; + const url = `${window.origin}${apiPrefix}/doc/download?docId=${file.documentId}`; downloadFun(url); }; diff --git a/src/views/dialogue/dialogueView.vue b/src/views/dialogue/dialogueView.vue index b180c088a2852ae1c0f70e6d3388be4e197dfdc4..0754b9d84d4bf4d6dabbd26dd93c6788f23deb69 100644 --- a/src/views/dialogue/dialogueView.vue +++ b/src/views/dialogue/dialogueView.vue @@ -81,10 +81,10 @@ let routerList: ComputedRef< }, { name: i18n.global.t('menu.sql'), - path: '/witchainD', + path: '/witchaind', src: WitChainDIcon, selectedSrc: WitChainDIconSelected, - routerName: 'witchainD', + routerName: 'witchaind', }, ]; }); @@ -145,10 +145,10 @@ const handleKnowledgeDialogClose = () => { const copy = () => { navigator.clipboard.writeText(apikey.value); }; - const handleConfirmCreateModel = async (formData: any | undefined) => { const [_, res] = await api.updateKnowledgeList({ - kb_ids: ruleForm.kb_id || '', + kb_ids: ruleForm.kb_id ? [ruleForm.kb_id] : [], + conversationId: '', }); if (!_ && res) { localStorage.setItem('kb_id', ruleForm.kb_id || ''); @@ -166,13 +166,6 @@ const handleFormValidate = (prop: any, isValid: boolean, message: string) => { }; onMounted(async () => { - const baseUrl = await getBaseUrl(); - const origin = window.location.origin; - const isElectron = window.navigator.userAgent.includes('Electron'); - const iframeTarget = isElectron - ? `${baseUrl}/witchaind` - : `${origin}/witchaind`; - if (localStorage.getItem('theme')) { // document.body.setAttribute( // 'theme', @@ -184,11 +177,6 @@ onMounted(async () => { } initCopilot(); - - const iframe = document.getElementById('my-iframe') as HTMLIFrameElement; - if (iframe) { - iframe.src = iframeTarget; - } }); watch( diff --git a/src/views/tools/index.vue b/src/views/tools/index.vue index 7f5fe2c874f3229730e3f617a165d68f299b47c3..7317341b79ab34ce5428e1cf45cacbabcb0b10dc 100644 --- a/src/views/tools/index.vue +++ b/src/views/tools/index.vue @@ -33,7 +33,7 @@ async function getIframeTarget() { const origin = window.location.origin; // Electron 环境的判断 const isElectron = window.navigator.userAgent.includes('Electron'); - const target = isElectron ? `${baseUrl}/witchaind` : `${origin}/witchaind`; + const target = isElectron ? `${baseUrl}/witchaind/` : `${origin}/witchaind/`; return target; } @@ -87,7 +87,7 @@ const sendTokenToIframe = async (token: string) => { watch( () => router.currentRoute.value.path, async (newPath) => { - const isWitchaindRoute = newPath === '/witchainD'; + const isWitchaindRoute = newPath === '/witchaind'; isActive.value = isWitchaindRoute; // 等待DOM更新完成 diff --git a/vite.config.ts b/vite.config.ts index 26b10af31427d8d337781dbd14aaa8a23c2e1029..e1ac6b0da86f6a7018178e5d6e10a130d404ac14 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -72,10 +72,10 @@ export default ({ mode }): UserConfigExport => { }, server: { - host: 'localhost', + host: env.VITE_HOST, hmr: true, - port: 8080, - origin: 'http://localhost:8080', + port: Number(env.VITE_PORT), + origin: env.VITE_ORIGIN, headers: { 'Access-Control-Allow-Origin': '*', }, @@ -93,13 +93,37 @@ export default ({ mode }): UserConfigExport => { rewrite: (path: string) => path, cookieDomainRewrite: '.euler-copilot-master.test.osinfra.cn', }, - '/witchainD': { - target: env.VITE_WITCHAIND_PROXY_URL, + // 代理 wtd API 接口到后端服务(生产环境中 /wtd 对应原来的 /witchaind API) + '/wtd': { + target: env.VITE_BASE_PROXY_URL, changeOrigin: true, secure: false, ws: false, - rewrite: (path: string) => path.replace(/^\/witchainD/, ''), + rewrite: (path: string) => path, cookieDomainRewrite: '.euler-copilot-master.test.osinfra.cn', + }, + // 代理 witchaind 前端应用,但排除已同步的静态资源 + '/witchaind': { + target: env.VITE_WITCHAIND_PROXY_URL, + changeOrigin: true, + secure: false, + ws: false, + bypass(req, res, options) { + // 只对已同步的静态资源 bypass 代理,其他请求(如 JS、CSS 模块)仍然代理 + if (req.url?.includes('/assets/') && + (req.url?.includes('.png') || + req.url?.includes('.jpg') || + req.url?.includes('.jpeg') || + req.url?.includes('.gif') || + req.url?.includes('.svg') || + req.url?.includes('.webp') || + req.url?.includes('.woff') || + req.url?.includes('.woff2') || + req.url?.includes('.ico'))) { + return req.url; + } + // JS、CSS、HTML 等文件继续代理到 witchaind 服务器 + } } }, }, diff --git a/web_diff/file_analyses/src_components_dialoguePanel_DialogueFlow.vue/analysis.md b/web_diff/file_analyses/src_components_dialoguePanel_DialogueFlow.vue/analysis.md deleted file mode 100644 index a4cc7e08d214d495468c432aba9a9ad78ca64707..0000000000000000000000000000000000000000 --- a/web_diff/file_analyses/src_components_dialoguePanel_DialogueFlow.vue/analysis.md +++ /dev/null @@ -1,57 +0,0 @@ -# 代码变更分析 - -## 1. 变更摘要 -该变更主要对DialogueFlow.vue组件进行了功能增强和UI优化,主要包括: -- 新增参数配置功能模块(ParamsModel组件) -- 增强流程状态处理逻辑 -- 改进UI样式和状态显示 -- 添加国际化支持和风险提示功能 - -## 2. 变更类型 -**重构 + 新增** - -## 3. 潜在影响 -- **功能增强**:新增了参数配置和风险提示功能,提升了用户体验 -- **状态处理**:扩展了流程状态的处理逻辑,增加了'waiting'和'cancelled'状态支持 -- **性能影响**:新增的watch监听逻辑可能影响组件渲染性能 -- **依赖变更**:引入了新的组件和store,增加了模块依赖 - -## 4. 注意事项 -1. **taskId判断逻辑问题**:多处使用`if (taskId)`判断,但taskId是ref对象,应该使用`if (taskId.value)` -2. **数据重复处理**:在watch中处理数据重复的逻辑可能存在性能问题 -3. **Props深度监听**:使用了`{ deep: true, immediate: true }`配置,需要注意性能影响 -4. **exParam数据处理**:exParam.value[0]在ParamsModel组件中被硬编码使用,可能存在数据不一致风险 - -## 5. 改进建议 - -### 5.1 代码质量优化 -```typescript -// 建议修正taskId判断逻辑 -// 错误写法: -if (taskId) { -// 正确写法: -if (taskId.value) { - -// 建议优化exParam使用方式 -// 当前硬编码使用exParam[0],建议传递具体索引或数据 -``` - -### 5.2 性能优化建议 -```typescript -// 优化数据去重逻辑 -const isDuplicate = contents.value[0].data[0].some( - (it) => it.id === item.id, -); -// 可以考虑使用Map或Set来提高查找性能 -``` - -### 5.3 功能完善建议 -1. **错误处理**:为async函数添加try-catch错误处理 -2. **类型安全**:为any类型添加具体类型定义 -3. **国际化**:确保所有用户界面文本都使用国际化 -4. **可访问性**:为按钮和交互元素添加适当的aria标签 - -### 5.4 代码结构建议 -1. 将复杂的逻辑提取为独立的组合式函数 -2. 对重复的状态判断逻辑进行封装 -3. 考虑将exData和exParam的处理逻辑抽象化 \ No newline at end of file diff --git a/web_diff/file_analyses/src_components_dialoguePanel_DialogueFlow.vue/src_components_dialoguePanel__DialogueFlow.vue.diff b/web_diff/file_analyses/src_components_dialoguePanel_DialogueFlow.vue/src_components_dialoguePanel__DialogueFlow.vue.diff deleted file mode 100644 index e134facd01912f1b13791a2705c992ba53165ff9..0000000000000000000000000000000000000000 --- a/web_diff/file_analyses/src_components_dialoguePanel_DialogueFlow.vue/src_components_dialoguePanel__DialogueFlow.vue.diff +++ /dev/null @@ -1,318 +0,0 @@ -diff --git a/src/components/dialoguePanel/DialogueFlow.vue b/src/components/dialoguePanel/DialogueFlow.vue -index e0c6a5d..e986a15 100644 ---- a/src/components/dialoguePanel/DialogueFlow.vue -+++ b/src/components/dialoguePanel/DialogueFlow.vue -@@ -1,9 +1,14 @@ - - -