PageSourceSearch

https://www.007icu.top/assets/OllamaModelDownloader-BufwqPXN.js

js 007icu.top collected 2026-10-09 04:34:17 UTC 2,951 bytes, 1 lines download raw bytes

1import{n as e,o as t}from"./rolldown-runtime-CMxvf4Kt.js";import{F as n,L as r}from"../vendor/vendor-data-runtime-nLFaCKB0.js";import{Bt as i,Ft as a,It as o,Lt as s}from"../vendor/vendor-ai-runtime-DrDK77gy.js";import{Ao as c,jo as l}from"./app-const-BzFqCjOv.js";import{Do as u,bo as d,go as f,vo as p}from"./ScrollArea-CdDxdn_v.js";import{Aa as m,n as h,oi as g}from"./es-D7HWafs1.js";import{W as _,n as v}from"./es-D3_QMuVV.js";import{O as y,n as b}from"./base-ui-Bi3Dz7GG.js";import{n as x,t as S}from"./swr-C_leGIiU.js";import{j as C,z as w}from"./keys-BAizXMAH.js";import{gr as T,lr as E}from"./index-Doip7UYu.js";import{n as D,t as O}from"./FormAction-Z8Dr0xnF.js";import{n as k,t as A}from"./models-UfQxa2eq.js";var j,M,N=e((()=>{j=t(l()),i(),M=(e,t)=>{let[n,r]=(0,j.useState)(`0 KB/s`),[i,a]=(0,j.useState)(`-`),c=(0,j.useRef)(t),l=(0,j.useRef)(Date.now());return(0,j.useEffect)(()=>{let n=Date.now(),i=(n-l.current)/1e3;if(t>0&&i>1){let u=Math.max(0,(t-c.current)/i);r(o(u)),a(s((e-t)/u)),c.current=t,l.current=n}},[t]),{downloadSpeed:n,remainingTime:i}}})),P,F,I,L=e((()=>{E(),h(),b(),v(),d(),P=t(l()),n(),D(),S(),C(),A(),i(),N(),F=t(c()),I=(0,P.memo)(({model:e,onSuccessDownload:t,extraAction:n})=>{let{t:i}=r([`modelProvider`,`error`]),[o,s]=(0,P.useState)(e),[c,l]=(0,P.useState)(0),[d,h]=(0,P.useState)(0),{remainingTime:v,downloadSpeed:b}=M(d,c),S=(0,P.useMemo)(()=>d?Number((c/d*100).toFixed(1)):0,[c,d]),C=(0,P.useCallback)(e=>{e.completed&&l(e.completed),e.total&&h(e.total)},[]),{mutate:E,isValidating:D,error:A}=x(w.downloadModel(o),async()=>(await k.downloadModel({model:o,provider:`ollama`},{onProgress:C}),!0),{onSuccess:t});return(0,F.jsxs)(f,{gap:16,paddingBlock:32,style:{width:`100%`},children:[(0,F.jsx)(O,{avatar:(0,F.jsx)(T,{color:u.colorPrimary,size:64}),description:i(D?`ollama.download.desc`:`ollama.unlock.description`),title:D?i(`ollama.download.title`,{model:o}):i(`ollama.unlock.title`),children:!D&&(0,F.jsx)(g,{value:o,onChange:e=>{s(e.target.value)}})}),D&&(0,F.jsxs)(p,{flex:1,gap:8,style:{maxWidth:300},width:`100%`,children:[(0,F.jsx)(_,{showInfo:!0,percent:S,strokeColor:u.colorSuccess,trailColor:u.colorSuccessBg}),(0,F.jsxs)(p,{horizontal:!0,distribution:`space-between`,style:{color:u.colorTextDescription,fontSize:12},children:[(0,F.jsxs)(`span`,{children:[i(`ollama.download.remainingTime`),`: `,v]}),(0,F.jsxs)(`span`,{children:[i(`ollama.download.speed`),`: `,b]})]})]}),(0,F.jsxs)(p,{gap:12,style:{maxWidth:300},width:`100%`,children:[A?.message&&(0,F.jsx)(m,{closable:!0,description:A.message,showIcon:!1,title:i(`ollama.download.failed`),type:`error`}),(0,F.jsx)(y,{block:!0,loading:D,style:{marginTop:8},type:`primary`,onClick:()=>{E()},children:D?d?i(`ollama.unlock.downloaded`,{completed:a(c,2),total:a(d,2)}):i(`ollama.unlock.starting`):i(`ollama.unlock.confirm`)}),D?(0,F.jsx)(y,{onClick:()=>{k.abortPull()},children:i(`ollama.unlock.cancel`)}):n]})]})})}));L();export{I as default,L as t};

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.