| Server IP : 202.61.199.114 / Your IP : 216.73.217.139 Web Server : nginx/1.22.1 System : Linux de.arni-solutions.de 6.1.0-49-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.174-1 (2026-05-26) x86_64 User : web20 ( 1018) PHP Version : 8.4.23 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /var/www/clients/client2/web30/web/backup/resources/ |
Upload File : |
import{_ as f,G as p,r as g,o as s,c as _,w as h,a as r,t as i,b as a,F as l,d as o,e as y}from"./index-UxwdVxub.js";const u=["B","kiB","MiB","GiB"],m=t=>{let e=0;for(;t>1e3&&e<u.length;)t/=1e3,e++;return Intl.NumberFormat(void 0,{maximumFractionDigits:2}).format(t||0)+` ${u[e]}/s`},C={name:"rTorrent",props:{item:Object},components:{Generic:p},data:()=>({dl:null,ul:null,count:null,error:null}),computed:{downRate:function(){return m(this.dl)},upRate:function(){return m(this.ul)}},created(){const t=parseInt(this.item.rateInterval,10)||0,e=parseInt(this.item.torrentInterval,10)||0;t>0&&setInterval(()=>this.fetchRates(),t),e>0&&setInterval(()=>this.fetchCount(),e),this.fetchRates(),this.fetchCount()},methods:{fetchRates:async function(){this.getRate("throttle.global_up.rate").then(t=>this.ul=t).catch(()=>this.error=!0),this.getRate("throttle.global_down.rate").then(t=>this.dl=t).catch(()=>this.error=!0)},fetchCount:async function(){this.getCount().catch(()=>this.error=!0)},getRate:async function(t){return this.getXml(t).then(e=>parseInt(e.getElementsByTagName("value")[0].firstChild.textContent,10))},getCount:async function(){return this.getXml("download_list").then(t=>{const e=t.getElementsByTagName("array");this.count=e?e[0].getElementsByTagName("value").length:0})},getXml:async function(t){const e={"Content-Type":"text/xml"};return this.item.username&&this.item.password&&(e.Authorization=`${this.item.username}:${this.item.password}`),fetch(`${this.item.xmlrpc.replace(/\/$/,"")}/RPC2`,{method:"POST",headers:e,body:`<methodCall><methodName>${t}</methodName></methodCall>`}).then(n=>{if(!n.ok)throw Error(n.statusText);return n.text()}).then(n=>Promise.resolve(new DOMParser().parseFromString(n,"text/xml")))}}},w={class:"title is-4"},R={class:"subtitle is-6"},v={key:0,class:"error"},B={class:"down"},I={class:"up"},k={key:0,class:"count"};function x(t,e,n,N,T,c){const d=g("Generic");return s(),_(d,{item:n.item},{content:h(()=>[r("p",w,i(n.item.name),1),r("p",R,[t.error?(s(),a("span",v,"An error has occurred.")):(s(),a(l,{key:1},[r("span",B,[e[0]||(e[0]=r("i",{class:"fas fa-download"},null,-1)),o(" "+i(c.downRate),1)]),r("span",I,[e[1]||(e[1]=r("i",{class:"fas fa-upload"},null,-1)),o(" "+i(c.upRate),1)])],64))])]),indicator:h(()=>[t.error?y("",!0):(s(),a("span",k,[o(i(t.count)+" ",1),t.count===1?(s(),a(l,{key:0},[o("torrent")],64)):(s(),a(l,{key:1},[o("torrents")],64))]))]),_:1},8,["item"])}const E=f(C,[["render",x],["__scopeId","data-v-4f095904"]]);export{E as default};