wip: adds cache rich functionality
This commit is contained in:
30
assets/controllers/clear_cache_controller.js
Normal file
30
assets/controllers/clear_cache_controller.js
Normal file
@@ -0,0 +1,30 @@
|
||||
import { Controller } from '@hotwired/stimulus';
|
||||
|
||||
/*
|
||||
* The following line makes this controller "lazy": it won't be downloaded until needed
|
||||
* See https://symfony.com/bundles/StimulusBundle/current/index.html#lazy-stimulus-controllers
|
||||
*/
|
||||
|
||||
/* stimulusFetch: 'lazy' */
|
||||
export default class extends Controller {
|
||||
initialize() {}
|
||||
|
||||
connect() {}
|
||||
|
||||
disconnect() {}
|
||||
|
||||
async clearAll() {
|
||||
let response = await fetch('/api/torrentio/cache', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'Accept': 'application/json',
|
||||
},
|
||||
body: JSON.stringify({
|
||||
type: 'torrentio',
|
||||
mediaType: 'tvshows',
|
||||
})
|
||||
});
|
||||
response = await response.json()
|
||||
}
|
||||
}
|
||||
@@ -25,6 +25,13 @@
|
||||
.alert-warning {
|
||||
@apply bg-yellow-500/70 hover:bg-yellow-600 border-yellow-400 text-black
|
||||
}
|
||||
|
||||
.primary-btn {
|
||||
@apply px-1 py-1 rounded-md bg-orange-500 self-end text-white w-16 ml-2 hover:bg-orange-600
|
||||
}
|
||||
.secondary-btn {
|
||||
@apply px-1 py-1 rounded-md self-end w-16 hover:bg-stone-100
|
||||
}
|
||||
}
|
||||
|
||||
/* Prevent scrolling while dialog is open */
|
||||
|
||||
Reference in New Issue
Block a user