v5.6.0-beta.1 (#116)

* Fix displaying versions in web/desktop
* Update deps
* Tag 5.6.0-beta.1
This commit is contained in:
Igor Katson 2024-04-06 09:37:31 +01:00 committed by GitHub
parent 5eb01ac226
commit e18a711abf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 635 additions and 679 deletions

View file

@ -1,6 +1,6 @@
[package]
name = "librqbit"
version = "5.6.0-beta.0"
version = "5.6.0-beta.1"
authors = ["Igor Katson <igor.katson@gmail.com>"]
edition = "2021"
description = "The main library used by rqbit torrent client. The binary is just a small wrapper on top of it."

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -4,14 +4,14 @@
"src": "assets/logo.svg"
},
"index.css": {
"file": "assets/index-d46108e9.css",
"file": "assets/index-58bde067.css",
"src": "index.css"
},
"index.html": {
"css": [
"assets/index-d46108e9.css"
"assets/index-58bde067.css"
],
"file": "assets/index-87e26627.js",
"file": "assets/index-3519fca6.js",
"isEntry": true,
"src": "index.html"
}

View file

@ -4,16 +4,21 @@ import { MagnetInput } from "./buttons/MagnetInput";
// @ts-ignore
import Logo from "../../assets/logo.svg?react";
export const Header = ({ title }: { title: string }) => {
const [name, version] = title.split("-");
export const Header = ({
title,
version,
}: {
title: string;
version: string;
}) => {
return (
<header className="bg-slate-50 drop-shadow-lg flex flex-wrap justify-center lg:justify-between items-center dark:bg-slate-800 mb-3">
<div className="flex flex-nowrap items-center justify-between m-2">
<Logo className="w-10 h-10 p-1" alt="logo" />
<h1 className="flex items-center dark:text-white">
<div className="text-3xl">{name}</div>
<div className="text-3xl">{title}</div>
<div className="bg-blue-100 text-blue-800 text-xl font-semibold me-2 px-2.5 py-0.5 rounded ms-2 dark:bg-blue-900 dark:text-white">
{version}
v{version}
</div>
</h1>
</div>

View file

@ -7,26 +7,26 @@ import { API } from "./http-api";
import "./globals.css";
const RootWithVersion = () => {
let [title, setTitle] = useState<string>("rqbit web UI");
let [version, setVersion] = useState<string>("");
useEffect(() => {
const refreshVersion = () =>
API.getVersion().then(
(version) => {
setVersion(version);
const title = `rqbit web UI - v${version}`;
setTitle(title);
document.title = title;
return 10000;
},
(e) => {
return 1000;
}
},
);
return customSetInterval(refreshVersion, 0);
}, []);
return (
<APIContext.Provider value={API}>
<RqbitWebUI title={title} />
<RqbitWebUI title="rqbit web UI" version={version} />
</APIContext.Provider>
);
};
@ -34,5 +34,5 @@ const RootWithVersion = () => {
ReactDOM.createRoot(document.getElementById("app") as HTMLInputElement).render(
<StrictMode>
<RootWithVersion />
</StrictMode>
</StrictMode>,
);

View file

@ -23,26 +23,26 @@ export interface ContextType {
export const RqbitWebUI = (props: {
title: string;
version: string;
menuButtons?: JSX.Element[];
}) => {
let [logsOpened, setLogsOpened] = useState<boolean>(false);
const setCloseableError = useErrorStore((state) => state.setCloseableError);
const setOtherError = useErrorStore((state) => state.setOtherError);
const API = useContext(APIContext);
const setTorrents = useTorrentStore((state) => state.setTorrents);
const setTorrentsLoading = useTorrentStore(
(state) => state.setTorrentsLoading
(state) => state.setTorrentsLoading,
);
const setRefreshTorrents = useTorrentStore(
(state) => state.setRefreshTorrents
(state) => state.setRefreshTorrents,
);
const refreshTorrents = async () => {
setTorrentsLoading(true);
let torrents = await API.listTorrents().finally(() =>
setTorrentsLoading(false)
setTorrentsLoading(false),
);
setTorrents(torrents.torrents);
};
@ -60,20 +60,15 @@ export const RqbitWebUI = (props: {
setOtherError({ text: "Error refreshing torrents", details: e });
console.error(e);
return 5000;
}
},
),
0
0,
);
}, []);
const context: ContextType = {
setCloseableError,
refreshTorrents,
};
return (
<div className="dark:bg-gray-900 dark:text-gray-200 min-h-screen">
<Header title={props.title} />
<Header title={props.title} version={props.version} />
<div className="relative">
{/* Menu buttons */}
<div className="absolute top-0 start-0 pl-2 z-10">

View file

@ -1,6 +1,6 @@
[package]
name = "rqbit"
version = "5.6.0-beta.0"
version = "5.6.0-beta.1"
authors = ["Igor Katson <igor.katson@gmail.com>"]
edition = "2021"
description = "A bittorrent command line client and server."