added type to toasted bubble

pull/24/head
Unending 4 years ago
parent a25d17955c
commit 5ee5bd135a

@ -182,6 +182,7 @@
.then(function (response) { .then(function (response) {
Vue.toasted.show("File uploaded successfully.", { Vue.toasted.show("File uploaded successfully.", {
theme: "bubble", theme: "bubble",
type: "success",
position: "top-right", position: "top-right",
duration: 5000, duration: 5000,
}); });
@ -191,6 +192,7 @@
if (error.response) { if (error.response) {
Vue.toasted.show(error.response.data?.message, { Vue.toasted.show(error.response.data?.message, {
theme: "bubble", theme: "bubble",
type: "error",
position: "top-right", position: "top-right",
duration: 5000, duration: 5000,
}); });
@ -237,6 +239,7 @@
.then(function (response) { .then(function (response) {
Vue.toasted.show("Podcast added successfully.", { Vue.toasted.show("Podcast added successfully.", {
theme: "bubble", theme: "bubble",
type: "success",
position: "top-right", position: "top-right",
duration: 5000, duration: 5000,
}); });
@ -246,6 +249,7 @@
if (error.response) { if (error.response) {
Vue.toasted.show(error.response.data?.message, { Vue.toasted.show(error.response.data?.message, {
theme: "bubble", theme: "bubble",
type: "error",
position: "top-right", position: "top-right",
duration: 5000, duration: 5000,
}); });

@ -168,6 +168,7 @@
.then(function (response) { .then(function (response) {
Vue.toasted.show("Podcast download enqueued.", { Vue.toasted.show("Podcast download enqueued.", {
theme: "bubble", theme: "bubble",
type: "info",
position: "top-right", position: "top-right",
duration: 5000, duration: 5000,
}); });
@ -178,6 +179,7 @@
if (error.response) { if (error.response) {
Vue.toasted.show(error.response.data?.message, { Vue.toasted.show(error.response.data?.message, {
theme: "bubble", theme: "bubble",
type: "error",
position: "top-right", position: "top-right",
duration: 5000, duration: 5000,
}); });
@ -192,6 +194,7 @@
.then(function (response) { .then(function (response) {
Vue.toasted.show("Podcast file deleted.", { Vue.toasted.show("Podcast file deleted.", {
theme: "bubble", theme: "bubble",
type: "success",
position: "top-right", position: "top-right",
duration: 5000, duration: 5000,
}); });
@ -202,6 +205,7 @@
if (error.response) { if (error.response) {
Vue.toasted.show(error.response.data?.message, { Vue.toasted.show(error.response.data?.message, {
theme: "bubble", theme: "bubble",
type: "error",
position: "top-right", position: "top-right",
duration: 5000, duration: 5000,
}); });
@ -219,6 +223,7 @@
.then(function (response) { .then(function (response) {
Vue.toasted.show("Podcast played status updated.", { Vue.toasted.show("Podcast played status updated.", {
theme: "bubble", theme: "bubble",
type: "info",
position: "top-right", position: "top-right",
duration: 5000, duration: 5000,
}); });
@ -229,6 +234,7 @@
if (error.response) { if (error.response) {
Vue.toasted.show(error.response.data?.message, { Vue.toasted.show(error.response.data?.message, {
theme: "bubble", theme: "bubble",
type: "error",
position: "top-right", position: "top-right",
duration: 5000, duration: 5000,
}); });

@ -70,16 +70,16 @@
<div class="columns four"> <div class="columns four">
Last Ep : {{ latestEpisodeDate .PodcastItems}} Last Ep : {{ latestEpisodeDate .PodcastItems}}
</div> </div>
{{$downloading:=downloadingEpisodes .PodcastItems}} {{$downloading:=downloadingEpisodes .PodcastItems}}
<div <div
class="columns five" class="columns five"
title="{{downloadedEpisodes .PodcastItems}} episodes downloaded out of total {{ len .PodcastItems}} episodes. title="{{downloadedEpisodes .PodcastItems}} episodes downloaded out of total {{ len .PodcastItems}} episodes.
{{if gt $downloading 0}} {{$downloading}} episodes in queue {{end}} {{if gt $downloading 0}} {{$downloading}} episodes in queue {{end}}
" "
> >
{{if gt $downloading 0}} ({{$downloading}})/{{end}}{{downloadedEpisodes .PodcastItems}}/{{ len .PodcastItems }} episodes {{if gt $downloading 0}} ({{$downloading}})/{{end}}{{downloadedEpisodes .PodcastItems}}/{{ len .PodcastItems }} episodes
</div> </div>
<div class="columns three" style=""> <div class="columns three" style="">
<button <button
@ -138,6 +138,7 @@
"All episodes of this podcast have been enqueued to download.", "All episodes of this podcast have been enqueued to download.",
{ {
theme: "bubble", theme: "bubble",
type: "info",
position: "top-right", position: "top-right",
duration: 5000, duration: 5000,
} }
@ -147,6 +148,7 @@
if (error.response) { if (error.response) {
Vue.toasted.show(error.response.data?.message, { Vue.toasted.show(error.response.data?.message, {
theme: "bubble", theme: "bubble",
type: "error",
position: "top-right", position: "top-right",
duration: 5000, duration: 5000,
}); });
@ -168,6 +170,7 @@
.then(function (response) { .then(function (response) {
Vue.toasted.show("Podcast deleted successfully.", { Vue.toasted.show("Podcast deleted successfully.", {
theme: "bubble", theme: "bubble",
type: "success",
position: "top-right", position: "top-right",
duration: 5000, duration: 5000,
}); });
@ -178,6 +181,7 @@
if (error.response) { if (error.response) {
Vue.toasted.show(error.response.data?.message, { Vue.toasted.show(error.response.data?.message, {
theme: "bubble", theme: "bubble",
type: "error",
position: "top-right", position: "top-right",
duration: 5000, duration: 5000,
}); });
@ -200,6 +204,7 @@
.then(function (response) { .then(function (response) {
Vue.toasted.show("Podcast Episodes deleted successfully.", { Vue.toasted.show("Podcast Episodes deleted successfully.", {
theme: "bubble", theme: "bubble",
type: "success",
position: "top-right", position: "top-right",
duration: 5000, duration: 5000,
}); });
@ -208,6 +213,7 @@
if (error.response) { if (error.response) {
Vue.toasted.show(error.response.data?.message, { Vue.toasted.show(error.response.data?.message, {
theme: "bubble", theme: "bubble",
type: "error",
position: "top-right", position: "top-right",
duration: 5000, duration: 5000,
}); });

@ -64,7 +64,7 @@
white-space: pre; white-space: pre;
word-wrap: break-word } word-wrap: break-word }
.example { .example {
position: relative; position: relative;
margin-top: 4rem; } margin-top: 4rem; }
.example-header { .example-header {
font-weight: 600; font-weight: 600;
@ -121,14 +121,14 @@
/* Larger than tablet */ /* Larger than tablet */
@media (min-width: 750px) { @media (min-width: 750px) {
} }
</style> </style>
</head> </head>
<body> <body>
<div class="container"> <div class="container">
<section class="header"> <section class="header">
<h1>{{ .title }}</h1> <h1>{{ .title }}</h1>
</section> </section>
{{template "navbar"}} {{template "navbar"}}
@ -143,7 +143,7 @@
<h4>{{.Title}}</h4> <h4>{{.Title}}</h4>
<small>{{ formatDate .PubDate }}</small> <small>{{ formatDate .PubDate }}</small>
<p>{{ .Summary }}</p> <p>{{ .Summary }}</p>
{{if .DownloadPath}} {{if .DownloadPath}}
<a class="button button-primary" href="{{ .DownloadPath }}" download>Download</a> <a class="button button-primary" href="{{ .DownloadPath }}" download>Download</a>
{{else}} {{else}}
@ -154,22 +154,23 @@
</div> </div>
<div class="columns one"> <div class="columns one">
</div> </div>
</div> </div>
<hr> <hr>
{{end}} {{end}}
</div> </div>
{{template "scripts"}} {{template "scripts"}}
<script> <script>
function downloadToDisk(id){ function downloadToDisk(id){
axios.get("/podcastitems/"+id+"/download") axios.get("/podcastitems/"+id+"/download")
.then(function(response){ .then(function(response){
Vue.toasted.show('Podcast download enqueued.' ,{ Vue.toasted.show('Podcast download enqueued.' ,{
theme: "bubble", theme: "bubble",
position: "top-right", position: "top-right",
type: "info",
duration : 5000 duration : 5000
}); });
var row = document.getElementById('podcast-'+id); var row = document.getElementById('podcast-'+id);
@ -177,14 +178,15 @@ function downloadToDisk(id){
}) })
.catch(function(error){ .catch(function(error){
if(error.response){ if(error.response){
Vue.toasted.show(error.response.data?.message, { Vue.toasted.show(error.response.data?.message, {
theme: "bubble", theme: "bubble",
position: "top-right", position: "top-right",
type: "error",
duration : 5000 duration : 5000
}) })
} }
}). }).
then(function(){ then(function(){
}) })
@ -192,4 +194,4 @@ function downloadToDisk(id){
} }
</script> </script>
</body> </body>
</html> </html>

@ -23,13 +23,13 @@
img{ img{
display: block display: block
} }
} }
</style> </style>
</head> </head>
<body> <body>
<div class="container"> <div class="container">
{{template "navbar" .}} {{template "navbar" .}}
<br> <br>
<div class="row"> <div class="row">
@ -48,13 +48,13 @@
<span class="label-body">Download episodes whenever new podcast is added</span> <span class="label-body">Download episodes whenever new podcast is added</span>
</label> </label>
</div> </div>
<div v-if="downloadOnAdd"> <div v-if="downloadOnAdd">
<br> <br>
<label for="initialDownloadCount" > <label for="initialDownloadCount" >
<span class="label-body">How many episodes to be downloaded when a new podcast is added</span> <span class="label-body">How many episodes to be downloaded when a new podcast is added</span>
</label> </label>
<input type="number" name="initialDownloadCount" v-model.number="initialDownloadCount" min="0"> <input type="number" name="initialDownloadCount" v-model.number="initialDownloadCount" min="0">
</div> </div>
@ -70,7 +70,7 @@
</div> </div>
{{template "scripts"}} {{template "scripts"}}
<script> <script>
var app = new Vue({ var app = new Vue({
delimiters: ['${', '}'], delimiters: ['${', '}'],
el: '#app', el: '#app',
@ -87,27 +87,29 @@ var app = new Vue({
}) })
.then(function(response){ .then(function(response){
Vue.toasted.show('Settings saved successfully.' ,{ Vue.toasted.show('Settings saved successfully.' ,{
theme: "bubble", theme: "bubble",
position: "top-right", type: "success",
position: "top-right",
duration : 5000 duration : 5000
}) })
}) })
.catch(function(error){ .catch(function(error){
if(error.response){ if(error.response){
Vue.toasted.show(error.response.data?.message, { Vue.toasted.show(error.response.data?.message, {
theme: "bubble", theme: "bubble",
position: "top-right", type: "error",
position: "top-right",
duration : 5000 duration : 5000
}) })
} }
}). }).
then(function(){ then(function(){
}) })
return false; return false;
} }
@ -116,10 +118,10 @@ var app = new Vue({
downloadOnAdd: {{ .setting.DownloadOnAdd }}, downloadOnAdd: {{ .setting.DownloadOnAdd }},
initialDownloadCount: {{ .setting.InitialDownloadCount }}, initialDownloadCount: {{ .setting.InitialDownloadCount }},
autoDownload: {{ .setting.AutoDownload }}, autoDownload: {{ .setting.AutoDownload }},
}, },
}) })
</script> </script>
</body> </body>
</html> </html>

Loading…
Cancel
Save