Other changes for Tauri
This commit is contained in:
parent
99db087cf1
commit
fe04e17d63
6 changed files with 16 additions and 23 deletions
|
|
@ -26,19 +26,6 @@ export interface ListTorrentsResponse {
|
|||
torrents: Array<TorrentId>;
|
||||
}
|
||||
|
||||
export interface TorrentAddQueryParams {
|
||||
overwrite?: boolean | null;
|
||||
output_folder?: string | null;
|
||||
sub_folder?: string | null;
|
||||
only_files_regex?: string | null;
|
||||
only_files?: string,
|
||||
peer_connect_timeout?: number | null;
|
||||
peer_read_write_timeout?: number | null;
|
||||
initial_peers?: string | null;
|
||||
is_url?: boolean | null;
|
||||
list_only?: boolean | null;
|
||||
}
|
||||
|
||||
// Interface for the Torrent Stats API response
|
||||
export interface LiveTorrentStats {
|
||||
snapshot: {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { MouseEventHandler, RefObject, createContext, useContext, useEffect, useRef, useState } from 'react';
|
||||
import { ProgressBar, Button, Container, Row, Col, Alert, Modal, Form, Spinner } from 'react-bootstrap';
|
||||
import { AddTorrentResponse, TorrentDetails, TorrentId, TorrentStats, ErrorDetails as ApiErrorDetails, STATE_INITIALIZING, STATE_LIVE, STATE_PAUSED, STATE_ERROR, RqbitAPI, ErrorDetails, ListTorrentsResponse, AddTorrentOptions } from './api-types';
|
||||
import { AddTorrentResponse, TorrentDetails, TorrentId, TorrentStats, ErrorDetails as ApiErrorDetails, STATE_INITIALIZING, STATE_LIVE, STATE_PAUSED, STATE_ERROR, RqbitAPI, AddTorrentOptions } from './api-types';
|
||||
|
||||
interface Error {
|
||||
text: string,
|
||||
|
|
@ -318,7 +318,7 @@ const Torrent: React.FC<{
|
|||
return liveInterval;
|
||||
}
|
||||
return nonLiveInterval;
|
||||
}, (e) => {
|
||||
}, () => {
|
||||
return errorInterval;
|
||||
});
|
||||
}), 0), [forceStatsRefresh]);
|
||||
|
|
@ -442,7 +442,7 @@ const UploadButton: React.FC<{
|
|||
const response = await API.uploadTorrent(data, { list_only: true });
|
||||
setListTorrentResponse(response);
|
||||
} catch (e) {
|
||||
setListTorrentError({ text: 'Error listing torrent files', details: e as ErrorDetails });
|
||||
setListTorrentError({ text: 'Error listing torrent files', details: e as ApiErrorDetails });
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
|
|
@ -511,11 +511,6 @@ const MagnetInput = () => {
|
|||
|
||||
let [showModal, setShowModal] = useState(false);
|
||||
|
||||
const onClick = () => {
|
||||
const m = prompt('Enter magnet link or HTTP(s) URL');
|
||||
setMagnet(m === '' ? null : m);
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<UploadButton
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue