Fix recursive lock

This commit is contained in:
2022-01-05 23:56:12 +10:30
parent 8bf9f42416
commit 3dc33cd441
8 changed files with 135 additions and 18 deletions

View File

@@ -18,8 +18,10 @@
<tr><th>state</th><td x-text="state"></td></tr>
<tr><th>progress</th><td x-text="percent"></td></tr>
<tr><th>ETA</th><td x-text="eta"></td></tr>
</table>
<p>You can close this window and your download will continue. Check the <a href="/" target="_gropple_status">Status page</a> to see all downloads in progress.</p>
<button x-show="state=='downloading'" class="pure-button" @click="stop()">stop</button>
<div>
<h4>Logs</h4>
<pre x-text="log">
@@ -50,6 +52,18 @@
console.log(info)
})
},
stop() {
let op = {
method: 'POST',
body: JSON.stringify({action: 'stop'}),
headers: { 'Content-Type': 'application/json' }
};
fetch('/rest/fetch/{{ .dl.Id }}', op)
.then(response => response.json())
.then(info => {
console.log(info)
})
},
fetch_data() {
fetch('/rest/fetch/{{ .dl.Id }}')
.then(response => response.json())