qBitrr2 5.6.1__py3-none-any.whl → 5.7.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- qBitrr/arss.py +390 -89
- qBitrr/bundled_data.py +2 -2
- qBitrr/db_lock.py +24 -10
- qBitrr/main.py +232 -10
- qBitrr/static/assets/ArrView.js +1 -1
- qBitrr/static/assets/ArrView.js.map +1 -1
- qBitrr/static/assets/ConfigView.js +5 -4
- qBitrr/static/assets/ConfigView.js.map +1 -1
- qBitrr/static/assets/LogsView.js +1 -1
- qBitrr/static/assets/LogsView.js.map +1 -1
- qBitrr/static/assets/ProcessesView.js +1 -1
- qBitrr/static/assets/ProcessesView.js.map +1 -1
- qBitrr/static/assets/app.css +1 -1
- qBitrr/static/assets/app.js +5 -5
- qBitrr/static/assets/app.js.map +1 -1
- qBitrr/static/assets/vendor.js +1 -1
- qBitrr/static/assets/vendor.js.map +1 -1
- qBitrr/tables.py +7 -0
- qBitrr/webui.py +48 -1
- qbitrr2-5.7.0.dist-info/METADATA +282 -0
- {qbitrr2-5.6.1.dist-info → qbitrr2-5.7.0.dist-info}/RECORD +25 -25
- qbitrr2-5.6.1.dist-info/METADATA +0 -1210
- {qbitrr2-5.6.1.dist-info → qbitrr2-5.7.0.dist-info}/WHEEL +0 -0
- {qbitrr2-5.6.1.dist-info → qbitrr2-5.7.0.dist-info}/entry_points.txt +0 -0
- {qbitrr2-5.6.1.dist-info → qbitrr2-5.7.0.dist-info}/licenses/LICENSE +0 -0
- {qbitrr2-5.6.1.dist-info → qbitrr2-5.7.0.dist-info}/top_level.txt +0 -0
qBitrr/static/assets/LogsView.js
CHANGED
|
@@ -204,5 +204,5 @@ import{j as M,u as ys,d as vs,I as dr,R as ws,D as bs,e as Ss,f as Es}from"./app
|
|
|
204
204
|
`),n=Me(r.endsWith(`
|
|
205
205
|
`)?r:r+`
|
|
206
206
|
`),i=Kt(this.encodedLog,n),{lines:s}=He(n);this.handleUpdate({lines:s,encodedLog:i})}handleScrollToLine(t=0){const r=yt({scrollToLine:t});this.setState({scrollToIndex:r,scrollToLine:t}),this.listRef?.current?.scrollToIndex(r,{align:"nearest"})}renderError(){const{url:t,lineClassName:r,selectableLines:n,highlightLineClassName:i,enableLinks:s,wrapLines:o}=this.props,{error:a}=this.state;return g.createElement(w.Fragment,null,g.createElement(Ae,{wrapLines:o,selectable:n,className:r,highlightClassName:i,enableLinks:s,number:"Error",key:"error-line-0",data:[{bold:!0,foreground:"red",text:a?.status?`${a?.message} (HTTP ${a?.status})`:a?.message||"Network Error"}]}),g.createElement(Ae,{wrapLines:o,selectable:n,key:"error-line-1",className:r,highlightClassName:i,enableLinks:s,data:[{bold:!0,text:"An error occurred attempting to load the provided log."}]}),g.createElement(Ae,{wrapLines:o,selectable:n,key:"error-line-2",className:r,highlightClassName:i,enableLinks:s,data:[{bold:!0,text:"Please check the URL and ensure it is reachable."}]}),g.createElement(Ae,{wrapLines:o,selectable:n,key:"error-line-3",className:r,highlightClassName:i,enableLinks:s,data:[]}),g.createElement(Ae,{wrapLines:o,selectable:n,key:"error-line-4",className:r,highlightClassName:i,enableLinks:s,data:[{foreground:"blue",text:t}]}))}clear(){this.searchBarRef.current?.setState({keywords:""}),this.handleClearSearch(),this.setState({count:0,lines:G(),isFilteringLinesWithMatches:!1})}render(){const{enableSearch:t}=this.props,{resultLines:r,isFilteringLinesWithMatches:n,filteredLines:i=G(),count:s,currentResultsPosition:o}=this.state,a=n?i.size:s;return g.createElement(w.Fragment,null,t&&g.createElement(cs,{ref:this.searchBarRef,currentResultsPosition:o,disabled:s===0,enableHotKeys:this.props.enableHotKeys,enableSearchNavigation:this.props.enableSearchNavigation,filterActive:n,iconFilterLines:this.props.iconFilterLines,iconFindNext:this.props.iconFindNext,iconFindPrevious:this.props.iconFindPrevious,onClearSearch:this.handleClearSearch,onEnter:this.handleEnterPressed,onFilterLinesWithMatches:this.handleFilterLinesWithMatches,onSearch:this.handleSearch,onShiftEnter:this.handleShiftEnterPressed,resultsCount:r.length,searchMinCharacters:this.props.searchMinCharacters}),g.createElement(qo,{ref:this.listRef,className:`react-lazylog ${vt.lazyLog} ${this.props.wrapLines?vt.wrapLine:""}`,style:{height:this.calculateListHeight(!0)},onScroll:u=>{if(this.setState({scrollOffset:u}),this.props.onScroll){if(!this.listRef?.current)return;const c={scrollTop:u,scrollHeight:this.listRef.current.scrollSize,clientHeight:this.calculateListHeight()};this.props.onScroll(c)}}},Array.from({length:a===0?a:a+(this.props.extraLines||0)}).map((u,c)=>this.renderRow({index:c})),this.props.loading===!0&&(this.props.loadingComponent||g.createElement($r,null))))}}ps.defaultProps={containerStyle:{width:"auto",maxWidth:"initial",overflow:"initial"},caseInsensitive:!1,enableGutters:!1,enableHotKeys:!1,enableLineNumbers:!0,enableLinks:!1,enableMultilineHighlight:!0,enableSearch:!1,enableSearchNavigation:!0,wrapLines:!1,extraLines:0,fetchOptions:{credentials:"omit"},follow:!1,formatPart:void 0,height:"auto",highlight:void 0,highlightLineClassName:"",lineClassName:"",onError:void 0,onHighlight:void 0,onLineNumberClick:void 0,onLoad:void 0,loading:void 0,overscanRowCount:100,rowHeight:19,scrollToLine:0,searchMinCharacters:2,selectableLines:!1,stream:!1,style:{},websocket:!1,websocketOptions:{},eventsource:!1,eventsourceOptions:{},width:"auto",external:!1};class qa extends w.Component{constructor(){super(...arguments),this.state={follow:this.props.startFollowing??!1},this.handleScroll=({scrollTop:t,scrollHeight:r,clientHeight:n})=>{r>n&&(this.state.follow&&r-t!==n?this.setState({follow:!1}):!this.state.follow&&r-t===n&&this.setState({follow:!0}))},this.startFollowing=()=>{this.setState({follow:!0})},this.stopFollowing=()=>{this.setState({follow:!1})}}render(){const{render:t}=this.props,{follow:r}=this.state;return g.createElement(w.Fragment,null,t({follow:r,onScroll:this.handleScroll,startFollowing:this.startFollowing,stopFollowing:this.stopFollowing}))}}qa.defaultProps={startFollowing:!1};const Pa="/static/assets/live-streaming.svg",Fa=()=>{const e=document.documentElement.getAttribute("data-theme")==="dark";return{control:t=>({...t,background:e?"#0f131a":"#ffffff",color:e?"#eaeef2":"#1d1d1f",borderColor:e?"#2a2f36":"#d2d2d7",minHeight:"38px",boxShadow:"none","&:hover":{borderColor:e?"#3a4149":"#b8b8bd"}}),menu:t=>({...t,background:e?"#0f131a":"#ffffff",borderColor:e?"#2a2f36":"#d2d2d7",border:`1px solid ${e?"#2a2f36":"#d2d2d7"}`}),option:(t,r)=>({...t,background:r.isFocused?e?"rgba(122, 162, 247, 0.15)":"rgba(0, 113, 227, 0.1)":e?"#0f131a":"#ffffff",color:e?"#eaeef2":"#1d1d1f","&:active":{background:e?"rgba(122, 162, 247, 0.25)":"rgba(0, 113, 227, 0.2)"}}),singleValue:t=>({...t,color:e?"#eaeef2":"#1d1d1f"}),input:t=>({...t,color:e?"#eaeef2":"#1d1d1f"}),placeholder:t=>({...t,color:e?"#9aa3ac":"#6e6e73"}),menuList:t=>({...t,padding:"4px"})}};function Ya({active:e}){const[t,r]=w.useState([]),[n,i]=w.useState("All.log"),[s,o]=w.useState(""),[a,u]=w.useState(!0),[c,f]=w.useState(!1),[l,h]=w.useState(!1),[d,p]=w.useState(!1),_=w.useRef(""),y=w.useRef(0),{push:v}=ys(),S=w.useCallback((k,m)=>k instanceof Error&&k.message?`${m}: ${k.message}`:typeof k=="string"&&k.trim().length?`${m}: ${k}`:m,[]),x=w.useCallback(async()=>{f(!0);try{const m=(await vs()).files??[];r(m),m.length?i(P=>P&&m.includes(P)?P:m.find(H=>H==="All.log")??m[0]):i("")}catch(k){v(S(k,"Failed to refresh log list"),"error")}finally{f(!1)}},[S,v]);w.useEffect(()=>{(async()=>{try{const P=(await Es())?.WebUI;_.current=P?.Token||""}catch(m){console.error("Failed to fetch WebUI token from config:",m)}finally{p(!0)}})()},[]),w.useEffect(()=>{x()},[x]);const K=w.useCallback(async(k=!1)=>{if(n){k&&h(!0);try{const m=new URLSearchParams;_.current&&m.set("token",_.current);const P=await fetch(`/web/logs/${encodeURIComponent(n)}?${m}`);if(!P.ok)throw new Error(`${P.status} ${P.statusText}`);const H=await P.text(),Le=H.split(`
|
|
207
|
-
`).length;Le!==y.current&&(o(H),y.current=Le)}catch(m){v(S(m,`Failed to read ${n}`),"error")}finally{k&&h(!1)}}},[n,v,S]);return w.useEffect(()=>{n&&d&&(y.current=0,K(!0))},[n,d,K]),ks(()=>{d&&K(!1)},e?1e3:null),M.jsxs("section",{className:"card",style:{height:"calc(100vh - 140px)",display:"flex",flexDirection:"column",margin:0,padding:0},children:[M.jsx("div",{className:"card-header",style:{flexShrink:0},children:"Logs"}),M.jsxs("div",{className:"card-body",style:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden",padding:"12px"},children:[M.jsxs("div",{className:"row",style:{flexShrink:0,marginBottom:"12px"},children:[M.jsx("div",{className:"col field",children:M.jsxs("div",{className:"field",children:[M.jsx("label",{children:"Log File"}),M.jsx(Ls,{options:t.map(k=>({value:k,label:k})),value:n?{value:n,label:n}:null,onChange:k=>i(k?.value||""),isDisabled:!t.length,styles:Fa()})]})}),M.jsxs("div",{className:"col field",children:[M.jsx("label",{children:" "}),M.jsxs("div",{className:"row",style:{alignItems:"center"},children:[M.jsxs("button",{className:"btn ghost",onClick:()=>
|
|
207
|
+
`).length;Le!==y.current&&(o(H),y.current=Le)}catch(m){v(S(m,`Failed to read ${n}`),"error")}finally{k&&h(!1)}}},[n,v,S]);return w.useEffect(()=>{n&&d&&(y.current=0,K(!0))},[n,d,K]),ks(()=>{d&&K(!1)},e?1e3:null),M.jsxs("section",{className:"card",style:{height:"calc(100vh - 140px)",display:"flex",flexDirection:"column",margin:0,padding:0},children:[M.jsx("div",{className:"card-header",style:{flexShrink:0},children:"Logs"}),M.jsxs("div",{className:"card-body",style:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden",padding:"12px"},children:[M.jsxs("div",{className:"row",style:{flexShrink:0,marginBottom:"12px"},children:[M.jsx("div",{className:"col field",children:M.jsxs("div",{className:"field",children:[M.jsx("label",{children:"Log File"}),M.jsx(Ls,{options:t.map(k=>({value:k,label:k})),value:n?{value:n,label:n}:null,onChange:k=>i(k?.value||""),isDisabled:!t.length,styles:Fa()})]})}),M.jsxs("div",{className:"col field",children:[M.jsx("label",{children:" "}),M.jsxs("div",{className:"row",style:{alignItems:"center"},children:[M.jsxs("button",{className:"btn ghost",onClick:()=>{x()},disabled:c,children:[M.jsx(dr,{src:ws}),"Reload List"]}),M.jsxs("button",{className:"btn",onClick:()=>n&&window.open(Ss(n),"_blank"),disabled:!n,children:[M.jsx(dr,{src:bs}),"Download"]}),M.jsxs("label",{className:"hint inline",style:{cursor:"pointer"},children:[M.jsx("input",{type:"checkbox",checked:a,onChange:k=>u(k.target.checked)}),M.jsx(dr,{src:Pa}),M.jsx("span",{children:"Auto-scroll"})]})]})]})]}),M.jsx("div",{style:{flex:1,minHeight:0,overflow:"hidden",borderRadius:"4px"},children:l?M.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%",color:"#666",backgroundColor:"#0a0e14"},children:[M.jsx("span",{className:"spinner",style:{marginRight:"8px"}}),"Loading logs..."]}):s?M.jsx(ps,{text:s,follow:a,enableSearch:!0,caseInsensitive:!0,selectableLines:!0,extraLines:1,style:{height:"100%",backgroundColor:"#0a0e14",color:"#e5e5e5",fontFamily:'"Cascadia Code", "Fira Code", "Consolas", "Monaco", monospace',fontSize:"13px",lineHeight:"1.5"}}):M.jsx("div",{style:{color:"#666",backgroundColor:"#0a0e14",padding:"16px"},children:"Select a log file to view..."})})]})]})}export{Ya as LogsView};
|
|
208
208
|
//# sourceMappingURL=LogsView.js.map
|