PageSourceSearch

https://kamios.cn/_next/static/chunks/7736.0b3988ab2206d578.js

js kamios.cn collected 2026-10-07 16:36:29 UTC 15,077 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7736],{49339:function(e,o,r){var t=r(31549),n=r(44194),l=r(11329),i=r(23385),a=r(66358),s=r(31469),c=r(46815),d=r(92289),m=r(1639),u=r(56347),p=r(71593);let x={primary:{styles:{_hover:{backgroundColor:"primary.50",color:"primary.600"},_focus:{backgroundColor:"primary.50",color:"primary.600"},_active:{backgroundColor:"primary.50",color:"primary.600"}},iconColor:"myGray.600"},gray:{styles:{_hover:{backgroundColor:"myGray.05",color:"primary.600"},_focus:{backgroundColor:"myGray.05",color:"primary.600"},_active:{backgroundColor:"myGray.05",color:"primary.600"}},iconColor:"myGray.400"},grayBg:{styles:{_hover:{backgroundColor:"myGray.05",color:"primary.600"},_focus:{backgroundColor:"myGray.05",color:"primary.600"},_active:{backgroundColor:"myGray.05",color:"primary.600"}},iconColor:"myGray.600"},danger:{styles:{color:"red.600",_hover:{background:"red.1"},_focus:{background:"red.1"},_active:{background:"red.1"}},iconColor:"red.600"}},h={mini:{iconStyle:{w:"14px"},labelStyle:{fontSize:"mini"},dividerStyle:{my:.5},menuItemStyle:{py:1.5,px:2}},xs:{iconStyle:{w:"14px"},labelStyle:{fontSize:"sm"},dividerStyle:{my:.5},menuItemStyle:{py:1.5,px:2}},sm:{iconStyle:{w:"1rem"},labelStyle:{fontSize:"sm"},dividerStyle:{my:1},menuItemStyle:{py:2,px:3,_notLast:{mb:.5}}},md:{iconStyle:{w:"2rem",borderRadius:"6px"},labelStyle:{fontSize:"sm"},dividerStyle:{my:1},menuItemStyle:{py:2,px:3,_notLast:{mb:.5}}}};o.Z=n.memo(e=>{let{width:o="auto",trigger:r="hover",size:y="sm",offset:f,Button:g,menuList:j,placement:b="bottom-start"}=e,{isPc:v}
1=(0,u.u)(),S=(0,n.useRef)(null),C=(0,n.useRef)(),[k,_]=(0,n.useState)(!1),w=v?r:"click";(0,l.O)({ref:S,handler:()=>{_(!1)}});let T=(0,n.useMemo)(()=>f||("number"==typeof o?[-o/2,5]:[0,5]),[f]);return(0,t.jsx)(i.v,{offset:T,isOpen:k,autoSelect:!1,direction:"ltr",isLazy:!0,lazyBehavior:"keepMounted",placement:b,computePositionOnMount:!0,children:(0,t.jsxs)(a.xu,{ref:S,onMouseEnter:()=>{"hover"===w&&_(!0),clearTimeout(C.current)},onMouseLeave:()=>{"hover"===w&&(C.current=setTimeout(()=>{_(!1)},100))},children:[(0,t.jsxs)(a.xu,{position:"relative",onClickCapture:e=>{e.stopPropagation(),"click"===w&&_(!k)},children:[(0,t.jsx)(s.j,{w:"100%",h:"100%",position:"absolute",top:0,right:0,bottom:0,left:0}),(0,t.jsx)(a.xu,{position:"relative",color:k?"primary.600":"",w:"fit-content",h:"fit-content",borderRadius:"sm",children:g})]}),(0,t.jsx)(c.q,{minW:k?"".concat(o,"px !important"):"80px",zIndex:100,maxW:"300px",p:"6px",border:"1px solid #fff",boxShadow:"3",children:j.map((e,o)=>(0,t.jsxs)(a.xu,{children:[e.label&&(0,t.jsx)(a.xu,{fontSize:"sm",children:e.label}),0!==o&&(0,t.jsx)(m.Z,{h:"1.5px",...h[y].dividerStyle}),e.children.map((e,o)=>(0,t.jsxs)(d.s,{borderRadius:"sm",onClick:o=>{o.stopPropagation(),e.onClick&&(_(!1),e.onClick())},alignItems:"center",fontSize:"sm",color:e.isActive?"primary.700":"myGray.600",whiteSpace:"pre-wrap",...x[e.type||"primary"].styles,...h[y].menuItemStyle,...e.menuItemStyles,children:[!!e.icon&&(0,t.jsx)(p.default,{src:e.icon,mr:2,...h[y].iconStyle,color:e.isActive?"inherit":x[e.type||"primary"].iconColor,sx:{'[role="menuitem"]:hover &':{color:"inherit"}}}),(0,t.jsxs)(a.xu,{w:"100%",children:[(0,t.jsx)(a.xu,{w:"100%",color:e.description?"myGray.900":"inherit",...h[y].labelStyle,children:e.label}),e.description&&(0,t.jsx)(a.xu,{color:"myGray.500",fontSize:"mini",w:"100%",children:e.description})]})]},o))]},o))})]})})})},95240:function(e,o,r){r.d(o,{Q:function(){return l}});var t=r(44194),n=r(24037);let l=e=>{let{onDrop:o,activeStyles:r}=e,[l,i]=(0,t.useState)(),[a,s]=(0,t.useState)(),[c,{setTrue:d,setFalse:m}]=(0,n.Z)();return{getBoxProps:(0,t.useCallback)(e=>{let{dataId:t,isFolder:n}=e;return{draggable:!0,userSelect:"none","data-drag-id":n?t:void 0,onDragStart:e=>{i(t)},onDragOver:e=>{e.preventDefault();let o=e.currentTarget.getAttribute("data-drag-id");o&&s(o)},onDragLeave:e=>{e.preventDefault(),s(void 0)},...n&&{onDrop:async e=>{e.preventDefault(),d();try{a&&l&&a!==l&&await o(l,a)}catch(e){}s(void 0),i(void 0),m()}},...r&&a===t&&{...r}}},[r,l,o,m,d,a]),isDropping:c}}},7736:function(e,o,r){r.r(o);var t=r(31549),n=r(44194),l=r(43527),i=r(42237),a=r(76652),s=r(4812),c=r(80160),d=r(82577),m=r(46269),u=r(6067),p=r(66358),x=r(21),h=r(31469),y=r(39054),f=r(67418),g=r(10623),j=r(95280),b=r(10474),v=r(31496),S=r(52454),C=r(49339),k=r(11180),_=r(71533),w=r(63829),T=r(4955),I=r(22925),z=r.n(I),G=r(99844),D=r(34113),Z=r(54218),R=r(38472),M=r(71506),F=r(42668),L=r(32407),N=r(477),A=r(3013),E=r(86233),P=r(95240),q=r(91616),W=r(43056);let B=z()(()=>Promise.all([r.e(23560),r.e(10501)]).then(r.bind(r,10501)),{loadableGenerated:{webpack:()=>[10501]}}),O=z()(()=>r.e(46748).then(r.bind(r,46748)),{loadableGenerated:{webpack:()=>[46748]}});o.default=n.memo(()=>{let e=(0,n.useRef)(null),o=(0,S.useRouter)(),{toast:r}=(0,D.p)(),{t:I}=(0,j.$G)(),{datasetDetail:z,loadDatasetDetail:U}=(0,M.Sz)(L.w,e=>e),{feConfigs:$}=(0,W.m)(),{openConfirm:Q,ConfirmModal:V}=(0,g.N)({content:I("common:dataset.Confirm to delete the file"),type:"delete"}),{onOpenModal:J,EditModal:Y}=(0,k.b)({title:I("common:Rename")}),[H,K]=(0,n.useState)(),{collections:X,Pagination:ee,total:eo,getData:er,isGetting:et,pageNum:en,pageSize:el}=(0,M.Sz)(F.p,e=>e),ei=(0,n.useMemo)(()=>X.map(e=>{let o=(0,w.Bg)(e.type,e.name),r=e.trainingAmount>0?{statusText:I("common:dataset.collections.Collection Embedding",{total:e.trainingAmount}),colorSchema:"gray"}:{statusText:I("common:core.dataset.collection.status.active"),colorSchema:"green"};return{...e,icon:o,...r}}),[X,I]),{runAsync:ea,loading:es}=(0,v.q)(y.Sx,{onSuccess(){er(en)},successToast:I("common:common.Update Success")}),{runAsync:ec,loading:ed}=(0,v.q)(e=>(0,y.Nw)({id:e}),{onSuccess(){er(en)},successToast:I("common:common.Delete Success"),errorToast:I("common:common.Delete Failed")}),{openConfirm:em,ConfirmModal:eu}=(0,g.N)({content:I("dataset:collection_sync_confirm_tip")}),{runAsync:ep,loading:ex}=(0,v.q)(y.J2,{onSuccess(e){var o;er(en),r({status:"success",title:I(null===(o=_.nd[e])||void 0===o?void 0:o.label)})},errorToast:I("common:core.dataset.error.Start Sync Failed")}),eh=(0,n.useMemo)(()=>!!ei.find(e=>
1e.trainingAmount>0),[ei]);(0,f.a)(["refreshCollection"],()=>(er(en),z.status===_.$8.syncing&&U(z._id),null),{refetchInterval:6e3,enabled:eh||z.status===_.$8.syncing});let{getBoxProps:ey,isDropping:ef}=(0,P.Q)({activeStyles:{bg:"primary.100"},onDrop:async(e,o)=>{try{await (0,y.Sx)({id:e,parentId:o}),er(en)}catch(e){}}}),eg=es||ed||ex||et&&0===X.length||ef;return(0,t.jsx)(R.Z,{isLoading:eg,h:"100%",py:[2,4],children:(0,t.jsxs)(l.k,{ref:e,flexDirection:"column",py:[1,0],h:"100%",px:[2,6],children:[(0,t.jsx)(B,{}),(0,t.jsxs)(i.x,{mt:3,overflowY:"auto",fontSize:"sm",children:[(0,t.jsxs)(a.i,{variant:"simple",draggable:!1,children:[(0,t.jsx)(s.h,{draggable:!1,children:(0,t.jsxs)(c.Tr,{children:[(0,t.jsx)(d.Th,{py:4,children:I("common:common.Name")}),(0,t.jsx)(d.Th,{py:4,children:I("dataset:collection.Training type")}),(0,t.jsx)(d.Th,{py:4,children:I("common:dataset.collections.Data Amount")}),(0,t.jsx)(d.Th,{py:4,children:I("dataset:collection.Create update time")}),(0,t.jsx)(d.Th,{py:4,children:I("common:common.Status")}),(0,t.jsx)(d.Th,{py:4,children:I("dataset:Enable")}),(0,t.jsx)(d.Th,{py:4})]})}),(0,t.jsxs)(m.p,{children:[(0,t.jsx)(c.Tr,{h:"5px"}),ei.map(e=>{var r;return(0,t.jsxs)(c.Tr,{_hover:{bg:"myGray.50"},cursor:"pointer",...ey({dataId:e._id,isFolder:e.type===_.Ug.folder}),draggable:!1,onClick:()=>{e.type===_.Ug.folder?o.push({query:{datasetId:z._id,parentId:e._id}}):o.push({query:{datasetId:z._id,collectionId:e._id,currentTab:T.TabEnum.dataCard}})},children:[(0,t.jsxs)(u.Td,{minW:"150px",maxW:["200px","300px"],draggable:!0,py:2,children:[(0,t.jsxs)(l.k,{alignItems:"center",children:[(0,t.jsx)(b.Z,{name:e.icon,w:"1.25rem",mr:2}),(0,t.jsx)(Z.Z,{label:I("common:common.folder.Drag Tip"),shouldWrapChildren:!1,children:(0,t.jsx)(p.xu,{color:"myGray.900",fontWeight:"500",className:"textEllipsis",children:e.name})})]}),(null==$?void 0:$.isPlus)&&!!(null===(r=e.tags)||void 0===r?void 0:r.length)&&(0,t.jsx)(q.Z,{currentCollection:e})]}),(0,t.jsx)(u.Td,{py:2,children:(0,E.A$)(e.type)?"-":(0,t.jsx)(t.Fragment,{children:I((0,E.E9)(e.trainingType)||"-")})}),(0,t.jsx)(u.Td,{py:2,children:e.dataAmount||"-"}),(0,t.jsxs)(u.Td,{fontSize:"xs",py:2,color:"myGray.500",children:[(0,t.jsx)(p.xu,{children:(0,N.T9)(e.createTime)}),(0,t.jsx)(p.xu,{children:(0,N.T9)(e.updateTime)})]}),(0,t.jsx)(u.Td,{py:2,children:(0,t.jsx)(A.Z,{showDot:!0,colorSchema:e.colorSchema,type:"borderFill",children:I(e.statusText)})}),(0,t.jsx)(u.Td,{py:2,onClick:e=>e.stopPropagation(),children:(0,t.jsx)(x.r,{isChecked:!e.forbid,size:"sm",onChange:o=>ea({id:e._id,forbid:!o.target.checked})})}),(0,t.jsx)(u.Td,{py:2,onClick:e=>e.stopPropagation(),children:e.permission.hasWritePer&&(0,t.jsx)(C.Z,{width:100,offset:[-70,5],Button:(0,t.jsx)(h.j,{w:"1.5rem",h:"1.5rem",borderRadius:"md",_hover:{color:"primary.500","& .icon":{bg:"myGray.200"}},children:(0,t.jsx)(b.Z,{className:"icon",name:"more",h:"1rem",w:"1rem",px:1,py:1,borderRadius:"md",cursor:"pointer"})}),menuList:[{children:[...e.type===_.Ug.link||z.type===_.ie.apiDataset?[{label:(0,t.jsxs)(l.k,{alignItems:"center",children:[(0,t.jsx)(b.Z,{name:"common/refreshLight",w:"0.9rem",mr:2}),I("dataset:collection_sync")]}),onClick:()=>em(()=>{ep(e._id)})()}]:[],{label:(0,t.jsxs)(l.k,{alignItems:"center",children:[(0,t.jsx)(b.Z,{name:"common/file/move",w:"0.9rem",mr:2}),I("common:Move")]}),onClick:()=>K({collectionId:e._id})},{label:(0,t.jsxs)(l.k,{alignItems:"center",children:[(0,t.jsx)(b.Z,{name:"edit",w:"0.9rem",mr:2}),I("common:Rename")]}),onClick:()=>J({defaultVal:e.name,onSuccess:o=>ea({id:e._id,name:o})})}]},{children:[{label:(0,t.jsxs)(l.k,{alignItems:"center",children:[(0,t.jsx)(b.Z,{mr:1,name:"delete",w:"0.9rem",_hover:{color:"red.600"}}),(0,t.jsx)(p.xu,{children:I("common:common.Delete")})]}),type:"danger",onClick:()=>Q(()=>{ec(e._id)},void 0,e.type===_.Ug.folder?I("common:dataset.collections.Confirm to delete the folder"):I("common:dataset.Confirm to delete the file"))()}]}]})})]},e._id)})]})]}),eo>el&&(0,t.jsx)(l.k,{mt:2,justifyContent:"center",children:(0,t.jsx)(ee,{})}),0===eo&&(0,t.jsx)(O,{})]}),(0,t.jsx)(V,{}),(0,t.jsx)(eu,{}),(0,t.jsx)(Y,{}),!!H&&(0,t.jsx)(G.Z,{datasetId:z._id,type:"folder",defaultSelectedId:[H.collectionId],onClose:()=>K(void 0),onSuccess:async e=>{let{parentId:o}=e;await (0,y.Sx)({id:H.collectionId,parentId:o}),er(en),K(void 0),r({status:"success",title:I("common:common.folder.Move Success")})}})]})})})},11180:function(e,o,r){r.d(o,{b:function(){return h}});
1var t=r(31549),n=r(44194),l=r(90256),i=r(85402),a=r(66358),s=r(13316),c=r(31921),d=r(78604),m=r(63025),u=r(34113),p=r(95280),x=r(31496);let h=e=>{let{title:o,tip:r,placeholder:h="",canEmpty:y=!0,valueRule:f}=e,{t:g}=(0,p.$G)(),{isOpen:j,onOpen:b,onClose:v}=(0,l.q)(),S=(0,n.useRef)(null),C=(0,n.useRef)(),k=(0,n.useRef)(),{toast:_}=(0,u.p)(),w=(0,n.useRef)(""),T=(0,n.useCallback)(e=>{let{defaultVal:o,onSuccess:r,onError:t}=e;b(),C.current=r,k.current=t,w.current=o},[b]),I=(0,n.useCallback)(async()=>{if(!S.current||!C.current)return;let e=S.current.value;if(!y&&!e){S.current.focus();return}if(f){let o=f(e);if(o)return _({status:"warning",title:o})}try{await C.current(e),v()}catch(e){var o;null===(o=k.current)||void 0===o||o.call(k,e)}},[y,v,_,f]);return{onOpenModal:T,EditModal:(0,n.useCallback)(e=>{let{maxLength:n=50,iconSrc:l="modal/edit",closeBtnText:u=g("common:common.Close")}=e,{runAsync:p,loading:y}=(0,x.q)(I);return(0,t.jsxs)(m.default,{isOpen:j,onClose:v,iconSrc:l,title:o,maxW:"500px",children:[(0,t.jsxs)(i.f,{children:[!!r&&(0,t.jsx)(a.xu,{mb:2,color:"myGray.500",fontSize:"sm",children:r}),(0,t.jsx)(s.I,{ref:S,defaultValue:w.current,placeholder:h,autoFocus:!0,maxLength:n})]}),(0,t.jsxs)(c.m,{children:[!!u&&(0,t.jsx)(d.z,{mr:3,variant:"whiteBase",onClick:v,children:u}),(0,t.jsx)(d.z,{onClick:p,isLoading:y,children:g("common:common.Confirm")})]})]})},[j,v,I,h,g,r,o])}}},99844:function(e,o,r){var t=r(31549),n=r(10474),l=r(63025),i=r(73251),a=r(31496),s=r(39054),c=r(41995),d=r(66358),m=r(85402),u=r(37882),p=r(57444),x=r(43527),h=r(31921),y=r(78604),f=r(71533),g=r(63829),j=r(67418),b=r(44194),v=r(95280),S=r(62968),C=r(71506),k=r(32407),_=r(80385);o.Z=e=>{let{datasetId:o,type:r,defaultSelectedId:w=[],onClose:T,onChange:I,onSuccess:z,title:G,tip:D,max:Z=1,CustomFooter:R}=e,{t:M}=(0,v.$G)(),F=(0,c.F)(),{loadDatasetDetail:L}=(0,C.Sz)(k.w,e=>e),{Loading:N}=(0,S.r)(),[A,E]=(0,b.useState)(w),[P,q]=(0,b.useState)("");(0,j.a)(["loadDatasetDetail",o],()=>L(o));let{data:W,loading:B}=(0,a.q)(()=>(0,s.Li)({datasetId:o,parentId:P,selectFolder:"folder"===r,simple:!0,pageNum:1,pageSize:50}),{manual:!1,refreshDeps:[o,P,r]}),O=(0,b.useMemo)(()=>(null==W?void 0:W.list.map(e=>{let o=(0,g.Bg)(e.type,e.name);return{...e,icon:o}}))||[],[W]),U=(0,b.useMemo)(()=>"folder"===r?O.filter(e=>e._id!==w[0]):O,[w,O,r]),{data:$=[]}=(0,j.a)(["getDatasetCollectionPathById",P],()=>(0,s.RS)(P)),{mutate:Q,isLoading:V}=(0,a.Q)({mutationFn:async()=>{var e,o;return"folder"===r?await (null==z?void 0:z({parentId:(null===(e=$[$.length-1])||void 0===e?void 0:e.parentId)||"",collectionIds:[]})):await (null==z?void 0:z({parentId:(null===(o=$[$.length-1])||void 0===o?void 0:o.parentId)||"",collectionIds:A})),null},errorToast:M("common:common.Request Error")});return(0,t.jsxs)(l.default,{isOpen:!0,onClose:T,maxW:["90vw","900px"],w:"100%",h:["90vh","80vh"],isCentered:!0,iconSrc:"/imgs/modal/move.svg",title:(0,t.jsx)(d.xu,{children:(0,t.jsx)(i.Z,{paths:$.map(e=>({parentId:e.parentId,parentName:e.parentName})),FirstPathDom:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(d.xu,{fontWeight:"bold",fontSize:["sm","md"],children:G||M("folder"===r?"common:common.Root folder":"common:dataset.collections.Select Collection")}),!!D&&(0,t.jsx)(d.xu,{fontSize:"sm",color:"myGray.500",children:D})]}),onClick:e=>{q(e)}})}),children:[(0,t.jsxs)(m.f,{flex:"1 0 0",overflow:"auto",children:[(0,t.jsx)(u.r,{gridTemplateColumns:["repeat(1,1fr)","repeat(2,1fr)"],gridGap:3,userSelect:"none",mt:2,children:U.map(e=>(()=>{let o=A.includes(e._id);return(0,t.jsx)(p.Z,{p:3,border:F.borders.base,boxShadow:"sm",cursor:"pointer",_hover:{bg:"primary.50",borderColor:"primary.300"},...o?{bg:"primary.200"}:{},onClick:()=>{if(e.type===f.Ug.folder)q(e._id);else{let r=[];1===Z?r=[e._id]:o?r=A.filter(o=>o!==e._id):A.length<Z&&(r=[...A,e._id]),E(r),I&&I({parentId:P,collectionIds:r})}},children:(0,t.jsxs)(x.k,{alignItems:"center",h:"38px",children:[(0,t.jsx)(n.Z,{name:e.icon,w:"18px"}),(0,t.jsx)(d.xu,{ml:3,fontSize:"sm",className:"textEllipsis",children:e.name})]})},e._id)})())}),0===U.length&&(0,t.jsx)(_.Z,{pt:"20vh",text:M("common:common.folder.No Folder")}),(0,t.jsx)(N,{loading:B,fixed:!1})]}),R?(0,t.jsx)(t.Fragment,{children:R}):(0,t.jsx)(h.m,{children:(0,t.jsx)(y.z,{isLoading:V,isDisabled:"collection"===r&&0===A.length,onClick:Q,children:M("folder"===r?"common:common.Confirm Move":"common:common.Confirm")})})]})}}}]);

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.