Commit 3af3c514 authored by Mathieu Delestre's avatar Mathieu Delestre

Kara downloader : Add a queue wipe button

parent fd125f16
......@@ -49,6 +49,17 @@ export async function getDownloadQueue() {
}
}
// DELETE karas download queue
export async function deleteDownloadQueue() {
try {
const res = await axios.delete('/api/system/downloads');
return res.data;
} catch (e) {
console.log('Error from /api/local.js:deleteDownloadQueue');
throw e;
}
}
// POST (add) items to download queue
export async function postToDownloadQueue(repo = 'kara.moe', downloads) {
try {
......
......@@ -4,7 +4,7 @@ import {connect} from 'react-redux';
import {Row, Col, Icon, Layout, Table, Input, Button} from 'antd';
import {loading, errorMessage, warnMessage} from '../../actions/navigation';
import openSocket from 'socket.io-client';
import { getLocalKaras, postToDownloadQueue, putToDownloadQueueStart, putToDownloadQueuePause } from '../../api/local';
import { getLocalKaras, deleteDownloadQueue, postToDownloadQueue, putToDownloadQueueStart, putToDownloadQueuePause } from '../../api/local';
class KaraDownload extends Component {
......@@ -156,6 +156,8 @@ class KaraDownload extends Component {
/>
</Col>
<Col>
<Button type="primary" key="queueDelete" onClick={deleteDownloadQueue}>Cleanup</Button>
&nbsp;
<Button type="primary" key="queueStart" onClick={putToDownloadQueueStart}>Start</Button>
&nbsp;
<Button type="primary" key="queuePause" onClick={putToDownloadQueuePause}>Pause</Button>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment