uploadController.js:
+ Close connection earlier when there are no upload when querying them.

dashboard.css + style.css:
+ Updated styling involving pagination and progress bar.

dashboard.js:
+ Fixed dashboard failing to handle cases where a user attemp to load
a next page when there are not enough uploads available.
+ Added a simple loading message as a placeholder when trying to view
Stastistics menu, since it may take a while in big servers.

bulma.min.css + LICENSE:
+ Updated bulma from 0.7.2 to 0.7.5.

_globals.njk:
+ Bumped v1 and v3 version strings.
This commit is contained in:
Bobby Wibowo 2019-06-19 01:48:30 +07:00
parent d2d41fc127
commit add2970ae6
No known key found for this signature in database
GPG Key ID: 51C3A1E1E22D26CF
7 changed files with 30 additions and 20 deletions

View File

@ -786,6 +786,8 @@ uploadsController.list = async (req, res) => {
.offset(25 * offset)
.select(columns)
if (!files.length) return res.json({ success: true, files, count, basedomain })
for (const file of files) {
file.extname = utils.extname(file.name)
if (utils.mayGenerateThumb(file.extname))

View File

@ -59,20 +59,29 @@ ul#albumsContainer li {
animation: fadeInOpacity .5s
}
.pagination a {
.pagination a:not([disabled]) {
color: #eff0f1;
border-color: #4d4d4d;
background-color: #31363b;
}
.pagination-link:hover,
.pagination-next:hover,
.pagination-previous:hover {
a.pagination-link:not(.is-current):hover,
a.pagination-next:not([disabled]):hover,
a.pagination-previous:not([disabled]):hover {
color: #eff0f1;
border-color: #60a8dc;
background-color: #31363b;
}
a.pagination-link.is-current {
background-color: #3794d2;
border-color: #3794d2;
}
a.pagination-link.is-current:hover {
border-color: #60a8dc;
}
.label {
color: #bdc3c7;
}

View File

@ -103,6 +103,10 @@ hr {
color: #fff;
}
.progress.is-breeze:indeterminate {
background-image: linear-gradient(to right,#60a8dc 30%,#eff0f1 30%);
}
.render {
position: fixed;
right: 0;
@ -142,14 +146,3 @@ hr {
opacity: 1;
}
}
.pagination-link.is-current {
background-color: #3794d2;
border-color: #3794d2;
}
.pagination-link:hover,
.pagination-next:hover,
.pagination-previous:hover {
border-color: #3794d2;
}

View File

@ -349,7 +349,7 @@ page.getUploads = function ({ pageNum, album, all, filters } = {}, element) {
}
const files = response.data.files
if (pageNum && (files === 0)) {
if (pageNum && (files.length === 0)) {
if (element) page.isLoading(element, false)
return swal('An error occurred!', `There are no more uploads to populate page ${pageNum + 1}.`, 'error')
}
@ -2021,6 +2021,12 @@ page.getServerStats = function (element) {
if (!page.permissions.admin)
return swal('An error occurred!', 'You can not do this!', 'error')
page.dom.innerHTML = `
Please wait, this may take a while\u2026
<progress class="progress is-breeze" max="100" style="margin-top: 10px"></progress>
`
page.fadeIn()
const url = 'api/stats'
axios.get(url).then(function (response) {
if (response.data.success === false)

View File

@ -1,6 +1,6 @@
The MIT License (MIT)
Copyright (c) 2018 Jeremy Thomas
Copyright (c) 2019 Jeremy Thomas
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

File diff suppressed because one or more lines are too long

View File

@ -16,9 +16,9 @@
v3: CSS and JS files (libs such as bulma, lazyload, etc).
v4: Renders in /public/render/* directories (to be used by render.js).
#}
{% set v1 = "sAfUXhJ9Gz" %}
{% set v1 = "RpD2narcvz" %}
{% set v2 = "hiboQUzAzp" %}
{% set v3 = "DKoamSTKbO" %}
{% set v3 = "RpD2narcvz" %}
{% set v4 = "43gxmxi7v8" %}
{#