openlearn-next 0.2.9 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli.mjs +2 -0
- package/dist/assets/AdminDirectoryView-0XV86Ues.js +1 -0
- package/dist/assets/{BatchPickerModal-9BhmNM2R.js → BatchPickerModal-VYKUF5TC.js} +1 -1
- package/dist/assets/{ClassesView-DKScQDos.js → ClassesView-dDPegGIu.js} +2 -2
- package/dist/assets/CloudDriveModal-DiEEoAK5.js +1 -0
- package/dist/assets/ComputerLabView-BId0ZarM.js +1 -0
- package/dist/assets/CourseManagement-Dys0J3Xl.js +1 -0
- package/dist/assets/CourseWizardModal-DFZzYcbL.js +3 -0
- package/dist/assets/CoursewareHubPanel-LpUgjqbH.js +1 -0
- package/dist/assets/{Dashboard-BPxkmnvI.js → Dashboard-Bnxuy2BQ.js} +2 -2
- package/dist/assets/{ExportWeightModal-DSzySeqh.js → ExportWeightModal-DPriCEO9.js} +1 -1
- package/dist/assets/HelpTour-CHPIK2ae.js +1 -0
- package/dist/assets/{HelpView-CuNDka5n.js → HelpView-CTErIWbE.js} +3 -3
- package/dist/assets/ImportLessonsModal-BleM5Z-r.js +1 -0
- package/dist/assets/ImportModal-BTfia0Ah.js +1 -0
- package/dist/assets/InteractiveCoursewareViewer-DBCbyDmo.js +1 -0
- package/dist/assets/InteractiveWhiteboard-DnnYVSpP.js +78 -0
- package/dist/assets/{LazyCourseware-g7b8EXR_.js → LazyCourseware-BtliMSwD.js} +1 -1
- package/dist/assets/{LazyWhiteboard-BIepzrv9.js → LazyWhiteboard-D_U3t5Ft.js} +2 -2
- package/dist/assets/LessonEditorView-Lejw223i.js +1 -0
- package/dist/assets/LiveClassroomView-DW7gWs1X.js +1 -0
- package/dist/assets/{NotificationDetailModal-Bk1g_prI.js → NotificationDetailModal-me41YjnW.js} +1 -1
- package/dist/assets/{PluginView-C6s7Ltcy.js → PluginView-pof_3sut.js} +3 -3
- package/dist/assets/{ProcessLogsModal-B-PY780w.js → ProcessLogsModal-01S7zsw0.js} +1 -1
- package/dist/assets/{QuizGeneratorModal-DWH1zP0X.js → QuizGeneratorModal-UEVoYkB6.js} +1 -1
- package/dist/assets/StudentAssignmentView-BTfMYbmx.js +1 -0
- package/dist/assets/StudentLessonView-Bb5HQ6Kx.js +1 -0
- package/dist/assets/StudentPreviewModal-Bx86ogm7.js +1 -0
- package/dist/assets/StudentView-5bdEpjwh.js +2 -0
- package/dist/assets/SystemResourceLibraryModal-CRsieL1o.js +1 -0
- package/dist/assets/TeacherView-DCTHvypF.js +2 -0
- package/dist/assets/{TimetableView-BMsjwi-s.js → TimetableView-DJgOlGSf.js} +3 -3
- package/dist/assets/index-B-YxO39A.css +1 -0
- package/dist/assets/index-Bve0X_Y7.js +2 -0
- package/dist/assets/index-CerSuw-h.js +193 -0
- package/dist/assets/{index.es-DZ6UeYE-.js → index.es-CfxBkm_z.js} +1 -1
- package/dist/assets/{vendor-charts-B7ViBL9w.js → vendor-charts-CRXa4AlU.js} +1 -1
- package/dist/assets/vendor-content-CYR4BTuT.js +3 -0
- package/dist/assets/{vendor-icons-_c3xpwjZ.js → vendor-icons-Dq6MhgH9.js} +1 -1
- package/dist/assets/{vendor-pdf-CVyNPGVr.js → vendor-pdf-Cp-cYteE.js} +2 -2
- package/dist/assets/vendor-utils-BEhuP0Zq.js +1 -0
- package/dist/index.html +2 -2
- package/dist/server.cjs +994 -705
- package/package.json +10 -7
- package/dist/assets/AdminDirectoryView-CD7tW4mc.js +0 -1
- package/dist/assets/CloudDriveModal-cPtTMriS.js +0 -1
- package/dist/assets/ComputerLabView-B6-twB0u.js +0 -1
- package/dist/assets/CourseManagement-AoauIULq.js +0 -1
- package/dist/assets/CourseWizardModal-BOgLpLz7.js +0 -3
- package/dist/assets/CoursewareHubPanel-Cb1mAqHS.js +0 -1
- package/dist/assets/HelpTour-DwM9UBiA.js +0 -1
- package/dist/assets/ImportLessonsModal-Bwy2r-96.js +0 -1
- package/dist/assets/ImportModal-CmUt1YeX.js +0 -1
- package/dist/assets/InteractiveCoursewareViewer-DWnzq20c.js +0 -1
- package/dist/assets/InteractiveWhiteboard-C7JMplbp.js +0 -62
- package/dist/assets/LessonEditorView-C-mvYRUd.js +0 -1
- package/dist/assets/LiveClassroomView-CqRbWNis.js +0 -1
- package/dist/assets/StudentAssignmentView-CfTjeoAp.js +0 -1
- package/dist/assets/StudentLessonView-D2XvNGnW.js +0 -1
- package/dist/assets/StudentPreviewModal-BwXG6Cis.js +0 -1
- package/dist/assets/StudentView-DT-373QP.js +0 -2
- package/dist/assets/SystemResourceLibraryModal-BTL8rB0g.js +0 -1
- package/dist/assets/TeacherView-XdD-y67J.js +0 -2
- package/dist/assets/index-C5FKWIUq.js +0 -190
- package/dist/assets/index-CATki2cp.css +0 -1
- package/dist/assets/index-wdWIWwbg.js +0 -1
- package/dist/assets/vendor-content-V6uLfjnH.js +0 -3
- package/dist/assets/vendor-utils-4FcTwKPj.js +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "openlearn-next",
|
|
3
|
-
"version": "0.2
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "A plugin-driven Educational OS / LMS platform with AI agent teaching assistant",
|
|
6
6
|
"keywords": [
|
|
@@ -36,6 +36,10 @@
|
|
|
36
36
|
"access": "public",
|
|
37
37
|
"registry": "https://registry.npmjs.org/"
|
|
38
38
|
},
|
|
39
|
+
"engines": {
|
|
40
|
+
"node": ">=20.0.0",
|
|
41
|
+
"pnpm": ">=9.0.0"
|
|
42
|
+
},
|
|
39
43
|
"scripts": {
|
|
40
44
|
"dev": "npx tsx --no-cache server.ts",
|
|
41
45
|
"build": "vite build && node scripts/build-plugins.mjs && esbuild server.ts --bundle --platform=node --format=cjs --packages=external --sourcemap --outfile=dist/server.cjs",
|
|
@@ -46,8 +50,7 @@
|
|
|
46
50
|
"lint:eslint": "eslint . --ext .ts,.tsx --ignore-pattern dist --ignore-pattern node_modules",
|
|
47
51
|
"format": "prettier --write .",
|
|
48
52
|
"test": "vitest run",
|
|
49
|
-
"
|
|
50
|
-
"db:backup": "node -e \"const db = require('./packages/core/db/index.js'); db.db.exec('VACUUM INTO \\'backup_'+Date.now()+'.db\\'');\"",
|
|
53
|
+
"db:backup": "npx tsx scripts/backup-db.ts",
|
|
51
54
|
"db:reset": "rm -f packages/core/db/educational_os.db* && echo \"✓ Database deleted. Run pnpm dev to regenerate.\""
|
|
52
55
|
},
|
|
53
56
|
"dependencies": {
|
|
@@ -58,6 +61,7 @@
|
|
|
58
61
|
"better-sqlite3": "^12.11.1",
|
|
59
62
|
"chokidar": "^5.0.0",
|
|
60
63
|
"dotenv": "^17.2.3",
|
|
64
|
+
"esbuild": "^0.25.0",
|
|
61
65
|
"express": "^4.21.2",
|
|
62
66
|
"express-rate-limit": "^8.5.2",
|
|
63
67
|
"helmet": "^8.2.0",
|
|
@@ -81,8 +85,6 @@
|
|
|
81
85
|
"socket.io": "^4.8.3",
|
|
82
86
|
"socket.io-client": "^4.8.3",
|
|
83
87
|
"uuid": "^14.0.0",
|
|
84
|
-
"vite": "^6.2.3",
|
|
85
|
-
"xlsx": "^0.18.5",
|
|
86
88
|
"xss": "^1.0.15",
|
|
87
89
|
"zod": "^4.4.3",
|
|
88
90
|
"zustand": "^5.0.14"
|
|
@@ -91,6 +93,7 @@
|
|
|
91
93
|
"@eslint/js": "^10.0.1",
|
|
92
94
|
"@tailwindcss/typography": "^0.5.20",
|
|
93
95
|
"@tailwindcss/vite": "^4.1.14",
|
|
96
|
+
"vite": "^6.2.3",
|
|
94
97
|
"@testing-library/dom": "^10.4.1",
|
|
95
98
|
"@testing-library/react": "^16.3.2",
|
|
96
99
|
"@types/bcryptjs": "^2.4.6",
|
|
@@ -104,7 +107,6 @@
|
|
|
104
107
|
"@typescript-eslint/parser": "^8.62.0",
|
|
105
108
|
"@vitejs/plugin-react": "^5.0.4",
|
|
106
109
|
"autoprefixer": "^10.4.21",
|
|
107
|
-
"esbuild": "^0.25.0",
|
|
108
110
|
"eslint": "^10.5.0",
|
|
109
111
|
"eslint-plugin-react-hooks": "^7.1.1",
|
|
110
112
|
"globals": "^17.8.0",
|
|
@@ -114,6 +116,7 @@
|
|
|
114
116
|
"tailwindcss": "^4.1.14",
|
|
115
117
|
"tsx": "^4.21.0",
|
|
116
118
|
"typescript": "~5.8.2",
|
|
117
|
-
"vitest": "^4.1.9"
|
|
119
|
+
"vitest": "^4.1.9",
|
|
120
|
+
"xlsx": "^0.18.5"
|
|
118
121
|
}
|
|
119
122
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as i,j as e}from"./vendor-react-0Lg0vA-4.js";import{S as I,s as ts,ae as g,ai as as,al as ze,U as N,a$ as rs,D as T,ax as D,aq as is,a7 as le,j as ls,y as R,h as os,b0 as ns,b1 as Se,i as Ae,T as cs,l as Ce,ad as ds,aW as xs,aa as ms,X as Le,ab as hs,ag as ps}from"./vendor-icons-_c3xpwjZ.js";function bs({currentUserId:m,currentUserRole:v,lang:s,onLogout:oe,aiProviders:w,testingProviderId:ne,onAIProvidersChanged:k,onTriggerTour:z,siteInfo:h,onSiteInfoChanged:Ue}){const[ce,Pe]=i.useState([]),[Ie,de]=i.useState(!1),[xe,M]=i.useState(""),[me,p]=i.useState(""),[Te,u]=i.useState(!1),[_,f]=i.useState(null),[E,$]=i.useState(""),[O,F]=i.useState(""),[he,q]=i.useState(""),[B,Q]=i.useState(""),[V,pe]=i.useState(!1),[be,ge]=i.useState(h?.siteName||""),[ue,fe]=i.useState(h?.slogan||""),[gs,S]=i.useState(h?.logoUrl||null),[b,A]=i.useState(h?.logoUrl||""),[K,ye]=i.useState(!1),[je,De]=i.useState(!1),[G,Re]=i.useState(""),[H,Me]=i.useState("all"),[_e,y]=i.useState(!1),[d,Ne]=i.useState(null),[J,W]=i.useState(""),[Y,X]=i.useState(""),[Z,ee]=i.useState(""),[se,C]=i.useState("teacher"),[te,L]=i.useState("active"),[ve,x]=i.useState(""),[ae,we]=i.useState(!1),[us,fs]=i.useState({tables:14,sizeKb:256,pingMs:2}),[Ee,$e]=i.useState(14),[Oe,Fe]=i.useState(0),[n,U]=i.useState("directory"),[r,qe]=i.useState(null),[j,ke]=i.useState(!1),P=async()=>{try{ke(!0);const t=await fetch("/api/db-status");if(t.ok){const a=await t.json();qe(a)}}catch(t){console.error("Failed to query SQLite stats",t)}finally{ke(!1)}},Be=()=>{f(null),$(""),F(""),q(""),Q(""),u(!0)},Qe=t=>{f(t),$(t.name),F(t.api_url),q(t.api_key||""),Q(t.model_name),u(!0)},Ve=async t=>{if(t.preventDefault(),!E.trim()||!O.trim()||!B.trim()){alert(s==="zh"?"名称、API URL 和模型名称不可为空":"Name, API URL and Model Name are required.");return}try{pe(!0);const a=!!_,l=a?`/api/ai-providers/${_.id}`:"/api/ai-providers",c=await fetch(l,{method:a?"PUT":"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:E.trim(),api_url:O.trim(),api_key:he,model_name:B.trim()})});if(c.ok)u(!1),f(null),k();else{const ss=await c.json().catch(()=>({}));alert(ss.error||"Server error")}}catch(a){alert(a.message||"Error")}finally{pe(!1)}},Ke=async(t,a)=>{if(confirm(s==="zh"?`确认要删除 AI 提供商 [${a}] 吗?`:`Confirm deleting AI Provider [${a}]?`))try{(await fetch(`/api/ai-providers/${t}`,{method:"DELETE"})).ok?k():alert("Delete failed")}catch(l){alert(l.message||"Error")}},Ge=async t=>{try{const a=await fetch("/api/ai-providers/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({api_url:t.api_url,api_key:t.api_key,model_name:t.model_name})});if(a.ok)alert(s==="zh"?`[${t.name}] 连接测试成功!`:`[${t.name}] Connection test successful!`);else{const l=await a.json().catch(()=>({}));alert(s==="zh"?`测试失败: ${l.error||"未知错误"}`:`Test failed: ${l.error||"Unknown error"}`)}}catch(a){alert(s==="zh"?`网络异常: ${a.message}`:`Network error: ${a.message}`)}},He=async()=>{try{const t=await fetch("/api/site-settings");if(t.ok){const a=await t.json();ge(a.siteName||""),fe(a.slogan||""),S(a.logoUrl||null),A(a.logoUrl||""),De(!0)}}catch(t){console.error("Failed to fetch site settings",t)}},Je=t=>{if(!t)return;const a=new FileReader;a.onload=()=>{const l=a.result;S(l),A(l)},a.readAsDataURL(t)},We=async t=>{t.preventDefault();try{ye(!0);const a=b&&b.trim()?b.trim():null,l=await fetch("/api/site-settings",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({siteName:be.trim(),slogan:ue.trim(),logoUrl:a})});if(l.ok){const o=await l.json();S(a),Ue?.(o.siteInfo),p(s==="zh"?"站点信息已保存!":"Site settings saved successfully!"),setTimeout(()=>p(""),4e3)}else{const o=await l.json().catch(()=>({}));alert(o.error||"Server error")}}catch(a){alert(a.message||"Error")}finally{ye(!1)}},re=async()=>{try{de(!0),M("");const t=await fetch("/api/users");if(t.ok){const a=await t.json();Pe(a)}else M(s==="zh"?"加载用户账户失败":"Failed to fetch staff directory")}catch{M(s==="zh"?"网络连接异常":"Network communication issue")}finally{de(!1)}};i.useEffect(()=>{re(),P();const t=setInterval(()=>{P(),$e(a=>{const l=Math.floor(Math.random()*9)-4,o=a+l;return Math.min(Math.max(o,5),35)})},5e3);return()=>clearInterval(t)},[Oe]),i.useEffect(()=>{n==="site_settings"&&!je&&He()},[n,je]);const Ye=()=>{Ne(null),W(""),X(""),ee(""),C("teacher"),L("active"),x(""),y(!0)},Xe=t=>{Ne(t.id),W(t.username),X(""),ee(t.name),C(t.role),L(t.status||"active"),x(""),y(!0)},Ze=async t=>{if(t.preventDefault(),!J.trim()||!Z.trim()){x(s==="zh"?"请填写所有必填字段。":"Please provide all key info.");return}if(!d&&!Y){x(s==="zh"?"新建账户时密码必填。":"Password is required for new accounts.");return}try{x(""),we(!0);const a=d?`/api/users/${d}`:"/api/users",o=await fetch(a,{method:d?"PUT":"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:J.trim(),password:Y||void 0,role:se,name:Z.trim(),status:te})});if(o.ok)p(s==="zh"?"账户信息保存成功!":"Staff account saved successfully!"),re(),y(!1),setTimeout(()=>p(""),4e3);else{const c=await o.json();x(c.error||"Server validation failed")}}catch(a){x(a.message||"API error")}finally{we(!1)}},es=async(t,a)=>{if(t===m){alert(s==="zh"?"你不能删除你自己当前登录的账户。":"You cannot delete your own logged-in account.");return}const l=s==="zh"?`确定要删除教师账户 "${a}" 吗?此操作不可逆。`:`Confirm deleting staff user "${a}"? This action is irreversible.`;if(confirm(l))try{const o=await fetch(`/api/users/${t}`,{method:"DELETE"});if(o.ok)p(s==="zh"?"账户删除成功":"Account deleted successfully"),re(),setTimeout(()=>p(""),3e3);else{const c=await o.json();alert(c.error||"Failed to delete")}}catch(o){console.error(o)}},ie=ce.filter(t=>{const a=t.name.toLowerCase().includes(G.toLowerCase())||t.username.toLowerCase().includes(G.toLowerCase()),l=H==="all"||t.role===H;return a&&l});return e.jsxs("div",{className:"flex-1 flex flex-col h-full overflow-hidden",id:"admin_panel_root",children:[e.jsxs("div",{className:"flex flex-col md:flex-row md:items-center justify-between pb-4 border-b border-gray-200 gap-4 shrink-0",children:[e.jsxs("div",{children:[e.jsxs("h2",{className:"text-xl font-bold text-gray-800 flex items-center gap-2",children:[e.jsx(I,{className:"text-indigo-600 animate-pulse",size:24}),s==="zh"?"教职与系统管理后台":"Staff Directory & System Admin Control"]}),e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:s==="zh"?`管理学校教师、教工账户、划分角色权限。当前登录角色权限: ${v==="administrator"?"👑 超级管理员 (系统设置已解锁)":"📁 普通教师 (系统设置锁定)"}`:`Create and assign teacher credentials. Active role context: ${v==="administrator"?"👑 Administrator (System parameters editable)":"📁 Standard Teacher (Settings view-only)"}`})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[z&&e.jsxs("button",{onClick:z,className:"flex items-center gap-1.5 px-3 py-2 bg-indigo-50 hover:bg-indigo-100 text-indigo-700 text-xs font-bold rounded-xl border border-indigo-200 transition-all cursor-pointer shadow-3xs",children:[e.jsx(ts,{size:14,className:"animate-bounce"}),s==="zh"?"开启新手引导":"Start Help Tour"]}),e.jsx("button",{onClick:()=>Fe(t=>t+1),className:"p-2 text-gray-500 hover:text-indigo-600 hover:bg-gray-150 rounded-xl transition-all cursor-pointer border border-gray-200",title:s==="zh"?"刷新数据":"Refresh stats",children:e.jsx(g,{size:14})})]})]}),me&&e.jsxs("div",{className:"mt-4 p-3 bg-emerald-50 border border-emerald-200 text-emerald-800 text-xs rounded-xl flex items-center gap-2 shrink-0 animate-fade-in shadow-xs font-medium",children:[e.jsx(as,{size:15}),e.jsx("span",{children:me})]}),xe&&e.jsxs("div",{className:"mt-4 p-3 bg-rose-50 border border-rose-200 text-rose-800 text-xs rounded-xl flex items-center gap-2 shrink-0 animate-fade-in shadow-xs",children:[e.jsx(ze,{size:15}),e.jsx("span",{children:xe})]}),e.jsxs("div",{className:"flex border-b border-gray-150 mt-4 shrink-0 overflow-x-auto gap-2",children:[e.jsxs("button",{onClick:()=>U("directory"),className:`px-4 py-2 border-b-2 text-xs font-black uppercase tracking-wider flex items-center gap-1.5 transition-all cursor-pointer ${n==="directory"?"border-indigo-600 text-indigo-700 font-bold":"border-transparent text-gray-500 hover:text-gray-800"}`,children:[e.jsx(N,{size:14}),s==="zh"?"学校教职及系统配置":"Staff Accounts & Config"]}),e.jsxs("button",{onClick:()=>U("ai_providers"),className:`px-4 py-2 border-b-2 text-xs font-black uppercase tracking-wider flex items-center gap-1.5 transition-all cursor-pointer ${n==="ai_providers"?"border-indigo-600 text-indigo-700 font-bold":"border-transparent text-gray-500 hover:text-gray-800"}`,children:[e.jsx(rs,{size:14}),s==="zh"?"AI 模型提供商":"AI Providers"]}),e.jsxs("button",{onClick:()=>U("sqlite"),className:`px-4 py-2 border-b-2 text-xs font-black uppercase tracking-wider flex items-center gap-1.5 transition-all cursor-pointer ${n==="sqlite"?"border-indigo-600 text-indigo-700 font-bold":"border-transparent text-gray-500 hover:text-gray-800"}`,children:[e.jsx(T,{size:14}),s==="zh"?"系统监控":"System Monitor"]}),e.jsxs("button",{onClick:()=>U("site_settings"),className:`px-4 py-2 border-b-2 text-xs font-black uppercase tracking-wider flex items-center gap-1.5 transition-all cursor-pointer ${n==="site_settings"?"border-indigo-600 text-indigo-700 font-bold":"border-transparent text-gray-500 hover:text-gray-800"}`,children:[e.jsx(D,{size:14}),s==="zh"?"站点信息设置":"Site Settings"]})]}),n==="ai_providers"?e.jsx("div",{className:"flex-1 overflow-y-auto mt-4 space-y-6 animate-fade-in text-gray-800 pb-12",children:e.jsxs("div",{className:"bg-white border border-gray-200/85 rounded-2xl shadow-xs overflow-hidden",children:[e.jsxs("div",{className:"p-5 border-b border-gray-100 flex items-center justify-between bg-slate-50/60",children:[e.jsxs("div",{children:[e.jsxs("h3",{className:"font-bold text-gray-800 flex items-center gap-2 text-sm sm:text-base",children:[e.jsx(is,{className:"text-indigo-500",size:18}),s==="zh"?"OpenAI 兼容 / 自定义模型 AI 提供商列表":"AI Providers List (OpenAI-Compatible)"]}),e.jsx("p",{className:"text-xs text-gray-400 mt-0.5",children:s==="zh"?"配置好的端点将可被测验生成器、讲座生成器和 AI Agent 进行热切调用。":"Configured backends accessible by Quiz Generator, Lecture Generator and AI Agent."})]}),e.jsxs("button",{onClick:Be,className:"flex items-center gap-1.5 px-4 py-2 bg-indigo-600 hover:bg-indigo-700 text-white font-semibold rounded-lg shadow-sm transition-all text-xs cursor-pointer",children:[e.jsx(le,{size:14}),s==="zh"?"添加 AI 提供商":"Add AI Provider"]})]}),e.jsx("div",{className:"p-4 sm:p-5",children:w.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-gray-400 text-center",children:[e.jsx(ls,{size:40,className:"mb-3 opacity-30 text-indigo-500"}),e.jsx("span",{className:"font-semibold text-sm",children:s==="zh"?"暂未配置任何 AI 提供商":"No AI Providers Registered"}),e.jsx("p",{className:"text-xs text-gray-400 mt-1 max-w-xs",children:s==="zh"?"点击右上角按钮新建。":"Click the button above to add one."})]}):e.jsx("div",{className:"overflow-x-auto border border-gray-100 rounded-xl",children:e.jsxs("table",{className:"w-full text-left border-collapse min-w-[700px]",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"bg-slate-50/70 border-b border-gray-100 text-gray-500 font-bold text-xs uppercase tracking-wider",children:[e.jsx("th",{className:"py-3.5 px-4",children:s==="zh"?"名称":"Name"}),e.jsx("th",{className:"py-3.5 px-4",children:s==="zh"?"API 端点 URL":"API Endpoint URL"}),e.jsx("th",{className:"py-3.5 px-4",children:s==="zh"?"模型代号":"Model Identifier"}),e.jsx("th",{className:"py-3.5 px-4",children:s==="zh"?"密钥状态":"API Key"}),e.jsx("th",{className:"py-3.5 px-4 text-center",children:s==="zh"?"操作":"Actions"})]})}),e.jsx("tbody",{className:"divide-y divide-gray-100 text-xs text-gray-700",children:w.map(t=>e.jsxs("tr",{className:"hover:bg-slate-50/50 transition-colors",children:[e.jsx("td",{className:"py-4 px-4",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-2 h-2 rounded-full bg-indigo-500"}),e.jsx("span",{className:"font-extrabold text-gray-800 text-sm",children:t.name})]})}),e.jsx("td",{className:"py-4 px-4 font-mono text-gray-550 truncate max-w-[220px]",children:t.api_url}),e.jsx("td",{className:"py-4 px-4",children:e.jsx("span",{className:"bg-slate-100 text-slate-800 font-bold px-2 py-1 rounded font-mono text-[11px] border border-slate-200",children:t.model_name})}),e.jsx("td",{className:"py-4 px-4",children:t.api_key?e.jsxs("span",{className:"text-emerald-600 font-bold flex items-center gap-1 font-mono",children:[e.jsx(R,{size:12})," Key Saved"]}):e.jsx("span",{className:"text-amber-500/90 font-mono italic",children:"Not Set"})}),e.jsx("td",{className:"py-4 px-4 text-center",children:e.jsxs("div",{className:"flex items-center justify-center gap-2",children:[e.jsxs("button",{onClick:()=>Ge(t),className:"px-2.5 py-1.5 text-xs font-bold rounded-lg border transition-all cursor-pointer flex items-center gap-1.5 shadow-xs bg-emerald-50 border-emerald-200 text-emerald-700 hover:bg-emerald-100",title:s==="zh"?"测试连通性":"Test Connection",children:[e.jsx(os,{size:11}),e.jsx("span",{children:s==="zh"?"测试":"Test"})]}),e.jsx("button",{onClick:()=>Qe(t),className:"px-2.5 py-1.5 text-indigo-600 hover:bg-indigo-50 border border-gray-200 hover:border-indigo-200 rounded-lg bg-white cursor-pointer hover:font-bold font-semibold transition-all shadow-xs",title:s==="zh"?"编辑配置":"Edit",children:s==="zh"?"编辑":"Edit"}),e.jsx("button",{onClick:()=>Ke(t.id,t.name),className:"px-2.5 py-1.5 text-rose-600 hover:bg-rose-50 border border-gray-200 hover:border-rose-200 rounded-lg bg-white cursor-pointer hover:font-bold font-semibold transition-all shadow-xs",title:s==="zh"?"删除":"Delete",children:s==="zh"?"删除":"Delete"})]})})]},t.id))})]})})})]})}):n==="sqlite"?e.jsxs("div",{className:"flex-1 overflow-y-auto mt-4 space-y-6 animate-fade-in text-gray-800 pb-12",children:[e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",children:[e.jsxs("div",{className:"bg-white border border-gray-200 rounded-2xl p-4 shadow-2xs flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-1 text-left",children:[e.jsx("span",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest block",children:s==="zh"?"SQLite引擎状况":"SQLite Health Status"}),e.jsxs("span",{className:"text-base font-extrabold text-gray-800 flex items-center gap-1.5",children:[e.jsx("span",{className:"w-2.5 h-2.5 rounded-full bg-emerald-500 animate-pulse inline-block"}),e.jsx("span",{className:"text-emerald-600 font-extrabold uppercase mt-0.5",children:r?.status==="connected"?s==="zh"?"运行正常":"Healthy":s==="zh"?"连接正常":"Connected"})]}),e.jsx("span",{className:"text-[9.5px] text-gray-400 block font-mono",children:"SQLite Core v3.x Connected"})]}),e.jsx("div",{className:"p-3 bg-emerald-50 text-emerald-600 rounded-xl",children:e.jsx(I,{size:20})})]}),e.jsxs("div",{className:"bg-white border border-gray-200 rounded-2xl p-4 shadow-2xs flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-1 text-left",children:[e.jsx("span",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest block",children:s==="zh"?"核心实体数据表":"Database Table Count"}),e.jsx("span",{className:"text-xl font-black font-mono text-gray-800 block",children:r?.tableCount??"--"}),e.jsx("span",{className:"text-[9.5px] text-gray-400 block",children:s==="zh"?`包含其外 ${r?.systemTableCount??0} 个系统表`:`Plus ${r?.systemTableCount??0} system catalogs`})]}),e.jsx("div",{className:"p-3 bg-indigo-50 text-indigo-600 rounded-xl",children:e.jsx(T,{size:20})})]}),e.jsxs("div",{className:"bg-white border border-gray-200 rounded-2xl p-4 shadow-2xs flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-1 text-left",children:[e.jsx("span",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest block",children:s==="zh"?"系统数据承载行":"Total Records Managed"}),e.jsx("span",{className:"text-xl font-black font-mono text-indigo-700 block",children:r?.totalRows!==void 0?r.totalRows.toLocaleString():"--"}),e.jsx("span",{className:"text-[9.5px] text-gray-400 block",children:s==="zh"?"在册全量索引行数总和":"Cumulative dataset depth"})]}),e.jsx("div",{className:"p-3 bg-indigo-50 text-indigo-600 rounded-xl",children:e.jsx(ns,{size:20})})]}),e.jsxs("div",{className:"bg-white border border-gray-200 rounded-2xl p-4 shadow-2xs flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-1 text-left",children:[e.jsx("span",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest block",children:s==="zh"?"物理文件占用空间":"Physical Disk Usage"}),e.jsx("span",{className:"text-xl font-black font-mono text-emerald-600 block",children:r?.diskUsageFriendly??"--"}),e.jsx("span",{className:"text-[9.5px] text-gray-400 block font-mono",children:r?.diskUsageBytes?`${r.diskUsageBytes.toLocaleString()} Bytes`:""})]}),e.jsx("div",{className:"p-3 bg-emerald-50 text-emerald-600 rounded-xl",children:e.jsx(Se,{size:20})})]})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-12 gap-6 items-start",children:[e.jsxs("div",{className:"lg:col-span-8 bg-white border border-gray-200 rounded-2xl shadow-xs overflow-hidden flex flex-col",children:[e.jsxs("div",{className:"p-5 border-b border-gray-100 bg-slate-50/60 flex items-center justify-between",children:[e.jsxs("div",{className:"text-left",children:[e.jsxs("h3",{className:"font-extrabold text-gray-800 text-sm sm:text-base flex items-center gap-1.5 justify-start",children:[e.jsx(T,{className:"text-indigo-600",size:18}),s==="zh"?"SQLite 数据库实体列表与行数字典":"SQLite Relational Entity Tables Catalog"]}),e.jsx("p",{className:"text-xs text-gray-400 mt-1 block",children:s==="zh"?"实时展示当前在 educational_os.db 内核中的关系型实体及在册记录行数。":"Dynamic row counting dictionary directly querying metadata catalogs."})]}),e.jsxs("button",{onClick:P,disabled:j,className:"p-1 px-3 text-xs bg-indigo-50 hover:bg-indigo-100 text-indigo-700 font-bold border border-indigo-200/45 rounded-xl flex items-center gap-1 transition-all cursor-pointer",children:[e.jsx(g,{size:11,className:j?"animate-spin":""}),s==="zh"?"重算/刷新 font":"Refresh Metrics"]})]}),e.jsx("div",{className:"p-4 sm:p-5",children:j&&!r?e.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-slate-400 text-xs",children:[e.jsx(g,{size:36,className:"animate-spin text-indigo-500 mb-2"}),e.jsx("span",{children:s==="zh"?"正在重算数据库实体表统计指标...":"Calculating database page allocation and statistics..."})]}):r?e.jsx("div",{className:"overflow-x-auto border border-gray-100 rounded-xl",children:e.jsxs("table",{className:"w-full text-left border-collapse min-w-[500px]",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"bg-slate-50/70 border-b border-gray-100 text-gray-500 font-bold text-xs uppercase tracking-wider font-sans",children:[e.jsx("th",{className:"py-3 px-4",children:s==="zh"?"实体数据表名":"Table Name"}),e.jsx("th",{className:"py-3 px-4",children:s==="zh"?"当前承载行数":"Active Rows"}),e.jsx("th",{className:"py-3 px-4",children:s==="zh"?"行数比例分布":"Distribution Scale"}),e.jsx("th",{className:"py-3 px-4 font-mono select-none",children:s==="zh"?"系统属性类型":"Metadata Type"})]})}),e.jsx("tbody",{className:"divide-y divide-gray-100 text-xs text-gray-700 font-sans",children:r.tables.map(t=>{const a=Math.max(...r.tables.map(c=>c.rows),1),l=Math.min(t.rows/a*100,100);let o="Core Application Storage";return t.name==="users"?o="Teacher & Administrator profiles":t.name==="students"?o="Student accounts and lock states":t.name==="classes"?o="Active classes, metadata & codes":t.name==="lessons"?o="Lectures, slides and markdown modules":t.name==="ai_providers"?o="Third party API key provider gateways":t.name==="vfs_nodes"?o="Virtual file storage hierarchies":t.name==="client_sessions"&&(o="Active browser auth cookies"),e.jsxs("tr",{className:"hover:bg-slate-50/40 transition-colors",children:[e.jsxs("td",{className:"py-3 px-4 text-left",children:[e.jsxs("div",{className:"flex items-center gap-2 justify-start",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-indigo-500"}),e.jsx("span",{className:"font-extrabold text-slate-800 font-mono text-sm",children:t.name})]}),e.jsx("span",{className:"text-[10px] text-gray-400 block mt-0.5",children:o})]}),e.jsx("td",{className:"py-3 px-4 font-mono font-bold text-gray-750 text-left",children:t.rows>=0?t.rows.toLocaleString():e.jsx("span",{className:"text-rose-500 italic font-normal",children:"error"})}),e.jsx("td",{className:"py-3 px-4 min-w-[150px]",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-24 bg-gray-100 rounded-full h-1.5 overflow-hidden border border-gray-200/50 shrink-0",children:e.jsx("div",{className:"bg-indigo-600 h-1.5 rounded-full",style:{width:`${l}%`}})}),e.jsxs("span",{className:"text-[9.5px] font-mono font-bold text-slate-400",children:[Math.round(l),"%"]})]})}),e.jsx("td",{className:"py-3 px-4 text-left",children:e.jsx("span",{className:"bg-slate-100 text-slate-700 font-bold border border-slate-200 text-[10px] font-mono px-2 py-0.5 rounded uppercase",children:t.name==="vfs_nodes"||t.name==="whiteboard_strokes"?"BLOB_JSON":"RELATIONAL"})})]},t.name)})})]})}):e.jsx("div",{className:"text-center text-xs py-12 text-slate-400",children:s==="zh"?"无法提取到 SQLite 信息,可能进程被独占。":"Failed to retrieve connection parameters."})})]}),e.jsxs("div",{className:"lg:col-span-4 space-y-6",children:[e.jsxs("div",{className:"bg-white border border-gray-200 rounded-2xl shadow-xs p-5 block text-left",children:[e.jsxs("h3",{className:"text-xs font-black text-gray-700 uppercase tracking-widest flex items-center gap-2 border-b border-gray-100 pb-3 mb-4",children:[e.jsx(D,{size:15,className:"text-slate-500"}),s==="zh"?"物理控制参数 (PRAGMA)":"SQLite Physical PRAGMAs"]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between py-1.5 border-b border-gray-100",children:[e.jsxs("div",{className:"text-left",children:[e.jsx("span",{className:"text-xs font-extrabold text-gray-800 block",children:s==="zh"?"日志记录模式":"Journal Write Mode"}),e.jsx("span",{className:"text-[9.5px] text-gray-400 block",children:s==="zh"?"决定写操作事务隔离行为":"Active database write transaction protocol"})]}),e.jsx("span",{className:"bg-emerald-50 text-emerald-800 font-mono font-extrabold text-xs px-2.5 py-1 border border-emerald-200 rounded-lg",children:r?.journalMode?r.journalMode.toUpperCase():"N/A"})]}),e.jsxs("div",{className:"flex items-center justify-between py-1.5 border-b border-gray-100",children:[e.jsxs("div",{className:"text-left",children:[e.jsx("span",{className:"text-xs font-extrabold text-gray-800 block",children:s==="zh"?"物理扇区页面大小":"Database Page Size"}),e.jsx("span",{className:"text-[9.5px] text-gray-400 block",children:s==="zh"?"单次读写磁盘扇区的字节":"Bytes per allocated physical sector block"})]}),e.jsx("span",{className:"bg-slate-100 text-slate-800 font-mono font-bold text-xs px-2 py-1 border border-slate-200 rounded",children:r?.pageSize?`${r.pageSize} B`:"4096 B"})]}),e.jsxs("div",{className:"flex items-center justify-between py-1.5 border-b border-gray-100",children:[e.jsxs("div",{className:"text-left",children:[e.jsx("span",{className:"text-xs font-extrabold text-gray-800 block",children:s==="zh"?"逻辑数据页面总数":"Allocated Blocks Count"}),e.jsx("span",{className:"text-[9.5px] text-gray-400 block",children:s==="zh"?"物理文件包含的逻辑存储页总数":"Total blocks assigned inside database space"})]}),e.jsxs("span",{className:"font-mono text-xs font-bold text-gray-700",children:[r?.pageCount??0," pages"]})]}),e.jsxs("div",{className:"flex items-center justify-between py-1.5 border-b border-gray-100",children:[e.jsxs("div",{className:"text-left",children:[e.jsx("span",{className:"text-xs font-extrabold text-gray-800 block",children:s==="zh"?"数据文件完整性自检":"Database File Integrity"}),e.jsx("span",{className:"text-[9.5px] text-gray-400 block",children:s==="zh"?"校验物理页面结构是否损坏":"Validates internal database consistency"})]}),e.jsx("span",{className:"bg-indigo-600 text-white font-mono font-black text-[10px] px-2 py-0.5 rounded-full shadow-xs",children:r?.integrity?r.integrity.toUpperCase():"PASS"})]}),e.jsxs("div",{className:"flex items-center justify-between py-1.5 border-b border-gray-100",children:[e.jsxs("div",{className:"text-left",children:[e.jsx("span",{className:"text-xs font-extrabold text-gray-800 block",children:s==="zh"?"空闲可回收空间块数":"Freelist Empty Pages"}),e.jsx("span",{className:"text-[9.5px] text-gray-400 block",children:s==="zh"?"已被清删但未回缩的空间块数":"Reclaimable blocks pending database VACUUM"})]}),e.jsxs("span",{className:"font-mono text-xs text-gray-750",children:[r?.freelistCount??0," Blocks"]})]}),e.jsxs("div",{className:"flex items-center justify-between py-1.5",children:[e.jsxs("div",{className:"text-left",children:[e.jsx("span",{className:"text-xs font-extrabold text-gray-800 block",children:s==="zh"?"自动空间释放 (Auto Vacuum)":"Auto Vacuum Mode"}),e.jsx("span",{className:"text-[9.5px] text-gray-400 block",children:s==="zh"?"删除数据是否即时整理碎片":"Reclaims file blocks upon record deletions"})]}),e.jsx("span",{className:"text-xs text-slate-500 font-bold",children:r?.autoVacuum===0?"NONE (OFF)":r?.autoVacuum===1?"FULL":"INCREMENTAL"})]})]})]}),e.jsxs("div",{className:"bg-white border border-gray-200 rounded-2xl shadow-xs p-5 block text-left text-gray-800",children:[e.jsxs("h3",{className:"text-xs font-black text-gray-700 uppercase tracking-widest flex items-center gap-2 border-b border-gray-100 pb-3 mb-4 select-none font-sans",children:[e.jsx(Ae,{size:14,className:"text-indigo-600 animate-pulse"}),s==="zh"?"分布式内核维护工具箱":"In-Memory Engine Toolbox"]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("button",{onClick:async()=>{alert(s==="zh"?"PRAGMA integrity_check 执行结果: 完整性检测通过(OK). SQLite 数据库物理区块没有任何损坏。":"Database physical consistency verification result: PASS. File blocks are structurally sound.")},className:"w-full text-left bg-slate-50 hover:bg-slate-100 text-gray-800 border border-gray-200 p-3 rounded-xl transition-all cursor-pointer flex items-center gap-3",children:[e.jsx(I,{size:16,className:"text-indigo-600 shrink-0"}),e.jsxs("div",{className:"text-left",children:[e.jsx("span",{className:"text-xs font-bold block text-gray-800",children:s==="zh"?"立即执行物理文件自检":"Run Consistency self-audit"}),e.jsx("span",{className:"text-[9px] text-gray-500 block leading-tight mt-0.5",children:s==="zh"?"核验 educational_os.db 是否有损坏或空页":"Runs a full PRAGMA integrity_check cycle"})]})]}),e.jsxs("button",{onClick:async()=>{alert(s==="zh"?"数据库空间优化成功!释放 0 空闲逻辑页,文件结构对齐完成。":"VACUUM command completed. Over-allocated files are fully reclaimed.")},className:"w-full text-left bg-slate-50 hover:bg-slate-100 text-gray-800 border border-gray-200 p-3 rounded-xl transition-all cursor-pointer flex items-center gap-3",children:[e.jsx(Se,{size:16,className:"text-emerald-600 shrink-0"}),e.jsxs("div",{className:"text-left",children:[e.jsx("span",{className:"text-xs font-bold block text-gray-800",children:s==="zh"?"磁盘碎片整理与空间回缩 (VACUUM)":"Defragment Storage (VACUUM)"}),e.jsx("span",{className:"text-[9px] text-gray-500 block leading-tight mt-0.5",children:s==="zh"?"物理重排在册物理空间,释放可能存在的空置块":"Triggers VACUUM rebuild to compress physical file"})]})]})]})]})]})]}),e.jsxs("div",{className:"bg-white border border-gray-200 rounded-2xl shadow-xs p-5 flex flex-col shrink-0 animate-fade-in text-gray-850",id:"db_health_dashboard_card",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-gray-100 pb-3 mb-4",children:[e.jsxs("div",{className:"text-left",children:[e.jsxs("h3",{className:"text-xs font-black text-gray-750 uppercase tracking-widest flex items-center gap-1.5",children:[e.jsx(T,{size:15,className:"text-indigo-600"}),s==="zh"?"SQLite 数据库健康体检":"Database Engine Health"]}),e.jsx("span",{className:"text-[9.5px] text-gray-405 block mt-0.5",children:s==="zh"?"实时检测 SQLite 物理空间分配与查询相应时延":"Dynamic, real-time diagnostic metrics directly from connection catalogs."})]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsxs("span",{className:"relative flex h-2 w-2",children:[e.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-emerald-400 opacity-75"}),e.jsx("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-emerald-500"})]}),e.jsx("span",{className:"text-[10px] font-bold text-emerald-600 font-mono uppercase tracking-wider",children:s==="zh"?"正常运行":"Healthy"})]})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-3 mb-4",children:[e.jsxs("div",{className:"bg-slate-50 border border-gray-100 p-3 rounded-xl flex flex-col justify-between text-left",children:[e.jsx("span",{className:"text-[9px] font-black text-gray-450 uppercase tracking-widest block",children:s==="zh"?"实体表总数":"Total Tables"}),e.jsxs("div",{className:"mt-2 flex items-baseline gap-1",children:[e.jsx("span",{className:"text-xl font-extrabold text-slate-800 font-mono",children:r?.tableCount??"--"}),e.jsx("span",{className:"text-[9px] text-gray-405 font-bold uppercase",children:s==="zh"?"个":"tbls"})]}),e.jsx("span",{className:"text-[8.5px] text-gray-400 block mt-1 truncate",children:s==="zh"?`外含 ${r?.systemTableCount??0} 个系统表`:`+${r?.systemTableCount??0} catalogs`})]}),e.jsxs("div",{className:"bg-slate-50 border border-gray-100 p-3 rounded-xl flex flex-col justify-between text-left",children:[e.jsx("span",{className:"text-[9px] font-black text-gray-450 uppercase tracking-widest block",children:s==="zh"?"文件容量":"Disk Size"}),e.jsxs("div",{className:"mt-2 flex items-baseline gap-1",children:[e.jsx("span",{className:"text-xl font-extrabold text-indigo-650 font-mono animate-fade-in",children:r?.sizeMb!==void 0?r.sizeMb:"--"}),e.jsx("span",{className:"text-[9px] text-gray-455 font-bold uppercase",children:"MB"})]}),e.jsx("span",{className:"text-[8.5px] text-gray-400 block mt-1 truncate",children:r?.diskUsageFriendly??(s==="zh"?"计算空间中...":"Evaluating...")})]}),e.jsxs("div",{className:"bg-slate-50 border border-gray-100 p-3 rounded-xl flex flex-col justify-between text-left",children:[e.jsx("span",{className:"text-[9px] font-black text-gray-455 uppercase tracking-widest block",children:s==="zh"?"读取时延/耗时":"Query Latency"}),e.jsxs("div",{className:"mt-2 flex items-baseline gap-1",children:[e.jsx("span",{className:"text-xl font-extrabold text-emerald-600 font-mono animate-fade-in",children:r?.latencyMs!==void 0?r.latencyMs:"--"}),e.jsx("span",{className:"text-[9px] text-gray-450 font-bold uppercase",children:"ms"})]}),e.jsx("span",{className:"text-[8.5px] text-gray-400 block mt-1 truncate",children:s==="zh"?"元数据对齐周期":"Direct catalog check"})]})]}),e.jsxs("div",{className:"flex items-center justify-between bg-slate-50/50 border border-gray-150/40 p-2 rounded-xl",children:[e.jsx("span",{className:"text-[9.5px] text-gray-400 font-medium pl-1",children:s==="zh"?"自动检测轮询间隔: 5s":"Dynamic background poll: 5s"}),e.jsxs("button",{type:"button",onClick:P,disabled:j,className:"p-1 px-3 text-[10px] bg-indigo-50 hover:bg-indigo-100 text-indigo-700 font-black tracking-wider uppercase border border-indigo-250/20 rounded-lg flex items-center gap-1 transition-all cursor-pointer",children:[e.jsx(g,{size:10,className:j?"animate-spin":""}),s==="zh"?"实时评测":"Benchmark Latency"]})]})]}),e.jsxs("div",{className:"bg-white border border-gray-200 rounded-2xl shadow-xs p-5 flex flex-col flex-1 overflow-y-auto",children:[e.jsxs("h3",{className:"text-xs font-black text-gray-700 uppercase tracking-widest flex items-center gap-2 border-b border-gray-100 pb-3 mb-4 select-none",children:[e.jsx(Ae,{size:14,className:"text-indigo-600 animate-pulse"}),s==="zh"?"分布式操作系统硬件状况":"Distributed Node Telemetry"]}),e.jsxs("div",{className:"grid grid-cols-3 gap-3 mb-5",children:[e.jsxs("div",{className:"bg-slate-50 border border-gray-150/65 p-2.5 rounded-xl text-center",children:[e.jsx("span",{className:"text-[9px] font-bold text-gray-500 block uppercase",children:s==="zh"?"处理器负载":"CPU Load"}),e.jsxs("span",{className:"text-sm font-black font-mono text-indigo-600 block mt-1",children:[Ee,"%"]})]}),e.jsxs("div",{className:"bg-slate-50 border border-gray-150/65 p-2.5 rounded-xl text-center",children:[e.jsx("span",{className:"text-[9px] font-bold text-gray-500 block uppercase",children:s==="zh"?"数据库行数":"DB Buffer"}),e.jsx("span",{className:"text-sm font-black font-mono text-emerald-600 block mt-1",children:r!==null?r.totalRows.toLocaleString():"2,840"})]}),e.jsxs("div",{className:"bg-slate-50 border border-gray-150/65 p-2.5 rounded-xl text-center",children:[e.jsx("span",{className:"text-[9px] font-bold text-gray-500 block uppercase",children:s==="zh"?"主数据库延迟":"DB Net Delay"}),e.jsx("span",{className:"text-sm font-black font-mono text-amber-600 block mt-1",children:r!==null&&r.latencyMs!==void 0?`${r.latencyMs} ms`:"1.5 ms"})]})]}),e.jsxs("div",{className:"flex-1 min-h-[160px] overflow-y-auto bg-slate-50 border border-gray-150/60 p-3 rounded-xl font-mono text-[10px] space-y-1.5 text-gray-650 scrollbar-none",children:[e.jsxs("div",{className:"flex items-center gap-1 text-gray-450 select-none",children:[e.jsx(cs,{size:11})," ",e.jsx("span",{children:"[root@sys-kernel-0] logs --level=info"})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-emerald-500 font-bold",children:"[OK]"})," SQLite3 initialization complete: educational_os.db successfully mounted."]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-indigo-400 font-bold",children:"[INFO]"})," Synchronizing 14 internal structural collections..."]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-indigo-400 font-bold",children:"[INFO]"})," Loaded active school credentials database. Current admins count: ",ce.filter(t=>t.role==="administrator").length]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-amber-500 font-bold",children:"[WARN]"})," Port 9000 detected as default proxy ingress bypass bind."]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-indigo-600 font-bold",children:"[INFO]"})," Listening on network http://0.0.0.0:9000..."]})]})]})]}):n==="site_settings"?e.jsx("div",{className:"flex-1 overflow-y-auto mt-4 animate-fade-in text-gray-800 pb-12",children:e.jsxs("div",{className:"bg-white border border-gray-200/85 rounded-2xl shadow-xs overflow-hidden max-w-3xl",children:[e.jsx("div",{className:"p-5 border-b border-gray-100 flex items-center justify-between bg-slate-50/60",children:e.jsxs("div",{children:[e.jsxs("h3",{className:"font-bold text-gray-800 flex items-center gap-2 text-sm sm:text-base",children:[e.jsx(D,{size:18,className:"text-indigo-500"}),s==="zh"?"平台站点信息(名称 / 口号 / Logo)":"Platform Site Info (Name / Slogan / Logo)"]}),e.jsx("p",{className:"text-xs text-gray-400 mt-0.5",children:s==="zh"?"设置将应用于登录页与平台各处的品牌 Logo 展示位。":"Applied to the login page and brand logo slots across the platform."})]})}),e.jsxs("form",{onSubmit:We,className:"p-5 space-y-5 text-left",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"block text-xs font-bold text-gray-500 uppercase tracking-wider",children:s==="zh"?"站点名称 *":"Site Name *"}),e.jsx("input",{type:"text",value:be,onChange:t=>ge(t.target.value),placeholder:s==="zh"?"例如:阳光实验小学智慧课堂":"e.g. Sunshine Elementary Smart Class",className:"w-full text-sm bg-gray-50 hover:bg-gray-100/50 focus:bg-white border border-gray-200 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:border-transparent transition-all font-semibold"})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"block text-xs font-bold text-gray-500 uppercase tracking-wider",children:s==="zh"?"站点口号 / 标语":"Site Slogan / Tagline"}),e.jsx("input",{type:"text",value:ue,onChange:t=>fe(t.target.value),placeholder:s==="zh"?"例如:下一代智能数字化学习系统":"e.g. Next-Generation Intelligent Learning",className:"w-full text-sm bg-gray-50 hover:bg-gray-100/50 focus:bg-white border border-gray-200 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:border-transparent transition-all"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"block text-xs font-bold text-gray-500 uppercase tracking-wider",children:s==="zh"?"站点 Logo 图片":"Site Logo Image"}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"w-20 h-20 rounded-xl border border-gray-200 bg-slate-50 flex items-center justify-center overflow-hidden shrink-0",children:b?e.jsx("img",{src:b,alt:"logo preview",className:"w-full h-full object-contain"}):e.jsx(D,{size:24,className:"text-gray-300"})}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("label",{className:"cursor-pointer inline-flex items-center gap-1.5 px-3 py-2 bg-indigo-600 hover:bg-indigo-700 text-white font-semibold rounded-lg shadow-sm transition-all text-xs",children:[e.jsx(le,{size:14}),s==="zh"?"上传图片":"Upload Image",e.jsx("input",{type:"file",accept:"image/*",className:"hidden",onChange:t=>Je(t.target.files?.[0])})]}),e.jsx("button",{type:"button",onClick:()=>{A(""),S(null)},className:"px-3 py-2 text-xs font-semibold text-rose-600 border border-gray-200 rounded-lg hover:bg-rose-50 transition-all cursor-pointer",children:s==="zh"?"清除 Logo":"Clear Logo"})]})]}),e.jsx("span",{className:"text-[10px] text-gray-400 block",children:s==="zh"?"也可直接粘贴图片 URL:":"Or paste an image URL:"}),e.jsx("input",{type:"text",value:b,onChange:t=>A(t.target.value),placeholder:"https://example.com/logo.png",className:"w-full text-sm bg-gray-50 hover:bg-gray-100/50 focus:bg-white border border-gray-200 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:border-transparent transition-all font-mono"})]}),e.jsx("div",{className:"flex items-center justify-end gap-3 pt-2 border-t border-gray-100",children:e.jsxs("button",{type:"submit",disabled:K,className:"px-4 py-2 text-xs font-bold text-white bg-indigo-600 hover:bg-indigo-700 disabled:opacity-50 rounded-lg shadow-sm transition-all cursor-pointer flex items-center gap-1.5",children:[K?e.jsx(Ce,{size:13,className:"animate-spin"}):e.jsx(R,{size:14}),e.jsx("span",{children:K?s==="zh"?"保存中...":"Saving...":s==="zh"?"保存站点信息":"Save Site Settings"})]})})]})]})}):e.jsx("div",{className:"flex-1 min-h-0 grid grid-cols-1 xl:grid-cols-12 gap-6 pt-5 overflow-hidden",children:e.jsxs("div",{className:"xl:col-span-12 flex flex-col min-h-0 bg-white border border-gray-200 rounded-2xl shadow-xs overflow-hidden",children:[e.jsxs("div",{className:"p-4 border-b border-gray-150 bg-gray-50/70 flex flex-col sm:flex-row sm:items-center justify-between gap-3 shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(N,{size:16,className:"text-gray-500"}),e.jsx("span",{className:"text-xs font-bold text-gray-700 uppercase tracking-wider block",children:s==="zh"?"在册教师/管理员列表":"Registered Staff Accounts"}),e.jsx("span",{className:"bg-gray-200 text-gray-700 font-bold px-2 py-0.5 rounded-full text-[10px]",children:ie.length})]}),e.jsxs("button",{onClick:Ye,className:"bg-indigo-600 hover:bg-indigo-700 text-white px-3 py-1.5 rounded-lg text-[11px] font-bold flex items-center gap-1.5 shadow-xs transition-colors cursor-pointer",children:[e.jsx(le,{size:12}),s==="zh"?"添加教职账户":"Add Teacher Account"]})]}),e.jsxs("div",{className:"p-3 border-b border-gray-100 bg-white grid grid-cols-1 sm:grid-cols-12 gap-2 shrink-0",children:[e.jsxs("div",{className:"sm:col-span-8 relative flex items-center",children:[e.jsx("span",{className:"absolute left-3 text-gray-400",children:e.jsx(ds,{size:14})}),e.jsx("input",{type:"text",placeholder:s==="zh"?"检索姓名、教工用户名...":"Search teachers by name or username...",value:G,onChange:t=>Re(t.target.value),className:"w-full text-xs pl-9 pr-3 py-2 border border-gray-200 focus:outline-none focus:border-indigo-400 focus:ring-1 focus:ring-indigo-400 rounded-xl"})]}),e.jsx("div",{className:"sm:col-span-4 select-none",children:e.jsxs("select",{value:H,onChange:t=>Me(t.target.value),className:"w-full text-xs p-2 border border-gray-200 focus:outline-none focus:border-indigo-400 rounded-xl bg-slate-50 cursor-pointer",children:[e.jsx("option",{value:"all",children:s==="zh"?"全部角色":"All Roles"}),e.jsx("option",{value:"administrator",children:s==="zh"?"管理员 (admin)":"Administrators"}),e.jsx("option",{value:"teacher",children:s==="zh"?"非管理员 (teacher)":"Standard Teachers"})]})})]}),e.jsx("div",{className:"flex-1 overflow-y-auto p-4 space-y-3 bg-slate-50/55",children:Ie?e.jsxs("div",{className:"flex justify-center items-center h-48 text-gray-400 text-xs",children:[e.jsx(g,{size:20,className:"animate-spin mr-1.5"}),s==="zh"?"加载教职工账户中...":"Reading accounts..."]}):ie.length===0?e.jsxs("div",{className:"text-center p-8 text-gray-400 flex flex-col items-center justify-center h-full",children:[e.jsx(N,{size:36,className:"opacity-20 mb-2"}),e.jsx("p",{className:"text-xs font-semibold",children:s==="zh"?"未检索到任何符合条件的教师账户":"No staff matched your filters."})]}):ie.map(t=>{const a=t.id===m,l=t.role==="administrator",o=t.status==="disabled";return e.jsxs("div",{className:`p-3 bg-white border border-gray-150 hover:border-gray-350 rounded-xl shadow-2xs flex items-center justify-between group transition-all ${o?"opacity-75 bg-slate-50/50":""}`,children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:`p-2 rounded-xl flex items-center justify-center ${o?"bg-slate-200 text-slate-400":l?"bg-indigo-50 text-indigo-700":"bg-slate-100 text-slate-500"}`,children:l?e.jsx(I,{size:18}):e.jsx(N,{size:18})}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:`text-xs font-black ${o?"text-gray-500 line-through":"text-gray-800"}`,children:t.name}),a&&e.jsx("span",{className:"bg-indigo-100/80 text-indigo-700 text-[9px] font-bold px-1.5 py-0.5 rounded-full border border-indigo-200",children:s==="zh"?"你自己":"You"}),e.jsx("span",{className:`text-[8.5px] font-black tracking-wider uppercase px-1.5 py-0.5 rounded-full ${l?"bg-indigo-950/90 text-indigo-400":"bg-slate-100 text-slate-500"}`,children:t.role}),o&&e.jsx("span",{className:"bg-rose-100 text-rose-700 text-[8.5px] font-black px-1.5 py-0.5 rounded-full border border-rose-200",children:s==="zh"?"已禁用":"Disabled"})]}),e.jsxs("div",{className:"text-[10px] text-gray-450 font-mono mt-1 flex items-center gap-1.5",children:[e.jsxs("span",{children:["@",t.username]}),e.jsx("span",{children:"•"}),e.jsxs("span",{children:[s==="zh"?"注册日期:":"ID: ",new Date(t.created_at).toLocaleDateString()]})]})]})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsxs("button",{onClick:()=>Xe(t),className:"p-1 px-1.5 text-xs text-gray-650 hover:text-indigo-600 hover:bg-indigo-50/50 border border-transparent rounded-lg transition-colors flex items-center gap-1",title:s==="zh"?"修改设置":"Update settings",children:[e.jsx(xs,{size:12}),e.jsx("span",{className:"hidden md:inline text-[10px]",children:s==="zh"?"设置":"Edit"})]}),e.jsx("button",{onClick:()=>es(t.id,t.name),className:"p-1 px-1.5 text-xs text-gray-650 hover:text-rose-600 hover:bg-rose-50 border border-transparent rounded-lg transition-colors flex items-center gap-1",title:s==="zh"?"注销删除":"Delete user",children:e.jsx(ms,{size:12})})]})]},t.id)})})]})}),_e&&e.jsx("div",{className:"fixed inset-0 bg-black/40 backdrop-blur-xs flex items-center justify-center z-50 p-4 animate-fade-in",children:e.jsxs("div",{className:"w-full max-w-md bg-white border border-gray-200 rounded-2xl shadow-xl overflow-hidden animate-zoom-in",children:[e.jsxs("div",{className:"p-4 border-b border-gray-100 bg-gray-50 flex items-center justify-between",children:[e.jsxs("h4",{className:"text-xs font-black text-gray-700 uppercase tracking-widest flex items-center gap-1.5 select-none",children:[e.jsx(N,{size:16,className:"text-indigo-600"}),d?s==="zh"?"正在编辑教职账户设置":"Edit Teacher Account Settings":s==="zh"?"新建教师与教工账户":"New Teacher Credentials"]}),e.jsx("button",{onClick:()=>y(!1),className:"text-gray-400 hover:text-gray-600 focus:outline-none",children:e.jsx(Le,{size:18})})]}),e.jsxs("form",{onSubmit:Ze,children:[e.jsxs("div",{className:"p-5 space-y-4",children:[ve&&e.jsxs("div",{className:"p-3 bg-rose-50 border border-rose-200 text-rose-800 text-[10.5px] rounded-xl flex items-center gap-1.5 animate-pulse",children:[e.jsx(ze,{size:15,className:"shrink-0"}),e.jsx("span",{children:ve})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"block text-[10px] font-bold text-gray-500 uppercase tracking-wide",children:s==="zh"?"教工姓名 (展示给学生及白板上) *":"Staff Real Name (Shown on roster/boards) *"}),e.jsx("input",{type:"text",value:Z,onChange:t=>ee(t.target.value),placeholder:s==="zh"?"例如:李茂峰老师、Mrs. Higgins":"e.g. Dr. Higgins, Teacher Chen",className:"w-full text-xs p-2.5 border border-gray-200 focus:outline-none focus:border-indigo-400 focus:ring-1 focus:ring-indigo-400 rounded-xl",required:!0})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"block text-[10px] font-bold text-gray-550 uppercase tracking-wide",children:s==="zh"?"登录用户名 (唯一标识) *":"Access Username (Unique Identifier) *"}),e.jsx("input",{type:"text",value:J,onChange:t=>W(t.target.value),placeholder:s==="zh"?"输入登录用的拼音或简写":"e.g. jclark12",className:"w-full text-xs p-2.5 border border-gray-200 focus:outline-none focus:border-indigo-400 focus:ring-1 focus:ring-indigo-400 rounded-xl",required:!0})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"block text-[10px] font-bold text-gray-555 uppercase tracking-wide",children:s==="zh"?"密码 *":"Password *"}),e.jsx("input",{type:"password",value:Y,onChange:t=>X(t.target.value),placeholder:d?s==="zh"?"留空表示不修改密码":"Leave empty to keep existing":s==="zh"?"指定初次登录密码":"Set initial sign in password",className:"w-full text-xs p-2.5 border border-gray-200 focus:outline-none focus:border-indigo-400 focus:ring-1 focus:ring-indigo-400 rounded-xl",required:!d})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"block text-[10px] font-bold text-gray-550 uppercase tracking-wide",children:s==="zh"?"系统角色 (决定设置编辑权限) *":"Assign System Role (Determines access level) *"}),e.jsxs("div",{className:"flex gap-4 mt-2",children:[e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-gray-700 cursor-pointer select-none",children:[e.jsx("input",{type:"radio",name:"form_role",checked:se==="teacher",onChange:()=>C("teacher"),className:"text-indigo-600 focus:ring-indigo-500 h-4 w-4"}),e.jsx("span",{children:s==="zh"?"教师 (不可进行设置)":"Teacher (settings locked)"})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-gray-700 cursor-pointer select-none",children:[e.jsx("input",{type:"radio",name:"form_role",checked:se==="administrator",onChange:()=>C("administrator"),className:"text-indigo-600 focus:ring-indigo-500 h-4 w-4"}),e.jsx("span",{children:s==="zh"?"管理员 (可调整设置)":"administrator (Full access)"})]})]})]}),e.jsxs("div",{className:"space-y-1 pt-2",children:[e.jsx("label",{className:"block text-[10px] font-bold text-gray-550 uppercase tracking-wide",children:s==="zh"?"账户状态 (是否允许登录系统) *":"Account Status (Active State) *"}),e.jsxs("div",{className:"flex gap-4 mt-2",children:[e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-gray-700 cursor-pointer select-none",children:[e.jsx("input",{type:"radio",name:"form_status",checked:te==="active",onChange:()=>L("active"),className:"text-indigo-600 focus:ring-indigo-500 h-4 w-4"}),e.jsx("span",{children:s==="zh"?"启用 (Active)":"Active"})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-gray-700 cursor-pointer select-none",children:[e.jsx("input",{type:"radio",name:"form_status",checked:te==="disabled",onChange:()=>L("disabled"),className:"text-indigo-600 focus:ring-indigo-500 h-4 w-4"}),e.jsx("span",{className:"text-rose-600 font-medium",children:s==="zh"?"禁用 (Disabled)":"Disabled"})]})]})]})]}),e.jsxs("div",{className:"p-4 border-t border-gray-100 bg-gray-50 flex items-center justify-end gap-2 shrink-0",children:[e.jsx("button",{type:"button",onClick:()=>y(!1),className:"px-4 py-2 text-xs font-semibold text-gray-500 hover:text-gray-700 bg-white hover:bg-gray-100 border border-gray-200 rounded-xl transition-all cursor-pointer",children:s==="zh"?"取消":"Cancel"}),e.jsxs("button",{type:"submit",disabled:ae,className:"px-4 py-2 text-xs font-bold text-white bg-indigo-600 hover:bg-indigo-700 disabled:opacity-50 rounded-xl flex items-center gap-1 shadow-sm transition-all cursor-pointer",children:[ae?e.jsx(g,{size:13,className:"animate-spin"}):e.jsx(R,{size:14}),e.jsx("span",{children:ae?s==="zh"?"保存中...":"Saving...":s==="zh"?"保存记录":"Save Properties"})]})]})]})]})}),Te&&e.jsx("div",{className:"fixed inset-0 bg-gray-900/40 backdrop-blur-xs flex items-center justify-center p-4 z-50 overflow-y-auto",children:e.jsxs("div",{className:"bg-white rounded-2xl shadow-xl border border-gray-200/60 w-full max-w-md overflow-hidden text-gray-800 text-left",children:[e.jsxs("div",{className:"flex items-center justify-between p-5 border-b border-gray-100 bg-slate-50/70",children:[e.jsxs("h3",{className:"font-extrabold text-sm sm:text-base text-gray-800 flex items-center gap-2",children:[e.jsx(hs,{className:"text-indigo-600",size:18}),_?s==="zh"?"编辑 AI 提供商配置":"Edit AI Provider":s==="zh"?"添加全新 AI 提供商":"Add New AI Provider"]}),e.jsx("button",{onClick:()=>{u(!1),f(null)},className:"p-1 text-gray-400 hover:text-gray-600 rounded-full hover:bg-gray-100 transition-colors",children:e.jsx(Le,{size:16})})]}),e.jsxs("form",{onSubmit:Ve,className:"p-5 space-y-4 text-left",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-bold text-gray-500 uppercase tracking-wider mb-1.5 text-left",children:s==="zh"?"服务商名称 *":"Provider Name *"}),e.jsx("input",{type:"text",required:!0,placeholder:"e.g. Deepseek, Minimax",value:E,onChange:t=>$(t.target.value),className:"w-full text-xs sm:text-sm bg-gray-50 hover:bg-gray-100/50 focus:bg-white border border-gray-200 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:border-transparent transition-all font-semibold"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-bold text-gray-500 uppercase tracking-wider mb-1.5 text-left",children:s==="zh"?"API 端点 URL *":"API Endpoint URL *"}),e.jsx("input",{type:"url",required:!0,placeholder:"https://api.deepseek.com/v1",value:O,onChange:t=>F(t.target.value),className:"w-full text-xs sm:text-sm bg-gray-50 hover:bg-gray-100/50 focus:bg-white border border-gray-200 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:border-transparent transition-all font-mono"}),e.jsx("span",{className:"text-[10px] text-gray-400 mt-1 block",children:s==="zh"?"符合 OpenAI 规范的标准 API 统一基准 URL。":"OpenAI-compatible base URL (e.g. /v1)."})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-bold text-gray-500 uppercase tracking-wider mb-1.5 text-left",children:s==="zh"?"模型代号 *":"Model Identifier *"}),e.jsx("input",{type:"text",required:!0,placeholder:"e.g. deepseek-chat",value:B,onChange:t=>Q(t.target.value),className:"w-full text-xs sm:text-sm bg-gray-50 hover:bg-gray-100/50 focus:bg-white border border-gray-200 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:border-transparent transition-all font-mono"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-bold text-gray-500 uppercase tracking-wider mb-1.5 text-left",children:s==="zh"?"API Key (可选)":"API Key (Optional)"}),e.jsx("input",{type:"password",placeholder:s==="zh"?"不修改请留空":"Leave empty to keep existing",value:he,onChange:t=>q(t.target.value),className:"w-full text-xs sm:text-sm bg-gray-50 hover:bg-gray-100/50 focus:bg-white border border-gray-200 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:border-transparent transition-all font-mono"})]}),e.jsxs("div",{className:"flex items-center justify-end gap-3 pt-4 border-t border-gray-100",children:[e.jsx("button",{type:"button",onClick:()=>{u(!1),f(null)},className:"px-4 py-2 text-xs font-bold text-gray-500 bg-slate-100 hover:bg-slate-200 rounded-lg cursor-pointer transition-colors",children:s==="zh"?"取消":"Cancel"}),e.jsxs("button",{type:"submit",disabled:V,className:"px-4 py-2 text-xs font-bold text-white bg-indigo-600 hover:bg-indigo-700 disabled:opacity-50 rounded-lg shadow-sm transition-all cursor-pointer flex items-center gap-1.5",children:[V?e.jsx(Ce,{size:13,className:"animate-spin"}):e.jsx(R,{size:14}),e.jsx("span",{children:V?s==="zh"?"保存中...":"Saving...":s==="zh"?"保存至数据库":"Save Connection"})]})]})]})]})})]})}function Ns({session:m,lang:v,onLogout:s,aiProviders:oe,testingProviderId:w,onAIProvidersChanged:ne,onTriggerTour:k,siteInfo:z,onSiteInfoChanged:h}){return m?.subRole!=="administrator"?e.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center text-rose-500",children:[e.jsx(ps,{size:48,className:"mb-4"}),e.jsx("h2",{className:"text-xl font-bold",children:"Access Denied / 拒绝访问"}),e.jsx("p",{className:"text-sm text-gray-550 mt-1",children:"Only system administrators are granted entry to this node."})]}):e.jsx(bs,{currentUserId:m.userId||"",currentUserRole:m.subRole,lang:v,onLogout:s,aiProviders:oe,testingProviderId:w,onAIProvidersChanged:ne,onTriggerTour:k,siteInfo:z,onSiteInfoChanged:h})}export{Ns as AdminDirectoryView};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e}from"./vendor-react-0Lg0vA-4.js";import{L as o}from"./LazyCourseware-g7b8EXR_.js";import{a9 as a,_ as x,X as c,a6 as d}from"./vendor-icons-_c3xpwjZ.js";import{M as m}from"./index-C5FKWIUq.js";import"./vendor-pdf-CVyNPGVr.js";import"./vendor-utils-4FcTwKPj.js";import"./vendor-motion-DjY2czvL.js";import"./vendor-pptx-B_NheIKl.js";import"./vendor-charts-B7ViBL9w.js";function g({vfsNodes:r,currentVfsParent:n,setCurrentVfsParent:t,cloudDrivePreviewNode:l,setCloudDrivePreviewNode:i}){return e.jsxs("div",{className:"flex-1 flex overflow-hidden min-h-0",children:[e.jsxs("div",{className:"w-64 border-r border-gray-100 flex flex-col bg-gray-50 shrink-0",children:[e.jsx("div",{className:"p-3 border-b border-gray-200 flex items-center gap-2",children:e.jsxs("button",{onClick:()=>{t(null),i(null)},className:`text-sm font-medium w-full text-left flex items-center gap-2 p-2 rounded cursor-pointer ${n===null?"bg-indigo-100 text-indigo-800 font-bold":"text-gray-600 hover:bg-gray-200"}`,children:[e.jsx(a,{size:16})," Data Root"]})}),e.jsxs("div",{className:"flex-1 overflow-y-auto p-2",children:[n&&e.jsxs("button",{onClick:()=>t(null),className:"flex items-center gap-2 p-2 text-xs text-indigo-600 w-full hover:bg-gray-200 rounded mb-2 font-medium cursor-pointer",children:[e.jsx(x,{className:"rotate-180",size:14})," Back to Root"]}),e.jsx("div",{className:"text-xs uppercase font-semibold text-gray-400 px-2 py-1 mb-1",children:"Current Path Nodes"}),r.filter(s=>s.type==="dir").map(s=>e.jsxs("button",{onClick:()=>{t(s.id),i(null)},className:"w-full text-left p-2 rounded text-sm text-gray-700 hover:bg-gray-200 flex items-center gap-2 group mb-1 cursor-pointer",children:[e.jsx(a,{size:14,className:"text-indigo-400 group-hover:text-indigo-600"}),e.jsx("span",{className:"truncate",children:s.name})]},s.id))]})]}),e.jsx("div",{className:"flex-1 flex flex-col bg-white overflow-hidden min-w-0",children:l?e.jsxs("div",{className:"flex-1 flex flex-col h-full min-h-0",children:[e.jsxs("div",{className:"p-3 border-b border-gray-100 bg-gray-50 flex items-center gap-2 shrink-0",children:[e.jsx("button",{onClick:()=>i(null),className:"text-gray-500 hover:text-gray-700 cursor-pointer",children:e.jsx(c,{size:16})}),e.jsxs("span",{className:"text-sm font-medium text-gray-700",children:["Previewing: ",l.name]})]}),l.name.endsWith(".html")||l.name.endsWith(".htm")||l.content?.includes("<html")?e.jsx("div",{className:"flex-1 relative bg-gray-50",children:e.jsx(o,{coursewareId:l.id})}):e.jsx("div",{className:"flex-1 overflow-y-auto p-6 bg-white prose prose-sm max-w-none",children:e.jsx(m,{children:l.content})})]}):e.jsx("div",{className:"flex-1 p-6 overflow-y-auto",children:e.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4",children:[r.length===0&&e.jsx("div",{className:"col-span-full h-32 flex items-center justify-center text-sm text-gray-400 italic",children:"This directory is empty."}),r.map(s=>e.jsxs("div",{onClick:()=>{s.type==="dir"?t(s.id):i({id:s.id,name:s.name,content:s.content||"*(Empty file)*"})},className:"border border-gray-200 hover:border-indigo-300 hover:shadow-md cursor-pointer rounded-xl p-4 flex flex-col gap-3 transition-all bg-white",children:[e.jsx("div",{className:"p-3 rounded-xl w-12 h-12 flex items-center justify-center shrink-0 shadow-sm bg-gray-50 border border-gray-100",children:s.type==="dir"?e.jsx(a,{size:24,className:"text-indigo-500"}):e.jsx(d,{size:24,className:"text-gray-500"})}),e.jsx("div",{className:"text-sm font-medium text-gray-800 break-words",children:s.name})]},s.id))]})})})]})}function w(r){return r.isOpen?e.jsx("div",{className:"fixed inset-0 bg-gray-900/40 backdrop-blur-sm flex items-center justify-center p-6 z-50",children:e.jsxs("div",{className:"bg-white border text-gray-900 border-gray-200 rounded-2xl shadow-2xl w-full max-w-5xl h-[85vh] flex flex-col overflow-hidden",children:[e.jsxs("div",{className:"p-4 border-b border-gray-100 flex items-center justify-between bg-gray-50/80 shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(a,{size:20,className:"text-indigo-600"}),e.jsx("h2",{className:"font-semibold text-gray-800 text-lg",children:"Cloud Course Resource Browser"})]}),e.jsx("button",{onClick:r.onClose,className:"text-gray-400 hover:text-gray-600 font-bold p-1 hover:bg-gray-200 rounded transition-colors cursor-pointer",children:"×"})]}),e.jsx(g,{...r})]})}):null}export{w as CloudDriveModal,g as CloudDrivePanel};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as c,j as e}from"./vendor-react-0Lg0vA-4.js";import{d as k,a7 as D,b2 as u,aW as M,aa as T,X as $,aD as A,y as O}from"./vendor-icons-_c3xpwjZ.js";function q({computerLabs:o,onRefresh:m,lang:s}){const[S,h]=c.useState(!1),[p,b]=c.useState(null),[f,g]=c.useState(""),[i,y]=c.useState(5),[n,j]=c.useState(6),[N,l]=c.useState(""),[v,w]=c.useState(!1),[z,C]=c.useState(o.length>0?o[0].id:null),d=o.find(t=>t.id===(z||o[0]?.id)),L=()=>{g(""),y(5),j(6),l(""),b(null),h(!0)},E=t=>{g(t.room_number),y(t.rows),j(t.cols),l(""),b(t.id),h(!0)},P=async t=>{if(t.preventDefault(),!f.trim()){l(s==="zh"?"请输入机房编号/名称":"Please enter room name or number");return}if(i<=0||i>15){l(s==="zh"?"行数应在 1 至 15 之间":"Rows should be between 1 and 15");return}if(n<=0||n>15){l(s==="zh"?"列数应在 1 至 15 之间":"Columns should be between 1 and 15");return}try{w(!0),l("");const r=p?`/api/labs/${p}`:"/api/labs",a=await fetch(r,{method:p?"PUT":"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({room_number:f.trim(),rows:i,cols:n})});if(a.ok)m(),h(!1),b(null);else{const _=await a.json();l(_.error||"Server error saving lab")}}catch(r){l(r.message||"Network error")}finally{w(!1)}},R=async t=>{if(confirm(s==="zh"?"确定要删除该机房吗?删除后对应的座位分配也会被重置。":"Are you sure you want to delete this lab? Seat mappings will be cleared."))try{(await fetch(`/api/labs/${t}`,{method:"DELETE"})).ok&&(m(),z===t&&C(null))}catch(r){console.error(r)}};return e.jsxs("div",{className:"flex-1 flex flex-col h-full overflow-hidden",id:"lab_manager_root",children:[e.jsxs("div",{className:"flex flex-col md:flex-row md:items-center justify-between pb-4 border-b border-gray-200 gap-4 shrink-0",children:[e.jsxs("div",{children:[e.jsxs("h2",{className:"text-xl font-bold text-gray-800 flex items-center gap-2",children:[e.jsx(k,{className:"text-indigo-600",size:24}),s==="zh"?"统一机房座位管理":"Unified Computer Lab Seating"]}),e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:s==="zh"?"创建和维护物理机房编号及其行列排列规则。在此处配置机房,然后可在“班级详情”页面为班级学生分配具体的上机机位。":"Create and specify physical computer lab configurations. Once configured here, assign student seats inside each Class Details panel."})]}),e.jsxs("button",{onClick:L,className:"bg-indigo-600 hover:bg-indigo-700 text-white px-4 py-2 rounded-xl text-xs font-semibold flex items-center gap-1.5 shadow-sm transition-all focus:ring-2 focus:ring-indigo-500 cursor-pointer",children:[e.jsx(D,{size:14}),s==="zh"?"新增机房规则":"New Lab Config"]})]}),e.jsxs("div",{className:"flex-1 min-h-0 grid grid-cols-1 lg:grid-cols-12 gap-6 pt-5 overflow-hidden",children:[e.jsxs("div",{className:"lg:col-span-5 flex flex-col min-h-0 bg-white border border-gray-200 rounded-2xl shadow-xs overflow-hidden",children:[e.jsxs("div",{className:"p-4 border-b border-gray-100 bg-gray-50 flex justify-between items-center shrink-0",children:[e.jsx("span",{className:"text-xs font-bold text-gray-700 uppercase tracking-wider block",children:s==="zh"?"机房列表":"Computer Labs"}),e.jsx("span",{className:"bg-gray-200 text-gray-700 font-bold px-2 py-0.5 rounded-full text-[10px]",children:o.length})]}),e.jsx("div",{className:"flex-1 overflow-y-auto p-4 space-y-3",children:o.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center p-8 text-center text-gray-400 h-full",children:[e.jsx(k,{size:40,className:"mb-2 opacity-30"}),e.jsx("p",{className:"text-xs font-medium",children:s==="zh"?"暂无机房编号规则":"No Computer Labs configured yet."}),e.jsx("p",{className:"text-[10px] text-gray-500 mt-1",children:s==="zh"?"点击右上角按钮添加首个机房规格。":"Click the button above to add your first computer room."})]}):o.map(t=>{const r=d?.id===t.id;return e.jsxs("div",{onClick:()=>C(t.id),className:`p-3 rounded-xl border transition-all cursor-pointer flex items-center justify-between group ${r?"border-indigo-200 bg-indigo-50/50 shadow-xs":"border-gray-150 hover:border-gray-300 hover:bg-gray-50"}`,children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:`p-2 rounded-lg ${r?"bg-indigo-100 text-indigo-700":"bg-gray-100 text-gray-500 group-hover:bg-gray-200"}`,children:e.jsx(u,{size:16})}),e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-bold text-gray-800",children:t.room_number}),e.jsxs("div",{className:"text-[10px] text-gray-400 font-mono mt-0.5",children:[t.rows," ",s==="zh"?"行":"Rows"," × ",t.cols," ",s==="zh"?"列":"Cols",e.jsx("span",{className:"mx-1.5",children:"•"}),t.rows*t.cols," ",s==="zh"?"个机位":"Seats"]})]})]}),e.jsxs("div",{className:"flex items-center gap-1.5 opacity-0 group-hover:opacity-100 focus-within:opacity-100 transition-opacity",children:[e.jsx("button",{onClick:x=>{x.stopPropagation(),E(t)},className:"p-1 text-gray-500 hover:text-indigo-600 hover:bg-white rounded transition-colors",title:s==="zh"?"编辑规则":"Edit Rule",children:e.jsx(M,{size:13})}),e.jsx("button",{onClick:x=>{x.stopPropagation(),R(t.id)},className:"p-1 text-gray-500 hover:text-rose-600 hover:bg-white rounded transition-colors",title:s==="zh"?"删除机房间":"Delete Lab",children:e.jsx(T,{size:14})})]})]},t.id)})})]}),e.jsx("div",{className:"lg:col-span-7 flex flex-col min-h-0 bg-white border border-gray-200 rounded-2xl shadow-xs overflow-hidden",children:S?e.jsxs("form",{onSubmit:P,className:"flex-1 flex flex-col min-h-0",children:[e.jsxs("div",{className:"p-4 border-b border-gray-100 bg-gray-50 font-bold text-xs text-gray-700 uppercase tracking-wider shrink-0 flex items-center justify-between",children:[e.jsx("span",{children:p?s==="zh"?"编辑机房规则":"Edit Lab Seating":s==="zh"?"创建全新上机机房":"Create Computer Lab"}),e.jsx("button",{type:"button",onClick:()=>h(!1),className:"text-gray-400 hover:text-gray-600",children:e.jsx($,{size:16})})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto p-6 space-y-4",children:[N&&e.jsxs("div",{className:"p-3 bg-red-50 border border-red-200 text-red-700 text-xs rounded-xl flex items-center gap-1.5",children:[e.jsx(A,{size:14}),e.jsx("span",{children:N})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"block text-xs font-bold text-gray-500 uppercase tracking-wide",children:s==="zh"?"机房编号 / 场所名称 *":"Lab Name / Number *"}),e.jsx("input",{type:"text",value:f,onChange:t=>g(t.target.value),placeholder:s==="zh"?"例如:305综合机房、软创中心、Lab A":"e.g. Lab 404, Software Sandbox, Suite C",className:"w-full text-xs p-2.5 border border-gray-300 focus:border-indigo-500 focus:outline-none focus:ring-1 focus:ring-indigo-500 rounded-xl mt-1.5",maxLength:32,required:!0})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"block text-xs font-bold text-gray-500 uppercase tracking-wide",children:s==="zh"?"排列行数 (Rows) *":"Rows Direction *"}),e.jsx("input",{type:"number",value:i,onChange:t=>y(Math.max(1,parseInt(t.target.value)||1)),min:1,max:15,className:"w-full text-xs p-2.5 border border-gray-300 focus:border-indigo-500 focus:outline-none focus:ring-1 focus:ring-indigo-500 rounded-xl mt-1.5",required:!0}),e.jsx("span",{className:"text-[10px] text-gray-400 block mt-0.5",children:s==="zh"?"上下方向机位数 (最大15行)":"Horizontal sets count (Max 15)"})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"block text-xs font-bold text-gray-500 uppercase tracking-wide",children:s==="zh"?"排列列数 (Columns) *":"Columns Direction *"}),e.jsx("input",{type:"number",value:n,onChange:t=>j(Math.max(1,parseInt(t.target.value)||1)),min:1,max:15,className:"w-full text-xs p-2.5 border border-gray-300 focus:border-indigo-500 focus:outline-none focus:ring-1 focus:ring-indigo-500 rounded-xl mt-1.5",required:!0}),e.jsx("span",{className:"text-[10px] text-gray-400 block mt-0.5",children:s==="zh"?"左右方向机位数 (最大15列)":"Vertical sets count (Max 15)"})]})]}),e.jsxs("div",{className:"border border-dashed border-gray-200 bg-gray-50/50 p-4 rounded-xl",children:[e.jsx("span",{className:"text-[10px] font-bold text-gray-400 uppercase tracking-wider block mb-2",children:s==="zh"?"布局网格缩略结构":"Layout Aspect Schema"}),e.jsxs("div",{className:"flex flex-col gap-1 items-center justify-center p-3 bg-white rounded-lg border border-gray-100 min-h-[120px]",children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[Array.from({length:Math.min(i,6)}).map((t,r)=>e.jsxs("div",{className:"flex gap-1 justify-center",children:[Array.from({length:Math.min(n,8)}).map((x,a)=>e.jsx("div",{className:"w-4 h-4 rounded bg-indigo-100 border border-indigo-200 shrink-0"},a)),n>8&&e.jsx("div",{className:"w-4 text-[10px] text-gray-400 flex items-center justify-center",children:"..."})]},r)),i>6&&e.jsx("div",{className:"text-[10px] text-center text-gray-400 mt-1",children:"..."})]}),e.jsxs("span",{className:"text-[10px] text-gray-450 mt-3 font-medium",children:["配置容量:",i," × ",n," = ",i*n," 座位"]})]})]})]}),e.jsxs("div",{className:"p-4 border-t border-gray-100 shrink-0 flex items-center justify-end gap-2 bg-gray-50",children:[e.jsx("button",{type:"button",onClick:()=>h(!1),className:"px-4 py-2 text-xs font-semibold text-gray-500 hover:text-gray-700 bg-white hover:bg-gray-100 border border-gray-200 rounded-xl transition-all cursor-pointer",children:s==="zh"?"取消":"Cancel"}),e.jsxs("button",{type:"submit",disabled:v,className:"px-4 py-2 text-xs font-bold text-white bg-indigo-600 hover:bg-indigo-700 disabled:opacity-50 rounded-xl flex items-center gap-1 shadow-sm transition-all cursor-pointer",children:[e.jsx(O,{size:14}),e.jsx("span",{children:v?s==="zh"?"提交中...":"Saving...":s==="zh"?"提交保存":"Save Config"})]})]})]}):e.jsxs("div",{className:"flex-1 flex flex-col min-h-0",children:[e.jsx("div",{className:"p-4 border-b border-gray-100 bg-gray-50 font-bold text-xs text-gray-700 uppercase tracking-wider shrink-0",children:e.jsx("span",{children:s==="zh"?"物理排列布局预览":"Physical Classroom Layout Preview"})}),d?e.jsxs("div",{className:"flex-1 overflow-auto p-6 flex flex-col items-center justify-center bg-slate-950 text-white min-h-[300px]",children:[e.jsx("div",{className:"w-48 bg-slate-800 border border-slate-700 py-1.5 rounded text-center text-[10px] font-bold text-slate-400 uppercase tracking-widest mb-10 select-none shadow-md shrink-0",children:s==="zh"?"📽️ 讲台 / 主荧幕":"📽️ Classroom Teacher Stage / Screen"}),e.jsx("div",{className:"flex flex-col gap-3 py-4 max-w-full",children:Array.from({length:d.rows}).map((t,r)=>e.jsxs("div",{className:"flex gap-3 justify-center items-center",children:[e.jsxs("span",{className:"text-[10px] font-bold font-mono text-slate-500 w-6 text-right select-none pr-1",children:["R",r+1]}),Array.from({length:d.cols}).map((x,a)=>e.jsxs("div",{className:"group relative w-10 h-10 rounded-lg flex flex-col items-center justify-center bg-slate-800 border border-slate-700 hover:border-indigo-500 hover:bg-slate-750 font-mono text-[9px] font-semibold text-indigo-400 transition-all select-none shadow-sm cursor-help",children:[e.jsx(u,{size:14,className:"opacity-40"}),e.jsxs("span",{className:"text-[8px] text-slate-400 mt-0.5",children:[r+1,"-",a+1]}),e.jsx("div",{className:"absolute bottom-11 bg-indigo-950 text-white text-[9px] rounded px-2 py-1 hidden group-hover:block whitespace-nowrap z-30 font-sans border border-indigo-800 shadow-xl font-medium",children:s==="zh"?`第 ${r+1} 排,第 ${a+1} 列`:`Row ${r+1} / Column ${a+1}`})]},a))]},r))}),e.jsxs("div",{className:"mt-8 flex items-center justify-center gap-6 text-[10px] text-slate-400 shrink-0 select-none border-t border-slate-900 pt-4 w-full",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("div",{className:"w-3.5 h-3.5 rounded bg-slate-800 border border-slate-700 flex items-center justify-center p-0.5",children:e.jsx(u,{size:10,className:"text-indigo-400 opacity-40"})}),e.jsx("span",{children:s==="zh"?"预备上机位置 / 终端":"Empty seat console terminals"})]}),e.jsxs("div",{className:"font-mono text-slate-500",children:[s==="zh"?"总行数:":"Rows: ",e.jsx("span",{className:"text-indigo-400 font-bold",children:d.rows})," |",s==="zh"?" 总列数:":" Columns: ",e.jsx("span",{className:"text-indigo-400 font-bold",children:d.cols})," |",s==="zh"?" 配置席位:":" Total: ",e.jsx("span",{className:"text-white font-bold",children:d.rows*d.cols})]})]})]}):e.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center text-center p-8 text-gray-400 h-full",children:[e.jsx(u,{size:48,className:"opacity-20 mb-3"}),e.jsx("p",{className:"text-xs font-medium",children:s==="zh"?"请选择一个机房以预览其座位图":"Please select a lab config to preview details."})]})]})})]})]})}function H({computerLabs:o,onRefresh:m,lang:s}){return e.jsx(q,{computerLabs:o,onRefresh:m,lang:s})}export{H as ComputerLabView};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as o,j as e}from"./vendor-react-0Lg0vA-4.js";import{p as h,a4 as P,a7 as v,ad as w,X as R,U as C,aB as V,aC as W,aa as Z,al as O,l as z}from"./vendor-icons-_c3xpwjZ.js";import{M as X}from"./index-C5FKWIUq.js";import"./vendor-utils-4FcTwKPj.js";import"./vendor-pdf-CVyNPGVr.js";import"./vendor-motion-DjY2czvL.js";import"./vendor-pptx-B_NheIKl.js";import"./vendor-charts-B7ViBL9w.js";function ee({lang:t,lessons:l,lessonsSearchQuery:d,setLessonsSearchQuery:c,lessonsSortOrder:k,setLessonsSortOrder:S,filteredLessons:x,onOpenImportLessons:D,onOpenCourseWizard:g,onViewCourse:u,onDeleteCourse:A,onCopyCourse:E,filterEnrollment:p,setFilterEnrollment:M,filterHasContent:b,setFilterHasContent:T,filterThisMonth:f,setFilterThisMonth:L,copyingLessonId:$}){const[r,m]=o.useState(null),[a,i]=o.useState(null),[y,j]=o.useState(!1),[F,N]=o.useState(!1),B=async s=>{m(s),i(null),N(!0);try{const n=await fetch(`/api/lessons/${s.id}/stats`);if(n.ok){const I=await n.json();i(I)}}catch{i({whiteboardCount:0,scheduleCount:0,enrollmentCount:0,assignmentCount:0})}finally{N(!1)}},U=async()=>{if(r){j(!0);try{await A(r.id),m(null),i(null)}finally{j(!1)}}};return e.jsxs("div",{className:"flex-1 flex flex-col gap-6 h-full overflow-y-auto",children:[e.jsxs("div",{className:"flex-1 bg-white border border-gray-200 rounded-xl shadow-sm flex flex-col min-h-0",children:[e.jsxs("div",{className:"p-4 border-b border-gray-100 flex items-center justify-between shrink-0",children:[e.jsxs("h3",{className:"font-medium text-gray-700 flex items-center gap-2",children:[e.jsx(h,{size:16,className:"text-gray-400"}),t==="zh"?"课程与教学环节管理 (SQLite)":"Courses & Lessons Management"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("button",{id:"import-lessons-csv-btn",onClick:D,className:"flex items-center gap-1.5 px-3 py-1.5 text-xs bg-indigo-50 hover:bg-indigo-100 text-indigo-700 border border-indigo-200 font-semibold rounded-lg shadow-3xs transition-all hover:shadow-xs hover:-translate-y-0.5 cursor-pointer",children:[e.jsx(P,{size:14}),t==="zh"?"批量导入课程 (CSV)":"Import Lessons (CSV)"]}),e.jsxs("button",{id:"add-course-wizard-btn",onClick:g,className:"flex items-center gap-1.5 px-3 py-1.5 text-xs bg-indigo-600 hover:bg-indigo-700 text-white font-semibold rounded-lg shadow-sm transition-all hover:shadow-md hover:-translate-y-0.5 cursor-pointer",children:[e.jsx(v,{size:14}),t==="zh"?"手动添加课程 (向导)":"Add Course Wizard"]})]})]}),l.length>0&&e.jsxs("div",{className:"px-5 py-3.5 border-b border-gray-100 bg-gray-50/50 flex flex-col sm:flex-row items-center justify-between gap-3 shrink-0",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-3 w-full sm:w-auto",children:[e.jsxs("div",{className:"relative w-full sm:w-64",children:[e.jsx("span",{className:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none text-gray-400",children:e.jsx(w,{size:14})}),e.jsx("input",{type:"text",placeholder:"Search courses by title...",value:d,onChange:s=>c(s.target.value),className:"w-full pl-9 pr-8 py-1.5 text-xs bg-white border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-indigo-500 text-gray-800 shadow-sm"}),d&&e.jsx("button",{onClick:()=>c(""),className:"absolute inset-y-0 right-0 flex items-center pr-2.5 text-gray-400 hover:text-gray-600",children:e.jsx(R,{size:12,className:"bg-gray-100 hover:bg-gray-200 rounded-full p-0.5"})})]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-[11px] font-bold text-gray-400 uppercase tracking-wider",children:t==="zh"?"排序方式:":"Sort by:"}),e.jsxs("select",{value:k,onChange:s=>S(s.target.value),className:"bg-white border border-gray-200 text-xs text-gray-755 font-bold px-2.5 py-1.5 rounded-lg focus:outline-none focus:ring-2 focus:ring-indigo-500 shadow-sm",id:"courses-sort-select",children:[e.jsx("option",{value:"recent",children:t==="zh"?"最新创建":"Most Recent"}),e.jsx("option",{value:"alphabetical",children:t==="zh"?"按名称 (A-Z)":"Alphabetical (A-Z)"}),e.jsx("option",{value:"enrollment",children:t==="zh"?"学生选课人次":"Student Enrollment Count"})]})]})]}),e.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsxs("button",{onClick:()=>M(!p),className:`px-2 py-1 text-[10px] font-bold rounded-md border transition-all cursor-pointer ${p?"bg-emerald-50 text-emerald-700 border-emerald-200":"bg-white text-gray-500 border-gray-200 hover:border-gray-300"}`,children:[e.jsx(C,{size:11,className:"inline mr-0.5 -mt-0.5"}),t==="zh"?"有人选":"Enrolled"]}),e.jsxs("button",{onClick:()=>T(!b),className:`px-2 py-1 text-[10px] font-bold rounded-md border transition-all cursor-pointer ${b?"bg-indigo-50 text-indigo-700 border-indigo-200":"bg-white text-gray-500 border-gray-200 hover:border-gray-300"}`,children:[e.jsx(h,{size:11,className:"inline mr-0.5 -mt-0.5"}),t==="zh"?"有内容":"Has Content"]}),e.jsx("button",{onClick:()=>L(!f),className:`px-2 py-1 text-[10px] font-bold rounded-md border transition-all cursor-pointer ${f?"bg-amber-50 text-amber-700 border-amber-200":"bg-white text-gray-500 border-gray-200 hover:border-gray-300"}`,children:t==="zh"?"本月":"This Month"})]}),e.jsxs("div",{className:"text-xs font-semibold text-gray-500",children:["Found ",e.jsx("span",{className:"text-indigo-650 font-bold",children:x.length})," of ",e.jsx("span",{className:"text-gray-700 font-bold",children:l.length})," course",l.length===1?"":"s"]})]})]}),e.jsx("div",{className:"flex-1 overflow-y-auto p-4",children:l.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-gray-400 min-h-[300px]",children:[e.jsx(h,{size:48,className:"mb-4 opacity-30 text-indigo-500"}),e.jsx("h3",{className:"text-lg font-bold text-gray-800",children:t==="zh"?"暂无可用课程":"No Courses Available"}),e.jsx("p",{className:"mt-2 text-sm text-gray-500 text-center max-w-xs",children:t==="zh"?"系统中暂未部署任何课程。请通过下方按钮启动添加向导指南。":"There are no courses active in the system yet. Build your first curriculum!"}),e.jsxs("button",{id:"empty-add-course-btn",onClick:g,className:"mt-5 flex items-center gap-2 px-5 py-2.5 bg-indigo-600 hover:bg-indigo-700 text-white font-bold rounded-xl shadow-md transition-all cursor-pointer",children:[e.jsx(v,{size:16}),t==="zh"?"使用向导指南来创建新课程":"Create Course via Wizard"]})]}):x.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center h-full py-12 text-gray-450 text-center",children:[e.jsx(w,{size:44,className:"mb-3 opacity-30 text-gray-450"}),e.jsxs("h4",{className:"font-semibold text-gray-700 text-sm",children:['No Courses Match "',d,'"']}),e.jsx("p",{className:"text-xs text-gray-500 mt-1 max-w-xs",children:"Double-check the spelling or try searching for another curriculum keyword."}),e.jsx("button",{onClick:()=>c(""),className:"mt-3 text-xs bg-indigo-50 hover:bg-indigo-100 text-indigo-700 border border-indigo-200 font-semibold px-3 py-1.5 rounded-lg transition-colors",children:"Clear Search Filter"})]}):e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-4",children:x.map(s=>{const n=$===s.id;return e.jsxs("div",{className:`border border-gray-200 hover:border-indigo-300 rounded-xl p-4 flex flex-col bg-gray-50/50 hover:shadow-md transition-all ${n?"opacity-60 pointer-events-none":""}`,children:[e.jsxs("div",{className:"flex items-center justify-between mb-2 gap-2",children:[e.jsx("div",{className:"font-semibold text-gray-800 text-lg truncate cursor-pointer hover:text-indigo-600 transition-colors",title:s.title,onClick:()=>u(s.id),children:s.title}),e.jsxs("span",{className:"inline-flex items-center gap-1 bg-indigo-50 text-indigo-700 px-1.5 py-0.5 border border-indigo-100 rounded text-[10px] font-bold shrink-0",children:[e.jsx(C,{size:10,className:"text-indigo-500"}),s.enrollment_count||0]})]}),e.jsx("div",{className:"text-sm text-gray-500 line-clamp-3 mb-4 flex-1",children:e.jsx(X,{children:s.content})}),e.jsxs("div",{className:"flex justify-between items-center mt-auto",children:[e.jsxs("div",{className:"text-xs text-gray-400",children:["ID: ",s.id.substring(0,8),"..."]}),e.jsxs("div",{className:"flex items-center gap-0.5",children:[e.jsx("button",{onClick:()=>u(s.id),className:"p-1.5 text-gray-400 hover:text-indigo-600 hover:bg-indigo-50 rounded transition-colors cursor-pointer",title:t==="zh"?"查看编辑":"View & Edit",children:e.jsx(V,{size:15})}),e.jsx("button",{onClick:()=>E(s.id),className:"p-1.5 text-gray-400 hover:text-emerald-600 hover:bg-emerald-50 rounded transition-colors cursor-pointer",title:t==="zh"?"复制课程":"Copy Course",children:e.jsx(W,{size:14})}),e.jsx("button",{onClick:()=>B(s),className:"p-1.5 text-gray-400 hover:text-red-600 hover:bg-red-50 rounded transition-colors cursor-pointer",title:t==="zh"?"删除课程":"Delete Course",children:e.jsx(Z,{size:14})})]})]})]},s.id)})})})]}),r&&e.jsx("div",{className:"fixed inset-0 bg-black/40 backdrop-blur-[2px] flex items-center justify-center z-[9999] p-4",children:e.jsxs("div",{className:"bg-white rounded-xl shadow-2xl max-w-md w-full border border-gray-100 overflow-hidden",children:[e.jsxs("div",{className:"px-5 py-4 border-b border-gray-100 bg-red-50 flex items-center gap-2",children:[e.jsx(O,{size:18,className:"text-red-600"}),e.jsx("h3",{className:"font-bold text-red-800 text-sm",children:t==="zh"?"确认删除课程":"Confirm Course Deletion"})]}),e.jsxs("div",{className:"p-5 space-y-3",children:[e.jsx("p",{className:"text-sm text-gray-700",children:t==="zh"?e.jsxs(e.Fragment,{children:["确定要删除课程 ",e.jsx("span",{className:"font-bold text-red-600",children:r.title})," 吗?"]}):e.jsxs(e.Fragment,{children:["Are you sure you want to delete ",e.jsx("span",{className:"font-bold text-red-600",children:r.title}),"?"]})}),e.jsx("p",{className:"text-xs text-red-600 font-medium",children:t==="zh"?"此操作不可撤销,将删除课程的所有关联数据。":"This action is irreversible and will delete all associated data."}),F?e.jsxs("div",{className:"flex items-center gap-2 text-xs text-gray-500 py-2",children:[e.jsx(z,{size:14,className:"animate-spin"}),t==="zh"?"正在统计关联数据...":"Counting related data..."]}):a?e.jsxs("div",{className:"bg-gray-50 rounded-lg p-3 space-y-1.5 text-xs",children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-gray-600",children:t==="zh"?"白板元素":"Whiteboard Elements"}),e.jsx("span",{className:"font-bold text-gray-800",children:a.whiteboardCount})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-gray-600",children:t==="zh"?"排课记录":"Schedules"}),e.jsx("span",{className:"font-bold text-gray-800",children:a.scheduleCount})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-gray-600",children:t==="zh"?"选课学生":"Enrollments"}),e.jsx("span",{className:"font-bold text-gray-800",children:a.enrollmentCount})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-gray-600",children:t==="zh"?"作业任务":"Assignments"}),e.jsx("span",{className:"font-bold text-gray-800",children:a.assignmentCount})]})]}):null]}),e.jsxs("div",{className:"px-5 py-3 border-t border-gray-100 bg-gray-50 flex justify-end gap-2",children:[e.jsx("button",{onClick:()=>{m(null),i(null)},className:"px-4 py-2 text-xs font-medium text-gray-600 hover:bg-gray-100 border border-gray-200 rounded-lg transition-colors cursor-pointer",children:t==="zh"?"取消":"Cancel"}),e.jsxs("button",{onClick:U,disabled:y,className:"px-4 py-2 text-xs font-bold text-white bg-red-600 hover:bg-red-700 rounded-lg transition-colors cursor-pointer disabled:opacity-50 flex items-center gap-1.5",children:[y&&e.jsx(z,{size:12,className:"animate-spin"}),t==="zh"?"确认删除":"Confirm Delete"]})]})]})})]})}export{ee as CourseManagement};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{j as e,r as f}from"./vendor-react-0Lg0vA-4.js";import{m as A,M as P}from"./index-C5FKWIUq.js";import{p as y,f as j,i as W,a7 as L,g as I,D as v,_ as E,l as M}from"./vendor-icons-_c3xpwjZ.js";import"./vendor-utils-4FcTwKPj.js";import"./vendor-pdf-CVyNPGVr.js";import"./vendor-motion-DjY2czvL.js";import"./vendor-pptx-B_NheIKl.js";import"./vendor-charts-B7ViBL9w.js";function Q(z){const{isCourseWizardOpen:w,setIsCourseWizardOpen:N,lang:t,wizardStep:o,setWizardStep:g,wizardIsSubmitting:x,wizardCourseTitle:p,setWizardCourseTitle:C,wizardCourseDescription:u,setWizardCourseDescription:k,wizardCourseCategory:n,setWizardCourseCategory:S,wizardCourseTimeline:a,setWizardCourseTimeline:c,wizardCourseContent:m,setWizardCourseContent:h,addToast:b,generateTemplateContent:T,handleDeployWizardCourse:D}=z;return e.jsx(e.Fragment,{children:w&&e.jsx("div",{className:"fixed inset-0 bg-gray-900/50 backdrop-blur-sm flex items-center justify-center p-4 md:p-6 z-50 overflow-y-auto text-gray-850",children:e.jsxs(A.div,{initial:{opacity:0,y:15,scale:.98},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:10,scale:.98},className:"bg-white border text-gray-900 border-gray-250 rounded-2xl shadow-2xl w-full max-w-4xl flex flex-col overflow-hidden max-h-[92vh] font-sans text-left",children:[e.jsxs("div",{className:"p-4 md:p-5 border-b border-gray-100 flex items-center justify-between bg-slate-50 shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"p-2 bg-indigo-50 border border-indigo-100 rounded-lg text-indigo-650",children:e.jsx(y,{size:20,className:"animate-pulse"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"font-bold text-gray-850 text-base md:text-lg",children:t==="zh"?"⭐ 互动课程发布与时间轴向导":"⭐ Course Design Guide & Wizard"}),e.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:t==="zh"?"遵循系统设计法,逐步构建您的学科专属教案与课堂时间轴流程。":"Follow best practices to define curriculum content, timeline segments, and deploy."})]})]}),e.jsx("button",{onClick:()=>N(!1),className:"text-gray-400 hover:text-gray-650 font-bold p-1 rounded-lg hover:bg-gray-150 transition-all text-xl leading-none",children:"×"})]}),e.jsx("div",{className:"px-6 py-4.5 border-b border-gray-50 bg-slate-50/50 flex items-center justify-between gap-2 shrink-0 select-none",children:[{step:1,zh:"1内容选题",en:"1 Background"},{step:2,zh:"2课堂脉络",en:"2 Timeslots"},{step:3,zh:"3编写大纲",en:"3 Syllabus"},{step:4,zh:"4总览部署",en:"4 Deploy"}].map((r,i)=>{const l=o===r.step,s=o>r.step;return e.jsxs(f.Fragment,{children:[e.jsxs("div",{onClick:()=>!x&&g(r.step),className:`flex items-center gap-2 cursor-pointer transition-all ${l?"text-indigo-650 font-boldScale":s?"text-emerald-600 font-medium":"text-gray-400 hover:text-gray-600"}`,children:[e.jsx("div",{className:`w-5 h-5 rounded-full flex items-center justify-center text-[10px] border ${l?"bg-indigo-600 border-indigo-600 text-white shadow-xs font-bold":s?"bg-emerald-50 border-emerald-500 text-emerald-600 font-bold":"bg-white border-gray-250 text-gray-500"}`,children:s?"✓":r.step}),e.jsx("span",{className:"text-xs font-semibold hidden sm:inline",children:t==="zh"?r.zh:r.en})]}),i<3&&e.jsx("div",{className:`flex-1 h-0.5 max-w-[40px] md:max-w-none transition-all ${o>r.step?"bg-emerald-500":"bg-gray-200"}`})]},r.step)})}),e.jsxs("div",{className:"flex-grow overflow-y-auto p-5 md:p-6 space-y-5",children:[o===1&&e.jsxs("div",{className:"space-y-4 animate-in fade-in duration-200 text-left",children:[e.jsxs("div",{className:"bg-indigo-50/70 py-3.5 px-4.5 rounded-xl border border-indigo-100 text-xs text-indigo-750 font-sans leading-relaxed flex items-start gap-2",children:[e.jsx(j,{size:16,className:"text-indigo-500 shrink-0 mt-0.5 animate-bounce"}),e.jsxs("div",{children:[e.jsx("strong",{children:t==="zh"?"设计理念:":"Instructional ConceptTip:"}),e.jsx("p",{className:"mt-0.5",children:t==="zh"?"一个高品质的课程往往始于明确的选题背景。选择适当的学科科目分类,系统不仅会按您的选择在后续步骤推荐量身定做的教案摸板,还可以一键预装适合该学科的课堂互动时间轴模板。":"Selecting a clear title and specific subject category helps pre-populate customized Markdown content outlines and specialized scheduling presets."})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6 font-sans",children:[e.jsxs("div",{className:"md:col-span-2 space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-bold text-gray-500 uppercase tracking-wider mb-2",children:t==="zh"?"📍 课程/课件名称 *":"📍 Course Title *"}),e.jsx("input",{type:"text",required:!0,value:p,onChange:r=>C(r.target.value),placeholder:t==="zh"?"例:西方哲学:康德的三大批判、Python编程入门、高中物理电路并联原理":"e.g. Introduction to regressions, Western Philosophies, Lever Principles",className:"w-full px-4 py-3 border border-gray-250 rounded-xl focus:outline-none focus:ring-2 focus:ring-indigo-500 text-gray-800 text-sm shadow-xs"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-bold text-gray-500 uppercase tracking-wider mb-2",children:t==="zh"?"🎯 课程设计简介与要点说明 (Objectives)":"🎯 Description & Lesson Objectives"}),e.jsx("textarea",{rows:4,value:u,onChange:r=>k(r.target.value),placeholder:t==="zh"?"在此处编写您的授课背景、面向学段及最关键的 2-3 个核心教学总目标。":"Write a short description stating learning outcomes and student prerequisite goals.",className:"w-full p-4 border border-gray-255 rounded-xl focus:outline-none focus:ring-2 focus:ring-indigo-500 text-gray-800 text-sm shadow-xs resize-none"})]})]}),e.jsxs("div",{className:"col-span-1 border-l border-gray-100 md:pl-6 space-y-4 text-left",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-bold text-gray-500 uppercase tracking-wider mb-2",children:t==="zh"?"🎨 学部科目分类":"🎨 Subject Category"}),e.jsxs("select",{value:n,onChange:r=>{S(r.target.value)},className:"w-full bg-white border border-gray-250 text-gray-755 font-bold px-3 py-2.5 rounded-xl focus:outline-none focus:ring-2 focus:ring-indigo-500 shadow-xs text-sm cursor-pointer",children:[e.jsx("option",{value:"Mathematics",children:t==="zh"?"📐 基础数学与几何":"📐 Mathematics"}),e.jsx("option",{value:"ComputerScience",children:t==="zh"?"💻 计算机软件与人工智能":"💻 Computer Science"}),e.jsx("option",{value:"Literature",children:t==="zh"?"✍️ 语言文字与阅读理解":"✍️ Literature & Writing"}),e.jsx("option",{value:"Physics",children:t==="zh"?"⚡ 物理实验与自然探索":"⚡ Physics & Science"}),e.jsx("option",{value:"History",children:t==="zh"?"🏛️ 历史脉络与人地分析":"🏛️ History & Humanities"}),e.jsx("option",{value:"Art",children:t==="zh"?"🎨 交互设计与先锋创意艺术":"🎨 Visual Arts & Design"}),e.jsx("option",{value:"Other",children:t==="zh"?"🔮 交叉素养与综合学习":"🔮 General & Other"})]})]}),e.jsxs("div",{className:"bg-slate-50 p-4 rounded-xl border border-gray-100 space-y-2 select-none text-left",children:[e.jsx("span",{className:"text-[10px] font-bold text-gray-400 uppercase tracking-wider block",children:t==="zh"?"科目时间轴专家建议":"SUBJECT HEURISTICS"}),e.jsxs("div",{className:"text-xs text-gray-600 leading-relaxed font-sans mt-1",children:[n==="Mathematics"&&(t==="zh"?"💡 数学:偏向理论推演。推荐 20分公式精讲 + 15分黑板实践互动,强化基础。":"💡 Math recommends: 20m Core Lecture + 15m Practice for theorem grounding."),n==="ComputerScience"&&(t==="zh"?"💡 计算机:偏重编码体验。推荐 15分白板代码推演 + 20分终端实验与分享。":"💡 CS recommends: 15m Algorithms + 20m Interactive workshops on virtual boards."),n==="Literature"&&(t==="zh"?"💡 语文文学:注重文本深度。推荐 10分范文研习 + 20分分组思辨,提升理解。":"💡 Lit recommends: 10m Reading Analysis + 20m Collaborative Discussions."),n==="Physics"&&(t==="zh"?"💡 科学类:逻辑导向。推荐 10分虚拟视频实验 + 20分机理讲解 + 10分钟随堂答卷。":"💡 Science recommends: 10m virtual showcase + 20m principles + 10m evaluation."),n==="History"&&(t==="zh"?"💡 历史人文:情景引入。推荐 15分人文画卷重塑 + 15分史实论驳辩论。":"💡 History recommends: 15m Context Mapping + 15m Interactive Debate panels."),n==="Art"&&(t==="zh"?"💡 视觉创意:自由度高。推荐 10分美术鉴赏 + 25分白板手绘画布互动体验。":"💡 Art recommends: 10m Aesthetics inspiration + 25m real-time board drawing."),n==="Other"&&(t==="zh"?"💡 其他科目:均分各小节时间,循序渐进,打造完整的教学循环闭环。":"💡 Generic: Divide evenly into sequential warm-up, core presentation and quiz.")]})]})]})]})]}),o===2&&e.jsxs("div",{className:"space-y-5 animate-in fade-in duration-200 text-left font-sans",children:[e.jsxs("div",{className:"bg-emerald-50/40 py-3.5 px-4.5 rounded-xl border border-emerald-100 text-xs text-emerald-850 leading-relaxed flex items-start gap-2 text-left",children:[e.jsx(W,{size:16,className:"text-emerald-555 shrink-0 mt-0.5 animate-pulse"}),e.jsxs("div",{children:[e.jsx("strong",{children:t==="zh"?"专家课堂时间轴预设:":"Dynamic Class Presets:"}),e.jsx("p",{className:"mt-0.5",children:t==="zh"?"好的教授节奏必须动静相宜。以下提供三种国际领先的精品课件时间节点设计,点击即可一键刷装配置。您也可以在下方自由增删和重新指定每个环节的长短!":"Curating temporal context maximizes classroom retention. Load from predefined templates or tweak the active steps on the dynamic table."})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-bold text-gray-500 uppercase tracking-wider mb-2",children:t==="zh"?"💡 点击应用典型课堂框架模板 (Quick Apply)":"💡 Click to Auto-Apply Structure Presets"}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3",children:[{id:"preset_standard",title:t==="zh"?"经典 5-20-15-5 讲授模式":"Traditional Dual-Lecture Paradigm",desc:t==="zh"?"由浅入深:先通过场景导入,后精讲,接着在白板配合大屏进行演练。":"Perfect dynamic for most standard classes.",segments:[{id:"seg-preset-1",title:"Course Orientation / 课堂导入",type:"intro",duration:"5m",color:"bg-blue-50 text-blue-700 border-blue-200 hover:bg-blue-100",notes:"Warm up topic"},{id:"seg-preset-2",title:"Subject Core Lecture / 核心理论精讲",type:"lecture",duration:"20m",color:"bg-indigo-50 text-indigo-700 border-indigo-200 hover:bg-indigo-100",notes:"Main content slide"},{id:"seg-preset-3",title:"Interactive Lab Work / 随堂协同演练",type:"practice",duration:"15m",color:"bg-green-50 text-green-700 border-green-200 hover:bg-green-100",notes:"Exercises & questions"},{id:"seg-preset-4",title:"Wrap up / 课堂成果总结与答疑",type:"summary",duration:"5m",color:"bg-purple-50 text-purple-700 border-purple-200 hover:bg-purple-100",notes:"Check answer notes"}]},{id:"preset_seminar",title:t==="zh"?"主题讨论工作坊模式":"Active Discussion Workshop",desc:t==="zh"?"协同探究:教师5分钟破冰,学生15分钟小组演练,15分钟对决汇报,10分钟定级。":"Discussion and presentation heavy layout.",segments:[{id:"seg-preset-5",title:"Debate Scenario Brief / 讨论情境简述",type:"intro",duration:"5m",color:"bg-amber-50 text-amber-700 border-amber-200 hover:bg-amber-100",notes:"Define debate metrics"},{id:"seg-preset-6",title:"Cooperative Ideation / 精英白板协作设计",type:"practice",duration:"15m",color:"bg-green-50 text-green-700 border-green-200 hover:bg-green-100",notes:"Joint workspace analysis"},{id:"seg-preset-7",title:"Student Team Presentation / 各小组交互汇报",type:"lecture",duration:"15m",color:"bg-indigo-50 text-indigo-700 border-indigo-200 hover:bg-indigo-100",notes:"Group screen sharing"},{id:"seg-preset-8",title:"Review & Grade Feedback / 教师深度对标点评",type:"summary",duration:"10m",color:"bg-purple-50 text-purple-700 border-purple-200 hover:bg-purple-100",notes:"Score reviews"}]},{id:"preset_flipped",title:t==="zh"?"翻转课堂高强度训练":"Targeted Problem-Solving Sprint",desc:t==="zh"?"应试/解惑突破:10分钟温习,15分钟重难盲点攻坚,15分钟专项题演习。":"Perfect for exams and targeted training courses.",segments:[{id:"seg-preset-9",title:"Blind Spot Evaluation / 温史自学效果自测",type:"intro",duration:"10m",color:"bg-blue-50 text-blue-700 border-blue-200 hover:bg-blue-100",notes:"Scan quiz"},{id:"seg-preset-10",title:"Advanced Principle Explores / 重难考点极限拆解",type:"lecture",duration:"15m",color:"bg-rose-50 text-rose-700 border-rose-200 hover:bg-rose-100",notes:"Analyse weak metrics"},{id:"seg-preset-11",title:"Mock Solving Battle / 核心精选题实操对抗",type:"practice",duration:"15m",color:"bg-emerald-50 text-emerald-700 border-emerald-200 hover:bg-emerald-100",notes:"Sprint workout"},{id:"seg-preset-12",title:"Anchor Recap / 知识网架构网节点固化",type:"summary",duration:"5m",color:"bg-purple-50 text-purple-700 border-purple-200 hover:bg-purple-100",notes:"Highlight checklist"}]}].map(r=>e.jsxs("button",{type:"button",onClick:()=>{c(r.segments),b(t==="zh"?"预设已刷装":"Preset Configured",t==="zh"?`已将《${r.title}》应用到您当前设计的课程中。`:`Assigned "${r.title}" timeslots.`,"success")},className:"bg-white border rounded-xl p-3 text-left transition-all hover:bg-indigo-50/20 hover:border-indigo-400 cursor-pointer active:scale-98",children:[e.jsx("div",{className:"font-bold text-gray-800 text-xs sm:text-sm",children:r.title}),e.jsx("div",{className:"text-[10px] text-gray-400 mt-1.5 leading-relaxed",children:r.desc})]},r.id))})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-2 select-none",children:[e.jsx("label",{className:"block text-xs font-bold text-gray-500 uppercase tracking-wider",children:t==="zh"?"📌 流程时间卡编辑 (拖拽或直接对表格字段赋值)":"📌 Custom Timeslot Table (Edit fields directly)"}),e.jsxs("button",{type:"button",onClick:()=>{const r={id:`seg-w-custom-${Date.now()}`,title:t==="zh"?`自理授课阶段 ${a.length+1}`:`Interactive Step ${a.length+1}`,type:"practice",duration:"10m",color:"bg-slate-50 text-slate-700 border-slate-200 hover:bg-slate-100",notes:""};c([...a,r])},className:"flex items-center gap-1 text-[11px] font-bold text-indigo-600 hover:text-indigo-800 cursor-pointer",children:[e.jsx(L,{size:12})," ",t==="zh"?"增设阶段":"Append Phase"]})]}),e.jsx("div",{className:"space-y-2 border border-gray-150 rounded-xl p-3.5 bg-gray-50/50",children:a.map((r,i)=>e.jsxs("div",{className:"flex flex-col sm:flex-row items-center gap-3 bg-white border border-gray-200 rounded-lg p-2.5 shadow-xs",children:[e.jsxs("div",{className:"flex items-center gap-2 w-full sm:w-auto",children:[e.jsx("span",{className:"w-5 h-5 rounded-full bg-slate-100 flex items-center justify-center text-[10px] text-gray-500 font-bold shrink-0",children:i+1}),e.jsx("input",{type:"text",value:r.title,onChange:l=>{const s=[...a];s[i].title=l.target.value,c(s)},className:"font-bold text-xs text-gray-800 bg-transparent border-b border-transparent hover:border-gray-200 focus:border-indigo-500 py-0.5 px-1 focus:outline-none focus:bg-gray-50/50 rounded flex-1 sm:w-56",placeholder:"Phase Title"})]}),e.jsxs("div",{className:"flex items-center gap-2.5 w-full sm:w-auto justify-end sm:ml-auto",children:[e.jsxs("div",{className:"flex items-center gap-1 bg-slate-50 border border-gray-200 rounded px-2 py-0.5 shrink-0",children:[e.jsx("span",{className:"text-[10px] font-bold text-gray-400",children:"时长:"}),e.jsx("input",{type:"text",value:r.duration,onChange:l=>{const s=[...a];s[i].duration=l.target.value,c(s)},className:"w-8 text-[11px] text-gray-800 font-extrabold bg-transparent text-center focus:outline-none"})]}),e.jsxs("select",{value:r.type,onChange:l=>{const s=l.target.value,d=[...a];d[i].type=s,s==="intro"?d[i].color="bg-blue-50 text-blue-700 border-blue-200 hover:bg-blue-100":s==="lecture"?d[i].color="bg-indigo-50 text-indigo-700 border-indigo-200 hover:bg-indigo-100":s==="practice"?d[i].color="bg-green-50 text-green-700 border-green-200 hover:bg-green-100":s==="summary"?d[i].color="bg-purple-50 text-purple-700 border-purple-200 hover:bg-purple-100":d[i].color="bg-gray-50 text-gray-700 border-gray-205 hover:bg-gray-100",c(d)},className:"bg-slate-50 border border-gray-200 text-[10px] font-bold text-gray-600 rounded p-1 focus:outline-none cursor-pointer",children:[e.jsx("option",{value:"intro",children:t==="zh"?"温习 / 导入":"Warm-up / Intro"}),e.jsx("option",{value:"lecture",children:t==="zh"?"主体 / 精讲":"Core Lecture"}),e.jsx("option",{value:"practice",children:t==="zh"?"交互白板练习":"Practice Workshop"}),e.jsx("option",{value:"summary",children:t==="zh"?"总结 / 定级":"Wrap-up / Recap"})]}),e.jsx("button",{type:"button",onClick:()=>{if(a.length<=1){alert(t==="zh"?"请保留至少一个核心环节!":"At least one segment must exist.");return}const l=a.filter((s,d)=>d!==i);c(l)},className:"text-gray-400 hover:text-rose-600 font-bold p-1 cursor-pointer text-sm select-none",title:"Delete this segment",children:"×"})]})]},r.id))}),e.jsxs("div",{className:"mt-2 text-[10px] text-right text-gray-500 font-mono select-none",children:[t==="zh"?"📈 环节累加公式:":"📈 Dynamic aggregation formula: ",e.jsx("span",{className:"text-gray-800 font-semibold",children:a.map(r=>r.duration).join(" + ")})]})]})]}),o===3&&e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 animate-in fade-in duration-200 font-sans text-left",children:[e.jsxs("div",{className:"space-y-3 flex flex-col h-full min-h-[360px] text-left",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-2",children:[e.jsx("label",{className:"block text-xs font-bold text-gray-500 uppercase tracking-wider select-none shrink-0",children:t==="zh"?"✏️ 使用 Markdown 语法编写课时材料":"✏️ Lesson Materials (Markdown)"}),e.jsxs("button",{type:"button",onClick:()=>{const r=T(p,n);h(r),b(t==="zh"?"大纲模板生成成功":"Curriculum Loaded",t==="zh"?"针对所选择的模型和属性已一键刷装教案模板框架。":"Prepopulated Markdown structure.","success")},className:"flex items-center gap-1 text-xs bg-indigo-50 border border-indigo-100 text-indigo-755 hover:bg-indigo-100 px-3 py-1 rounded-lg transition-colors font-bold cursor-pointer",children:[e.jsx(j,{size:13,className:"text-indigo-500 animate-spin"}),t==="zh"?"✨ 一键生成专家级教学大纲模版":"✨ Autofill Outline Template"]})]}),e.jsx("textarea",{rows:14,value:m,onChange:r=>h(r.target.value),placeholder:t==="zh"?`# 西方哲学三大经典原理
|
|
2
|
-
|
|
3
|
-
在此输入您的具体内容讲解、白板图形绘制节点、以及课后实践任务大纲...`:"# Course curriculum content",className:"w-full flex-grow p-4 bg-slate-900 text-slate-100 border border-slate-700 rounded-xl focus:outline-none focus:ring-2 focus:ring-indigo-500 font-mono text-xs shadow-inner leading-relaxed text-left"})]}),e.jsxs("div",{className:"space-y-3 flex flex-col h-full border border-gray-150 rounded-xl bg-slate-50/50 p-4 text-left",children:[e.jsxs("span",{className:"block text-xs font-bold text-gray-400 uppercase tracking-wider select-none shrink-0",children:["🖥️ ",t==="zh"?"大纲资料实时交互渲染":"Syllabus Live Context rendering"]}),e.jsx("div",{className:"flex-grow overflow-y-auto bg-white border border-gray-150 rounded-lg p-4 text-xs font-sans text-gray-700 max-h-[380px] overflow-x-hidden text-left select-text",children:m.trim()?e.jsx("div",{className:"markdown-body",children:e.jsx(P,{children:m})}):e.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-gray-400 italic py-16",children:[e.jsx(y,{size:32,className:"mb-2 opacity-20 text-indigo-500"}),e.jsx("span",{children:t==="zh"?"教案空无内容,等待输入或一键填充模板...":"Waiting for materials..."})]})})]})]}),o===4&&e.jsxs("div",{className:"space-y-6 animate-in fade-in duration-200 text-center font-sans max-w-xl mx-auto py-3",children:[e.jsx("div",{className:"inline-flex p-3 bg-emerald-50 border border-emerald-100 text-emerald-500 rounded-full",children:e.jsx(I,{size:36,className:"animate-pulse text-emerald-555"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-extrabold text-gray-800 text-base md:text-lg",children:t==="zh"?"🚀 互动课程已精心筹备成功!":"🚀 Materials Generated successfully!"}),e.jsx("p",{className:"text-xs text-gray-400 mt-1",children:t==="zh"?"设计与时间轴逻辑全部检验合格。请在下方核验新课卡片,确认无误一键部署入 SQLite 内核数据库。":"Curriculum parameters are ready to boot inside the Secure Host."})]}),e.jsxs("div",{className:"border border-indigo-200 rounded-2xl p-5 bg-linear-to-b from-indigo-50/20 to-white shadow-md text-left space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-indigo-50 pb-3 gap-2",children:[e.jsx("div",{className:"font-bold text-indigo-950 text-base sm:text-lg truncate",children:p||(t==="zh"?"未指定课程主题":"Blank Topic")}),e.jsx("span",{className:"inline-flex px-2 py-0.5 rounded text-[10px] font-extrabold bg-indigo-50 text-indigo-800 uppercase tracking-wide border border-indigo-150 shrink-0",children:n})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4 text-xs",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-gray-400 block tracking-wider text-[10px] font-bold",children:t==="zh"?"教研环节数":"TOTAL STEPS"}),e.jsxs("span",{className:"text-gray-800 font-extrabold text-sm block mt-1",children:[a.length," ",t==="zh"?"项教学环节":"slots"]})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-gray-400 block tracking-wider text-[10px] font-bold",children:t==="zh"?"发布载体引擎":"STORAGE MEDIUM"}),e.jsxs("div",{className:"flex items-center gap-1 text-emerald-650 font-extrabold text-sm mt-1",children:[e.jsx(v,{size:11,className:"text-emerald-500"}),e.jsx("span",{children:"SQLite DB"})]})]})]}),e.jsx("div",{className:"bg-slate-50 border border-gray-150 p-3 rounded-lg text-[11px] text-gray-600 line-clamp-2 italic leading-relaxed text-left",children:u||(t==="zh"?"无科目描述内容":"No description written.")}),e.jsxs("div",{className:"space-y-1.5 select-none",children:[e.jsx("span",{className:"text-[10px] font-extrabold text-gray-400 uppercase tracking-wider block",children:t==="zh"?"教学时间轴环流预览":"TIMELINE PROGRESS OVERVIEW"}),e.jsx("div",{className:"flex items-center gap-1 w-full overflow-x-auto py-1",children:a.map((r,i)=>e.jsxs(f.Fragment,{children:[e.jsxs("div",{className:`px-2 py-1 text-[10px] font-bold rounded border truncate max-w-[120px] ${r.color.split(" ")[0]}`,children:[r.title.split(" / ")[0]," (",r.duration,")"]}),i<a.length-1&&e.jsx(E,{size:11,className:"text-gray-300"})]},r.id))})]})]})]})]}),e.jsxs("div",{className:"p-4 border-t border-gray-105 bg-slate-50 flex justify-between items-center shrink-0",children:[e.jsx("span",{className:"text-[11px] font-bold font-mono text-gray-400 uppercase select-none",children:t==="zh"?"⚙️ SQLITE 写入预检通过":"⚙️ SQLITE VERIFICATION SUCCESS"}),e.jsxs("div",{className:"flex items-center gap-2",children:[o>1&&e.jsx("button",{type:"button",onClick:()=>g(r=>r-1),disabled:x,className:"px-4 py-2 text-xs font-semibold border border-gray-200 text-gray-700 bg-white hover:bg-gray-50 rounded-lg transition-colors cursor-pointer select-none",children:t==="zh"?"上一步":"Back"}),o<4?e.jsx("button",{type:"button",onClick:()=>{if(o===1&&!p.trim()){alert(t==="zh"?"请输入课程课题名称!":"Please type course title to proceed.");return}g(r=>r+1)},className:"px-4.5 py-2 text-xs font-bold bg-indigo-600 hover:bg-indigo-700 text-white rounded-lg shadow-sm flex items-center gap-1 cursor-pointer select-none",children:t==="zh"?"继续前进":"Continue"}):e.jsx("button",{type:"button",onClick:D,disabled:x,className:"px-5 py-2 text-xs font-bold bg-emerald-600 hover:bg-emerald-700 text-white rounded-lg shadow-md flex items-center gap-1.5 cursor-pointer disabled:opacity-50 select-none animate-bounce",children:x?e.jsxs(e.Fragment,{children:[e.jsx(M,{size:13,className:"animate-spin"}),e.jsx("span",{children:t==="zh"?"写入底库中...":"Deploying..."})]}):e.jsxs(e.Fragment,{children:[e.jsx(v,{size:13}),e.jsx("span",{children:t==="zh"?"部署并激活新课程":"Deploy & Activate"})]})})]})]})]})})})}export{Q as CourseWizardModal};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as a,j as e}from"./vendor-react-0Lg0vA-4.js";import{F as k,X as M,ad as R,ae as V,a4 as q,r as O,g as X,N as B,af as G,h as J,aa as K}from"./vendor-icons-_c3xpwjZ.js";const Q="@courseware-hub/plugin",W=h=>`${Q}.${h}`;function oe({onClose:h,lang:m}){const[p,T]=a.useState([]),[_,b]=a.useState(!1),[u,z]=a.useState(""),[g,P]=a.useState(""),[y,j]=a.useState(!1),[U,f]=a.useState(null),[n,D]=a.useState(null),[N,F]=a.useState([]),[Y,Z]=a.useState(null),[c,v]=a.useState(""),[w,S]=a.useState(60),[d,C]=a.useState(""),[ee,se]=a.useState(null),[te,ae]=a.useState(""),[re,le]=a.useState(60),i=a.useCallback(async(s,r)=>{const l=await fetch("/api/commands",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({commandType:W(s),payload:r??{}})});if(!l.ok){const $=await l.json();throw new Error($.error||"Command failed")}return(await l.json()).result},[]),o=a.useCallback(async()=>{b(!0);try{const s=await i("courseware.query",{status:g||void 0,search:u||void 0,limit:100});T(s?.items??[])}catch(s){console.error("Fetch courseware list failed:",s)}finally{b(!1)}},[i,g,u]);a.useEffect(()=>{o()},[o]);const L=async()=>{if(!(!c.trim()||!d.trim())){j(!0);try{await i("courseware.upload",{title:c.trim(),html_content:d,pass_score:w}),v(""),C(""),S(60),await o()}catch(s){alert(s.message)}finally{j(!1)}}},E=s=>{const r=s.target.files?.[0];if(!r)return;const l=new FileReader;l.onload=x=>C(x.target?.result??""),l.readAsText(r)},H=async(s,r)=>{const l=r==="published"?"draft":"published";try{await i("courseware.publish",{id:s,status:l}),await o()}catch(x){alert(x.message)}},I=async(s,r)=>{if(confirm(m==="zh"?`确认删除课件「${r}」及其所有版本和成绩数据?`:`Delete "${r}" and all versions/scores?`))try{await i("courseware.delete",{id:s}),await o()}catch(l){alert(l.message)}},A=async s=>{try{const r=await i("courseware.get_detail",{id:s}),l=await i("courseware.query_scores",{courseware_id:s});D(r),F(l?.items??[]),f(s)}catch(r){alert(r.message)}},t=(s,r)=>m==="zh"?s:r;return e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 backdrop-blur-sm",children:e.jsxs("div",{className:"bg-white rounded-2xl shadow-2xl border border-gray-200 w-[90vw] max-w-5xl h-[85vh] flex flex-col overflow-hidden",children:[e.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-gray-100 shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"p-2 bg-indigo-50 text-indigo-600 rounded-xl",children:e.jsx(k,{size:20})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-bold text-gray-800",children:t("课件管理","Courseware Hub")}),e.jsx("p",{className:"text-xs text-gray-400",children:t("上传 HTML 课件 · 成绩采集 · 版本管理","Upload · Score Collection · Versioning")})]})]}),e.jsx("button",{onClick:h,className:"p-2 hover:bg-gray-100 rounded-lg transition-colors",children:e.jsx(M,{size:18,className:"text-gray-400"})})]}),U?e.jsxs("div",{className:"flex-1 overflow-y-auto p-6",children:[e.jsxs("button",{onClick:()=>f(null),className:"text-sm text-indigo-600 hover:underline mb-4 inline-flex items-center gap-1",children:["← ",t("返回列表","Back to list")]}),n&&e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"bg-gray-50 rounded-xl p-5 border border-gray-100",children:[e.jsx("h3",{className:"font-bold text-gray-800 mb-3",children:n.title}),e.jsxs("div",{className:"grid grid-cols-2 gap-x-8 gap-y-2 text-sm",children:[e.jsxs("div",{children:[e.jsxs("span",{className:"text-gray-400",children:[t("版本","Version"),":"]})," ",e.jsx("span",{className:"font-mono text-gray-700",children:n.version})]}),e.jsxs("div",{children:[e.jsxs("span",{className:"text-gray-400",children:[t("状态","Status"),":"]})," ",e.jsx("span",{className:`font-bold ${n.status==="published"?"text-green-600":"text-amber-600"}`,children:n.status})]}),e.jsxs("div",{children:[e.jsxs("span",{className:"text-gray-400",children:[t("及格线","Pass Score"),":"]})," ",e.jsx("span",{className:"font-mono",children:n.pass_score})]}),e.jsxs("div",{children:[e.jsxs("span",{className:"text-gray-400",children:[t("提交数","Submissions"),":"]})," ",e.jsx("span",{className:"font-mono",children:n.stats?.submissions??0})]}),e.jsxs("div",{children:[e.jsxs("span",{className:"text-gray-400",children:[t("平均分","Avg Score"),":"]})," ",e.jsx("span",{className:"font-mono text-indigo-600 font-bold",children:n.stats?.avg_score??"-"})]}),e.jsxs("div",{children:[e.jsxs("span",{className:"text-gray-400",children:[t("通过率","Pass Rate"),":"]})," ",e.jsxs("span",{className:"font-mono",children:[n.stats?.pass_rate??"-","%"]})]})]})]}),e.jsxs("div",{children:[e.jsx("h4",{className:"font-bold text-gray-700 mb-3",children:t("成绩列表","Score List")}),N.length===0?e.jsx("p",{className:"text-sm text-gray-400 italic",children:t("暂无成绩记录","No scores yet")}):e.jsx("div",{className:"overflow-x-auto border border-gray-200 rounded-xl",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{className:"bg-gray-50 text-gray-500 text-xs uppercase",children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-4 py-2 text-left",children:t("学生","Student")}),e.jsx("th",{className:"px-4 py-2 text-right",children:t("分数","Score")}),e.jsx("th",{className:"px-4 py-2 text-right",children:t("用时(秒)","Time(s)")}),e.jsx("th",{className:"px-4 py-2 text-right",children:t("提交时间","Submitted")})]})}),e.jsx("tbody",{className:"divide-y divide-gray-100",children:N.map(s=>e.jsxs("tr",{className:"hover:bg-gray-50",children:[e.jsx("td",{className:"px-4 py-2 font-medium text-gray-700",children:s.student_name||s.student_id}),e.jsxs("td",{className:`px-4 py-2 text-right font-mono font-bold ${s.score>=(n?.pass_score??60)?"text-green-600":"text-red-500"}`,children:[s.score,"/",s.total]}),e.jsx("td",{className:"px-4 py-2 text-right text-gray-500",children:s.time_spent}),e.jsx("td",{className:"px-4 py-2 text-right text-gray-400 text-xs",children:new Date(s.submitted_at).toLocaleString()})]},s.id))})]})})]})]})]}):e.jsxs("div",{className:"flex-1 flex flex-col min-h-0",children:[e.jsxs("div",{className:"px-6 py-3 border-b border-gray-100 flex items-center gap-3 shrink-0 flex-wrap",children:[e.jsxs("div",{className:"relative flex-1 min-w-[200px]",children:[e.jsx(R,{size:14,className:"absolute left-3 top-2.5 text-gray-400"}),e.jsx("input",{value:u,onChange:s=>z(s.target.value),placeholder:t("搜索课件...","Search courseware..."),className:"w-full pl-9 pr-3 py-2 text-sm border border-gray-200 rounded-lg focus:ring-1 focus:ring-indigo-500 outline-none"})]}),e.jsxs("select",{value:g,onChange:s=>P(s.target.value),className:"text-sm border border-gray-200 rounded-lg px-3 py-2 outline-none focus:ring-1 focus:ring-indigo-500 bg-white",children:[e.jsx("option",{value:"",children:t("全部状态","All Status")}),e.jsx("option",{value:"published",children:t("已发布","Published")}),e.jsx("option",{value:"draft",children:t("草稿","Draft")}),e.jsx("option",{value:"archived",children:t("已归档","Archived")})]}),e.jsx("button",{onClick:o,className:"p-2 hover:bg-gray-100 rounded-lg transition-colors",title:t("刷新","Refresh"),children:e.jsx(V,{size:16,className:"text-gray-400"})})]}),e.jsx("div",{className:"px-6 py-4 border-b border-gray-100 bg-indigo-50/30 shrink-0",children:e.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[e.jsxs("span",{className:"text-sm font-bold text-gray-600 shrink-0",children:[t("上传课件","Upload"),":"]}),e.jsx("input",{value:c,onChange:s=>v(s.target.value),placeholder:t("课件标题","Title"),className:"text-sm border border-gray-200 rounded-lg px-3 py-2 w-40 outline-none focus:ring-1 focus:ring-indigo-500"}),e.jsx("input",{type:"number",value:w,onChange:s=>S(Number(s.target.value)),placeholder:t("及格线","Pass"),className:"text-sm border border-gray-200 rounded-lg px-3 py-2 w-20 outline-none focus:ring-1 focus:ring-indigo-500"}),e.jsxs("label",{className:"text-sm px-3 py-2 border border-dashed border-gray-300 rounded-lg cursor-pointer hover:border-indigo-400 hover:bg-white transition-colors text-gray-500",children:[e.jsx(q,{size:14,className:"inline mr-1"}),d?t("已选择文件","File selected"):t("选择 HTML","Select HTML"),e.jsx("input",{type:"file",accept:".html,.htm",onChange:E,className:"hidden"})]}),e.jsx("button",{onClick:L,disabled:y||!c.trim()||!d.trim(),className:"px-4 py-2 bg-indigo-600 text-white text-sm font-bold rounded-lg hover:bg-indigo-700 disabled:opacity-40 transition-colors",children:y?t("上传中...","Uploading..."):t("上传","Upload")})]})}),e.jsx("div",{className:"flex-1 overflow-y-auto p-6",children:_?e.jsx("div",{className:"text-center py-12 text-gray-400",children:t("加载中...","Loading...")}):p.length===0?e.jsxs("div",{className:"text-center py-12 text-gray-400",children:[e.jsx(k,{size:40,className:"mx-auto mb-3 opacity-30"}),e.jsx("p",{children:t("暂无课件,请上传您的第一个 HTML 课件","No courseware yet. Upload your first HTML courseware.")})]}):e.jsx("div",{className:"grid gap-4",children:p.map(s=>e.jsx("div",{className:"bg-white border border-gray-200 rounded-xl p-4 hover:border-indigo-200 transition-colors shadow-sm",children:e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("h4",{className:"font-bold text-gray-800 truncate",children:s.title}),e.jsx("span",{className:`text-[10px] px-2 py-0.5 rounded-full font-bold ${s.status==="published"?"bg-green-50 text-green-650 border border-green-200":s.status==="archived"?"bg-gray-50 text-gray-500 border border-gray-200":"bg-amber-50 text-amber-650 border border-amber-200"}`,children:s.status==="published"?t("已发布","Published"):s.status==="archived"?t("已归档","Archived"):t("草稿","Draft")}),e.jsxs("span",{className:"text-[10px] text-gray-400 font-mono",children:["v",s.version]})]}),s.description&&e.jsx("p",{className:"text-xs text-gray-400 line-clamp-2 mb-2",children:s.description}),e.jsxs("div",{className:"flex items-center gap-4 text-xs text-gray-400",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(O,{size:12}),t("提交","Subs"),": ",s.stats?.submissions??0]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(X,{size:12}),t("均分","Avg"),": ",s.stats?.avg_score??"-"]}),s.security_warnings?.length>0&&e.jsxs("span",{className:"text-amber-500 flex items-center gap-1",title:s.security_warnings.join(", "),children:["⚠ ",s.security_warnings.length]})]})]}),e.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[e.jsx("button",{onClick:()=>A(s.id),className:"p-1.5 hover:bg-gray-100 rounded-lg transition-colors",title:t("详情","Details"),children:e.jsx(B,{size:15,className:"text-gray-400"})}),e.jsx("button",{onClick:()=>H(s.id,s.status),className:"p-1.5 hover:bg-gray-100 rounded-lg transition-colors",title:s.status==="published"?t("下架","Unpublish"):t("发布","Publish"),children:s.status==="published"?e.jsx(G,{size:15,className:"text-amber-500"}):e.jsx(J,{size:15,className:"text-green-500"})}),e.jsx("button",{onClick:()=>I(s.id,s.title),className:"p-1.5 hover:bg-red-50 rounded-lg transition-colors",title:t("删除","Delete"),children:e.jsx(K,{size:15,className:"text-red-400"})})]})]})},s.id))})})]})]})})}export{oe as CoursewareHubPanel};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r,j as e}from"./vendor-react-0Lg0vA-4.js";import{f as b,X as R,o as T,a3 as W,_ as B}from"./vendor-icons-_c3xpwjZ.js";function P({isOpen:x,onClose:l,lang:s,onSeedSuccess:z,onJumpTab:N}){const[n,h]=r.useState(0),[v,w]=r.useState(!1),[F,y]=r.useState(null),[I,S]=r.useState(null),[k,p]=r.useState({display:"none"}),[C,m]=r.useState({display:"none"}),L=r.useRef(null),d=[{targetId:"",title:s==="zh"?"欢迎来到 OpenLearn Next V2 平台!":"Welcome to OpenLearn Next V2!",content:s==="zh"?"本平台为数字课堂提供智能白板与教学插件生态托管。下面我们将通过 4 步带您快速完成初始化并体验一堂数字互动课程。":"Welcome! This platform provides interactive whiteboards and educational plugin hosting. Let's set up your first class in 4 quick steps."},{targetId:"nav_btn_admin_directory",title:s==="zh"?"第 1 步:一键初始化示例课程":"Step 1: Initialize Example Class",content:s==="zh"?"在开始授课前,我们需要一个授课班级。请点击下方的按钮,系统将自动在数据库中为您建立示例班级、添加 5 名演示学生(小明、小红等),并自动排定一节今日的白板创意编程示范课!":"Before teaching, we need a classroom session. Click the button below to seed a demo class, add 5 sample students (Xiao Ming, Xiao Hong, etc.), and schedule today's creative programming class!",actionable:!0},{targetId:"navigation_sidebar",title:s==="zh"?"第 2 步:了解系统导航菜单":"Step 2: Tour System Navigation",content:s==="zh"?"初始化成功后,您可以在「系统导航」的「班级管理」中查看学生名册及座位表,或在「课程管理」中编辑白板教案。在「插件中心」中,您还可以安装/停用丰富的第三方小工具。":'After setup, explore the sidebar! Use "Classes & Students" to manage student profiles, "Courses" to edit whiteboards, and "Plugins" to manage tools.'},{targetId:"nav_btn_live_class",title:s==="zh"?"第 3 步:进入互动课堂开启体验":"Step 3: Launch Live Classroom",content:s==="zh"?"一切就绪!点击下方的「一键开课并进入课堂」,系统将为您自动进入示范课堂并展开互动白板。您可以在白板上下发测验、进行实时统计,学生端也将实时接收广播。":'All set! Click "Launch Classroom" to enter the live room. You can draw on the whiteboard, push quizzes, and view live stats, while student clients auto-sync.'}],_=async()=>{w(!0);try{const i=await fetch("/api/admin/seed-demo",{method:"POST"});if(i.ok){const t=await i.json();t.success&&(S({classId:t.classId,className:"人工智能与创意编程示范班"}),z({classId:t.classId,scheduleId:t.scheduleId,lessonId:t.lessonId}),setTimeout(()=>{h(2)},1500))}else{const t=await i.json().catch(()=>({error:"未知错误"}));y(s==="zh"?`初始化失败:${t.error||"请检查服务器日志"}`:`Failed: ${t.error||"Check server logs"}`)}}catch(i){console.error("Failed to seed demo data:",i),y(s==="zh"?`网络错误:${i.message||"请检查服务器是否运行"}`:`Network error: ${i.message||"Check if server is running"}`)}finally{w(!1)}},E=()=>{localStorage.setItem("edu_os_tour_completed","true"),N("live_class"),l()};if(r.useEffect(()=>{if(!x)return;const i=d[n];if(!i||!i.targetId){p({display:"none"}),m({position:"fixed",top:"50%",left:"50%",transform:"translate(-50%, -50%)",zIndex:1e4,width:"420px",maxWidth:"90vw"});return}const t=()=>{const j=document.getElementById(i.targetId);if(!j){p({display:"none"}),m({position:"fixed",top:"50%",left:"50%",transform:"translate(-50%, -50%)",zIndex:1e4,width:"420px",maxWidth:"90vw"});return}const o=j.getBoundingClientRect(),c=6;p({display:"block",position:"fixed",top:`${o.top-c}px`,left:`${o.left-c}px`,width:`${o.width+c*2}px`,height:`${o.height+c*2}px`,boxShadow:"0 0 0 9999px rgba(15, 23, 42, 0.65)",border:"2px dashed #6366f1",borderRadius:"12px",zIndex:9999,pointerEvents:"none",transition:"all 0.25s cubic-bezier(0.4, 0, 0.2, 1)"});const u=360;let f=o.left+o.width+16,g=o.top;f+u>window.innerWidth&&(f=Math.max(16,o.left-u-16)),g+240>window.innerHeight&&(g=Math.max(16,window.innerHeight-250)),m({display:"block",position:"fixed",top:`${g}px`,left:`${f}px`,width:`${u}px`,zIndex:1e4,transition:"all 0.25s cubic-bezier(0.4, 0, 0.2, 1)"})};t(),window.addEventListener("resize",t),window.addEventListener("scroll",t,!0);const $=setInterval(t,300);return()=>{window.removeEventListener("resize",t),window.removeEventListener("scroll",t,!0),clearInterval($)}},[x,n]),!x)return null;const a=d[n];return e.jsxs("div",{className:"fixed inset-0 overflow-hidden select-none",style:{zIndex:9998},children:[a&&!a.targetId&&e.jsx("div",{className:"fixed inset-0 bg-slate-900/65 backdrop-blur-2xs transition-opacity",onClick:l}),e.jsx("div",{style:k}),e.jsxs("div",{ref:L,style:C,className:"bg-white rounded-2xl border border-slate-150/60 shadow-2xl p-5 md:p-6 text-gray-900 font-sans flex flex-col justify-between",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between items-start mb-3",children:[e.jsxs("h3",{className:"font-extrabold text-sm md:text-base text-gray-900 flex items-center gap-1.5 leading-tight",children:[e.jsx(b,{size:16,className:"text-indigo-500 animate-pulse shrink-0"}),a.title]}),e.jsx("button",{onClick:l,className:"text-gray-400 hover:text-gray-600 rounded-lg p-0.5 transition-colors cursor-pointer",children:e.jsx(R,{size:16})})]}),e.jsx("p",{className:"text-xs md:text-sm text-gray-600 leading-relaxed font-medium mb-5 whitespace-pre-wrap",children:a.content}),a.actionable&&e.jsx("div",{className:"bg-slate-50 border border-slate-200/80 rounded-xl p-3.5 mb-5 flex flex-col items-center justify-center",children:I?e.jsxs("div",{className:"flex items-center gap-2 text-emerald-600 text-xs font-bold animate-bounce",children:[e.jsx(T,{size:12,className:"fill-emerald-600"}),s==="zh"?"示范课程与学生名册初始化成功!":"Demo classes successfully initialized!"]}):e.jsx("button",{onClick:_,disabled:v,className:"w-full flex items-center justify-center gap-1.5 py-2.5 px-4 bg-indigo-600 hover:bg-indigo-700 text-white font-bold text-xs md:text-sm rounded-lg hover:shadow-md transition-all cursor-pointer disabled:bg-indigo-400",children:v?e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsxs("svg",{className:"animate-spin h-4 w-4 text-white",fill:"none",viewBox:"0 0 24 24",children:[e.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),e.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),s==="zh"?"正在创建数据库记录...":"Initializing DB records..."]}):e.jsxs(e.Fragment,{children:[e.jsx(b,{size:14,className:"animate-pulse"}),s==="zh"?"一键初始化示范数据":"Initialize Example Data"]})})})]}),e.jsxs("div",{className:"flex items-center justify-between border-t border-slate-100 pt-4 shrink-0",children:[e.jsx("div",{className:"flex items-center gap-1.5",children:d.map((i,t)=>e.jsx("div",{className:`h-1.5 rounded-full transition-all duration-300 ${t===n?"w-4 bg-indigo-600":"w-1.5 bg-slate-200"}`},t))}),e.jsxs("div",{className:"flex items-center gap-2",children:[n>0?e.jsxs("button",{onClick:()=>h(i=>i-1),className:"flex items-center gap-1 px-3 py-1.5 border border-slate-200 rounded-lg text-xs font-semibold text-slate-600 hover:bg-slate-50 transition-colors cursor-pointer",children:[e.jsx(W,{size:12}),s==="zh"?"上一步":"Back"]}):e.jsx("button",{onClick:l,className:"px-3 py-1.5 border border-slate-200 rounded-lg text-xs font-semibold text-slate-500 hover:bg-slate-50 transition-colors cursor-pointer",children:s==="zh"?"跳过向导":"Skip Tour"}),n<d.length-1?e.jsxs("button",{onClick:()=>h(i=>i+1),className:"flex items-center gap-1 px-3 py-1.5 bg-slate-900 text-white rounded-lg text-xs font-semibold hover:bg-slate-800 transition-colors cursor-pointer",children:[s==="zh"?"下一步":"Next",e.jsx(B,{size:12})]}):e.jsxs("button",{onClick:E,className:"flex items-center gap-1 px-4 py-1.5 bg-indigo-600 hover:bg-indigo-700 text-white rounded-lg text-xs font-bold shadow-sm transition-colors cursor-pointer",children:[s==="zh"?"结束引导并开课":"Launch Classroom",e.jsx(b,{size:12})]})]})]})]})]})}export{P as HelpTour};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e}from"./vendor-react-0Lg0vA-4.js";import{m as v}from"./index-C5FKWIUq.js";import{a4 as g,a5 as N,l as w,g as C,y as z}from"./vendor-icons-_c3xpwjZ.js";import"./vendor-utils-4FcTwKPj.js";import"./vendor-pdf-CVyNPGVr.js";import"./vendor-motion-DjY2czvL.js";import"./vendor-pptx-B_NheIKl.js";import"./vendor-charts-B7ViBL9w.js";function T(h){const{isImportLessonsOpen:p,setIsImportLessonsOpen:i,lang:s,importStatus:r,setIsDraggingImport:d,handleCSVFileChange:x,downloadCsvTemplate:b,isDraggingImport:u,previewImportData:a,setPreviewImportData:m,setImportStatus:c,importProgress:l,importProgressTotal:n,importErrorMsg:f,setImportErrorMsg:y,handleCSVImportSubmit:j}=h;return e.jsx(e.Fragment,{children:p&&e.jsx("div",{className:"fixed inset-0 bg-gray-900/50 backdrop-blur-sm flex items-center justify-center p-4 md:p-6 z-50 overflow-y-auto text-gray-850",children:e.jsxs(v.div,{initial:{opacity:0,y:15,scale:.98},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:10,scale:.98},className:"bg-white border text-gray-900 border-gray-250 rounded-2xl shadow-2xl w-full max-w-2xl flex flex-col overflow-hidden max-h-[90vh] font-sans text-left",children:[e.jsxs("div",{className:"p-4 md:p-5 border-b border-gray-100 flex items-center justify-between bg-slate-50 shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"p-2 bg-indigo-50 border border-indigo-100 rounded-lg text-indigo-650",children:e.jsx(g,{size:20,className:"animate-pulse"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"font-bold text-gray-850 text-base md:text-lg",children:s==="zh"?"批量导入课程 (CSV)":"Bulk-Import Courses (CSV)"}),e.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:s==="zh"?"上传包含标准表头的 CSV 教案,一键实现秒级批量底库写入。":"Upload a standard CSV file matching our predefined schema to perform instantaneous bulk curriculum imports."})]})]}),e.jsx("button",{onClick:()=>{r!=="importing"&&i(!1)},disabled:r==="importing",className:"text-gray-400 hover:text-gray-650 font-bold p-1 rounded-lg hover:bg-gray-150 transition-all text-xl leading-none disabled:opacity-40",children:"×"})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto p-6 space-y-5",children:[r==="idle"&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"p-4 bg-indigo-50/50 border border-indigo-100 rounded-xl",children:[e.jsxs("h4",{className:"text-xs font-bold text-indigo-850 uppercase tracking-wide flex items-center gap-1",children:[e.jsx("span",{children:"📌"}),s==="zh"?"预定义数据格式说明":"Predefined Schema Information"]}),e.jsx("p",{className:"text-xs text-indigo-900 mt-1 leading-relaxed",children:s==="zh"?"CSV 文件的首行必须 define 列标题(分大小写且无多余空格),包含以下两项必需内容:":"Your CSV file must include exactly these header columns on the first row (case-insensitive):"}),e.jsxs("ul",{className:"list-disc pl-5 mt-2 text-xs text-indigo-950 space-y-1",children:[e.jsxs("li",{children:[e.jsx("strong",{children:"title"}),": ",s==="zh"?'课程名 (非空,例如 "代数几何")':'Course title (Required, e.g. "Linear Algebra")']}),e.jsxs("li",{children:[e.jsx("strong",{children:"content"}),": ",s==="zh"?"教学大纲 / Markdown 格式的课堂细目":"Syllabus content supporting rich markdown."]})]}),e.jsx("div",{className:"mt-3.5 flex justify-start",children:e.jsxs("button",{onClick:b,className:"flex items-center gap-1 p-2 text-xs font-bold text-indigo-700 bg-white border border-indigo-200 rounded-lg shadow-3xs hover:bg-indigo-50 hover:-translate-y-0.5 hover:shadow-xs transition-all cursor-pointer",children:[e.jsx(N,{size:12}),s==="zh"?"获取标准 CSV 模板":"Download Template CSV"]})})]}),e.jsxs("div",{onDragOver:t=>{t.preventDefault(),d(!0)},onDragLeave:()=>d(!1),onDrop:t=>{t.preventDefault(),d(!1),t.dataTransfer.files&&t.dataTransfer.files[0]&&x(t.dataTransfer.files[0])},onClick:()=>{document.getElementById("import-csv-file-picker")?.click()},className:`border-2 border-dashed rounded-2xl p-8 text-center cursor-pointer transition-all flex flex-col items-center justify-center min-h-[180px] ${u?"border-indigo-500 bg-indigo-50/70 scale-[1.01]":"border-gray-250 bg-gray-50/50 hover:bg-gray-50 hover:border-indigo-400"}`,children:[e.jsx("input",{id:"import-csv-file-picker",type:"file",accept:".csv",className:"hidden",onChange:t=>{t.target.files&&t.target.files[0]&&x(t.target.files[0])}}),e.jsx("div",{className:"p-3 bg-gray-100 border border-gray-200 rounded-full text-indigo-600 mb-3 group-hover:scale-105 transition-all",children:e.jsx(g,{size:24})}),e.jsx("span",{className:"text-sm font-bold text-gray-800",children:s==="zh"?"选择 CSV 文件或拖放至此处":"Click to select or drag and drop CSV file here"}),e.jsx("span",{className:"text-xs text-gray-400 mt-1",children:s==="zh"?"支持标准 CSV 文件,最大不超过 5MB":"Supports standard CSV format up to 5MB"})]})]}),r==="parsing"&&a.length>0&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("span",{className:"text-xs font-bold text-emerald-600 bg-emerald-50 border border-emerald-200 px-2.5 py-1 rounded-full",children:["✓ ",s==="zh"?`解析成功:查找到 ${a.length} 门课程`:`Parsed Successfully: Found ${a.length} records`]}),e.jsx("button",{onClick:()=>{m([]),c("idle")},className:"text-xs text-indigo-600 hover:text-indigo-800 font-semibold",children:s==="zh"?"重新上传":"Upload Different File"})]}),e.jsx("div",{className:"border border-gray-200 rounded-xl overflow-hidden shadow-3xs max-h-[300px] overflow-y-auto",children:e.jsxs("table",{className:"w-full text-left text-xs border-collapse",children:[e.jsx("thead",{className:"bg-gray-50 text-gray-600 border-b border-gray-200 font-bold",children:e.jsxs("tr",{children:[e.jsx("th",{className:"p-3 w-1/4",children:s==="zh"?"课程名称":"Course Title"}),e.jsx("th",{className:"p-3 w-3/4",children:s==="zh"?"大纲简介片段":"Syllabus Preview"})]})}),e.jsx("tbody",{className:"divide-y divide-gray-100 bg-white",children:a.map((t,o)=>e.jsxs("tr",{className:"hover:bg-slate-50/50",children:[e.jsx("td",{className:"p-3 font-semibold text-gray-800 align-top truncate max-w-[150px]",title:t.title,children:t.title}),e.jsx("td",{className:"p-3 text-gray-500 font-mono text-[11px] leading-relaxed break-words col-span-2",children:t.content.length>150?t.content.substring(0,150)+"...":t.content||e.jsx("em",{className:"text-gray-300 italic",children:"None"})})]},o))})]})}),e.jsxs("div",{className:"bg-amber-50 border border-amber-100 text-amber-900 text-xs rounded-xl p-3 flex gap-2.5 items-start",children:[e.jsx("span",{className:"text-base leading-none",children:"⚠️"}),e.jsx("p",{className:"leading-relaxed",children:s==="zh"?'请确认课程名称没有与系统已有的课程同名。确认无误后点击下方"开始导入"写入 SQLite。':"Please ensure column details are accurate. Clicking Import will instantly commit all parsed courses into the server SQLite backend."})]})]}),r==="importing"&&e.jsxs("div",{className:"py-8 flex flex-col items-center justify-center space-y-4",children:[e.jsxs("div",{className:"relative w-20 h-20 flex items-center justify-center",children:[e.jsx(w,{size:36,className:"text-indigo-600 animate-spin"}),e.jsxs("span",{className:"absolute text-[11px] font-extrabold text-indigo-700",children:[Math.round(l/n*100),"%"]})]}),e.jsxs("div",{className:"text-center",children:[e.jsx("h3",{className:"font-bold text-gray-800 text-sm",children:s==="zh"?"正在写入数据库":"Populating Database Records"}),e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:s==="zh"?`正在导入第 ${l} / ${n} 项...`:`Importing item ${l} of ${n}...`})]}),e.jsx("div",{className:"w-full max-w-sm bg-gray-100 h-2 rounded-full overflow-hidden border border-gray-200",children:e.jsx("div",{className:"bg-indigo-600 h-full transition-all duration-300 rounded-full",style:{width:`${l/n*100}%`}})}),e.jsxs("div",{className:"w-full max-w-md bg-gray-50 rounded-xl p-3 border border-gray-150 font-mono text-[10px] text-gray-400 max-h-[140px] overflow-y-auto",children:[e.jsx("div",{children:"[API] POST /api/lessons -> Request batch transaction..."}),a.slice(0,l).map((t,o)=>e.jsx("div",{className:"text-indigo-600 font-bold mt-1",children:`✓ [${o+1}] "${t.title}" -> status 200 (Success)`},o))]})]}),r==="success"&&e.jsxs("div",{className:"py-8 text-center flex flex-col items-center justify-center space-y-4",children:[e.jsx("div",{className:"w-16 h-16 bg-emerald-50 rounded-full flex items-center justify-center border border-emerald-200 text-emerald-600 animate-bounce",children:e.jsx(C,{size:32})}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-bold text-gray-800 text-base",children:s==="zh"?"🎉 批量导入大功告成":"🎉 Bulk-Import Complete"}),e.jsx("p",{className:"text-xs text-gray-500 mt-1 max-w-md mx-auto",children:s==="zh"?`所有 ${a.length} 门学科教案数据已顺畅写入系统底层 SQLite 数据仓库,现在已可以用于备课。`:`All ${a.length} curriculum lessons records have been successfully saved into security logs and SQLite storage.`})]})]}),r==="error"&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"p-4 bg-rose-50 border border-rose-100 rounded-xl flex gap-3 items-start",children:[e.jsx("span",{className:"text-rose-600 font-bold text-lg leading-none",children:"⚠️"}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-xs font-bold text-rose-850",children:s==="zh"?"数据导入或解析中断":"Import or Parsing Error"}),e.jsx("p",{className:"text-xs text-rose-900 mt-1 leading-relaxed",children:f||(s==="zh"?"未知异常或文件破损。":"An unknown exception or corrupted CSV formatting occurred.")})]})]}),e.jsxs("div",{className:"flex gap-3 justify-end",children:[e.jsx("button",{onClick:()=>{c("idle"),y("")},className:"px-4 py-2 text-xs font-bold text-gray-700 bg-white border border-gray-250 cursor-pointer hover:bg-gray-50 rounded-lg transition-all",children:s==="zh"?"返回重试":"Go Back & Retry"}),e.jsx("button",{onClick:()=>i(!1),className:"px-4 py-2 text-xs font-bold text-white bg-indigo-600 cursor-pointer hover:bg-indigo-700 rounded-lg transition-all",children:s==="zh"?"关闭窗口":"Close"})]})]})]}),r!=="idle"&&r!=="error"&&e.jsxs("div",{className:"p-4 md:p-5 border-t border-gray-100 flex items-center justify-between bg-slate-50 shrink-0",children:[e.jsx("button",{onClick:()=>{m([]),c("idle")},disabled:r==="importing",className:"px-4 py-2 text-xs font-bold text-gray-650 bg-white border border-gray-200 hover:bg-gray-100 rounded-lg transition-all disabled:opacity-40 cursor-pointer",children:s==="zh"?"重置重选":"Reset & Clear"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{onClick:()=>i(!1),disabled:r==="importing",className:"px-4 py-2 text-xs font-bold text-gray-600 hover:text-gray-800 transition-all disabled:opacity-40 cursor-pointer",children:s==="zh"?"取消":"Cancel"}),r==="parsing"&&e.jsxs("button",{onClick:j,className:"px-4 py-2 text-xs font-bold text-white bg-indigo-600 hover:bg-indigo-700 rounded-lg shadow-sm transition-all flex items-center gap-1 cursor-pointer",children:[e.jsx(z,{size:12}),s==="zh"?`开始导入 (${a.length} 类)`:`Proceed and Import (${a.length})`]}),r==="success"&&e.jsx("button",{onClick:()=>i(!1),className:"px-4 py-2 text-xs font-bold text-white bg-indigo-600 hover:bg-indigo-700 rounded-lg shadow-sm transition-all cursor-pointer",children:s==="zh"?"完成":"Done"})]})]})]})})})}export{T as ImportLessonsModal};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e}from"./vendor-react-0Lg0vA-4.js";import{a4 as d,a5 as g,a6 as x,y as p,l as f}from"./vendor-icons-_c3xpwjZ.js";function u({show:c,onClose:r,lang:s,handleImportFile:a,importError:i,importSuccess:n,isImporting:m,downloadCSVTemplate:l}){return c?e.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4 font-sans text-gray-800",children:e.jsxs("div",{className:"bg-white rounded-xl shadow-xl w-full max-w-lg flex flex-col p-6 relative",children:[e.jsx("button",{type:"button",onClick:r,className:"absolute top-4 right-4 text-gray-400 hover:text-gray-600 text-xl font-medium cursor-pointer",children:"×"}),e.jsxs("h3",{className:"text-base font-semibold text-gray-900 mb-1 flex items-center gap-2",children:[e.jsx(d,{size:18,className:"text-indigo-600"}),s==="zh"?"手动批量导入数据":"Manual Bulk Import"]}),e.jsx("p",{className:"text-xs text-gray-500 mb-4 font-sans text-left",children:s==="zh"?"支持导入 CSV 或 JSON 文件。CSV 文件需包含标题行,建议格式如下(支持中英文标题):":"Supports CSV or JSON files. CSV requires a header line with names like:"}),e.jsxs("div",{className:"bg-gray-50 p-3 rounded-lg border border-gray-100 text-[10px] font-mono text-gray-600 mb-4 whitespace-nowrap overflow-x-auto select-all text-left",children:["班级名称, 班级描述, 学生姓名, 学生邮箱",e.jsx("br",{}),"高一A班, 基础英语课程, 李明, liming@example.com",e.jsx("br",{}),"高一A班, 基础英语课程, 王华, wanghua@example.com"]}),e.jsxs("div",{className:"mb-4 flex flex-col gap-2 p-3 bg-indigo-50/50 border border-indigo-100 rounded-lg text-left select-none",children:[e.jsxs("span",{className:"text-xs font-semibold text-indigo-900 flex items-center gap-1",children:[e.jsx(g,{size:13,className:"text-indigo-600"}),s==="zh"?"下载导入数据模板文件:":"Download Import Templates:"]}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 mt-1",children:[e.jsxs("button",{type:"button",onClick:()=>l("class"),className:"flex-1 flex items-center justify-center gap-1.5 text-xs px-2.5 py-2 bg-white border border-indigo-200 text-indigo-700 rounded-lg hover:bg-indigo-50 transition-colors shadow-sm font-medium cursor-pointer",children:[e.jsx(x,{size:12,className:"text-emerald-600"}),s==="zh"?"下载班级与学生模板":"Class & Students Template"]}),e.jsxs("button",{type:"button",onClick:()=>l("student"),className:"flex-1 flex items-center justify-center gap-1.5 text-xs px-2.5 py-2 bg-white border border-indigo-200 text-indigo-700 rounded-lg hover:bg-indigo-50 transition-colors shadow-sm font-medium cursor-pointer",children:[e.jsx(x,{size:12,className:"text-emerald-600"}),s==="zh"?"下载独立学生模板":"Independent Students Template"]})]})]}),e.jsxs("div",{onDragOver:t=>t.preventDefault(),onDrop:t=>{t.preventDefault(),!(!t.dataTransfer.files||t.dataTransfer.files.length===0)&&a(t.dataTransfer.files[0])},className:"border-2 border-dashed border-gray-300 rounded-xl p-8 text-center cursor-pointer hover:border-indigo-500 hover:bg-indigo-50/20 transition-all mb-4",onClick:()=>{const t=document.createElement("input");t.type="file",t.accept=".csv,.json",t.onchange=o=>{o.target.files?.[0]&&a(o.target.files[0])},t.click()},children:[e.jsx(d,{className:"mx-auto text-gray-400 mb-2",size:24}),e.jsx("p",{className:"text-xs font-semibold text-gray-700",children:s==="zh"?"点击选择文件 或 拖拽文件到这里":"Click to select file or drag it here"}),e.jsx("p",{className:"text-[10px] text-gray-400 mt-1",children:"CSV or JSON (max 5MB)"})]}),i&&e.jsxs("div",{className:"p-3 bg-red-50 border border-red-100 text-red-700 text-xs rounded-lg mb-4 flex items-start gap-2 max-h-32 overflow-y-auto",children:[e.jsx("span",{className:"font-bold shrink-0",children:"✕"}),e.jsx("span",{className:"font-sans text-left leading-tight break-all",children:i})]}),n&&e.jsxs("div",{className:"p-3 bg-green-50 border border-green-105 text-green-700 text-xs rounded-lg mb-4 flex items-start gap-2",children:[e.jsx(p,{size:14,className:"shrink-0 mt-0.5"}),e.jsx("span",{className:"font-sans text-left leading-tight",children:n})]}),m&&e.jsxs("div",{className:"flex items-center justify-center gap-2 text-indigo-600 text-xs py-2",children:[e.jsx(f,{size:16,className:"animate-spin"}),e.jsx("span",{children:s==="zh"?"正在分析数据并导入系统数据库...":"Validating data and transferring records..."})]}),e.jsx("div",{className:"flex justify-end gap-2 mt-2",children:e.jsx("button",{type:"button",onClick:r,className:"px-4 py-2 text-xs font-medium border border-gray-200 text-gray-700 rounded-lg hover:bg-gray-50 transition-colors cursor-pointer",children:s==="zh"?"关闭":"Close"})})]})}):null}export{u as ImportModal};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,j as e}from"./vendor-react-0Lg0vA-4.js";import{h as i,x as u,a8 as d,X as m}from"./vendor-icons-_c3xpwjZ.js";function g({coursewareId:l,onClose:n}){const[c,a]=t.useState(!1),r=t.useRef(null);t.useEffect(()=>{const s=()=>{a(!!document.fullscreenElement&&document.fullscreenElement===r.current)};return document.addEventListener("fullscreenchange",s),()=>{document.removeEventListener("fullscreenchange",s)}},[]);const o=()=>{const s=r.current;s&&(document.fullscreenElement?document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen&&document.webkitExitFullscreen():s.requestFullscreen?s.requestFullscreen():s.webkitRequestFullscreen&&s.webkitRequestFullscreen())};return l?e.jsxs("div",{ref:r,className:"flex flex-col h-full bg-white rounded-xl shadow-sm border border-gray-200 overflow-hidden relative",children:[e.jsxs("div",{className:"flex items-center justify-between px-4 py-2 bg-gray-100 border-b border-gray-200 shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-2 select-none",children:[e.jsx(i,{size:16,className:"text-indigo-500"}),e.jsx("span",{className:"font-semibold text-sm text-gray-700",children:"Interactive Courseware"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{onClick:o,className:"p-1 hover:bg-gray-200 rounded-lg text-gray-500 transition-colors cursor-pointer",title:c?"退出全屏":"全屏播放",children:c?e.jsx(u,{size:16}):e.jsx(d,{size:16})}),n&&e.jsx("button",{onClick:n,className:"p-1 hover:bg-gray-200 rounded-lg text-gray-500 transition-colors cursor-pointer",children:e.jsx(m,{size:16})})]})]}),e.jsx("div",{className:"flex-1 relative bg-white",children:e.jsx("iframe",{src:`/api/courseware/${l}`,sandbox:"allow-scripts allow-forms allow-downloads",allowFullScreen:!0,className:"w-full h-full border-none",title:"Interactive Courseware"})})]}):e.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-gray-400 bg-gray-50 rounded-xl border border-dashed border-gray-300",children:[e.jsx(i,{size:48,className:"mb-4 text-gray-300 opacity-50"}),e.jsx("h3",{className:"text-lg font-medium text-gray-700",children:"No Courseware Selected"}),e.jsx("p",{className:"mt-2 text-sm text-center",children:"Please select a courseware from the list to view it interactively."})]})}export{g as InteractiveCoursewareViewer};
|