mirror of
https://github.com/caronc/apprise-api.git
synced 2025-03-03 17:11:43 +01:00
Improved css, updated sweetalert2, and added new config confirmation prompt (#237)
This commit is contained in:
parent
86e80921b6
commit
9592b9b801
@ -51,7 +51,7 @@
|
|||||||
<a class="collection-item" href="{% url 'config' DEFAULT_CONFIG_ID %}"><i class="material-icons">settings</i>
|
<a class="collection-item" href="{% url 'config' DEFAULT_CONFIG_ID %}"><i class="material-icons">settings</i>
|
||||||
{% trans "Configuration Manager" %}</a>
|
{% trans "Configuration Manager" %}</a>
|
||||||
{% if not CONFIG_LOCK %}
|
{% if not CONFIG_LOCK %}
|
||||||
<a class="collection-item" href="{% url 'config' UNIQUE_CONFIG_ID %}"><i class="material-icons">refresh</i>
|
<a class="collection-item" id='cfg-gen' href="{% url 'config' UNIQUE_CONFIG_ID %}"><i class="material-icons">refresh</i>
|
||||||
{% trans "New Configuration" %}</a>
|
{% trans "New Configuration" %}</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</ul>
|
</ul>
|
||||||
@ -144,6 +144,22 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
document.querySelector('#cfg-gen').addEventListener('click', function(e) {
|
||||||
|
e.preventDefault();
|
||||||
|
|
||||||
|
Swal.fire({
|
||||||
|
title: '{% trans "New Configuration" %}',
|
||||||
|
html: `{% blocktrans with default_config_id=DEFAULT_CONFIG_ID %}This will generate a new Apprise configuration ID and transition over to it. It is important that you have bookmarked or noted the current ID <code>{{ default_config_id }}</code> before continuing. Do you still wish to proceed?{% endblocktrans %}`,
|
||||||
|
icon: "warning",
|
||||||
|
showCancelButton: true,
|
||||||
|
confirmButtonText: '{% trans "Yes" %}',
|
||||||
|
cancelButtonText: '{% trans "No" %}'
|
||||||
|
}).then((result) => {
|
||||||
|
if (result.isConfirmed) {
|
||||||
|
window.location.href = e.target.href;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
|
@ -515,25 +515,25 @@ function config_init() {
|
|||||||
main_init();
|
main_init();
|
||||||
|
|
||||||
// user notification
|
// user notification
|
||||||
Swal.fire(
|
Swal.fire({
|
||||||
'{% trans "Save" %}',
|
title: '{% trans "Save" %}',
|
||||||
'{% trans "Successfully saved the specified URL(s)." %}',
|
html: '{% trans "Successfully saved the specified URL(s)." %}',
|
||||||
'success'
|
icon: 'success'
|
||||||
);
|
});
|
||||||
} else if(response.status == 500) {
|
} else if(response.status == 500) {
|
||||||
// Disk issue
|
// Disk issue
|
||||||
Swal.fire(
|
Swal.fire({
|
||||||
'{% trans "Save" %}',
|
title: '{% trans "Save" %}',
|
||||||
'{% trans "There was an issue writing the configuration to disk. Check your file permissions and try again." %}',
|
html: '{% trans "There was an issue writing the configuration to disk. Check your file permissions and try again." %}',
|
||||||
'error'
|
icon: 'error'
|
||||||
);
|
});
|
||||||
} else {
|
} else {
|
||||||
// user notification
|
// user notification
|
||||||
Swal.fire(
|
Swal.fire({
|
||||||
'{% trans "Save" %}',
|
title: '{% trans "Save" %}',
|
||||||
'{% trans "Failed to save the specified URL(s). Check your syntax and try again." %}',
|
html: '{% trans "Failed to save the specified URL(s). Check your syntax and try again." %}',
|
||||||
'error'
|
icon: 'error'
|
||||||
);
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
@ -549,18 +549,18 @@ function config_init() {
|
|||||||
main_init();
|
main_init();
|
||||||
|
|
||||||
// user notification
|
// user notification
|
||||||
Swal.fire(
|
Swal.fire({
|
||||||
'{% trans "Delete" %}',
|
title: '{% trans "Delete" %}',
|
||||||
'{% trans "Successfully removed configuration." %}',
|
html: '{% trans "Successfully removed configuration." %}',
|
||||||
'success'
|
icon: 'success'
|
||||||
);
|
});
|
||||||
} else {
|
} else {
|
||||||
// user notification
|
// user notification
|
||||||
Swal.fire(
|
Swal.fire({
|
||||||
'{% trans "Delete" %}',
|
title: '{% trans "Delete" %}',
|
||||||
'{% trans "There was an issue removing the configuration." %}',
|
html: '{% trans "There was an issue removing the configuration." %}',
|
||||||
'error'
|
icon: 'error'
|
||||||
);
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -655,10 +655,10 @@ function notify_init() {
|
|||||||
const form = new FormData(this);
|
const form = new FormData(this);
|
||||||
|
|
||||||
// perform our notification
|
// perform our notification
|
||||||
Swal.fire(
|
Swal.fire({
|
||||||
'{% trans "Notification" %}',
|
title: '{% trans "Notification" %}',
|
||||||
'{% trans "Sending notification(s)..." %}',
|
html: '{% trans "Sending notification(s)..." %}',
|
||||||
);
|
});
|
||||||
Swal.showLoading()
|
Swal.showLoading()
|
||||||
let response = fetch('{% url "notify" key %}', {
|
let response = fetch('{% url "notify" key %}', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
@ -672,25 +672,28 @@ function notify_init() {
|
|||||||
if(response.status == 200)
|
if(response.status == 200)
|
||||||
{
|
{
|
||||||
// user notification
|
// user notification
|
||||||
Swal.fire(
|
Swal.fire({
|
||||||
'{% trans "Notification" %}',
|
title: '{% trans "Notification" %}',
|
||||||
'{% trans "Successfully sent the notification(s)." %}' + html,
|
html: '{% trans "Successfully sent the notification(s)." %}' + html,
|
||||||
'success'
|
icon: 'success',
|
||||||
);
|
width: '80em'
|
||||||
|
});
|
||||||
} else if(response.status == 424) {
|
} else if(response.status == 424) {
|
||||||
// user notification
|
// user notification
|
||||||
Swal.fire(
|
Swal.fire({
|
||||||
'{% trans "Notification" %}',
|
title: '{% trans "Notification" %}',
|
||||||
'{% trans "One or more of the notification(s) were not sent." %}' + html,
|
html: '{% trans "One or more of the notification(s) were not sent." %}' + html,
|
||||||
'warning'
|
icon: 'warning',
|
||||||
);
|
width: '80em'
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
// user notification
|
// user notification
|
||||||
Swal.fire(
|
Swal.fire({
|
||||||
'{% trans "Notification" %}',
|
title: '{% trans "Notification" %}',
|
||||||
'{% trans "Failed to send the notification(s)." %}' + html,
|
html: '{% trans "Failed to send the notification(s)." %}' + html,
|
||||||
'error'
|
icon: 'error',
|
||||||
);
|
width: '80em'
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -783,11 +783,13 @@ class NotifyView(View):
|
|||||||
if not content.get('attachment'):
|
if not content.get('attachment'):
|
||||||
if 'attachment' in request.POST:
|
if 'attachment' in request.POST:
|
||||||
# Acquire attachments to work with them
|
# Acquire attachments to work with them
|
||||||
content['attachment'] = request.POST.getlist('attachment')
|
content['attachment'] = \
|
||||||
|
[a for a in request.POST.getlist('attachment') if isinstance(a, str) and a.strip()]
|
||||||
|
|
||||||
elif 'attach' in request.POST:
|
elif 'attach' in request.POST:
|
||||||
# Acquire kw (alias) attach to work with them
|
# Acquire kw (alias) attach to work with them
|
||||||
content['attachment'] = request.POST.getlist('attach')
|
content['attachment'] = \
|
||||||
|
[a for a in request.POST.getlist('attach') if isinstance(a, str) and a.strip()]
|
||||||
|
|
||||||
elif content.get('attach'):
|
elif content.get('attach'):
|
||||||
# Acquire kw (alias) attach from payload to work with
|
# Acquire kw (alias) attach from payload to work with
|
||||||
|
@ -189,22 +189,6 @@ ul.logs li div.log_msg {
|
|||||||
flex: 1;
|
flex: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
ul.logs li.log_INFO {
|
|
||||||
color: black;
|
|
||||||
}
|
|
||||||
|
|
||||||
ul.logs li.log_DEBUG {
|
|
||||||
color: #606060;
|
|
||||||
}
|
|
||||||
|
|
||||||
ul.logs li.log_WARNING {
|
|
||||||
color: orange;
|
|
||||||
}
|
|
||||||
|
|
||||||
ul.logs li.log_ERROR {
|
|
||||||
color: #8B0000;
|
|
||||||
}
|
|
||||||
|
|
||||||
.url-enabled {
|
.url-enabled {
|
||||||
color:#004d40;
|
color:#004d40;
|
||||||
}
|
}
|
||||||
|
23
apprise_api/static/css/theme-dark.min.css
vendored
23
apprise_api/static/css/theme-dark.min.css
vendored
@ -1335,8 +1335,10 @@ input[type=range]::-ms-thumb {
|
|||||||
|
|
||||||
.swal2-popup {
|
.swal2-popup {
|
||||||
background-color: #2e3440;
|
background-color: #2e3440;
|
||||||
|
color: #e5e9f0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.swal-icon--success__ring {
|
.swal-icon--success__ring {
|
||||||
border: 4px solid rgba(194, 26, 90, 0.2);
|
border: 4px solid rgba(194, 26, 90, 0.2);
|
||||||
}
|
}
|
||||||
@ -1380,3 +1382,24 @@ input[type=range]::-ms-thumb {
|
|||||||
.swal-icon--info:before {
|
.swal-icon--info:before {
|
||||||
background-color: #d119c8;
|
background-color: #d119c8;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ul.logs {
|
||||||
|
background-color: #1b1e26;
|
||||||
|
color: #e5e9f0;
|
||||||
|
}
|
||||||
|
|
||||||
|
ul.logs li.log_INFO {
|
||||||
|
color: #e5e9f0;
|
||||||
|
}
|
||||||
|
|
||||||
|
ul.logs li.log_DEBUG {
|
||||||
|
color: #606060;
|
||||||
|
}
|
||||||
|
|
||||||
|
ul.logs li.log_WARNING {
|
||||||
|
color: orange;
|
||||||
|
}
|
||||||
|
|
||||||
|
ul.logs li.log_ERROR {
|
||||||
|
color: #8B0000;
|
||||||
|
}
|
||||||
|
17
apprise_api/static/css/theme-light.min.css
vendored
17
apprise_api/static/css/theme-light.min.css
vendored
@ -27,3 +27,20 @@
|
|||||||
color: #fff;
|
color: #fff;
|
||||||
background-color: #258528!important;
|
background-color: #258528!important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
ul.logs li.log_INFO {
|
||||||
|
color: black;
|
||||||
|
}
|
||||||
|
|
||||||
|
ul.logs li.log_DEBUG {
|
||||||
|
color: #606060;
|
||||||
|
}
|
||||||
|
|
||||||
|
ul.logs li.log_WARNING {
|
||||||
|
color: orange;
|
||||||
|
}
|
||||||
|
|
||||||
|
ul.logs li.log_ERROR {
|
||||||
|
color: #8B0000;
|
||||||
|
}
|
||||||
|
8
apprise_api/static/js/sweetalert2.all.min.js
vendored
8
apprise_api/static/js/sweetalert2.all.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user