openlearn-next 0.2.9 → 0.3.1
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/dist/assets/AdminDirectoryView-0XV86Ues.js +1 -0
- package/dist/assets/{BatchPickerModal-9BhmNM2R.js → BatchPickerModal-of9a5EJz.js} +1 -1
- package/dist/assets/{ClassesView-DKScQDos.js → ClassesView-CefnsjZ8.js} +2 -2
- package/dist/assets/CloudDriveModal-DgVQLbO5.js +1 -0
- package/dist/assets/ComputerLabView-BId0ZarM.js +1 -0
- package/dist/assets/CourseManagement-Cxhc784Q.js +1 -0
- package/dist/assets/CourseWizardModal-Da6PKhnU.js +3 -0
- package/dist/assets/CoursewareHubPanel-LpUgjqbH.js +1 -0
- package/dist/assets/{Dashboard-BPxkmnvI.js → Dashboard-LWbFbup4.js} +2 -2
- package/dist/assets/{ExportWeightModal-DSzySeqh.js → ExportWeightModal-Cyg1zMEd.js} +1 -1
- package/dist/assets/HelpTour-CHPIK2ae.js +1 -0
- package/dist/assets/{HelpView-CuNDka5n.js → HelpView-CvpgBpdr.js} +3 -3
- package/dist/assets/ImportLessonsModal-CfWIrW1K.js +1 -0
- package/dist/assets/ImportModal-BTfia0Ah.js +1 -0
- package/dist/assets/InteractiveCoursewareViewer-CS5BqfJZ.js +1 -0
- package/dist/assets/InteractiveWhiteboard-U23CsqGo.js +78 -0
- package/dist/assets/{LazyCourseware-g7b8EXR_.js → LazyCourseware-DXL9IxZO.js} +1 -1
- package/dist/assets/{LazyWhiteboard-BIepzrv9.js → LazyWhiteboard-CtkzSFtN.js} +2 -2
- package/dist/assets/LessonEditorView-Bfxf4VVB.js +1 -0
- package/dist/assets/LiveClassroomView-DHzCM4qQ.js +1 -0
- package/dist/assets/{NotificationDetailModal-Bk1g_prI.js → NotificationDetailModal-BxrpnlWV.js} +1 -1
- package/dist/assets/{PluginView-C6s7Ltcy.js → PluginView-12qYzmnq.js} +3 -3
- package/dist/assets/{ProcessLogsModal-B-PY780w.js → ProcessLogsModal-01S7zsw0.js} +1 -1
- package/dist/assets/{QuizGeneratorModal-DWH1zP0X.js → QuizGeneratorModal-DfZI40Ii.js} +1 -1
- package/dist/assets/StudentAssignmentView-BP6zbHuM.js +1 -0
- package/dist/assets/StudentLessonView-DEpMzrH2.js +1 -0
- package/dist/assets/StudentPreviewModal-DCmai53s.js +1 -0
- package/dist/assets/StudentView-CcGlfW25.js +2 -0
- package/dist/assets/SystemResourceLibraryModal-BzHw1edT.js +1 -0
- package/dist/assets/TeacherView-Dw6mKwcv.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-C8sCKzmN.js +2 -0
- package/dist/assets/index-CYzNsYZB.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 +989 -700
- package/package.json +9 -6
- 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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as i,j as e}from"./vendor-react-0Lg0vA-4.js";import{S as I,O as ts,am as g,aq as as,at as ze,U as v,b5 as rs,q as T,aE as D,ay as is,ag as le,u as ls,e as R,p as os,h as ns,b6 as Se,t as Ae,s as cs,w as Ce,al as ds,b0 as xs,T as ms,X as Le,aj as hs,ao as ps}from"./vendor-icons-Dq6MhgH9.js";function bs({currentUserId:m,currentUserRole:w,lang:s,onLogout:oe,aiProviders:k,testingProviderId:ne,onAIProvidersChanged:u,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,f]=i.useState(!1),[_,y]=i.useState(null),[E,O]=i.useState(""),[$,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,j]=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,Oe]=i.useState(14),[$e,Fe]=i.useState(0),[n,U]=i.useState("directory"),[r,qe]=i.useState(null),[N,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=()=>{y(null),O(""),F(""),q(""),Q(""),f(!0)},Qe=t=>{y(t),O(t.name),F(t.api_url),q(t.api_key||""),Q(t.model_name),f(!0)},Ve=async t=>{if(t.preventDefault(),!E.trim()||!$.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:$.trim(),api_key:he,model_name:B.trim()})});if(c.ok)f(!1),y(null),u();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?u():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(),u();const t=setInterval(()=>{P(),Oe(a=>{const l=Math.floor(Math.random()*9)-4,o=a+l;return Math.min(Math.max(o,5),35)})},5e3);return()=>clearInterval(t)},[$e]),i.useEffect(()=>{n==="site_settings"&&!je&&He()},[n,je]);const Ye=()=>{Ne(null),W(""),X(""),ee(""),C("teacher"),L("active"),x(""),j(!0)},Xe=t=>{Ne(t.id),W(t.username),X(""),ee(t.name),C(t.role),L(t.status||"active"),x(""),j(!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(),j(!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"?`管理学校教师、教工账户、划分角色权限。当前登录角色权限: ${w==="administrator"?"👑 超级管理员 (系统设置已解锁)":"📁 普通教师 (系统设置锁定)"}`:`Create and assign teacher credentials. Active role context: ${w==="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(v,{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:k.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:k.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:N,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:N?"animate-spin":""}),s==="zh"?"重算/刷新 font":"Refresh Metrics"]})]}),e.jsx("div",{className:"p-4 sm:p-5",children:N&&!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:N,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:N?"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(v,{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(v,{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(v,{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(v,{size:16,className:"text-indigo-600"}),d?s==="zh"?"正在编辑教职账户设置":"Edit Teacher Account Settings":s==="zh"?"新建教师与教工账户":"New Teacher Credentials"]}),e.jsx("button",{onClick:()=>j(!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:()=>j(!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:()=>{f(!1),y(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=>O(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:$,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:()=>{f(!1),y(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:w,onLogout:s,aiProviders:oe,testingProviderId:k,onAIProvidersChanged:ne,onTriggerTour:u,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:w,onLogout:s,aiProviders:oe,testingProviderId:k,onAIProvidersChanged:ne,onTriggerTour:u,siteInfo:z,onSiteInfoChanged:h})}export{Ns as AdminDirectoryView};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e}from"./vendor-react-0Lg0vA-4.js";import{m as p}from"./index-
|
|
1
|
+
import{j as e}from"./vendor-react-0Lg0vA-4.js";import{m as p}from"./index-CYzNsYZB.js";import"./vendor-icons-Dq6MhgH9.js";import"./vendor-pdf-Cp-cYteE.js";import"./vendor-utils-BEhuP0Zq.js";import"./vendor-motion-DjY2czvL.js";import"./vendor-pptx-B_NheIKl.js";import"./vendor-charts-CRXa4AlU.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};
|