openlearn-next 0.3.22 → 0.4.0
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/README.md +1 -0
- package/dist/assets/AdminDirectoryView-DY--WM5Z.js +1 -0
- package/dist/assets/{BatchPickerModal-C9FH3J57.js → BatchPickerModal-BobcoTtn.js} +1 -1
- package/dist/assets/ClassesView-DtO0PJXQ.js +22 -0
- package/dist/assets/ClassroomCountdownWidget-AWnCu4JJ.js +2 -0
- package/dist/assets/CloudDriveModal-Dr4kDySU.js +1 -0
- package/dist/assets/ComputerLabView-1qWDNRQ2.js +1 -0
- package/dist/assets/CourseManagement-DtInD0J-.js +1 -0
- package/dist/assets/CourseWizardModal-B16QBckO.js +3 -0
- package/dist/assets/CoursewareHubPanel-CaEizhxl.js +1 -0
- package/dist/assets/Dashboard-D1gZ_4NI.js +8 -0
- package/dist/assets/{ExportWeightModal-C4d-0uTM.js → ExportWeightModal-UPsVax6L.js} +1 -1
- package/dist/assets/HelpTour-CMJbbGne.js +1 -0
- package/dist/assets/{HelpView-B9Pny6u9.js → HelpView-BryOHwLE.js} +4 -4
- package/dist/assets/{ImportLessonsModal-hKRuw9p4.js → ImportLessonsModal-Dnx_QR0Z.js} +1 -1
- package/dist/assets/{ImportModal-CVXHZ1Ei.js → ImportModal-D7L-KNhZ.js} +1 -1
- package/dist/assets/{InteractiveCoursewareViewer-DMMAs2k_.js → InteractiveCoursewareViewer-BYMKvIHi.js} +1 -1
- package/dist/assets/InteractiveWhiteboard-550JMFBu.js +77 -0
- package/dist/assets/LazyCourseware-CLHWQJ8g.js +2 -0
- package/dist/assets/LazyWhiteboard-DJWh6sdV.js +2 -0
- package/dist/assets/LessonEditorView-DRwi0sjA.js +1 -0
- package/dist/assets/LiveClassroomView-DgN2Zqe6.js +59 -0
- package/dist/assets/{NotificationDetailModal-1MOkBDr_.js → NotificationDetailModal-CMKHpWX1.js} +1 -1
- package/dist/assets/PluginView-BQVWPofY.js +66 -0
- package/dist/assets/{ProcessLogsModal-gZ9LILYM.js → ProcessLogsModal-DmFXg9mG.js} +1 -1
- package/dist/assets/QuizGeneratorModal-BeaBRn1w.js +1 -0
- package/dist/assets/StudentAssignmentView-Dn4Bgqr2.js +1 -0
- package/dist/assets/StudentLessonView-CMPqL1ia.js +1 -0
- package/dist/assets/StudentPreviewModal-0QSLnD9u.js +1 -0
- package/dist/assets/StudentView-9pjzjJgG.js +2 -0
- package/dist/assets/{SystemResourceLibraryModal-Ce-Dis6M.js → SystemResourceLibraryModal-COrhUd53.js} +1 -1
- package/dist/assets/TeacherView-mP2YucVr.js +2 -0
- package/dist/assets/{TimetableView-0VaTfpz3.js → TimetableView-BQG-rEb5.js} +4 -4
- package/dist/assets/index-C70OJPV_.js +217 -0
- package/dist/assets/index-CvGu7LSj.css +1 -0
- package/dist/assets/{index.es-CkgATcHw.js → index.es-C5eWEO4o.js} +1 -1
- package/dist/assets/{vendor-charts-U9fLlNC_.js → vendor-charts-qLbgF1eL.js} +1 -1
- package/dist/assets/{vendor-icons-30iiuCQb.js → vendor-icons-BRmhY6fg.js} +1 -1
- package/dist/assets/vendor-motion-BFAPOs-b.js +1 -0
- package/dist/assets/{vendor-pdf-Bw0ZQZtM.js → vendor-pdf-D7rGevI1.js} +3 -2
- package/dist/index.html +12 -13
- package/dist/server.cjs +4955 -623
- package/package.json +9 -4
- package/dist/assets/AdminDirectoryView-D-AOtp1o.js +0 -1
- package/dist/assets/ClassesView-DTuyCvYd.js +0 -19
- package/dist/assets/CloudDriveModal-Bi-aMuax.js +0 -1
- package/dist/assets/ComputerLabView-DWMtMSHV.js +0 -1
- package/dist/assets/CourseManagement-CeelAyst.js +0 -1
- package/dist/assets/CourseWizardModal-m7TDgcB2.js +0 -3
- package/dist/assets/CoursewareHubPanel-C4LQjt4v.js +0 -1
- package/dist/assets/Dashboard-CiBtG7Ge.js +0 -8
- package/dist/assets/HelpTour-00eT17Vg.js +0 -1
- package/dist/assets/InteractiveWhiteboard-jpweQ094.js +0 -77
- package/dist/assets/LazyCourseware-DVgyrg3r.js +0 -2
- package/dist/assets/LazyWhiteboard-BSzsAPXC.js +0 -2
- package/dist/assets/LessonEditorView-D4g48fr5.js +0 -1
- package/dist/assets/LiveClassroomView-HQGhVwd_.js +0 -1
- package/dist/assets/PluginView-D8cQ8mLM.js +0 -65
- package/dist/assets/QuizGeneratorModal-BFCJe1cm.js +0 -1
- package/dist/assets/StudentAssignmentView-C34nleZT.js +0 -1
- package/dist/assets/StudentLessonView-DNbu2o04.js +0 -1
- package/dist/assets/StudentPreviewModal-BXbKzQgo.js +0 -1
- package/dist/assets/StudentView-BF2WjF4_.js +0 -2
- package/dist/assets/TeacherView-BySyCiZG.js +0 -2
- package/dist/assets/index-C7jMgry5.js +0 -216
- package/dist/assets/index-huP36ZNf.css +0 -1
- package/dist/assets/vendor-motion-DjY2czvL.js +0 -1
- /package/dist/assets/{vendor-content-CYR4BTuT.js → purify.es-CYR4BTuT.js} +0 -0
package/README.md
CHANGED
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
- 在线感知(Presence Engine):实时捕获学生专注度(Focused/Unfocused)、离屏状态与班级专注率。
|
|
28
28
|
- 多人协同(Collaboration Engine):支持分组协作、共享对象锁(ObjectLock)与白板事件插槽(WhiteboardEventSlot)。
|
|
29
29
|
- **学生端极简低干扰异常遥测**:端侧左下角极简感叹号图标+红色角标,降低课堂认知负荷;异常秒级上报至教师端大屏并落盘审计日志。
|
|
30
|
+
- **班级上课临时密码与双轨登录**:课前就绪一键设定与动态时效管控,学生可凭班级临时口令或个人密码快速入课;预留第三方插件扩展插槽与标准获取接口。
|
|
30
31
|
- 🤖 **原生 AI 伴随教学引擎**
|
|
31
32
|
- 兼容 OpenAI 协议(DeepSeek、Qwen、Ollama、OpenAI 等任意兼容提供商),密钥多重加密存储。
|
|
32
33
|
- 赋能教师工作台:一键智能生成结构化教案、自动出题与随堂小测、学情诊断与个性化学习规划。
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as i,j as e}from"./vendor-react-B0t7H3hh.js";import{S as D,a2 as as,ab as g,U as T,bo as rs,t as R,bC as M,_ as is,D as oe,b$ as os,ao as ls,aI as ns,a4 as Ce,aS as ds,n as le,x as cs,e as _,s as xs,h as ms,bi as Le,w as Pe,v as hs,z as Ue,aF as ps,X as ne,bl as bs,T as gs,aD as us,aQ as fs}from"./vendor-icons-BRmhY6fg.js";import"./vendor-utils-m0Urvtws.js";function ys({currentUserId:m,currentUserRole:u,lang:s,onLogout:de,aiProviders:w,testingProviderId:ce,onAIProvidersChanged:f,onTriggerTour:z,siteInfo:h,onSiteInfoChanged:Ie}){const[xe,De]=i.useState([]),[Te,me]=i.useState(!1),[he,E]=i.useState(""),[pe,p]=i.useState(""),[Re,y]=i.useState(!1),[O,j]=i.useState(null),[$,F]=i.useState(""),[q,Q]=i.useState(""),[be,B]=i.useState(""),[V,K]=i.useState(""),[G,ge]=i.useState(!1),[ue,fe]=i.useState(h?.siteName||""),[ye,je]=i.useState(h?.slogan||""),[js,k]=i.useState(h?.logoUrl||null),[b,S]=i.useState(h?.logoUrl||""),[H,Ne]=i.useState(!1),[ve,Me]=i.useState(!1),[A,we]=i.useState(""),[J,_e]=i.useState("all"),[Ee,N]=i.useState(!1),[c,ze]=i.useState(null),[W,Y]=i.useState(""),[X,Z]=i.useState(""),[ee,se]=i.useState(""),[te,C]=i.useState("teacher"),[ae,L]=i.useState("active"),[ke,x]=i.useState(""),[re,Se]=i.useState(!1),[Ns,vs]=i.useState({tables:14,sizeKb:256,pingMs:2}),[Oe,$e]=i.useState(14),[Fe,qe]=i.useState(0),[n,P]=i.useState("directory"),[r,Qe]=i.useState(null),[v,Ae]=i.useState(!1),U=async()=>{try{Ae(!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{Ae(!1)}},Be=()=>{j(null),F(""),Q(""),B(""),K(""),y(!0)},Ve=t=>{j(t),F(t.name),Q(t.api_url),B(t.api_key||""),K(t.model_name),y(!0)},Ke=async t=>{if(t.preventDefault(),!$.trim()||!q.trim()||!V.trim()){alert(s==="zh"?"名称、API URL 和模型名称不可为空":"Name, API URL and Model Name are required.");return}try{ge(!0);const a=!!O,o=a?`/api/ai-providers/${O.id}`:"/api/ai-providers",d=await fetch(o,{method:a?"PUT":"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:$.trim(),api_url:q.trim(),api_key:be,model_name:V.trim()})});if(d.ok)y(!1),j(null),f();else{const ts=await d.json().catch(()=>({}));alert(ts.error||"Server error")}}catch(a){alert(a.message||"Error")}finally{ge(!1)}},Ge=async(t,a)=>{if(confirm(s==="zh"?`确认要删除 AI 提供商 [${a}] 吗?`:`Confirm deleting AI Provider [${a}]?`))try{(await fetch(`/api/ai-providers/${t}`,{method:"DELETE"})).ok?f():alert("Delete failed")}catch(o){alert(o.message||"Error")}},He=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 o=await a.json().catch(()=>({}));alert(s==="zh"?`测试失败: ${o.error||"未知错误"}`:`Test failed: ${o.error||"Unknown error"}`)}}catch(a){alert(s==="zh"?`网络异常: ${a.message}`:`Network error: ${a.message}`)}},Je=async()=>{try{const t=await fetch("/api/site-settings");if(t.ok){const a=await t.json();fe(a.siteName||""),je(a.slogan||""),k(a.logoUrl||null),S(a.logoUrl||""),Me(!0)}}catch(t){console.error("Failed to fetch site settings",t)}},We=t=>{if(!t)return;const a=new FileReader;a.onload=()=>{const o=a.result;k(o),S(o)},a.readAsDataURL(t)},Ye=async t=>{t.preventDefault();try{Ne(!0);const a=b&&b.trim()?b.trim():null,o=await fetch("/api/site-settings",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({siteName:ue.trim(),slogan:ye.trim(),logoUrl:a})});if(o.ok){const l=await o.json();k(a),Ie?.(l.siteInfo),p(s==="zh"?"站点信息已保存!":"Site settings saved successfully!"),setTimeout(()=>p(""),4e3)}else{const l=await o.json().catch(()=>({}));alert(l.error||"Server error")}}catch(a){alert(a.message||"Error")}finally{Ne(!1)}},ie=async()=>{try{me(!0),E("");const t=await fetch("/api/users");if(t.ok){const a=await t.json();De(a)}else E(s==="zh"?"加载用户账户失败":"Failed to fetch staff directory")}catch{E(s==="zh"?"网络连接异常":"Network communication issue")}finally{me(!1)}};i.useEffect(()=>{ie(),U(),f();const t=setInterval(()=>{U(),$e(a=>{const o=Math.floor(Math.random()*9)-4,l=a+o;return Math.min(Math.max(l,5),35)})},5e3);return()=>clearInterval(t)},[Fe]),i.useEffect(()=>{n==="site_settings"&&!ve&&Je()},[n,ve]);const Xe=()=>{ze(null),Y(""),Z(""),se(""),C("teacher"),L("active"),x(""),N(!0)},Ze=t=>{ze(t.id),Y(t.username),Z(""),se(t.name),C(t.role),L(t.status||"active"),x(""),N(!0)},es=async t=>{if(t.preventDefault(),!W.trim()||!ee.trim()){x(s==="zh"?"请填写所有必填字段。":"Please provide all key info.");return}if(!c&&!X){x(s==="zh"?"新建账户时密码必填。":"Password is required for new accounts.");return}try{x(""),Se(!0);const a=c?`/api/users/${c}`:"/api/users",l=await fetch(a,{method:c?"PUT":"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:W.trim(),password:X||void 0,role:te,name:ee.trim(),status:ae})});if(l.ok)p(s==="zh"?"账户信息保存成功!":"Staff account saved successfully!"),ie(),N(!1),setTimeout(()=>p(""),4e3);else{const d=await l.json();x(d.error||"Server validation failed")}}catch(a){x(a.message||"API error")}finally{Se(!1)}},ss=async(t,a)=>{if(t===m){alert(s==="zh"?"你不能删除你自己当前登录的账户。":"You cannot delete your own logged-in account.");return}const o=s==="zh"?`确定要删除教师账户 "${a}" 吗?此操作不可逆。`:`Confirm deleting staff user "${a}"? This action is irreversible.`;if(confirm(o))try{const l=await fetch(`/api/users/${t}`,{method:"DELETE"});if(l.ok)p(s==="zh"?"账户删除成功":"Account deleted successfully"),ie(),setTimeout(()=>p(""),3e3);else{const d=await l.json();alert(d.error||"Failed to delete")}}catch(l){console.error(l)}},I=xe.filter(t=>{const a=t.name.toLowerCase().includes(A.toLowerCase())||t.username.toLowerCase().includes(A.toLowerCase()),o=J==="all"||t.role===J;return a&&o});return e.jsxs("div",{className:"flex-1 bg-white border border-gray-200 rounded-xl shadow-sm flex flex-col min-h-0 overflow-hidden h-full",id:"admin_panel_root",children:[e.jsxs("div",{className:"px-6 py-4 border-b border-gray-100 flex flex-col sm:flex-row sm:items-center justify-between gap-3 bg-white shrink-0",children:[e.jsxs("div",{children:[e.jsxs("h2",{className:"text-base sm:text-lg font-bold text-gray-800 flex items-center gap-2",children:[e.jsx(D,{className:"text-indigo-600 shrink-0",size:20}),e.jsx("span",{children:s==="zh"?"系统管理与教职后台":"Staff Directory & System Admin"}),e.jsx("span",{className:"text-xs font-semibold px-2 py-0.5 rounded-full bg-indigo-50 text-indigo-700 border border-indigo-100/80",children:u==="administrator"?s==="zh"?"超级管理员":"Admin":s==="zh"?"教师":"Teacher"})]}),e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:s==="zh"?`管理学校教师、教工账户、划分角色权限。当前登录角色权限: ${u==="administrator"?"超级管理员 (系统设置已解锁)":"普通教师 (系统设置锁定)"}`:`Create and assign teacher credentials. Active role context: ${u==="administrator"?"Administrator (System parameters editable)":"Standard Teacher (Settings view-only)"}`})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[z&&e.jsxs("button",{onClick:z,className:"flex items-center gap-1.5 px-3 py-1.5 bg-indigo-50 hover:bg-indigo-100 text-indigo-700 text-xs font-semibold rounded-lg border border-indigo-200 transition-all cursor-pointer shadow-3xs",children:[e.jsx(as,{size:14,className:"animate-bounce"}),e.jsx("span",{children:s==="zh"?"开启新手引导":"Start Help Tour"})]}),e.jsx("button",{onClick:()=>qe(t=>t+1),className:"p-1.5 text-gray-500 hover:text-indigo-600 hover:bg-gray-100 rounded-lg transition-all cursor-pointer border border-gray-200 shadow-3xs",title:s==="zh"?"刷新数据":"Refresh stats",children:e.jsx(g,{size:14})})]})]}),e.jsxs("div",{className:"px-6 py-2.5 border-b border-gray-100 bg-gray-50/50 flex items-center justify-between gap-4 shrink-0 overflow-x-auto",children:[e.jsxs("div",{className:"bg-gray-200/60 p-1 rounded-xl flex items-center gap-1 shrink-0",children:[e.jsxs("button",{onClick:()=>P("directory"),className:`px-3.5 py-1.5 text-xs font-bold rounded-lg flex items-center gap-1.5 transition-all cursor-pointer ${n==="directory"?"bg-white text-indigo-700 shadow-xs":"text-gray-500 hover:text-gray-800"}`,children:[e.jsx(T,{size:14}),e.jsx("span",{children:s==="zh"?"学校教职及系统配置":"Staff Accounts & Config"})]}),e.jsxs("button",{onClick:()=>P("ai_providers"),className:`px-3.5 py-1.5 text-xs font-bold rounded-lg flex items-center gap-1.5 transition-all cursor-pointer ${n==="ai_providers"?"bg-white text-indigo-700 shadow-xs":"text-gray-500 hover:text-gray-800"}`,children:[e.jsx(rs,{size:14}),e.jsx("span",{children:s==="zh"?"AI 模型提供商":"AI Providers"})]}),e.jsxs("button",{onClick:()=>P("sqlite"),className:`px-3.5 py-1.5 text-xs font-bold rounded-lg flex items-center gap-1.5 transition-all cursor-pointer ${n==="sqlite"?"bg-white text-indigo-700 shadow-xs":"text-gray-500 hover:text-gray-800"}`,children:[e.jsx(R,{size:14}),e.jsx("span",{children:s==="zh"?"系统监控":"System Monitor"})]}),e.jsxs("button",{onClick:()=>P("site_settings"),className:`px-3.5 py-1.5 text-xs font-bold rounded-lg flex items-center gap-1.5 transition-all cursor-pointer ${n==="site_settings"?"bg-white text-indigo-700 shadow-xs":"text-gray-500 hover:text-gray-800"}`,children:[e.jsx(M,{size:14}),e.jsx("span",{children:s==="zh"?"站点信息设置":"Site Settings"})]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[e.jsxs("a",{id:"btn-download-audit-report",href:"/api/audit-report/download",download:"OpenLearn-V2-代码质量与架构审计报告.md",className:"px-3 py-1.5 text-xs font-semibold rounded-lg flex items-center gap-1.5 bg-indigo-50 hover:bg-indigo-100 text-indigo-700 border border-indigo-200 transition-all shrink-0 cursor-pointer shadow-xs",title:s==="zh"?"下载全栈代码质量与架构审计报告":"Download Code Quality & Architecture Audit Report",children:[e.jsx(is,{size:14,className:"text-indigo-600"}),e.jsx("span",{children:s==="zh"?"下载审计报告":"Download Audit Report"}),e.jsx(oe,{size:13,className:"text-indigo-500 ml-0.5"})]}),e.jsxs("a",{id:"btn-download-remediation-roadmap",href:"/api/remediation-roadmap/download",download:"OpenLearn-V2-修补与优化路线图.md",className:"px-3 py-1.5 text-xs font-semibold rounded-lg flex items-center gap-1.5 bg-emerald-50 hover:bg-emerald-100 text-emerald-700 border border-emerald-200 transition-all shrink-0 cursor-pointer shadow-xs",title:s==="zh"?"下载分阶段修补与优化路线图":"Download Phased Remediation & Optimization Roadmap",children:[e.jsx(os,{size:14,className:"text-emerald-600"}),e.jsx("span",{children:s==="zh"?"下载修补路线图":"Download Roadmap"}),e.jsx(oe,{size:13,className:"text-emerald-500 ml-0.5"})]}),e.jsxs("a",{id:"btn-download-optimization-plan",href:"/api/classroom-optimization-plan/download",download:"OpenLearn-V2-互动课堂与编辑器优化方案.md",className:"px-3 py-1.5 text-xs font-semibold rounded-lg flex items-center gap-1.5 bg-amber-50 hover:bg-amber-100 text-amber-700 border border-amber-200 transition-all shrink-0 cursor-pointer shadow-xs",title:s==="zh"?"下载互动课堂及课程编辑器深度优化方案":"Download Interactive Classroom & Lesson Editor Optimization Plan",children:[e.jsx(ls,{size:14,className:"text-amber-600"}),e.jsx("span",{children:s==="zh"?"下载课堂优化方案":"Download Plan"}),e.jsx(oe,{size:13,className:"text-amber-500 ml-0.5"})]})]})]}),pe&&e.jsxs("div",{className:"mx-6 mt-3 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(ns,{size:15}),e.jsx("span",{children:pe})]}),he&&e.jsxs("div",{className:"mx-6 mt-3 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(Ce,{size:15}),e.jsx("span",{children:he})]}),n==="ai_providers"?e.jsx("div",{className:"flex-1 overflow-y-auto p-6 space-y-6 animate-fade-in text-gray-800",children:e.jsxs("div",{className:"bg-white border border-gray-200 rounded-xl shadow-3xs overflow-hidden",children:[e.jsxs("div",{className:"p-4 sm:p-5 border-b border-gray-100 flex items-center justify-between bg-gray-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(ds,{className:"text-indigo-600",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-3.5 py-1.5 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(cs,{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-xs 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(_,{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:()=>He(t),className:"px-2.5 py-1 text-xs font-semibold rounded-lg border transition-all cursor-pointer flex items-center gap-1.5 shadow-3xs bg-emerald-50 border-emerald-200 text-emerald-700 hover:bg-emerald-100",title:s==="zh"?"测试连通性":"Test Connection",children:[e.jsx(xs,{size:11}),e.jsx("span",{children:s==="zh"?"测试":"Test"})]}),e.jsx("button",{onClick:()=>Ve(t),className:"px-2.5 py-1 text-indigo-700 hover:bg-indigo-100 border border-indigo-200 rounded-lg bg-indigo-50 cursor-pointer font-semibold transition-all shadow-3xs",title:s==="zh"?"编辑配置":"Edit",children:s==="zh"?"编辑":"Edit"}),e.jsx("button",{onClick:()=>Ge(t.id,t.name),className:"px-2.5 py-1 text-rose-600 hover:bg-rose-100 border border-rose-200 rounded-lg bg-rose-50 cursor-pointer font-semibold transition-all shadow-3xs",title:s==="zh"?"删除":"Delete",children:s==="zh"?"删除":"Delete"})]})})]},t.id))})]})})})]})}):n==="sqlite"?e.jsxs("div",{className:"flex-1 overflow-y-auto p-6 space-y-6 animate-fade-in text-gray-800",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-xl p-4 shadow-3xs flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-1 text-left",children:[e.jsx("span",{className:"text-xs 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-xs 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(D,{size:20})})]}),e.jsxs("div",{className:"bg-white border border-gray-200 rounded-xl p-4 shadow-3xs flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-1 text-left",children:[e.jsx("span",{className:"text-xs 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-xs 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(R,{size:20})})]}),e.jsxs("div",{className:"bg-white border border-gray-200 rounded-xl p-4 shadow-3xs flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-1 text-left",children:[e.jsx("span",{className:"text-xs 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-xs 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(ms,{size:20})})]}),e.jsxs("div",{className:"bg-white border border-gray-200 rounded-xl p-4 shadow-3xs flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-1 text-left",children:[e.jsx("span",{className:"text-xs 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-xs 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(Le,{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-xl shadow-3xs overflow-hidden flex flex-col",children:[e.jsxs("div",{className:"p-4 sm:p-5 border-b border-gray-100 bg-gray-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(R,{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:U,disabled:v,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:v?"animate-spin":""}),s==="zh"?"重算/刷新 font":"Refresh Metrics"]})]}),e.jsx("div",{className:"p-4 sm:p-5",children:v&&!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(d=>d.rows),1),o=Math.min(t.rows/a*100,100);let l="Core Application Storage";return t.name==="users"?l="Teacher & Administrator profiles":t.name==="students"?l="Student accounts and lock states":t.name==="classes"?l="Active classes, metadata & codes":t.name==="lessons"?l="Lectures, slides and markdown modules":t.name==="ai_providers"?l="Third party API key provider gateways":t.name==="vfs_nodes"?l="Virtual file storage hierarchies":t.name==="client_sessions"&&(l="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-xs text-gray-400 block mt-0.5",children:l})]}),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:`${o}%`}})}),e.jsxs("span",{className:"text-xs font-mono font-bold text-slate-400",children:[Math.round(o),"%"]})]})}),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-xs 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(M,{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-xs 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-xs 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-xs 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-xs 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-xs 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-xs 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-xs 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(Pe,{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(D,{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-xs 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(Le,{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-xs 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(R,{size:15,className:"text-indigo-600"}),s==="zh"?"SQLite 数据库健康体检":"Database Engine Health"]}),e.jsx("span",{className:"text-xs 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-xs 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-xs 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-xs text-gray-405 font-bold uppercase",children:s==="zh"?"个":"tbls"})]}),e.jsx("span",{className:"text-xs 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-xs 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-xs text-gray-455 font-bold uppercase",children:"MB"})]}),e.jsx("span",{className:"text-xs 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-xs 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-xs text-gray-450 font-bold uppercase",children:"ms"})]}),e.jsx("span",{className:"text-xs 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-xs text-gray-400 font-medium pl-1",children:s==="zh"?"自动检测轮询间隔: 5s":"Dynamic background poll: 5s"}),e.jsxs("button",{type:"button",onClick:U,disabled:v,className:"p-1 px-3 text-xs 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:v?"animate-spin":""}),s==="zh"?"实时评测":"Benchmark Latency"]})]})]}),e.jsxs("div",{className:"bg-white border border-gray-200 rounded-xl shadow-3xs 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(Pe,{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-xs 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:[Oe,"%"]})]}),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-xs 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-xs 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-xs 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(hs,{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: ",xe.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 p-6 animate-fade-in text-gray-800",children:e.jsxs("div",{className:"bg-white border border-gray-200 rounded-xl shadow-3xs overflow-hidden max-w-3xl",children:[e.jsx("div",{className:"p-4 sm:p-5 border-b border-gray-100 flex items-center justify-between bg-gray-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(M,{size:18,className:"text-indigo-600"}),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:Ye,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:ue,onChange:t=>fe(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:ye,onChange:t=>je(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(M,{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=>We(t.target.files?.[0])})]}),e.jsx("button",{type:"button",onClick:()=>{S(""),k(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-xs text-gray-400 block",children:s==="zh"?"也可直接粘贴图片 URL:":"Or paste an image URL:"}),e.jsx("input",{type:"text",value:b,onChange:t=>S(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:H,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:[H?e.jsx(Ue,{size:13,className:"animate-spin"}):e.jsx(_,{size:14}),e.jsx("span",{children:H?s==="zh"?"保存中...":"Saving...":s==="zh"?"保存站点信息":"Save Site Settings"})]})})]})]})}):e.jsxs("div",{className:"flex-1 min-h-0 flex flex-col overflow-hidden",children:[e.jsxs("div",{className:"px-6 py-3 border-b border-gray-100 bg-white 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 flex-1",children:[e.jsxs("div",{className:"relative w-full sm:w-72",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(ps,{size:14})}),e.jsx("input",{type:"text",placeholder:s==="zh"?"检索姓名、教工用户名...":"Search teachers by name or username...",value:A,onChange:t=>we(t.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-3xs"}),A&&e.jsx("button",{onClick:()=>we(""),className:"absolute inset-y-0 right-0 flex items-center pr-2.5 text-gray-400 hover:text-gray-600",children:e.jsx(ne,{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-xs font-bold text-gray-400 uppercase tracking-wider",children:s==="zh"?"角色筛选:":"Role:"}),e.jsxs("select",{value:J,onChange:t=>_e(t.target.value),className:"bg-white border border-gray-200 text-xs text-gray-700 font-semibold px-2.5 py-1.5 rounded-lg focus:outline-none focus:ring-2 focus:ring-indigo-500 shadow-3xs 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("span",{className:"text-xs text-gray-400",children:s==="zh"?`共 ${I.length} 位教工`:`${I.length} total staff`})]}),e.jsxs("button",{onClick:Xe,className:"bg-indigo-600 hover:bg-indigo-700 text-white px-3.5 py-1.5 rounded-lg text-xs font-semibold flex items-center gap-1.5 shadow-sm hover:shadow transition-all cursor-pointer shrink-0 self-end sm:self-auto",children:[e.jsx(le,{size:14}),e.jsx("span",{children:s==="zh"?"添加教职账户":"Add Teacher Account"})]})]}),e.jsx("div",{className:"flex-1 overflow-y-auto px-6 py-4 space-y-2.5 bg-gray-50/40",children:Te?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..."]}):I.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(T,{size:36,className:"opacity-20 mb-2"}),e.jsx("p",{className:"text-xs font-semibold",children:s==="zh"?"未检索到任何符合条件的教师账户":"No staff matched your filters."})]}):I.map(t=>{const a=t.id===m,o=t.role==="administrator",l=t.status==="disabled";return e.jsxs("div",{className:`p-3.5 bg-white border border-gray-200/90 hover:border-indigo-200 rounded-xl shadow-3xs flex items-center justify-between group transition-all ${l?"opacity-75 bg-slate-50/50":""}`,children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:`p-2 rounded-lg flex items-center justify-center ${l?"bg-slate-100 text-slate-400":o?"bg-indigo-50 text-indigo-600":"bg-slate-100 text-slate-500"}`,children:o?e.jsx(D,{size:18}):e.jsx(T,{size:18})}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:`text-xs font-bold ${l?"text-gray-500 line-through":"text-gray-800"}`,children:t.name}),a&&e.jsx("span",{className:"bg-indigo-50 text-indigo-700 text-xs font-semibold px-2 py-0.5 rounded-full border border-indigo-100",children:s==="zh"?"你自己":"You"}),e.jsx("span",{className:`text-xs font-semibold px-2 py-0.5 rounded-full ${o?"bg-indigo-900 text-indigo-200":"bg-gray-100 text-gray-600"}`,children:t.role}),l&&e.jsx("span",{className:"bg-rose-50 text-rose-700 text-xs font-semibold px-2 py-0.5 rounded-full border border-rose-100",children:s==="zh"?"已禁用":"Disabled"})]}),e.jsxs("div",{className:"text-xs text-gray-400 font-mono mt-0.5 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.5",children:[e.jsxs("button",{onClick:()=>Ze(t),className:"px-2.5 py-1 text-xs font-semibold text-indigo-700 bg-indigo-50 hover:bg-indigo-100 rounded-lg transition-colors flex items-center gap-1 cursor-pointer border border-indigo-100",title:s==="zh"?"修改设置":"Update settings",children:[e.jsx(bs,{size:12}),e.jsx("span",{children:s==="zh"?"设置":"Edit"})]}),e.jsx("button",{onClick:()=>ss(t.id,t.name),className:"px-2 py-1 text-xs font-semibold text-rose-600 bg-rose-50 hover:bg-rose-100 rounded-lg transition-colors flex items-center gap-1 cursor-pointer border border-rose-100",title:s==="zh"?"注销删除":"Delete user",children:e.jsx(gs,{size:12})})]})]},t.id)})})]}),Ee&&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(T,{size:16,className:"text-indigo-600"}),c?s==="zh"?"正在编辑教职账户设置":"Edit Teacher Account Settings":s==="zh"?"新建教师与教工账户":"New Teacher Credentials"]}),e.jsx("button",{onClick:()=>N(!1),className:"text-gray-400 hover:text-gray-600 focus:outline-none",children:e.jsx(ne,{size:18})})]}),e.jsxs("form",{onSubmit:es,children:[e.jsxs("div",{className:"p-5 space-y-4",children:[ke&&e.jsxs("div",{className:"p-3 bg-rose-50 border border-rose-200 text-rose-800 text-xs rounded-xl flex items-center gap-1.5 animate-pulse",children:[e.jsx(Ce,{size:15,className:"shrink-0"}),e.jsx("span",{children:ke})]}),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"?"教工姓名 (展示给学生及白板上) *":"Staff Real Name (Shown on roster/boards) *"}),e.jsx("input",{type:"text",value:ee,onChange:t=>se(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-xs font-bold text-gray-550 uppercase tracking-wide",children:s==="zh"?"登录用户名 (唯一标识) *":"Access Username (Unique Identifier) *"}),e.jsx("input",{type:"text",value:W,onChange:t=>Y(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-xs font-bold text-gray-555 uppercase tracking-wide",children:s==="zh"?"密码 *":"Password *"}),e.jsx("input",{type:"password",value:X,onChange:t=>Z(t.target.value),placeholder:c?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:!c})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"block text-xs 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:te==="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:te==="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-xs 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:ae==="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:ae==="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:()=>N(!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:re,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:[re?e.jsx(g,{size:13,className:"animate-spin"}):e.jsx(_,{size:14}),e.jsx("span",{children:re?s==="zh"?"保存中...":"Saving...":s==="zh"?"保存记录":"Save Properties"})]})]})]})]})}),Re&&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(us,{className:"text-indigo-600",size:18}),O?s==="zh"?"编辑 AI 提供商配置":"Edit AI Provider":s==="zh"?"添加全新 AI 提供商":"Add New AI Provider"]}),e.jsx("button",{onClick:()=>{y(!1),j(null)},className:"p-1 text-gray-400 hover:text-gray-600 rounded-full hover:bg-gray-100 transition-colors",children:e.jsx(ne,{size:16})})]}),e.jsxs("form",{onSubmit:Ke,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:$,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-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:q,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.jsx("span",{className:"text-xs 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:V,onChange:t=>K(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:be,onChange:t=>B(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:()=>{y(!1),j(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:G,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:[G?e.jsx(Ue,{size:13,className:"animate-spin"}):e.jsx(_,{size:14}),e.jsx("span",{children:G?s==="zh"?"保存中...":"Saving...":s==="zh"?"保存至数据库":"Save Connection"})]})]})]})]})})]})}function Ss({session:m,lang:u,onLogout:s,aiProviders:de,testingProviderId:w,onAIProvidersChanged:ce,onTriggerTour:f,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(fs,{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(ys,{currentUserId:m.userId||"",currentUserRole:m.subRole,lang:u,onLogout:s,aiProviders:de,testingProviderId:w,onAIProvidersChanged:ce,onTriggerTour:f,siteInfo:z,onSiteInfoChanged:h})}export{Ss as AdminDirectoryView};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e}from"./vendor-react-B0t7H3hh.js";import{m as p}from"./index-
|
|
1
|
+
import{j as e}from"./vendor-react-B0t7H3hh.js";import{m as p}from"./index-C70OJPV_.js";import"./vendor-utils-m0Urvtws.js";import"./vendor-icons-BRmhY6fg.js";import"./vendor-pdf-D7rGevI1.js";import"./vendor-motion-BFAPOs-b.js";import"./vendor-pptx-C5-U7ieS.js";import"./vendor-charts-qLbgF1eL.js";function w({batchPicker:o,setBatchPicker:t,batchPickerLesson:l,setBatchPickerLesson:a,batchPickerDate:i,setBatchPickerDate:n,batchPickerTargetClass:d,setBatchPickerTargetClass:c,lessons:x,classes:u,expandedClassId:m,confirmBatchPicker:h,lang:r}){return o?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(p.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},className:"bg-white border text-gray-900 border-gray-200 rounded-2xl shadow-2xl w-full max-w-md 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",children:[e.jsx("h2",{className:"font-bold text-gray-800 text-base",children:o==="schedule"?r==="zh"?"批量排课":"Batch Schedule":o==="lockedLesson"?r==="zh"?"批量设置锁定课程":"Batch Lock Lesson":r==="zh"?"批量转班":"Batch Transfer"}),e.jsx("button",{onClick:()=>t(null),className:"text-gray-400 hover:text-gray-600 text-lg font-bold p-1 hover:bg-gray-200 rounded",children:"×"})]}),e.jsxs("div",{className:"p-5 space-y-4",children:[(o==="schedule"||o==="lockedLesson")&&e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-xs font-semibold text-gray-600",children:r==="zh"?"选择课程":"Select Lesson"}),e.jsxs("select",{value:l,onChange:s=>a(s.target.value),className:"w-full border border-gray-200 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500",children:[e.jsx("option",{value:"",children:r==="zh"?"— 请选择 —":"— Select —"}),x.map(s=>e.jsx("option",{value:s.id,children:s.title},s.id))]})]}),o==="schedule"&&e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-xs font-semibold text-gray-600",children:r==="zh"?"上课日期":"Schedule Date"}),e.jsx("input",{type:"date",value:i,onChange:s=>n(s.target.value),className:"w-full border border-gray-200 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500"})]}),o==="transfer"&&e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-xs font-semibold text-gray-600",children:r==="zh"?"选择目标班级":"Select Target Class"}),e.jsxs("select",{value:d,onChange:s=>c(s.target.value),className:"w-full border border-gray-200 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500",children:[e.jsx("option",{value:"",children:r==="zh"?"— 请选择 —":"— Select —"}),u.filter(s=>s.id!==m).map(s=>e.jsx("option",{value:s.id,children:s.name},s.id))]})]})]}),e.jsxs("div",{className:"p-4 border-t border-gray-100 flex justify-end gap-2",children:[e.jsx("button",{onClick:()=>t(null),className:"px-4 py-2 text-sm rounded-lg border border-gray-200 text-gray-600 hover:bg-gray-100 cursor-pointer",children:r==="zh"?"取消":"Cancel"}),e.jsx("button",{onClick:h,className:"px-4 py-2 text-sm rounded-lg bg-indigo-600 text-white hover:bg-indigo-700 cursor-pointer",children:r==="zh"?"确认":"Confirm"})]})]})}):null}export{w as BatchPickerModal};
|