1import{a as e,c as t,d as n,l as r,m as i,n as a,o,p as s,r as c,s as l,u,v as d}from"./index-C32yDzkE.js";var f=[`B`,`KB`,`MB`,`GB`],p=e=>{let t=0;for(;e>1e3&&t<f.length;)e/=1e3,t++;return Intl.NumberFormat(void 0,{maximumFractionDigits:2}).format(e||0)+` ${f[t]}/s`},m={name:`QBittorrent`,mixins:[a],props:{item:Object},data:()=>({dl:null,ul:null,count:null,error:null}),computed:{downRate:function(){return p(this.dl)},upRate:function(){return p(this.ul)}},created(){this.autoUpdateMethod=this.fetchAllData,this.fetchAllData()},methods:{fetchAllData:async function(){this.getRate(),this.fetchCount()},fetchCount:async function(){try{let e=await this.fetch(`/api/v2/torrents/info`);this.error=!1,this.count=e.length}catch(e){this.error=!0,console.error(e)}},getRate:async function(){try{let e=await this.fetch(`/api/v2/transfer/info`);this.error=!1,this.dl=e.dl_info_speed,this.ul=e.up_info_speed}catch(e){this.error=!0,console.error(e)}}}},h={class:`title is-4`},g={class:`subtitle is-6`},_={key:0,class:`error`},v={class:`down monospace`},y={class:`up monospace`},b={key:0,class:`count`};function x(a,c,f,p,m,x){let S=s(`Generic`);return n(),l(S,{item:f.item},{content:i(()=>[o(`p`,h,d(f.item.name),1),o(`p`,g,[a.error?(n(),r(`span`,_,`An error has occurred.`)):(n(),r(e,{key:1},[o(`span`,v,[c[0]||=o(`p`,{class:`fas fa-download`},null,-1),u(` `+d(x.downRate),1)]),o(`span`,y,[c[1]||=o(`p`,{class:`fas fa-upload`},null,-1),u(` `+d(x.upRate),1)])],64))])]),indicator:i(()=>[a.error?t(``,!0):(n(),r(`span`,b,[u(d(a.count)+` `,1),a.count===1?(n(),r(e,{key:0},[u(`torrent`)],64)):(n(),r(e,{key:1},[u(`torrents`)],64))]))]),_:1},8,[`item`])}var S=c(m,[[`render`,x],[`__scopeId`,`data-v-14481e4d`]]);export{S 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.