* add tailwindcss * add header component with logo and add torrent buttons * remove bootstrap from few files replace it with tailwindcss classes, add card which diplay all nessesarry information about torrent and current state * Add modal component and reorganize components folder * add useModal hook to render modal though react portal, remove UrlPromptModal and replace it with useModal. * add taliwindcss to Desctop app * removed bootstrap from deleteTorrentModal replace it with useModal * replacing bootstrap with useModal * saving * Saving * Header and cards now look good * Modals still broken... * still doesnt work * Finally it scrolls * Continuing to fix bugs * Continuing to fix bugs * Aler * Getting better * Desktop doesnt work with tailwind somehow * Desktop now works with tailwind * Styles fully work * (De)select all buttons * fix alert styles * Animate progress bar * Progress bar + error colors * Fix error message * Torrent status icon (#56) * add statusIcon component to display icon of the torrent status * change props name and remove isDownloading variable * Tweak styles for icon * Tweak styles * Update styles --------- Co-authored-by: Artur Lozovski <arccik@gmail.com>
42 lines
1.1 KiB
TypeScript
42 lines
1.1 KiB
TypeScript
import { useContext } from "react";
|
|
import { APIContext } from "../../context";
|
|
import { ErrorComponent } from "../ErrorComponent";
|
|
import { LogStream } from "../LogStream";
|
|
import { Modal } from "./Modal";
|
|
import { ModalFooter } from "./ModalFooter";
|
|
import { ModalBody } from "./ModalBody";
|
|
import { Button } from "../buttons/Button";
|
|
|
|
interface Props {
|
|
show: boolean;
|
|
onClose: () => void;
|
|
}
|
|
|
|
export const LogStreamModal: React.FC<Props> = ({ show, onClose }) => {
|
|
const api = useContext(APIContext);
|
|
let logsUrl = api.getStreamLogsUrl();
|
|
|
|
return (
|
|
<Modal
|
|
isOpen={show}
|
|
onClose={onClose}
|
|
title="rqbit server logs"
|
|
className="max-w-7xl"
|
|
>
|
|
<ModalBody>
|
|
{logsUrl ? (
|
|
<LogStream url={logsUrl} />
|
|
) : (
|
|
<ErrorComponent
|
|
error={{ text: "HTTP API not available to stream logs" }}
|
|
></ErrorComponent>
|
|
)}
|
|
</ModalBody>
|
|
<ModalFooter>
|
|
<Button variant="primary" onClick={onClose}>
|
|
Close
|
|
</Button>
|
|
</ModalFooter>
|
|
</Modal>
|
|
);
|
|
};
|