You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
podgrab/client/settings.html

171 lines
5.0 KiB

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>PodGrab</title>
{{template "commoncss"}}
<style>
.button-delete{
background-color: indianred;
color:wheat;
}
img{
display: none;
}
@media (max-width: 750px) {
.label-body{
display: inline!important;
}
}
/* Larger than tablet */
@media (min-width: 750px) {
img{
display: block
}
}
</style>
</head>
<body>
<div class="container">
{{template "navbar" .}}
<br>
<div class="row">
<div class="columns two">
<a href="/backups" class="button">Backups</a>
</div>
<div class="columns two">
<a href="/opml" class="button">Export OPML</a>
</div>
</div>
<hr>
<div class="row" id="app">
<div class="columns twelve">
<form action="/saveSettings" method="post" @submit="saveSettings" >
<div class="row">
<h3>Settings</h3>
<label for="downloadOnAdd">
<input type="checkbox" name="downloadOnAdd" v-model="downloadOnAdd">
<span class="label-body">Download episodes whenever new podcast is added</span>
</label>
</div>
<div v-if="downloadOnAdd">
<label for="initialDownloadCount" style="display: inline-block;" >
<span class="label-body">How many episodes to be downloaded when a new podcast is added</span>
</label>
&nbsp;
<input type="number" name="initialDownloadCount" v-model.number="initialDownloadCount" min="0">
</div>
<label for="autoDownload">
<input type="checkbox" name="autoDownload" v-model="autoDownload">
<span class="label-body">Automatically download new episodes to the disk</span>
</label>
<label for="appendDateToFileName">
<input type="checkbox" name="appendDateToFileName" v-model="appendDateToFileName">
<span class="label-body">Append episode date to episode file name</span>
</label>
<label for="appendEpisodeNumberToFileName">
<input type="checkbox" name="appendEpisodeNumberToFileName" v-model="appendEpisodeNumberToFileName">
<span class="label-body">Append episode number to episode file name</span>
</label>
<input type="submit" value="Save" class="button button-primary">
</form>
</div>
</div>
<hr>
<div class="row">
<div class="columns twelve">
<h3>More Info</h3>
<table>
<tr>
<td>Website</td>
<td><a href="https://github.com/akhilrex/podgrab" target="_blank">https://github.com/akhilrex/podgrab</a></td>
</tr>
<tr>
<td>Found a bug</td>
<td><a href="https://github.com/akhilrex/podgrab/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc" target="_blank" rel="noopener noreferrer">Report here</a></td>
</tr>
<tr>
<td>Feature Request</td>
<td><a href="https://github.com/akhilrex/podgrab/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc" target="_blank" rel="noopener noreferrer">Request here</a></td>
</tr>
<tr>
<td>Support development</td>
<td><a href="https://www.buymeacoffee.com/akhilrex" target="_blank" rel="noopener noreferrer">Support here</a></td>
</tr>
</table>
</div>
</div>
{{template "scripts"}}
<script>
var app = new Vue({
delimiters: ['${', '}'],
el: '#app',
methods:{
saveSettings:function(e){
e.preventDefault();
var self=this;
self.searching=true;
axios.post("/settings",{
downloadOnAdd: self.downloadOnAdd,
initialDownloadCount:self.initialDownloadCount,
autoDownload:self.autoDownload,
appendDateToFileName:self.appendDateToFileName,
appendEpisodeNumberToFileName:self.appendEpisodeNumberToFileName
})
.then(function(response){
Vue.toasted.show('Settings saved successfully.' ,{
theme: "bubble",
type: "success",
position: "top-right",
duration : 5000
})
})
.catch(function(error){
if(error.response){
Vue.toasted.show(error.response.data?.message, {
theme: "bubble",
type: "error",
position: "top-right",
duration : 5000
})
}
}).
then(function(){
})
return false;
}
},
data: {
downloadOnAdd: {{ .setting.DownloadOnAdd }},
initialDownloadCount: {{ .setting.InitialDownloadCount }},
autoDownload: {{ .setting.AutoDownload }},
appendDateToFileName: {{ .setting.AppendDateToFileName }},
appendEpisodeNumberToFileName:{{ .setting.AppendEpisodeNumberToFileName }}
},
})
</script>
</body>
</html>