PageSourceSearch

https://mdm.edu.tw/assets/MDMSplashtopUserManagement.00f5e644.js

js mdm.edu.tw collected 2026-10-01 23:56:07 UTC 10,071 bytes, 2 lines download raw bytes

1import{c as ce,r as o,n as G,u as de,a as e,j as r,R as b}from"./index.7613290f.js";import{I as L}from"./Input.f61068b8.js";import{B as K}from"./ButtonBox.f5ca8933.js";import{B as O}from"./Button.5e3edbef.js";import{L as me}from"./Loader.2a36551f.js";import"./GridTable.module.cf1e4838.js";import{S as Q}from"./SectionTitle.851f4667.js";import{T as R}from"./Title.93c85d07.js";import{s as V}from"./[email protected]";import{c as pe}from"./[email protected]";import{A as fe}from"./APISplashtop.94cb7f5b.js";import"./Button.module.5bbc35fb.js";import{G as B}from"./GridDataTable.10376ef2.js";import"./appInsights.79eb1af4.js";import"./Input.module.1ba51252.js";import"./ButtonBox.module.888fa962.js";/* empty css               */import"./GridDataTable.module.8625a0ee.js";import"./PageSwitch.eaab9be9.js";import"./Selection.ae9a33d4.js";import"./[email protected]";function he(){const A=sessionStorage.getItem("token"),{GetSplashtopUserQueryInfo:m,GetSplashtopTeamDeviceIDList:H,GetSplashtopTeamDeviceListQuery:v,GetSplashtopGroupList:E,GetUserAccessPermission:U,PostUpdateUserAccessPermission:g}=fe({tokenParam:A}),[F,$]=ce(),D=F.get("userID"),[k,l]=o.exports.useState(),[y,P]=o.exports.useState(),[x,I]=o.exports.useState(),[s,f]=o.exports.useState(),[h,W]=o.exports.useState(),[N,X]=o.exports.useState([]),[w,Y]=o.exports.useState([]),Z=x==null?void 0:x.filter(t=>!(N!=null&&N.some(a=>a.id===t.id))),ee=s==null?void 0:s.filter(t=>!(w!=null&&w.some(a=>a.id===t.id)));async function q(){l(!0);try{const t=await H();P(t)}catch(t){console.log(t)}finally{l(!1),z()}}async function z(){l(!0);const t=["id","uuid","name","host_name","os_logon","os_user","os_domain","last_online","os","group_id","online_status","pubip","local_ip","version","last_session","rds_uuid","note","preference_policy"];try{const a=await v({teamDeviceIDList:y,Params:t});I(a)}catch(a){console.log(a)}finally{l(!1)}}async function J(){l(!0);try{const t=await E();f(t)}catch(t){console.log(t)}finally{l(!1)}}async function se(){const t=parseInt(D);l(!0);const a=["id","email","status","role","member_name","group_id","super_admin","group_scope","enable_2fa","access_permissions_kind","last_session_at","last_login_at"];try{const p=await m({UserID:t,Params:a});if(!p.length>0)return;W(p[0])}catch(p){console.log(p)}finally{l(!1)}}async function T(){const t=parseInt(D);l(!0);try{const a=await U(t),{computers:p,groups:S}=a;X(()=>p),Y(()=>S)}catch(a){console.log(a)}finally{l(!1)}}o.exports.useEffect(function(){D&&(se(),T())},[D]),o.exports.useEffect(function(){J(),q()},[]),o.exports.useEffect(function(){y&&z()},[y]);function te(){const[t,a]=o.exports.useState([]),[p,S]=o.exports.useState([]),[C,M]=o.exports.useState([]),[_,j]=o.exports.useState([]);function ne(u,n){const i=u.target.checked;if(i){a([...t,n]);return}if(!i){a(t.filter(c=>c!==n));return}}function re(u,n){const i=u.target.checked;if(i){S([...p,n]);return}if(!i){S(p.filter(c=>c!==n));return}}function ae(u,n){const i=u.target.checked;if(i){M([...C,n]);return}if(!i){M(C.filter(c=>c!==n));return}}function ie(u,n){if(n==="AppendGroup")return t.includes(u);if(n==="RemoveGroup")return p.includes(u);if(n==="AppendDevice")return C.includes(u);if(n==="RemoveDevice")return _.includes(u)}function le(u,n){const i=u.target.checked;if(i){j([..._,n]);return}if(!i){j(_.filter(c=>c!==n));return}}async function ue(){var i,c;const u=parseInt(D),n={access_setting:"specify_computers_and_groups",computers:{add:[],remove:[]},groups:{add:t,remove:p}};l(!0);try{const d=await g({UserID:u,Params:n});if(((c=(i=d==null?void 0:d.groups)==null?void 0:i.fail)==null?void 0:c.length)>0)return G.error("\u8A2D\u7F6E\u4F7F\u7528\u8005\u7FA4\u7D44\u6B0A\u9650\u51FA\u73FE\u932F\u8AA4");console.log(d),G.success("\u4F7F\u7528\u8005\u7FA4\u7D44\u6B0A\u9650\u8A2D\u7F6E\u6210\u529F"),a([]),S([])}catch(d){console.log(d)}finally{l(!1),T(),J()}}async function oe(){var i,c;const u=parseInt(D),n={access_setting:"specify_computers_and_groups",computers:{add:C,remove:_},groups:{add:[],remove:[]}};l(!0);try{const d=await g({UserID:u,Params:n});if(((c=(i=d==null?void 0:d.computers)==null?void 0:i.fail)==null?void 0:c.length)>0)return G.error("\u8A2D\u7F6E\u4F7F\u7528\u8005\u8F09\u5177\u6B0A\u9650\u51FA\u73FE\u932F\u8AA4");G.success("\u4F7F\u7528\u8005\u8F09\u5177\u6B0A\u9650\u8A2D\u7F6E\u6210\u529F"),M([]),j([])}catch(d){console.log(d)}finally{l(!1),T(),q()}}
1return{isItemSelected:ie,HandleSelectAppendGroup:ne,HandleSelectRemoveGroup:re,HandleSelectDeviceForAppend:ae,HandleSelectDeviceForRemove:le,HandlePostUpdateUserGroupAccessPermission:ue,HandlePostUpdateUserDeviceAccessPermission:oe}}return{isLoading:k,userData:h,accessComputerList:N,accessGroupList:w,filteredTeamDeviceList:Z,filteredTeamGroupList:ee,useUpdateAccessPermission:te}}function Pe(){//!! 群組載具介面需再優化 !!//
2const{isLoading:A,userData:m,accessComputerList:H,accessGroupList:v,filteredTeamDeviceList:E,filteredTeamGroupList:U,useUpdateAccessPermission:g}=he(),{isItemSelected:F,HandleSelectAppendGroup:$,HandleSelectRemoveGroup:D,HandleSelectDeviceForAppend:k,HandleSelectDeviceForRemove:l,HandlePostUpdateUserGroupAccessPermission:y,HandlePostUpdateUserDeviceAccessPermission:P}=g(),x=de();function I(s){x(`/MDMSplashtopGroupManagement/${s}`)}return e("div",{className:"MDMSplashtopUserManagement",children:A?e(me,{}):r("div",{className:"w-full flex flex-wrap gap-y-15",children:[r("div",{className:"w-full",children:[e(Q,{children:"\u4F7F\u7528\u8005\u8CC7\u8A0A"}),e("div",{className:"w-full mt-5",children:r("div",{className:"w-full grid text-lg grid-cols-[25%,1fr] gap-y-2.5",children:[e("span",{children:"\u96FB\u5B50\u4FE1\u7BB1"}),e("span",{children:m==null?void 0:m.email}),e("span",{children:"\u59D3\u540D"}),e("span",{children:m==null?void 0:m.member_name}),e("span",{children:"\u4E0A\u6B21\u767B\u5165"}),e("span",{children:m==null?void 0:m.last_login_at})]})})]}),r("div",{className:"w-full",children:[e(Q,{children:"\u7BA1\u7406Splashtop\u4F7F\u7528\u8005\u9023\u7DDA\u8F09\u5177\u6B0A\u9650"}),r("div",{className:"w-full flex flex-wrap mt-5",children:[r("div",{className:"w-full grid grid-cols-2 gap-[6%]",children:[r("div",{className:"w-full",children:[e(R,{children:"\u4F7F\u7528\u8005\u9023\u7DDA\u6B0A\u9650\u8F09\u5177"}),e("div",{className:"w-full border-1 border-moe-grey h-[650px]",children:e(B,{ContainerClassName:"flex-col h-full justify-between",HeaderDivStyle:{borderTop:"none"},GridClassName:"grid-cols-[55%,15%,15%,15%] h-[calc(100%-50px)]",RowCount:10,DataHeader:["\u8F09\u5177\u540D\u7A31","","","\u79FB\u9664\u8F09\u5177"],DataList:H,RenderNull:()=>e("div",{className:"cols-span-4 text-center",children:e("span",{children:"\u76EE\u524D\u6C92\u6709\u8F09\u5177"})}),Render:(s,f)=>r(b.Fragment,{children:[e("div",{children:e("span",{children:s==null?void 0:s.name})}),e("div",{}),e("div",{}),e("div",{children:e(L,{type:"checkbox",checked:F(s==null?void 0:s.id,"RemoveDevice"),onChange:h=>l(h,s==null?void 0:s.id)})})]},f)})})]}),r("div",{className:"w-full",children:[e(R,{children:"\u7D44\u7E54\u8F09\u5177"}),e("div",{className:"w-full border-1 border-moe-grey h-[650px]",children:e(B,{ContainerClassName:"flex-col h-full justify-between",HeaderDivStyle:{borderTop:"none"},GridClassName:"grid-cols-[55%,15%,15%,15%] h-[calc(100%-50px)]",RowCount:10,DataHeader:["\u8F09\u5177\u540D\u7A31","","","\u79FB\u9664\u8F09\u5177"],DataList:E,Render:(s,f)=>r(b.Fragment,{children:[e("div",{children:e("span",{children:s==null?void 0:s.name})}),e("div",{}),e("div",{}),e("div",{children:e(L,{type:"checkbox",checked:F(s==null?void 0:s.id,"AppendDevice"),onChange:h=>k(h,s==null?void 0:s.id)})})]},f),RenderNull:()=>e("div",{className:"cols-span-4 text-center",children:e("span",{children:"\u76EE\u524D\u6C92\u6709\u6210\u54E1"})})})})]})]}),e(K,{className:"mt-15",children:r(O,{type:"button",onClick:()=>P(),disabled:A,children:[e("img",{src:V}),"\u9001\u51FA"]})})]})]}),r("div",{className:"w-full",children:[e(Q,{children:"\u7BA1\u7406Splashtop\u4F7F\u7528\u8005\u9023\u7DDA\u7FA4\u7D44\u6B0A\u9650"}),r("div",{className:"w-full flex flex-wrap mt-5",children:[r("div",{className:"w-full grid grid-cols-2 gap-x-[6%]",children:[r("div",{className:"w-full",children:[e(R,{children:"\u4F7F\u7528\u8005\u9023\u7DDA\u6B0A\u9650\u7FA4\u7D44"}),e("div",{className:"w-full border-1 border-moe-grey h-[650px]",children:e(B,{ContainerClassName:"flex-col h-full justify-between",HeaderDivStyle:{borderTop:"none"},GridClassName:"grid-cols-[55%,15%,15%,15%] h-[calc(100%-50px)]",RowCount:10,DataHeader:["\u7FA4\u7D44\u540D\u7A31","","\u7BA1\u7406\u7FA4\u7D44","\u79FB\u9
2664\u7FA4\u7D44"],DataList:v==null?void 0:v.filter(s=>(s==null?void 0:s.id)!==0),RenderNull:()=>e("div",{className:"col-span-4 text-center",children:e("span",{children:"\u76EE\u524D\u6C92\u6709\u7FA4\u7D44"})}),Render:(s,f)=>r(b.Fragment,{children:[e("div",{children:e("span",{children:s==null?void 0:s.name})}),e("div",{}),e("div",{children:e("img",{src:pe,onClick:()=>I(s==null?void 0:s.id)})}),e("div",{children:e(L,{type:"checkbox",checked:F(s==null?void 0:s.id,"RemoveGroup"),onChange:h=>D(h,s==null?void 0:s.id)})})]},f)})})]}),r("div",{className:"w-full",children:[e(R,{children:"\u7D44\u7E54\u7FA4\u7D44"}),e("div",{className:"w-full border-1 border-moe-grey h-[650px]",children:e(B,{ContainerClassName:"flex-col h-full justify-between",HeaderDivStyle:{borderTop:"none"},GridClassName:"grid-cols-[55%,15%,15%,15%] h-[calc(100%-50px)]",RowCount:10,DataHeader:["\u7FA4\u7D44\u540D\u7A31","","","\u52A0\u5165\u7FA4\u7D44"],DataList:U,RenderNull:()=>e("span",{style:{gridColumn:"span 5"},children:"\u76EE\u524D\u6C92\u6709\u6210\u54E1"}),Render:(s,f)=>r(b.Fragment,{children:[e("div",{children:e("span",{children:s==null?void 0:s.name})}),e("div",{}),e("div",{}),e("div",{children:e(L,{type:"checkbox",checked:F(s==null?void 0:s.id,"AppendGroup"),onChange:h=>$(h,s==null?void 0:s.id)})})]},f)})})]})]}),e(K,{className:"mt-15",children:r(O,{type:"button",onClick:()=>y(),disabled:A,children:[e("img",{src:V}),"\u9001\u51FA"]})})]})]})]})})}export{Pe as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.